Re: flash session and authentication not work in production

2014-12-13 Thread CUCULEAC STEFAN
Hello Sekou.

I'm not an expert in Cakephp but before anyone can tell you something  t 
think  you have to check logs to see if you have errors there.
If you have could you post them? maybe someone can advise you. 

sâmbătă, 13 decembrie 2014, 21:05:14 UTC+2, Sekou Dioubate a scris:
>
>
> hello,
> I developed an application using cakephp 2.x. Everything works locally but 
> when sent on the dedicated server online (for production), the flash 
> session and authentication not works. I arrive I was logged. I am lost, I 
> do not know where is the problem
> thank you in advance!
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Update field aflter select other

2014-07-19 Thread CUCULEAC STEFAN
Hello everyone.
I have a small problem, and maybe you know how to solve this:

I have a table with town and city and i need that after select town , the 
field for city to autocomplete. 
Please note that there are many town in one city, so i need to update the 
city field with exact city from the table.
Database table looks like this: id | town | city

my ctp file look like this

 echo $this->Form->input('User.town', array(
   'options' => $city,  
'class' => array('form-control', 'chosen-select'),
 'label' => false,
  'empty' => 'Towns',
 ));
 echo $this->Form->input('User.city', array(
'readonly' => 'readonly',
'class' => array('form-control', 'chosen-select'),
'label' => false
 ));

I'm using cakephp 2.5 and i'm new in cakephp.


Thanks in advance for the help.

Best Regards,
Stefan

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Form Uploaded Image not exist when Edit form

2014-07-16 Thread CUCULEAC STEFAN
Hello Kimi.
What i did was to show the image if exist, when edit, and if you not upload 
other,do nothing:

Edit page
echo $this->Html->image("user_icons/".$photo, $options =  array('alt' => 
'Icon User', 'width' => '150px'));

echo $this->Form->input('User.photo', array('type' => 'file'));


UserController edit function
if ($this->request->is(array('post', 'put'))) {
$tmp_name = $this->request->data['User']['photo']['tmp_name'];
$filename = $this->code().'_'.$this->request->data['User']['photo']['name'];
$uploads_dir = WWW_ROOT.'img'.DS.'user_icons'.DS. $filename;
 $this->request->data['User']['photo'] = $filename;
//pr($this->request->data); die();
if ($this->User->save($this->request->data)) { 
move_uploaded_file($tmp_name, $uploads_dir);   
$this->Session->setFlash(__('The user has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The user could not be saved. Please, try 
again.'));
}
} else {

$options = array('conditions' => array('User.' . $this->User->primaryKey => 
$id));
$this->request->data = $this->User->find('first', $options);
$this->set('photo', $this->request->data['User']['photo']); 
}

Hope that help you.

Best Regards, Stefan

miercuri, 16 iulie 2014, 10:25:55 UTC+3, Kimi Sharma a scris:
>
> I have create form with some text field and one image field. It add 
> successfully after submit.
>
> but when i edit this form.. my form fields prefilled value exist of that 
> particular id (to which i edit) . but form image not show existing image 
> and request to enter new image. 
>
> kindly let me know solution. as i want to my previous image already 
> uploaded when i edit this form.. if i upload new then it replace. otherwise 
> same image uploaded.
>
> kindly revert asap. 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Use 2 tables for update

2014-07-02 Thread CUCULEAC STEFAN
OK, since no one response to this post, and because in the meantime i 
figure out i will post the result.

The problem was that i didn't respect conventions because i've use tables: 
users and users_details.
Because of that i should use in UsersDetail Model  *public $primaryKey = 
'user_id'; *otherwise it didn't know witch id field to use and i was 
inserting a new row, not updating the one allready used



joi, 26 iunie 2014, 14:19:23 UTC+3, CUCULEAC STEFAN a scris:
>
> No one? 
>
>
>
> -- 
> View this message in context: 
> http://cakephp.1045679.n5.nabble.com/Use-2-tables-for-update-tp5718641p5718652.html
>  
> Sent from the CakePHP mailing list archive at Nabble.com. 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


David Persson's Media Plugin

2011-05-04 Thread Stefan Schlesinger
Hello Folks,

I'm working on my first project with cakephp and I ran into an issue
when trying to
implement file uploads:

1) I'm trying to use the media plugin for my application. I'm having
problems to apply
the polymorphic behavior to the model. Here are my models and the
controller:

models/attachment.php: http://pastie.org/private/qjofpjluwaxsgr4t99jw
models/artist.php: http://pastie.org/private/oqhz5isx4npxdo1b0olvew
controllers/artists_contoller.php:
http://pastie.org/private/x1u10dbgc9awwpxhulqcw

When I upload a new file, its saved correctly into the attachments
table, but without
the foreign_key or the model fields being set.

2) I tried as well to manually add this fields by extending $this-
>data in my controller,
but I end up with a broken string in my database.

Here is the controller with the manually specified model and
foreign_key:

http://pastie.org/private/wrgxo9sdspar3sdxgrpyyq

and the field if its read by the Artist view:

http://666kb.com/i/bt7evphoib2ca2m6y.gif


Regards, Stefan.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Should id be hidden value?

2009-09-06 Thread stefan blickensdoerfer

hi

baked views should not be used as final solution for an application.

but you can use the security component to avoid manipulation of form data.

regards



On Sun, Sep 6, 2009 at 3:32 PM, thesti wrote:
>
> hi,
>
> i'm learning CakePHP and i take the Blog tutorial.
>
> and as i came to the modifying a post part, it's written that if we
> supply the 'id' field to the FormHelper then the form will be used to
> edit a post.
>
> when i see the source page, i see that the id is there as a hidden
> Input in the edit form. is there any other way in cake to make an edit
> form?
>
> because with javascript we can edit Hidden Input value and i think
> it's not secure.
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Routing Plugins

2009-09-05 Thread Stefan

Hey hello i'm new to cakephp but i think it's a really cool thing to
learn and so fare all went well. But now I  have a problem and i can't
figure it out by my self.
I have a plug in and I visit the plug in over the url pluginname/
controller/action and i want to go back over a navigation menue that
is integrated in my standard layout to an url controller/action. That
fails because the html helper routes it to pluginname/controller/
action what do i wrong? My html helper in the layout menu looks like
this
$html->link('controller'=>'users','action'=>'home').

I would be very kind if you could help me thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake 1.2 Session Write

2008-04-22 Thread Stefan

I developed a rather large amount of code on Cake 1.1. At the end of
the View, I wrote some data back to Session->write. I can't seem to
find the proper object to get to the Session from the View in Version
1.2. Any clues would be greatly appreciated.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Boolean value postgres

2008-02-15 Thread Stefan

Hello,

I am using cake 1.1.15.5144 with PHP5 and postgres 8.2.5.
The problem is that boolean values from the database are stored within
the model as strings ('t' / 'f').
Is there a solution that the model stores 'real' boolean (TRUE/FALSE)
values?
There is a function "boolean" in dbo_postgres.php that does the
mapping, but it seems that the values stored from the database to the
model are not translated.

Regards

Stefan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model->Del() causes SQL Error

2008-01-29 Thread stefan

thanks again for your hints...i updated to the latest nightly build
which was no good idea because somehow it messed up with my auth
component...so i reverted all and just uses the dbo_.. from that build
and now the query problem is gone...

On 26 Jan., 17:36, villas <[EMAIL PROTECTED]> wrote:
> After updating to the latest 'nightly' version,  my problem with
> 'delete' in firebird appeared to have been resolved.
> Maybe that will work for you too.
>
> However,  I am still curious about the SQL 'delete {alias} from'
> because I cannot see why the {alias} would be required in that
> position by any SQL database?
>
> On Jan 25, 12:44 pm, stefan <[EMAIL PROTECTED]> wrote:
>
> > thanks for your tips.
>
> > i'm using 1.2.0.6311 beta right now, hopefully there are no other
> > problems when updating
>
> > On 25 Jan., 11:37, villas <[EMAIL PROTECTED]> wrote:
>
> > > This may be related to the thread I started 'Problem with Delete'.
>
> > > I decided that DELETE {Alias} FROM Table must be non-standard because
> > > you don't normally put {alias} in that position.  I posted a bug
> > > report:
>
> > > #3984 (Delete {alias} from Table - non-standard SQL which stops
> > > Firebird working)
>
> > > See the 'Problem with Delete' thread or the bug report for my proposed
> > > solution.
>
> > > On Jan 24, 8:01 pm, stefan <[EMAIL PROTECTED]> wrote:
>
> > > > Hi all,
>
> > > > i have a Problem with my Models that use HABTM relations (also i'm not
> > > > sure if this causes the trouble)
>
> > > > when using the $model->del($id) i get an sql error:
>
> > > > SQL Error: 1066: Not unique table/alias: 'Company'
>
> > > > the query built by cake is:
> > > > DELETE `Company` FROM `companies` AS `Company` WHERE `Company`.`id` IN
> > > > (11)
>
> > > > why does cake to that?
> > > > i could of course write my own query as this is a very tiny one, but i
> > > > would like to understand why cake does this...
>
> > > > thanks a lot
>
> > > > stefan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



HABTM data after Validation Error

2008-01-25 Thread stefan

so i have another simple question:

i have a simple edit form with some habtm-relations.
if i use data validation and get a validation error while saving, in
the following edit-view none of the related data is loaded.
but if i manually do a $model->read i loose the user-input from the
post data.
i did not find any solution , can you help me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model->Del() causes SQL Error

2008-01-25 Thread stefan

thanks for your tips.

i'm using 1.2.0.6311 beta right now, hopefully there are no other
problems when updating

On 25 Jan., 11:37, villas <[EMAIL PROTECTED]> wrote:
> This may be related to the thread I started 'Problem with Delete'.
>
> I decided that DELETE {Alias} FROM Table must be non-standard because
> you don't normally put {alias} in that position.  I posted a bug
> report:
>
> #3984 (Delete {alias} from Table - non-standard SQL which stops
> Firebird working)
>
> See the 'Problem with Delete' thread or the bug report for my proposed
> solution.
>
> On Jan 24, 8:01 pm, stefan <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > i have a Problem with my Models that use HABTM relations (also i'm not
> > sure if this causes the trouble)
>
> > when using the $model->del($id) i get an sql error:
>
> > SQL Error: 1066: Not unique table/alias: 'Company'
>
> > the query built by cake is:
> > DELETE `Company` FROM `companies` AS `Company` WHERE `Company`.`id` IN
> > (11)
>
> > why does cake to that?
> > i could of course write my own query as this is a very tiny one, but i
> > would like to understand why cake does this...
>
> > thanks a lot
>
> > stefan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model->Del() causes SQL Error

2008-01-24 Thread stefan

Hi all,

i have a Problem with my Models that use HABTM relations (also i'm not
sure if this causes the trouble)

when using the $model->del($id) i get an sql error:

SQL Error: 1066: Not unique table/alias: 'Company'

the query built by cake is:
DELETE `Company` FROM `companies` AS `Company` WHERE `Company`.`id` IN
(11)

why does cake to that?
i could of course write my own query as this is a very tiny one, but i
would like to understand why cake does this...

thanks a lot

stefan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PHP Version 6 compatibilty

2007-12-19 Thread Stefan

I guess the real question was:

Will CakePHP be compatible with PHP6?

Thanks

Stefan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



PHP Version 6 compatibilty

2007-12-18 Thread Stefan

Having good ol SQL Server character coding problem. Supposedly PHP6
fixes the problem, Cake compatible with V6 or not?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



onError - the query which produced the error ?

2007-06-11 Thread Stefan

Hi,


Can I get the query in production mode without using logs when a SQL
error occurs ?

I made an onError() in AppModel which is sending an email with the
last SQL error, but without the query some errors are difficult to
trace. It seems that there is a way by using the query log but I don't
want to log all the queries just because of some errors.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ObserveField - Firefox Issue

2007-03-17 Thread Stefan

It can be done without $ajax->observeField, and it's better because IE
doesn't know the ID of a SELECT (or maybe I'm not capable of doing it
right):

codeBlock("function fnSearch(el) { new
Ajax.Updater('content', '".$html->url("/services/index")."',
{asinchronous:true, evalScripts:true,
parameters:Form.serialize(el.form), requestHeaders:['X-Update',
'content']}) }"));?>

select("Services/domain", $categories["Domain"], $html-
>tagValue("Services/domain"),
array("id"=>"filterdomain","class"=>"textbox", "style"=>"width:300px",
"onchange"=>"fnSearch(this)")));?>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help with ACL and/or tree behavior

2007-03-16 Thread Stefan

I found something but I'm not sure if it's correct:

$aro = $this->Acl->Aro;
$tree = $aro->behaviors["Tree"];

for a parent:

$tree->setup($aro,array("parent" => "Aro.id")); // just "id"
doesn't work
$aro-
>save(array('model'=>'Roles','foreign_key'=>'0','alias'=>'Parent'));

for children:
$tree->setup($aro,array("parent" =>
"Aro.id","parent_id"=>"1")); // 1 = Aro.id of the above 'Parent'
$aro-
>save(array('model'=>'Roles','foreign_key'=>'0','alias'=>'Child1'));
$aro-
>save(array('model'=>'Roles','foreign_key'=>'0','alias'=>'Child2'));
etc.


pr($aro) shows usefull informations.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Gettext unstable ¿?

2007-03-13 Thread Stefan

Using
 or


where $data["description"] = "Description for product" and comes from
db is the same thing.
locale/your language/LC_MESSAGES/default.po file must have the
translation for string "Product description".


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: i18n language name

2007-02-23 Thread Stefan

Ok, I understand.

Something about the __() function:

I wanted to translate the title of a link : e($html-
>link(__("LABEL_TERMS_CONDITIONS"), "/terms"));
gives : Règles et Conditions, title outside the
tags.
The right solution : e($html->link(__("LABEL_TERMS_CONDITIONS", true),
"/terms"));

That's not a big deal, but most of the texts are inside html helper
functions (link, form functions, table functions, etc), so maybe using
e(_("translation")) means less code.
And it's like the other basics functions, which don't have the $return
argument.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



i18n language name

2007-02-23 Thread Stefan

Hi,

The ISO language name for french is fra , fre.
I made a directory app/locale/fra/LC_MESSAGES/  and put there a
default.po and default.mo and followed the instructions about using
i18n :

$language = 'fra';
$this->Session->write('Config.language', $language);

with a very simple page ( no controller only a view template ), Cake
1.2.

But the translation didn't appeared.
$I18n::__bindTextDomain() searched 4 times for app/locale/fre/
LC_MESSAGES/default.po.

Only 'fre' is working as a language directory name.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Ajax Updater and IE 6.0 errors

2006-12-16 Thread Stefan

If you are using the get method in ajax functions, use modrewrite
(maybe it's not a modrewrite problem) and IE 6.0 reports errors add the
dummy parameter to the ajax url option:

WRONG URL: url = "/products/edit/2";
GOOD URL:url = "/products/edit/2/#";// even if the url has it's
own parameter(s)

$timerOptions = array("update" => "ajax_update",
"frequency" => "15",
"url" => GOOD URL,
"method" => "get");
echo $ajax->remoteTimer($timerOptions);

Firefox doesn't have any problem with or without that #, but perhaps
the correct way is with the #.


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How To : Call the Model methods in beforeFilter in AppController

2006-10-07 Thread Stefan

In beforeFilter() in AppController it can be used :

$this->{Inflector::singularize($this->name)}->findAll();
$this->{Inflector::singularize($this->name)}->read();
$this->{Inflector::singularize($this->name)}->query();
etc

or

$this->{Inflector::singularize($this->name)}->myfunction();

with myfunction() defined in AppModel :

function myfunction() {
  $this->query();
}


No $uses, no headache.
Solution provided by OceanCMS.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---