Re: Simple Acl controlled Application Tutorial - Problem with release 1.2.5??

2009-09-29 Thread brian
I just ran into the same thing recently. Use $Controllers = Configure::listObjects('controller'); On Tue, Sep 29, 2009 at 10:10 AM, robmcvey wrote: > > We aregoing through the "Simple Acl controlled Application Tutorial" > as per the manual. > > Everything is going fine until we try and run the

Re: Associating model aliases

2009-09-29 Thread brian
On Tue, Sep 29, 2009 at 5:21 PM, Mario wrote: > > But to me the BIG question is: > isn't there a simpler and more elegant way in Cake to reach the same > result? > > I feel there should be; because the kind of problem, if I understood > it correctly (that is: model alias does not retain the assoc

Re: javascript link in default.ctp

2009-09-29 Thread brian
On Tue, Sep 29, 2009 at 5:07 PM, lorenx wrote: > > sure but... > is there a way to do it in the app/ area? Do you mean in individual controllers? Yes, but you'd have to add it to all of them, so there's not much point. Besides, if you then ran into a "missing controller" error or similar, you'd

Re: Change Password

2009-09-29 Thread brian
I kept running into issues with passwords so I removed the validation from the model and created a component to handle it. For a "new password" scenario, the fields are 'password_1' and 'password_2',, so Auth keeps its mitts off them. You can see it here, with a "new password" example: http://bin

Re: Sorting Paginated Results Question

2009-09-29 Thread Paul Redmond
I figured out the answer to my own question =) The original order I specified was: 'order' => array('Coupon.id' => 'DESC', 'Restaurant.tier'=>'ASC', 'Restaurant.name' => 'ASC'), I changed order to: 'order' => array("Coupon.id != 0 DESC", 'Restaurant.tier ASC', 'Restaurant.name ASC'), Hope this

Re: 1.3 problem with baking from custom view template

2009-09-29 Thread mark_story
fired that last email off too quickly, also check the http://code.cakephp.org/wiki/1.3/migration-guide/bake-updates notes about bake as bake had a fairly significant set of changes done to it for 1.3 and the location of the templates has changed a bit. -Mark On Sep 29, 11:48 am, Johnny wrote: >

Re: 1.3 problem with baking from custom view template

2009-09-29 Thread mark_story
There was an issue with this, you will need to either use the Git head. Or wait for a new package. -Mark On Sep 29, 11:48 am, Johnny wrote: > I recently started playin around with the 1.3 dev version of cake and > i'm having problems with using custom view templates for bake. I place > them in

Devmoz's Ajax Select Box

2009-09-29 Thread hahmadi82
Hi, I'm using this tutorial: http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/ and have set up everything exactly as said but the example does not work. I noticed on the comments at the bottom that a lot of people using Cakephp 1.2 were not able to get this example

Re: Associating model aliases

2009-09-29 Thread Mario
But to me the BIG question is: isn't there a simpler and more elegant way in Cake to reach the same result? I feel there should be; because the kind of problem, if I understood it correctly (that is: model alias does not retain the associations of the original model), seems to me quite broad and

Re: Ajax (jquery) Question - am I doing this right?

2009-09-29 Thread Cronet
Now it works really perfect... I set the "RequestHandler" part in my beforeFilter method in app_controller. Thank you for directing in the right direction! On Sep 29, 4:05 pm, brian wrote: > On Tue, Sep 29, 2009 at 2:23 AM, Cronet wrote: > > > Hi Brian, > > > thanks for your answer. > > >

Re: formhelper: deep model values

2009-09-29 Thread lorenx
i'm sorry for my perseverance but... the FormHelper magic is really limited just to one-level recursion? On Sep 26, 8:52 pm, lorenx wrote: > me again... > > i found the following link (i'm not using the $uses controller > attribute) and i did some tests:https://trac.cakephp.org/ticket/4626 > >

Re: javascript link in default.ctp

2009-09-29 Thread lorenx
sure but... is there a way to do it in the app/ area? On Sep 29, 10:43 pm, m lundvall wrote: > Hi, > > You can add Javascript helper to /app/app_controller.php, then it can > be used throughout the whole application. > > class AppController extends Controller { >         var $helpers = array('J

Re: Associating model aliases

2009-09-29 Thread Mario
Ok, this is solved, I can get the fields I need by adding the 'fields' parameter $this->data = $this->Message->find( 'all', array( 'fields' => array('SenderProfile.firstname', 'RecipientProfile.firstname'), 'joins' => array(...) ) ); So we have a workaro

Re: javascript link in default.ctp

2009-09-29 Thread m lundvall
Hi, You can add Javascript helper to /app/app_controller.php, then it can be used throughout the whole application. class AppController extends Controller { var $helpers = array('Javascript'); } // lundvall On 29 Sep, 19:57, lorenx wrote: > hi all, > i'm wondering one thing: > i under

Editing data in related tables (hasOne)

2009-09-29 Thread Bunnie
Hi guys, I'm trying to edit data in related tables (Material hasOne Book). But by the time to save the data in the table are well edited, but the system tries to save a new record in paper, instead of edit. See code below: BensController

Re: Setting up Auth is breaking my Add and Edit functions on all controllers.

2009-09-29 Thread gparra
Actually the problem is that if i DO call parent::beforeFilter() the application does not work. The only way the application is working as it should is by NOT calling parent::beforeFilter() My before filter function with only $this->Auth->allow('index'); in it, lets everything work as intended,

Re: Controller::setAction heads-up

2009-09-29 Thread Bert Van den Brande
On Tue, Sep 29, 2009 at 4:14 PM, brian wrote: > > On Tue, Sep 29, 2009 at 2:19 AM, Bert Van den Brande > wrote: > > Ok tnx now I understand the problem, though I still can't wrap my head > > around the core issue. > > > > Is it that call_user_func_array() can never call private methods ? I > fou

Re: Cake PhP (1.2) Secure Forms and Ajax

2009-09-29 Thread clearflysyst...@googlemail.com
I Meant The hidden 'Token' Fields not Target fields are missing ie the ones generated by the Security component. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to ca

Re: Strange FormHelper behavior

2009-09-29 Thread euromark (munich)
this is the correct way to go: echo $form->create('Model',array('url'=>'/'.$this->params['url'] ['url'])); On 29 Sep., 15:00, Django Janny wrote: > I think you just have to specify the relative url to your action > $this->here is the absolute url... > > > > On Tue, Sep 29, 2009 at 14:49, Ernes

Unit Test controller with redirect

2009-09-29 Thread patton
Hi, I just want to test a User controller that has a register action. When a user is successfully registered, the action redirects. I've read these resources but still can't get it to work: http://mark-story.com/posts/view/testing-cakephp-controllers-the-hard-way http://mark-story.com/posts/view

Cake PhP (1.2) Secure Forms and Ajax

2009-09-29 Thread clearflysyst...@googlemail.com
I'm fairly new to cakePhP so excuse me if im missing the obvious. I'm building an application using secure forms by using the 'Security' component which i've set up in the main app_controller.php This is all working fine, all my forms are secure except for one condition after an expired session

Simple Acl controlled Application Tutorial - Problem with release 1.2.5??

2009-09-29 Thread robmcvey
We aregoing through the "Simple Acl controlled Application Tutorial" as per the manual. Everything is going fine until we try and run the "Automated tool for creating ACOs" in this section; http://book.cakephp.org/view/647/An-Automated-tool-for-creating-ACOs When we run this method we get the f

CakePHP :: IFrame

2009-09-29 Thread Shouvik Chatterjee
HI I am using cakephp for my website and trying to implement an IFRAME into my website, the IFRAME have the following styntax http://yahoo.com"; width="750" height="500"> But for some reason, instead of displaying the yahoo website, it displays me my own website. Can someone pls tell me a so

Re: Strange FormHelper behavior

2009-09-29 Thread Django Janny
I think you just have to specify the relative url to your action $this->here is the absolute url... On Tue, Sep 29, 2009 at 14:49, Ernesto wrote: > > Hello. > > here's some code from my view > > > echo $this->here; > > echo $form->create(null, array("url" => $this->here)); > > ?> > > the first

Re: habtm limit

2009-09-29 Thread bram
These are the resulting queries: SELECT `User`.`id`, `User`.`username`, `User`.`name` FROM `users` AS `User` ORDER BY `name` ASC SELECT `Event`.`id`, `Event`.`date`, `EventsUser`.`id`, `EventsUser`.`event_id`, `EventsUser`.`user_id` FROM `events` AS `Event` JOIN `events_users` AS `EventsUser` ON

RE: Change Password

2009-09-29 Thread Dave Maharaj :: WidePixels.com
Here is the controller function Maybe someone can see where I am going wrong? function changePassword() { $id = $this->Auth->user('id'); $this->User->unbindValidation('keep', array('password', 'confirm'), true); if (!empty($this->data)) { $this->

CookieComponent - RFC 2109/2068 Non-Compliance

2009-09-29 Thread marklap
CakePHP Version: 1.2.5 PHP: 5.1.6 Apache HTTPD: 2.2.3 OS: RHEL 5 If you look at RFC 2109, Section 4.1, the Cookie and Set-Cookie header attr (name) are defined as "tokens", a token being defined as (in RFC 2068) "any CHAR exept CTLs or tspecials" and it continues on to define what the specials. N

Re: Associating model aliases

2009-09-29 Thread Mario
Hi Brian, modified as per your suggestion to: $this->data = $this->Message->find( 'all', array( 'joins' => array( array( 'type' => 'LEFT', 'table' => 'profiles', 'alias' => 'SenderProfile', 'conditions' => array(

RE: Change Password

2009-09-29 Thread Dave Maharaj :: WidePixels.com
Ok cool will give it a try. Dave -Original Message- From: Miles J [mailto:mileswjohn...@gmail.com] Sent: September-29-09 3:40 PM To: CakePHP Subject: Re: Change Password I dont think hash() adds the security salt, you must use Auth->password (). --~--~-~--~~

Re: Change Password

2009-09-29 Thread Miles J
I dont think hash() adds the security salt, you must use Auth->password (). --~--~-~--~~~---~--~~ 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 unsubscrib

javascript link in default.ctp

2009-09-29 Thread lorenx
hi all, i'm wondering one thing: i understand the choise to call helpers only when needed but... if i want to include a javascript file in the default.ctp (the common layout used everywhere), i have to call the javascript helper in every controller of my application? thanks. --~--~-~--~--

Change Password

2009-09-29 Thread Dave Maharaj :: WidePixels.com
I am trying to set up a change password section. password field and confirm field only. model: validation rules: 'password' => array( 'pass-notempty' => array( 'rule' => array('notempty'), 'required' => true, 'allowEmpty' => false, 'message' => 'Password cannot be empty.',

Re: Associating model aliases

2009-09-29 Thread brian
On Tue, Sep 29, 2009 at 12:02 PM, Mario wrote: > > Hi Brian, > > thank you for your help, getting closer to an initial solution. > > With the following find (slightly different from yours, now profiles > are joined with the user_id / recipient_id in Message, like it is done > for users) > >    $t

Re: find('threaded') doesn't find any children

2009-09-29 Thread brian
On Tue, Sep 29, 2009 at 12:02 PM, Chris wrote: > > All you need for a threaded find is a Table.parent_id. > > SVN FILE: $Id: model.php 8283 2009-08-03 20:49:17Z > > line 2187 > > I never said it's the way you want it.  I said it might be the way you > want it to work, which it obviously it is sin

Uninitialized string offset notice

2009-09-29 Thread borcho
My cakephp applications works fine on my local server. On my web server, I get the following error notice (the data does get saved, though): Notice (8): Uninitialized string offset: 0 [CORE/cake/libs/model/ model.php, line 1319] Code | Context Model::__saveMulti() - CORE/cake/libs/model/model.php

RE: Display Error

2009-09-29 Thread Dave Maharaj :: WidePixels.com
Right on thanks! Dave -Original Message- From: Marcelo Andrade [mailto:mfandr...@gmail.com] Sent: September-29-09 12:18 PM To: cake-php@googlegroups.com Subject: Re: Display Error On Tue, Sep 29, 2009 at 12:34 AM, Dave Maharaj :: WidePixels.com wrote: > I need to place an error in a

Re: find('threaded') doesn't find any children

2009-09-29 Thread Chris
All you need for a threaded find is a Table.parent_id. SVN FILE: $Id: model.php 8283 2009-08-03 20:49:17Z line 2187 I never said it's the way you want it. I said it might be the way you want it to work, which it obviously it is since you don't have any issues with it, and it's not the way othe

Re: find() when having nested models

2009-09-29 Thread brian
Use ContainableBehavior and try the find() like: $this->E->find( 'all', array( 'contain' => array( 'D' => array( 'fields' => array('D.title'), 'C' => array(

Re: Doubt in cake php

2009-09-29 Thread Travis L
I don't see it as making the controller "fat", really. It's where this call belongs. I usually think of fat controllers as doing some of the models' heavy lifting for them. But in this case, putting the code in your controller is clearly the right thing to do, by Cake's MVC principles. Don't w

Re: Associating model aliases

2009-09-29 Thread Mario
Hi Brian, thank you for your help, getting closer to an initial solution. With the following find (slightly different from yours, now profiles are joined with the user_id / recipient_id in Message, like it is done for users) $this->data = $this->Message->find( 'all', array(

Re: Email Component Skip Authentification when using SMTP

2009-09-29 Thread AgBorkowski
Hi mate :) resolve is simple: look carefully at host and string => ssl:// $config['Email']['from'] = 'i...@sycyliada.pl'; $config['Email']['fromName'] = 'Zespół Mio Technology'; $config['Email']['fromHeader'] = "{$config['Email']['fromName']} < {$config['Email']['from']}>"; $config['Email']['ho

1.3 problem with baking from custom view template

2009-09-29 Thread Johnny
I recently started playin around with the 1.3 dev version of cake and i'm having problems with using custom view templates for bake. I place them in the app/vendors/shells/templates/views folder but bake ignores them and still uses the default templates that come with cake. In cake 1.2.5 everythin

find() when having nested models

2009-09-29 Thread Melanie Sommer
Hi, I have models with belongsTo and hasMany relations in the following form: A -> C -> D -> E B -> C F -> E G -> E When displaying E I also want to display the title-fields of A, B, C, D, F and G. find() can only be set to rescursive=2 giving me E together with D, C, F, G. What is the best wa

Re: interlinked selects

2009-09-29 Thread Marcelo Andrade
On Tue, Sep 29, 2009 at 7:09 AM, Melanie Sommer wrote: > > Hello, > > Please excuse my bad English, I am not a native speaker. I only > started CakePHP two weaks ago, read a book about it and am now trying > to program my project. I have some experience in php, mysql, html and > css but hardly an

Re: Display Error

2009-09-29 Thread Marcelo Andrade
On Tue, Sep 29, 2009 at 12:34 AM, Dave Maharaj :: WidePixels.com wrote: > I need to place an error in a specific spot so I used the > > error($model . $field); ?> > > But the error shows up in 2 places now. Where I have my error code and > beside the field. How can I remove it from the field so i

Re: input text box instead of dropdown list

2009-09-29 Thread Marcelo Andrade
On Tue, Sep 29, 2009 at 1:58 AM, Jiru wrote: > > hii , > > In my project the names are displayed in dropdown list. bt i need it > in input text box with ajax autocomplete code. http://book.cakephp.org/view/632/autoComplete -- MARCELO DE F. ANDRADE Belem, PA, Amazonia, Brazil Linux User #221105

Re: Associating model aliases

2009-09-29 Thread brian
Try something like this: $this->Message->find( 'all', array( 'joins' => array( array( 'type' => 'LEFT', 'table' => 'users', 'alias' => 'Sender',

Re: Problem with Ajax.autocomplete and Internet Explorer

2009-09-29 Thread brian
It may be related to some other CSS rule you have. You may need to judiciously comment out rules and test until the div looks right. Or, if you load an IE-only stylesheet via conditional comments (I recommend it) you might be able to fiddle with this div's rules to get it to pop into place. On Tu

Re: Controller::setAction heads-up

2009-09-29 Thread brian
On Tue, Sep 29, 2009 at 2:19 AM, Bert Van den Brande wrote: > Ok tnx now I understand the problem, though I still can't wrap my head > around the core issue. > > Is it that call_user_func_array() can never call private methods ? I found > some comments here and there on the web stating that the n

Re: Validate non-existent Model

2009-09-29 Thread brian
On Mon, Sep 28, 2009 at 10:19 PM, Dave Maharaj :: WidePixels.com wrote: > > I upload an image using a component which produces this array > > [Image] => Array >        ( >            [image] => Array >                ( >                    [name] => blue_self_shot_m057.jpg >                    [ty

Re: Extracting PATHS but not the full HTML object

2009-09-29 Thread brian
I don't about images, but to get the path to an action, you can use Router::url(array('controller' => '...', 'action' => '...')) On Mon, Sep 28, 2009 at 8:49 PM, tcornett wrote: > > I am curious how I would extract the path of a LINK or an IMAGE > without getting the whole HTML object.  Instead

Re: Ajax (jquery) Question - am I doing this right?

2009-09-29 Thread brian
On Tue, Sep 29, 2009 at 2:23 AM, Cronet wrote: > > Hi Brian, > > thanks for your answer. > > That's a neat trick to avoid the switch statement! > > > I've done the redirecting, because i thought it's more DRY. With your > solution (which works perfect!) i need to copy the admin_index method > in

Re: Strange FormHelper behavior

2009-09-29 Thread Ernesto
after some test i found a working solution. echo $form->create(null, array("url" => str_replace($this->base, "", $this->here))); it isn't beautiful but... it works. On 29 Set, 14:49, Ernesto wrote: > Hello. > > here's some code from my view > > > echo $this->here; > > echo $form->create(null,

HABTM and multiple level

2009-09-29 Thread emmexx
I need to tag some "record", say picture, with a tree-like model. I have a pictures model and a category model. The category model has 3 fields connected as a tree: cat1 cat2 cat3 The tree structure could be: art painting minimalism expressionism ... sculpture nature

Re: Question on the method input of Form helper relative to type 'date'

2009-09-29 Thread byqsri
Sorry I have mistaked :-) I would get: . . On 18 Set, 12:05, WebbedIT wrote: > now I've stared at them for 5 mins and I am certain they are > identical :P > > On Sep 17, 8:17 am, byqsri wrote: > > > I get > > > . > > . > > > > Instead of: > > > . > > .

Re: Oracle 10g

2009-09-29 Thread Bert Van den Brande
Maybe this example will help : http://liamgraham.wordpress.com/2007/04/19/using-oracle-with-cakephp-15-minute-blog-tutorial/ Google is such a nice tool :) On Mon, Sep 28, 2009 at 5:21 PM, osamo101 wrote: > > Hi > > I have a problem connecting to Oracle 10g database. > > When I put 'driver' => '

Re: habtm limit

2009-09-29 Thread Bert Van den Brande
Have a look at the query it generates (set debug to 2) , I'm sure this will shine a bright light on the problem ... On Mon, Sep 28, 2009 at 9:48 PM, bram wrote: > > In my app, I have a User model that has a habtm association with > 'Event'. In one of the views, I want to show a list of Users and

Re: cakePHP with FatCow hosting provider - mod_rewrite issue?

2009-09-29 Thread Bert Van den Brande
Verifying with your host if mod_rewrite is enabled would be a good place to start :) On Tue, Sep 29, 2009 at 3:54 AM, DK wrote: > > Does anyone have a cakephp application running with the FatCow hosing > provider? I have the base code installed in my /cake directory. > My URL is below: > http://

Strange FormHelper behavior

2009-09-29 Thread Ernesto
Hello. here's some code from my view here; echo $form->create(null, array("url" => $this->here)); ?> the first echo outputs this: /cakephp/development/apps/myapp/package/add and here's the output from form::create look @ "action" html property! what's going on here? --~--~-~--~

Re: Associating model aliases

2009-09-29 Thread Mario
Hi John, thank you! Is just very basic, no control over depth of joins. data = $this->Message->find('all'); debug ($this->data); die; } ?> It seems to me that joins are not in place because of somehow missing aliases association, not because I have cut them somewhere. The underlying

Re: Associating model aliases

2009-09-29 Thread John Andersen
Thanks, a little more information is needed! Please show the code from the controller, where you are using $this- >Message->find. Are you using the Containable behaviour or just the recursive option? Enjoy, John On Sep 29, 1:43 pm, Mario wrote: > Hi John, > > thank you for your reply. > > As

Re: Self Join query

2009-09-29 Thread Bert Van den Brande
Oops clicked 'send' by accident. So what I meant was : Hah it works ? Great :) Yes Containable Behavior is a very important one. Start using it on all your model from the start of your project , it will save you a lot of queries and refactoring of code afterwards. Glad I could help, Bert On T

CPAMF plugin, Auth and Encryption - anyone got any experience?

2009-09-29 Thread designv...@gmail.com
Hi there, I'm looking at starting a new project that is going to need to use the CPAMF plugin, CakePHP Auth and Encryption (for communicating between Flash and CakePHP). Has anyone had any experience if this sort of project? I have got CPAMF all set up and have some dummy controller methods in

Re: Self Join query

2009-09-29 Thread Bert Van den Brande
Ha On Tue, Sep 29, 2009 at 12:44 PM, hunny wrote: > > Thanks Bert, > > It works perfectly fine. This is exactly what I was looking for. > While going through the manual, I had completely left the Behaviors > Section. I think its high time that I go through it. > > > On Sep 28, 4:53 pm, Bert Van

Re: Self Join query

2009-09-29 Thread hunny
Thanks Bert, It works perfectly fine. This is exactly what I was looking for. While going through the manual, I had completely left the Behaviors Section. I think its high time that I go through it. On Sep 28, 4:53 pm, Bert Van den Brande wrote: > I typed this code out of the top of my head, b

Re: Associating model aliases

2009-09-29 Thread Mario
Hi John, thank you for your reply. As stated, is done exactly as in the Cookbook: array( 'className' => 'User', 'foreignKey' => 'user_id' ), 'Recipient' => array( 'className' => 'User', 'foreignKey' => 'recipient_id' )

Re: Associating model aliases

2009-09-29 Thread John Andersen
Please provide information on how you relates the message model with the other models? Enjoy, John On Sep 29, 12:52 pm, Mario wrote: > Hi all, > > probably a not so difficult question, but I am a newbie to CakePHP and > would really appreciate some advice. > > I have coded something exactly f

interlinked selects

2009-09-29 Thread Melanie Sommer
Hello, Please excuse my bad English, I am not a native speaker. I only started CakePHP two weaks ago, read a book about it and am now trying to program my project. I have some experience in php, mysql, html and css but hardly any knowledge of javascript or ajax. I have several tables linked with

Associating model aliases

2009-09-29 Thread Mario
Hi all, probably a not so difficult question, but I am a newbie to CakePHP and would really appreciate some advice. I have coded something exactly following the situation described in http://book.cakephp.org/view/851/Multiple-relations-to-the-same-model that is: a User model, a Message model, Se

Regarding puting unicodes characters for po files

2009-09-29 Thread Mars
I'm working on a application that needs to handle Japanese and English. For Japanese po file, I want to specify "msgstr" in "po" file using unicodes. Refer following sample msgid "test" msgstr "\u30e1\u30f3\u30bf\u30eb\u30d8\u30eb \u30b9\u30b1\u30a2\u30b7\u30b9\u30c6\u30e0" When I used that "tes

Re: Problem with Ajax.autocomplete and Internet Explorer

2009-09-29 Thread Bs
*bump* On 22 Sep., 14:28, Bs wrote: > Hi, > > I'm using the Ajax Helper for some fields in my app and it works > flawlessly from the backend side. The only problem is Internet > Explorer where the popup DIV is displayed totally dispositioned, > several pixels to the right and lower than it's dis

Re: Doubt in cake php

2009-09-29 Thread Walther
Just be careful with requestAction. If you don't cache properly you can dramatically slow down your application. Mark Story has some good tips on requestAction use at his blog (http://mark-story.com/) On Sep 28, 12:15 pm, John Andersen wrote: > It will not be much more fat, as the only thing eac

How use ACL in a particular situation

2009-09-29 Thread marco.rizze...@gmail.com
Hi I have a design question on ACL that I would use in my system. The problem is my system is a bit different from standard. I have users that can be belong to many teams. So a user can belong to two,three,four etc... teams. Moreover I have to manage the access of users to a document's list. To do