Re: found - old Graham Bird's AJAX tutorial copy
On 18 maio, 22:20, Delirium tremens wrote: > http://web.archive.org/web/20080221171422/http://www.grahambird.co.uk... > > Hi, > > A long time ago, I was here and asked for help so much that you > stopped helping me. > I was a help vampire, but I'm not any longer and I'm not going to do > that again. > > Bye, > Delirium tremens > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > 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 > athttp://groups.google.com/group/cake-php?hl=en I improved. I even made a cool Firefox addon. It's at https://addons.mozilla.org/en-US/firefox/addon/52714 Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
found - old Graham Bird's AJAX tutorial copy
http://web.archive.org/web/20080221171422/http://www.grahambird.co.uk/cake/tutorials/ajax.php Hi, A long time ago, I was here and asked for help so much that you stopped helping me. I was a help vampire, but I'm not any longer and I'm not going to do that again. Bye, Delirium tremens Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
dispatcher class
The action code (like update) runs twice. First, without params data. Second, with params data. What dispatcher class code runs right before the action code runs first and second times? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: I need to compare how I work to how you work
omg Martin, I am relieved! Sometimes, my posts don't make sense or ask too much or nobody finds interesting (or like you said are asked at the wrong time) or whatever, but I know from your post that this time it went alright!!! By the way, there is a link to reply to author... should I use it AND use the link to just reply? I had made a list of places where I can get help, but had not used it. Maybe, one or two itens in the list are new to you. Check it out! 1 Cookbook - http://book.cakephp.org/ 2 Bakery - http://bakery.cakephp.org/ 3 CakeForge- http://www.cakeforge.org/ 4 API - http://api.cakephp.org/1.2 5 Test Cases - http://api.cakephp.org/tests 6 Wiki - https://trac.cakephp.org/ 7 FAQ - http://groups.google.com/group/cake-php/web/faq On 31 mar, 08:41, Martin Westin wrote: > The thing with Google Groups is that it is a mailing list that many > people access like a forum... I think people don't page back to > "yesterday" and read every message since their last login as many do > in forums. I know I don't. > > This is a debated god / bad aspect of the group. > > The time and day you post a problem greatly affect the number of > people reading it. It is mid-day for me here in Sweden right now and > if you had posted 5-6 hours later I would never have seen your > message. > > I loosely follow this path most of the time: > > Search the google group. > Search Google. > Ask the google group. > Search the core test-cases. (these are a very good source of knowledge > at times) > Start reading the source of related core-files (if I have a "bug" or > strange behaviour) > Check for an answer. > Update question with my current findings from the core > Ask on irc sometimes (I'm not a big chatter-bug but there are some > nice helpful people there... in realtime!) > Workaround the problem or post a ticket if I think I really found a > bug... which is very rare. > > I rarely do all of it and most often I find the answer on the top > three steps. But I always keep playing around on my own while I wait > or if I am really stuck work on some other part of my application for > a while. I have also been known to ask my question again after a day > or two of silence. > > /Martin > > On Mar 31, 11:27 am, Delirium tremens wrote: > > > Hi! > > > Once, I created a topic here, asking for help, then I got one reply. > > Unfortunately, it was not enough help to solve the problem. I kept > > posting my progress, waiting for a reply and I must have posted three > > times, but I waited days to get one reply again. Fortunately, It was > > enough help to solve the problem. > > > I am afraid of waiting. Regarding waiting... > > > Before waiting: how much do you google? While you are waiting: do you > > keep trying to solve the problem yourself? or other problems in your > > project? or other people's problems (in message boards, in chat rooms > > etc)? how often do you check your inbox for a reply? After waiting: do > > you work around? or delay? or quit? > > > How dependent / independent are you? How I can I be more like you??? > > > 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 -~--~~~~--~~--~--~---
I need to compare how I work to how you work
Hi! Once, I created a topic here, asking for help, then I got one reply. Unfortunately, it was not enough help to solve the problem. I kept posting my progress, waiting for a reply and I must have posted three times, but I waited days to get one reply again. Fortunately, It was enough help to solve the problem. I am afraid of waiting. Regarding waiting... Before waiting: how much do you google? While you are waiting: do you keep trying to solve the problem yourself? or other problems in your project? or other people's problems (in message boards, in chat rooms etc)? how often do you check your inbox for a reply? After waiting: do you work around? or delay? or quit? How dependent / independent are you? How I can I be more like you??? 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 -~--~~~~--~~--~--~---
testing
testing testing testing --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: one or two parameters
The lines I mentioned aren't immediately separated. On 14 mar, 02:55, Miles J wrote: > In the link you sent me, that code isn't even existent. This is > however: > > // uses the ticket to reset the password for the correct user. > function password($hash = null) > { > if ( $email = $this->Tickets->get($this->params['controller'], > $hash) ) > { --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: one or two parameters
The get function is defined with one parameter ($ticket), then it is called with two parameters ($this->params['controller'] and $hash). How come that is right??? On 13 mar, 18:10, Miles J wrote: > Yes? Theres nothing wrong with that code. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
one or two parameters
I found these two lines function get($ticket = null) if ( $email = $this->Tickets->get($this->params['controller'], $hash) ) at http://bakery.cakephp.org/articles/view/ticket-component-resetting-user-passwords Are they right??? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: What when the name is unknown?
What name should I look for if the names keep changing? On 8 mar, 01:59, Miles J wrote: > What exactly is your question? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
What when the name is unknown?
The API tells the names of the properties and the methods in a class. What when the name is unknown? Like a "findByIdAndEmail" database query (method) or an "interests" field to be validated (property). --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: I am clueless...
I need many clues, many clues... On 6 mar, 03:51, Delirium tremens wrote: > To extend CakePHP, do I have to read all of its source code? > > On 6 mar, 03:09, Delirium tremens wrote: > > > How do you work without having read all CakePHP source code? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: I am clueless...
To extend CakePHP, do I have to read all of its source code? On 6 mar, 03:09, Delirium tremens wrote: > How do you work without having read all CakePHP source code? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
I am clueless...
How do you work without having read all CakePHP source code? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: $this->data is being unset
By completely changing the code. function hashPasswords($data, $enforce = false) { if ($enforce && isset ($this->data[$this->alias]['password'])) { if (!empty ($this->data[$this->alias]['password'])) { $this->data[$this->alias]['password'] = Security :: hash($this->data [$this->alias]['password'], null, true); } } return $data; } function beforeSave() { $this->hashPasswords(null, true); return true; } On 30 jan, 01:46, "bioselem...@gmail.com" wrote: > So, How did you solve it? > > On Jan 29, 8:11 pm,Deliriumtremens wrote: > > > This part of the problem has been solved. > > > On 29 jan, 20:41,Deliriumtremens wrote: > > > > The following code does not work. > > > > function hashPasswords($data) { > > > return $data; > > > } > > > function beforeSave() { > > > $this->data['Account']['password'] = > > > Security::hash($this->data > > > ['Account']['password'], null, true); > > > return true; > > > } > > > > Can you figure out why? > > > > On 29 jan, 19:51,Deliriumtremens wrote: > > > > > function hashPasswords($data, $enforce=false) { > > > > if($enforce && isset($data['Account']['password'])) { > > > > if(!empty($data['Account']['password'])) { > > > > $data['Account']['password'] = Security::hash($data > > > > ['Account']['password'], null, true); > > > > } > > > > } > > > > $this->data = $data; > > > > pr($this->data); > > > > return $data; > > > > } > > > > function beforeSave() { > > > > $data = $this->data; > > > > pr($data); > > > > $this->hashPasswords($data, true); > > > > return true; > > > > } > > > > > The first pr prints an array with email and password (hashPasswords is > > > > called twice, it should print an unencrypted password, then print an > > > > encrypted password). The second pr does not print anything. How to > > > > solve this problem? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
To validate passwords, use this code: # in account controller var $components = array ( 'Auth' ); function beforeFilter() { $this->Auth->fields = array ( 'username' => 'email', 'password' => 'password' ); $this->Auth->userModel = 'Account'; $this->Auth->allow('create'); if ($this->action == 'create' || $this->action == 'update') { $this->Auth->authenticate = $this->Account; } } function create() { $this->pageTitle = 'Account / Create'; if (!empty ($this->data)) { if ($this->Account->save($this->data)) { $this->flash('The account has been saved.', '/statistics'); } } } function update() { $this->pageTitle = 'Account / Update'; $this->Account->id = $id = $this->Auth->user('id'); if (empty ($this->data)) { $this->data = $this->Account->read(); } else { $account = $this->Account->findById($this->Auth->user('id')); $this->Account->set($this->data); if ($this->Account->validates()) { if ($this->Auth->password($this->data['Account'] ['currentpassword']) == $account['Account']['password']) $this->data['Account']['password'] = $this->data['Account'] ['newpassword']; if ($this->Account->save($this->data)) { $this->flash('The account with id ' . $id . ' has been updated.', '/statistics'); } } } } } # in account model function hashPasswords($data, $enforce = false) { if ($enforce && isset ($this->data[$this->alias]['password'])) { if (!empty ($this->data[$this->alias]['password'])) { $this->data[$this->alias]['password'] = Security :: hash($this->data [$this->alias]['password'], null, true); } } return $data; } function beforeSave() { $this->hashPasswords(null, true); return true; } # in create view create('Account', array('action' => 'create')); echo $form->input('email', array('size' => 40)); echo $form->input('password', array('type'=>'password', 'size' => 20)); echo $form->end('Create Account'); ?> # in update view create('Account', array('action' => 'update')); echo $form->input('email', array('size' => 40)); echo $form->input('currentpassword', array('type' => 'password', 'size'=> 20)); echo $form->input('newpassword', array('type' => 'password', 'size'=> 20)); echo $form->input('id', array('type'=>'hidden')); echo $form->end('Update Account'); ?> On 30 jan, 06:05, ddaffy wrote: > i solved it this way: > > - named form field 'password1' (or whatever) > - validated that field in User model > - hashed it with AuthComponent::password() in User::beforeSave() > - placed it in $this->data['User']['password'] (and unset $this->data > ['User']['password1']) > > On Jan 30, 2:11 am,Deliriumtremens wrote: > > > This part of the problem has been solved. > > > On 29 jan, 15:06,Deliriumtremens wrote: > > > > What else should I try? > > > > On 29 jan, 15:01,Deliriumtremens wrote: > > > > > The code from the site: > > > > > function hashPasswords($data, $enforce=false) { > > > > if($enforce && > > > > isset($this->data[$this->alias]['password'])) { > > > > if(!empty($this->data[$this->alias]['password'])) { > > > > $this->data[$this->alias]['password'] = Security::hash > > > > ($this->data[$this->alias]['password'], null, true); > > > > } > > > > } > > > > return $data; > > > > } > > > > function beforeSave() { > > > > $this->hashPasswords(null, true); > > > > return true; > > > > } > > > > > I tried: > > > > - the code without changes > > > > - the code with alias changed to userModel > > > > - the code with null changed to $data > > > > - the code with null changed to $this->data > > > > > The codes I tried are not encrypting the password after validating it. > > > > > On 29 jan, 12:18, "j0n4s.h4rtm...@googlemail.com" > > > > > wrote: > > > > > I did not try this yet, but this should help you, right?: > > > > > >http://teknoid.wordpress.com/2008/10/08/demystifying-auth-features-in... > > > > > > p.s. I believe the whole thing is because AuthComponent is > > > > > AuthComponent and not AuthBehavior. If it came with such a thing it > > > > > would be more clear (because hashing would take place in the model > > > > > then) > > > > > > On Jan 28, 8:04 pm,Deliriumtremens wrote: > > > > > > > there is no afterValidate > > > > > > there is no beforeLogin > > > > > > > What now??? > > > > > > > On 28 jan, 16:47,Deliriumtremens wrote: > > > > > > > > I added: > > > > >
Re: behaving the CakePHP 1.2 way
This part of the problem has been solved. On 29 jan, 15:06, Delirium tremens wrote: > What else should I try? > > On 29 jan, 15:01, Delirium tremens wrote: > > > The code from the site: > > > function hashPasswords($data, $enforce=false) { > > if($enforce && isset($this->data[$this->alias]['password'])) { > > if(!empty($this->data[$this->alias]['password'])) { > > $this->data[$this->alias]['password'] = Security::hash > > ($this->data[$this->alias]['password'], null, true); > > } > > } > > return $data; > > } > > function beforeSave() { > > $this->hashPasswords(null, true); > > return true; > > } > > > I tried: > > - the code without changes > > - the code with alias changed to userModel > > - the code with null changed to $data > > - the code with null changed to $this->data > > > The codes I tried are not encrypting the password after validating it. > > > On 29 jan, 12:18, "j0n4s.h4rtm...@googlemail.com" > > > wrote: > > > I did not try this yet, but this should help you, right?: > > > >http://teknoid.wordpress.com/2008/10/08/demystifying-auth-features-in... > > > > p.s. I believe the whole thing is because AuthComponent is > > > AuthComponent and not AuthBehavior. If it came with such a thing it > > > would be more clear (because hashing would take place in the model > > > then) > > > > On Jan 28, 8:04 pm, Delirium tremens wrote: > > > > > there is no afterValidate > > > > there is no beforeLogin > > > > > What now??? > > > > > On 28 jan, 16:47, Delirium tremens wrote: > > > > > > I added: > > > > > > function beforeSave() { > > > > > $this->data['Account']['password'] = > > > > > md5($this->data['Account'] > > > > > ['password']); > > > > > return true; > > > > > > } > > > > > > to Account model, but now login does not work. Why? > > > > > > On 28 jan, 16:04, Delirium tremens wrote: > > > > > > > Hold on... I need it encrypted after validated... What now??? > > > > > > > On 28 jan, 15:53, Delirium tremens wrote: > > > > > > > > I understood! I added it to BeforeFilter. It works! > > > > > > > > On 28 jan, 15:37, Delirium tremens wrote: > > > > > > > > > I added: > > > > > > > > > $this->Auth->authenticate = $this->Account; > > > > > > > > > to login. > > > > > > > > > I added: > > > > > > > > > function hashPasswords( $data ) { > > > > > > > > return $data; > > > > > > > > } > > > > > > > > > to Account model. > > > > > > > > > After updating my account, $cakeDebug (my debug config is 2, so > > > > > > > > flash > > > > > > > > is eternal) flashed my password hashed. Am I doing anything > > > > > > > > wrong? > > > > > > > > > On 27 jan, 21:34, Gonzalo Servat wrote: > > > > > > > > > > On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens > > > > > > > > > wrote: > > > > > > > > > > > CakePHP 1.2 is encrypting passwords before validating them. > > > > > > > > > > > CakePHP 1.2 is trying to make us behave in a different way. > > > > > > > > > > > Are you behaving the CakePHP 1.2 way? > > > > > > > > > > > What are you doing now that you are not allowed to validate > > > > > > > > > > passwords? > > > > > > > > > > I take it you're talking about the AuthComponent? If so, yes > > > > > > > > > it hashes > > > > > > > > > passwords automagically so you basically just store the > > > > > > > > > hashed password in > > > > > > > > > your DB. If you don't want that, you can do something like > > > > > > > > > this: > > > > > > > > > > $this->Auth->authenticate = $this->User; // or whatever ... > > > > > > > > > > Inside the User model, you could have: > > > > > > > > > > function hashPasswords( $data ) { > > > > > > > > > return $data; > > > > > > > > > > } > > > > > > > > > > Instead of hashing the password, it just returns it > > > > > > > > > unmodified (clear text). > > > > > > > > > > - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: $this->data is being unset
This part of the problem has been solved. On 29 jan, 20:41, Delirium tremens wrote: > The following code does not work. > > function hashPasswords($data) { > return $data; > } > function beforeSave() { > $this->data['Account']['password'] = Security::hash($this->data > ['Account']['password'], null, true); > return true; > } > > Can you figure out why? > > On 29 jan, 19:51, Delirium tremens wrote: > > > function hashPasswords($data, $enforce=false) { > > if($enforce && isset($data['Account']['password'])) { > > if(!empty($data['Account']['password'])) { > > $data['Account']['password'] = Security::hash($data > > ['Account']['password'], null, true); > > } > > } > > $this->data = $data; > > pr($this->data); > > return $data; > > } > > function beforeSave() { > > $data = $this->data; > > pr($data); > > $this->hashPasswords($data, true); > > return true; > > } > > > The first pr prints an array with email and password (hashPasswords is > > called twice, it should print an unencrypted password, then print an > > encrypted password). The second pr does not print anything. How to > > solve this problem? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: $this->data is being unset
The following code does not work. function hashPasswords($data) { return $data; } function beforeSave() { $this->data['Account']['password'] = Security::hash($this->data ['Account']['password'], null, true); return true; } Can you figure out why? On 29 jan, 19:51, Delirium tremens wrote: > function hashPasswords($data, $enforce=false) { > if($enforce && isset($data['Account']['password'])) { > if(!empty($data['Account']['password'])) { > $data['Account']['password'] = Security::hash($data > ['Account']['password'], null, true); > } > } > $this->data = $data; > pr($this->data); > return $data; > } > function beforeSave() { > $data = $this->data; > pr($data); > $this->hashPasswords($data, true); > return true; > } > > The first pr prints an array with email and password (hashPasswords is > called twice, it should print an unencrypted password, then print an > encrypted password). The second pr does not print anything. How to > solve this problem? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$this->data is being unset
function hashPasswords($data, $enforce=false) { if($enforce && isset($data['Account']['password'])) { if(!empty($data['Account']['password'])) { $data['Account']['password'] = Security::hash($data ['Account']['password'], null, true); } } $this->data = $data; pr($this->data); return $data; } function beforeSave() { $data = $this->data; pr($data); $this->hashPasswords($data, true); return true; } The first pr prints an array with email and password (hashPasswords is called twice, it should print an unencrypted password, then print an encrypted password). The second pr does not print anything. How to solve this problem? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
What else should I try? On 29 jan, 15:01, Delirium tremens wrote: > The code from the site: > > function hashPasswords($data, $enforce=false) { > if($enforce && isset($this->data[$this->alias]['password'])) { > if(!empty($this->data[$this->alias]['password'])) { > $this->data[$this->alias]['password'] = Security::hash > ($this->data[$this->alias]['password'], null, true); > } > } > return $data; > } > function beforeSave() { > $this->hashPasswords(null, true); > return true; > } > > I tried: > - the code without changes > - the code with alias changed to userModel > - the code with null changed to $data > - the code with null changed to $this->data > > The codes I tried are not encrypting the password after validating it. > > On 29 jan, 12:18, "j0n4s.h4rtm...@googlemail.com" > > wrote: > > I did not try this yet, but this should help you, right?: > > >http://teknoid.wordpress.com/2008/10/08/demystifying-auth-features-in... > > > p.s. I believe the whole thing is because AuthComponent is > > AuthComponent and not AuthBehavior. If it came with such a thing it > > would be more clear (because hashing would take place in the model > > then) > > > On Jan 28, 8:04 pm, Delirium tremens wrote: > > > > there is no afterValidate > > > there is no beforeLogin > > > > What now??? > > > > On 28 jan, 16:47, Delirium tremens wrote: > > > > > I added: > > > > > function beforeSave() { > > > > $this->data['Account']['password'] = md5($this->data['Account'] > > > > ['password']); > > > > return true; > > > > > } > > > > > to Account model, but now login does not work. Why? > > > > > On 28 jan, 16:04, Delirium tremens wrote: > > > > > > Hold on... I need it encrypted after validated... What now??? > > > > > > On 28 jan, 15:53, Delirium tremens wrote: > > > > > > > I understood! I added it to BeforeFilter. It works! > > > > > > > On 28 jan, 15:37, Delirium tremens wrote: > > > > > > > > I added: > > > > > > > > $this->Auth->authenticate = $this->Account; > > > > > > > > to login. > > > > > > > > I added: > > > > > > > > function hashPasswords( $data ) { > > > > > > > return $data; > > > > > > > } > > > > > > > > to Account model. > > > > > > > > After updating my account, $cakeDebug (my debug config is 2, so > > > > > > > flash > > > > > > > is eternal) flashed my password hashed. Am I doing anything wrong? > > > > > > > > On 27 jan, 21:34, Gonzalo Servat wrote: > > > > > > > > > On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens > > > > > > > > wrote: > > > > > > > > > > CakePHP 1.2 is encrypting passwords before validating them. > > > > > > > > > > CakePHP 1.2 is trying to make us behave in a different way. > > > > > > > > > > Are you behaving the CakePHP 1.2 way? > > > > > > > > > > What are you doing now that you are not allowed to validate > > > > > > > > > passwords? > > > > > > > > > I take it you're talking about the AuthComponent? If so, yes it > > > > > > > > hashes > > > > > > > > passwords automagically so you basically just store the hashed > > > > > > > > password in > > > > > > > > your DB. If you don't want that, you can do something like this: > > > > > > > > > $this->Auth->authenticate = $this->User; // or whatever ... > > > > > > > > > Inside the User model, you could have: > > > > > > > > > function hashPasswords( $data ) { > > > > > > > > return $data; > > > > > > > > > } > > > > > > > > > Instead of hashing the password, it just returns it unmodified > > > > > > > > (clear text). > > > > > > > > > - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
The code from the site: function hashPasswords($data, $enforce=false) { if($enforce && isset($this->data[$this->alias]['password'])) { if(!empty($this->data[$this->alias]['password'])) { $this->data[$this->alias]['password'] = Security::hash ($this->data[$this->alias]['password'], null, true); } } return $data; } function beforeSave() { $this->hashPasswords(null, true); return true; } I tried: - the code without changes - the code with alias changed to userModel - the code with null changed to $data - the code with null changed to $this->data The codes I tried are not encrypting the password after validating it. On 29 jan, 12:18, "j0n4s.h4rtm...@googlemail.com" wrote: > I did not try this yet, but this should help you, right?: > > http://teknoid.wordpress.com/2008/10/08/demystifying-auth-features-in... > > p.s. I believe the whole thing is because AuthComponent is > AuthComponent and not AuthBehavior. If it came with such a thing it > would be more clear (because hashing would take place in the model > then) > > On Jan 28, 8:04 pm, Delirium tremens wrote: > > > there is no afterValidate > > there is no beforeLogin > > > What now??? > > > On 28 jan, 16:47, Delirium tremens wrote: > > > > I added: > > > > function beforeSave() { > > > $this->data['Account']['password'] = md5($this->data['Account'] > > > ['password']); > > > return true; > > > > } > > > > to Account model, but now login does not work. Why? > > > > On 28 jan, 16:04, Delirium tremens wrote: > > > > > Hold on... I need it encrypted after validated... What now??? > > > > > On 28 jan, 15:53, Delirium tremens wrote: > > > > > > I understood! I added it to BeforeFilter. It works! > > > > > > On 28 jan, 15:37, Delirium tremens wrote: > > > > > > > I added: > > > > > > > $this->Auth->authenticate = $this->Account; > > > > > > > to login. > > > > > > > I added: > > > > > > > function hashPasswords( $data ) { > > > > > > return $data; > > > > > > } > > > > > > > to Account model. > > > > > > > After updating my account, $cakeDebug (my debug config is 2, so > > > > > > flash > > > > > > is eternal) flashed my password hashed. Am I doing anything wrong? > > > > > > > On 27 jan, 21:34, Gonzalo Servat wrote: > > > > > > > > On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens > > > > > > > wrote: > > > > > > > > > CakePHP 1.2 is encrypting passwords before validating them. > > > > > > > > > CakePHP 1.2 is trying to make us behave in a different way. > > > > > > > > > Are you behaving the CakePHP 1.2 way? > > > > > > > > > What are you doing now that you are not allowed to validate > > > > > > > > passwords? > > > > > > > > I take it you're talking about the AuthComponent? If so, yes it > > > > > > > hashes > > > > > > > passwords automagically so you basically just store the hashed > > > > > > > password in > > > > > > > your DB. If you don't want that, you can do something like this: > > > > > > > > $this->Auth->authenticate = $this->User; // or whatever ... > > > > > > > > Inside the User model, you could have: > > > > > > > > function hashPasswords( $data ) { > > > > > > > return $data; > > > > > > > > } > > > > > > > > Instead of hashing the password, it just returns it unmodified > > > > > > > (clear text). > > > > > > > > - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
there is no afterValidate there is no beforeLogin What now??? On 28 jan, 16:47, Delirium tremens wrote: > I added: > > function beforeSave() { > $this->data['Account']['password'] = md5($this->data['Account'] > ['password']); > return true; > > } > > to Account model, but now login does not work. Why? > > On 28 jan, 16:04, Delirium tremens wrote: > > > Hold on... I need it encrypted after validated... What now??? > > > On 28 jan, 15:53, Delirium tremens wrote: > > > > I understood! I added it to BeforeFilter. It works! > > > > On 28 jan, 15:37, Delirium tremens wrote: > > > > > I added: > > > > > $this->Auth->authenticate = $this->Account; > > > > > to login. > > > > > I added: > > > > > function hashPasswords( $data ) { > > > > return $data; > > > > } > > > > > to Account model. > > > > > After updating my account, $cakeDebug (my debug config is 2, so flash > > > > is eternal) flashed my password hashed. Am I doing anything wrong? > > > > > On 27 jan, 21:34, Gonzalo Servat wrote: > > > > > > On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens > > > > > wrote: > > > > > > > CakePHP 1.2 is encrypting passwords before validating them. > > > > > > > CakePHP 1.2 is trying to make us behave in a different way. > > > > > > > Are you behaving the CakePHP 1.2 way? > > > > > > > What are you doing now that you are not allowed to validate > > > > > > passwords? > > > > > > I take it you're talking about the AuthComponent? If so, yes it hashes > > > > > passwords automagically so you basically just store the hashed > > > > > password in > > > > > your DB. If you don't want that, you can do something like this: > > > > > > $this->Auth->authenticate = $this->User; // or whatever ... > > > > > > Inside the User model, you could have: > > > > > > function hashPasswords( $data ) { > > > > > return $data; > > > > > > } > > > > > > Instead of hashing the password, it just returns it unmodified (clear > > > > > text). > > > > > > - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
I added: function beforeSave() { $this->data['Account']['password'] = md5($this->data['Account'] ['password']); return true; } to Account model, but now login does not work. Why? On 28 jan, 16:04, Delirium tremens wrote: > Hold on... I need it encrypted after validated... What now??? > > On 28 jan, 15:53, Delirium tremens wrote: > > > I understood! I added it to BeforeFilter. It works! > > > On 28 jan, 15:37, Delirium tremens wrote: > > > > I added: > > > > $this->Auth->authenticate = $this->Account; > > > > to login. > > > > I added: > > > > function hashPasswords( $data ) { > > > return $data; > > > } > > > > to Account model. > > > > After updating my account, $cakeDebug (my debug config is 2, so flash > > > is eternal) flashed my password hashed. Am I doing anything wrong? > > > > On 27 jan, 21:34, Gonzalo Servat wrote: > > > > > On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens > > > > wrote: > > > > > > CakePHP 1.2 is encrypting passwords before validating them. > > > > > > CakePHP 1.2 is trying to make us behave in a different way. > > > > > > Are you behaving the CakePHP 1.2 way? > > > > > > What are you doing now that you are not allowed to validate passwords? > > > > > I take it you're talking about the AuthComponent? If so, yes it hashes > > > > passwords automagically so you basically just store the hashed password > > > > in > > > > your DB. If you don't want that, you can do something like this: > > > > > $this->Auth->authenticate = $this->User; // or whatever ... > > > > > Inside the User model, you could have: > > > > > function hashPasswords( $data ) { > > > > return $data; > > > > > } > > > > > Instead of hashing the password, it just returns it unmodified (clear > > > > text). > > > > > - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
Hold on... I need it encrypted after validated... What now??? On 28 jan, 15:53, Delirium tremens wrote: > I understood! I added it to BeforeFilter. It works! > > On 28 jan, 15:37, Delirium tremens wrote: > > > I added: > > > $this->Auth->authenticate = $this->Account; > > > to login. > > > I added: > > > function hashPasswords( $data ) { > > return $data; > > } > > > to Account model. > > > After updating my account, $cakeDebug (my debug config is 2, so flash > > is eternal) flashed my password hashed. Am I doing anything wrong? > > > On 27 jan, 21:34, Gonzalo Servat wrote: > > > > On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens > > > wrote: > > > > > CakePHP 1.2 is encrypting passwords before validating them. > > > > > CakePHP 1.2 is trying to make us behave in a different way. > > > > > Are you behaving the CakePHP 1.2 way? > > > > > What are you doing now that you are not allowed to validate passwords? > > > > I take it you're talking about the AuthComponent? If so, yes it hashes > > > passwords automagically so you basically just store the hashed password in > > > your DB. If you don't want that, you can do something like this: > > > > $this->Auth->authenticate = $this->User; // or whatever ... > > > > Inside the User model, you could have: > > > > function hashPasswords( $data ) { > > > return $data; > > > > } > > > > Instead of hashing the password, it just returns it unmodified (clear > > > text). > > > > - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
I understood! I added it to BeforeFilter. It works! On 28 jan, 15:37, Delirium tremens wrote: > I added: > > $this->Auth->authenticate = $this->Account; > > to login. > > I added: > > function hashPasswords( $data ) { > return $data; > } > > to Account model. > > After updating my account, $cakeDebug (my debug config is 2, so flash > is eternal) flashed my password hashed. Am I doing anything wrong? > > On 27 jan, 21:34, Gonzalo Servat wrote: > > > On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens wrote: > > > > CakePHP 1.2 is encrypting passwords before validating them. > > > > CakePHP 1.2 is trying to make us behave in a different way. > > > > Are you behaving the CakePHP 1.2 way? > > > > What are you doing now that you are not allowed to validate passwords? > > > I take it you're talking about the AuthComponent? If so, yes it hashes > > passwords automagically so you basically just store the hashed password in > > your DB. If you don't want that, you can do something like this: > > > $this->Auth->authenticate = $this->User; // or whatever ... > > > Inside the User model, you could have: > > > function hashPasswords( $data ) { > > return $data; > > > } > > > Instead of hashing the password, it just returns it unmodified (clear text). > > > - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
I added: $this->Auth->authenticate = $this->Account; to login. I added: function hashPasswords( $data ) { return $data; } to Account model. After updating my account, $cakeDebug (my debug config is 2, so flash is eternal) flashed my password hashed. Am I doing anything wrong? On 27 jan, 21:34, Gonzalo Servat wrote: > On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens wrote: > > > > > CakePHP 1.2 is encrypting passwords before validating them. > > > CakePHP 1.2 is trying to make us behave in a different way. > > > Are you behaving the CakePHP 1.2 way? > > > What are you doing now that you are not allowed to validate passwords? > > I take it you're talking about the AuthComponent? If so, yes it hashes > passwords automagically so you basically just store the hashed password in > your DB. If you don't want that, you can do something like this: > > $this->Auth->authenticate = $this->User; // or whatever ... > > Inside the User model, you could have: > > function hashPasswords( $data ) { > return $data; > > } > > Instead of hashing the password, it just returns it unmodified (clear text). > > - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
behaving the CakePHP 1.2 way
CakePHP 1.2 is encrypting passwords before validating them. CakePHP 1.2 is trying to make us behave in a different way. Are you behaving the CakePHP 1.2 way? What are you doing now that you are not allowed to validate passwords? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
What is automated and what is not?
I am going to add remember me and activate account features to my login system. Why is it not built in CakePHP? Are remember me and activate account not common enough? What is automated and what is not? Why? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
acl, auth and security components
How do they relate to each other? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
The Manual»Example Applications»Blog»Deleting Posts - a security issue
http://localhost/CakePHP/cakeBlog/posts/delete/1 1 can be anything What if a cracker visits http://localhost/CakePHP/cakeBlog/posts/delete/'all' or something like that? How are you protecting your site? What would an explanation look like in the manual about denying any argument like 'all' from being passed to a method like delete? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: get method validation
Are you still not understanding the question? On 18 jan, 15:38, Delirium tremens wrote: > How come nobody knows??? > > On 18 jan, 13:30, Delirium tremens wrote: > > > How to validate an id passed not by post, but by get? I do not have to > > output an error message to hackers and crackers, do I? I tested using / > > ^[0-9]{1,10}$/ as rule, nothing as message and passing an "a", but it > > did not output an error message. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: get method validation
Do you know and http://www.asite.com/script.php?id=a ? Valid IDs are numbers. How do I prevent my script from assigning invalid values to id? On 18 jan, 17:18, Webweave wrote: > Not clear on what your question means, are you asking about validation > rules? > > On Jan 18, 7:30 am, Delirium tremens wrote: > > > How to validate an id passed not by post, but by get? I do not have to > > output an error message to hackers and crackers, do I? I tested using / > > ^[0-9]{1,10}$/ as rule, nothing as message and passing an "a", but it > > did not output an error message. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: get method validation
update link readall view echo $html->link('Update', '/articles/update/'.$articleid); update method articles controller function update($id = null) { validate var articles model 'id' => 'numeric' update link articles controller echo $form->input('id', array('type'=>'hidden')); How do I prevent my script from trying to delete id = not a number? On 18 jan, 17:07, brian wrote: > Well, I don't know quite what the question is. What does your test > look like, exactly? What data are you posting? Post some code. > > On Sun, Jan 18, 2009 at 12:38 PM, Delirium tremens wrote: > > > How come nobody knows??? > > > On 18 jan, 13:30, Delirium tremens wrote: > >> How to validate an id passed not by post, but by get? I do not have to > >> output an error message to hackers and crackers, do I? I tested using / > >> ^[0-9]{1,10}$/ as rule, nothing as message and passing an "a", but it > >> did not output an error message. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: get method validation
How come nobody knows??? On 18 jan, 13:30, Delirium tremens wrote: > How to validate an id passed not by post, but by get? I do not have to > output an error message to hackers and crackers, do I? I tested using / > ^[0-9]{1,10}$/ as rule, nothing as message and passing an "a", but it > did not output an error message. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: abnormal flash
oi Marcelo, supresa! eu sou brasileiro também!!! hahaha Existe mercado de trabalho para programador de CakePHP no Brasil??? Tenho que sair logo. Até mais, Pedro On 18 jan, 13:44, "Marcelo Andrade" wrote: > On Sun, Jan 18, 2009 at 12:37 PM, Delirium tremens wrote: > > > Flash is called like that because you see the message and seconds > > later you are redirected, right? Well, my flash does not redirect. > > Why??? > > Your debug level at config modifies the flash behaviour. > > Best regards. > > -- > MARCELO DE F. ANDRADE (aka "eleKtron") > Belem, PA, Amazonia, Brazil > Linux User #221105 > > [...@pará ~]# linkshttp://pa.slackwarebrasil.org/ > > For Libby's backstory be told on > Losthttp://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
good or bad practice - password validation
Is it a good or a bad practice to validate passwords before hashing? Is the following solution, the best? //register function function register() { if (!empty($this->data)) { if ($this->data['User']['password'] == $this- >Auth->password($this- >data['User']['password_confirm'])) { $this->User->create() && $this->User- >validates(); if ($this->User->save($this->data)) { $this->Session->setFlash("You have been registered! You can log in now."); $this->redirect(array('action' => 'index')); } } } } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
abnormal flash
Flash is called like that because you see the message and seconds later you are redirected, right? Well, my flash does not redirect. Why??? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
get method validation
How to validate an id passed not by post, but by get? I do not have to output an error message to hackers and crackers, do I? I tested using / ^[0-9]{1,10}$/ as rule, nothing as message and passing an "a", but it did not output an error message. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$id = null and $id
What is it for? http://book.cakephp.org/view/336/Creating-Post-Views # function view($id = null) { http://book.cakephp.org/view/337/Adding-Posts function view($id) { = null removed!!! function add() { http://book.cakephp.org/view/339/Deleting-Posts 1. function delete($id) { no = null!!! http://book.cakephp.org/view/340/Editing-Posts 1. function edit($id = null) { --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: renaming problem
I found the solution! The default user model for the auth component is User. so I changed it to Account. That's all! Thank you for listening, anyway. On 16 jan, 06:57, Delirium tremens wrote: > I renamed posts to articles and users to accounts. I searched for ser > without U and without u in the profuture folder (the one that was > app)! I get the error message "Error: UsersController could not be > found". I can't figure out what is missing to rename! What is it? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
renaming problem
I renamed posts to articles and users to accounts. I searched for ser without U and without u in the profuture folder (the one that was app)! I get the error message "Error: UsersController could not be found". I can't figure out what is missing to rename! What is it? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: unwanted user_id increase
I removed the line, but it still does not work, because user_id is empty. On 16 jan, 00:51, stefano wrote: > why are you doing the save into User's model? remove this line > $usersaved = $this->User->save($this->data); > > function add() { > if (!empty ($this->data)) { > $this->data['Post']['user_id'] = $this->User->id; > $postsaved = $this->User->Post->save($this->data); > if($postsaved) { > $this->flash('The post has been saved.', '/posts'); > } > } > > > > } > On Thu, Jan 15, 2009 at 11:45 PM, Delirium tremens wrote: > > > I have a User hasMany Post and a Post belongs to User. The function to > > add a post with an user id is inserting a user with null email and > > null password into the users table and a post with an user id > > increased by one into the posts table. Take a look... > > > function add() { > > if (!empty ($this->data)) { > > $usersaved = $this->User->save($this->data); > > $this->data['Post']['user_id'] = $this->User->id; > > $postsaved = $this->User->Post->save($this->data); > > if($postsaved && $usersaved) { > > $this->flash('The post has been saved.', '/posts'); > > } > > } > > } > > > How to solve this problem? > > -- > Stefano Salvatori M.http://stefano.salvatori.cl/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: unwanted user_id increase
The order is actually: 1. $this->User->save($this->data); 2. $this->data['Profile']['user_id'] = $this->User->id; 3. $this->User->Profile->save($this->data); On 16 jan, 01:03, Delirium tremens wrote: > On 16 jan, 00:51, stefano wrote: > > > why are you doing the save into User's model? > > http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasM... > > The add example on top of that page uses... > > 1. $this->User->Profile->save($this->data); > 2. $this->data['Profile']['user_id'] = $this->User->id; > 3. $this->User->save($this->data); > > If I'm using User hasMany Post and Post belongsTo User, why does the > example need the three lines, but I don't? > > > remove this line > > $usersaved = $this->User->save($this->data); > > > function add() { > > if (!empty ($this->data)) { > > $this->data['Post']['user_id'] = $this->User->id; > > $postsaved = $this->User->Post->save($this->data); > > if($postsaved) { > > $this->flash('The post has been saved.', '/posts'); > > } > > } > > > } > > On Thu, Jan 15, 2009 at 11:45 PM, Delirium tremens > > wrote: > > > > I have a User hasMany Post and a Post belongs to User. The function to > > > add a post with an user id is inserting a user with null email and > > > null password into the users table and a post with an user id > > > increased by one into the posts table. Take a look... > > > > function add() { > > > if (!empty ($this->data)) { > > > $usersaved = $this->User->save($this->data); > > > $this->data['Post']['user_id'] = $this->User->id; > > > $postsaved = $this->User->Post->save($this->data); > > > if($postsaved && $usersaved) { > > > $this->flash('The post has been saved.', '/posts'); > > > } > > > } > > > } > > > > How to solve this problem? > > > -- > > Stefano Salvatori M.http://stefano.salvatori.cl/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: unwanted user_id increase
On 16 jan, 00:51, stefano wrote: > why are you doing the save into User's model? http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo The add example on top of that page uses... 1. $this->User->Profile->save($this->data); 2. $this->data['Profile']['user_id'] = $this->User->id; 3. $this->User->save($this->data); If I'm using User hasMany Post and Post belongsTo User, why does the example need the three lines, but I don't? > remove this line > $usersaved = $this->User->save($this->data); > > function add() { > if (!empty ($this->data)) { > $this->data['Post']['user_id'] = $this->User->id; > $postsaved = $this->User->Post->save($this->data); > if($postsaved) { > $this->flash('The post has been saved.', '/posts'); > } > } > > > > } > On Thu, Jan 15, 2009 at 11:45 PM, Delirium tremens wrote: > > > I have a User hasMany Post and a Post belongs to User. The function to > > add a post with an user id is inserting a user with null email and > > null password into the users table and a post with an user id > > increased by one into the posts table. Take a look... > > > function add() { > > if (!empty ($this->data)) { > > $usersaved = $this->User->save($this->data); > > $this->data['Post']['user_id'] = $this->User->id; > > $postsaved = $this->User->Post->save($this->data); > > if($postsaved && $usersaved) { > > $this->flash('The post has been saved.', '/posts'); > > } > > } > > } > > > How to solve this problem? > > -- > Stefano Salvatori M.http://stefano.salvatori.cl/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
unwanted user_id increase
I have a User hasMany Post and a Post belongs to User. The function to add a post with an user id is inserting a user with null email and null password into the users table and a post with an user id increased by one into the posts table. Take a look... function add() { if (!empty ($this->data)) { $usersaved = $this->User->save($this->data); $this->data['Post']['user_id'] = $this->User->id; $postsaved = $this->User->Post->save($this->data); if($postsaved && $usersaved) { $this->flash('The post has been saved.', '/posts'); } } } How to solve this problem? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Saving Your Data
"The example action shown below will assume that you've POSTed enough data (using the FormHelper) to create a single User and a single Profile." http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo POSTed enough data to save a single User and a single Profile??? If I have - email and password fields for user - title and body fields for post Why do I need to post not just user ID, but also user email and user password to save profile title and profile body??? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
there is something missing
"We'll be doing that soon enough. You should now have models, controllers, and baked views for your users, groups, posts and widgets. in actions mode, this authenticates our ARO - groups and users - against the ACO objects - controllers & actions." After "posts and widgets" and before "in actions mode", there is something missing. at http://book.cakephp.org/view/642/Preparing-our-Application It looks like it is a lot missing, because all of a sudden "We now have a functioning CRUD application." at http://book.cakephp.org/view/643/Preparing-to-Add-Auth What do you think is missing? By the way, do I have to understand the automated tool for creating ACOs code to create a CakePHP site with user authentication? - http://book.cakephp.org/view/647/An-Automated-tool-for-creating-ACOs --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
there is something missing
After "posts and widgets" and before "in actions mode", there is something missing. What do you think it is? "We'll be doing that soon enough. You should now have models, controllers, and baked views for your users, groups, posts and widgets. in actions mode, this authenticates our ARO - groups and users - against the ACO objects - controllers & actions." http://book.cakephp.org/view/642/Preparing-our-Application It looks like it is a lot missing, because all of a sudden "We now have a functioning CRUD application." http://book.cakephp.org/view/643/Preparing-to-Add-Auth By the way, do I have to understand the automated tool for creating ACOs code to create a CakePHP site with user authentication? http://book.cakephp.org/view/647/An-Automated-tool-for-creating-ACOs --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: xampp phpeclipse dbg
I was finally able to install and configure a php debugger!!! http://smwforum.ontoprise.com/smwforum/index.php/Help:How_can_I_debug_XAMPP_PHP_Eclipse (the "Install xampp and dbg" part of the page worked) http://wiki.eistiens.net/w/PHPEclipse_:_Installation (the "configuring the debugger client part" of the page worked) http://www.phpeclipse.com/discussion/3/29 (the "set the project URL/browser path" part, "Change it per project" subpart worked) On 25 dez, 23:13, Delirium tremens wrote: > On 25 dez, 19:16, Delirium tremens wrote: > > > > > For record,http://www.phpeclipse.com/wiki/Howto/DBGAndPHPEclipse > > > My Remote Src path is the DocumentRoot which is set to "C:\xampp > > \htdocs". On my local machine, where I am running Eclipse, the > > workspace is "C:\xampp\htdocs" and the project is called "faninter". > > So my total local path would be "C:\xampp\htdocs\faninter". > > > I set my remote Sourcepath to "C:\xampp\htdocs". Local path is "C: > > \xampp\htdocs\faninter". Remoate path is "C:\xampp\htdocs". > > > Problem 1: The target file is not "C:\xampp\htdocs\faninter\account > > \create.php", it is "C:\xampp\htdocs\account\create.php" > > >http://e.imagehost.org/0024/debug.png > > > Problem 2: When I click the Debug button, I get an object not found > > (in portuguese, objeto não encontrado) message. > > >http://e.imagehost.org/0527/debug_2.png > > > How to solve these problems? > > I solved these problems!!! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: xampp phpeclipse dbg
On 25 dez, 19:16, Delirium tremens wrote: > For record,http://www.phpeclipse.com/wiki/Howto/DBGAndPHPEclipse > > My Remote Src path is the DocumentRoot which is set to "C:\xampp > \htdocs". On my local machine, where I am running Eclipse, the > workspace is "C:\xampp\htdocs" and the project is called "faninter". > So my total local path would be "C:\xampp\htdocs\faninter". > > I set my remote Sourcepath to "C:\xampp\htdocs". Local path is "C: > \xampp\htdocs\faninter". Remoate path is "C:\xampp\htdocs". > > Problem 1: The target file is not "C:\xampp\htdocs\faninter\account > \create.php", it is "C:\xampp\htdocs\account\create.php" > > http://e.imagehost.org/0024/debug.png > > Problem 2: When I click the Debug button, I get an object not found > (in portuguese, objeto não encontrado) message. > > http://e.imagehost.org/0527/debug_2.png > > How to solve these problems? I solved these problems!!! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: xampp phpeclipse dbg
On 25 dez, 19:27, persivo_cunha wrote: > Eu não sei qual o seu problema, pois não utilizo o Eclipse com o Cake > dessa forma, a única coisa que posso dizer, pois reparei na figura 2, > é que você está chamando o endereço errado na URL. Todas as pastas > dentro de htdocs são encaradas como páginas web, e account está dentro > de faninter, logo vc deve chamar localhost/faninter. > > Reiterando, isso não resolverá o problema. Eu sei, mas é o Eclipse que lança o navegador chamando localhost sem faninter. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
xampp phpeclipse dbg
For record, http://www.phpeclipse.com/wiki/Howto/DBGAndPHPEclipse My Remote Src path is the DocumentRoot which is set to "C:\xampp \htdocs". On my local machine, where I am running Eclipse, the workspace is "C:\xampp\htdocs" and the project is called "faninter". So my total local path would be "C:\xampp\htdocs\faninter". I set my remote Sourcepath to "C:\xampp\htdocs". Local path is "C: \xampp\htdocs\faninter". Remoate path is "C:\xampp\htdocs". Problem 1: The target file is not "C:\xampp\htdocs\faninter\account \create.php", it is "C:\xampp\htdocs\account\create.php" http://e.imagehost.org/0024/debug.png Problem 2: When I click the Debug button, I get an object not found (in portuguese, objeto não encontrado) message. http://e.imagehost.org/0527/debug_2.png How to solve these problems? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---