Re: $this->Session->setFlash problem
Thank you guys! yes Im using 1.2 and after I removing "echo" I'm not having that "1"!!! I spent hours last night to remove that 1 Thanks Sherry -- View this message in context: http://cakephp.1045679.n5.nabble.com/this-Session-setFlash-problem-tp3314357p3314653.html Sent from the CakePHP mailing list archive at Nabble.com. 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
Re: IDE
Hi, I use easy eclipse for PHP ( http://www.easyeclipse.org/site/distributions/php.html). I have also used Aptana IDE once but found easy eclipse better. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Dec 21, 2010 at 8:27 PM, Kristofer wrote: > What IDE do people typically use with CakePHP? I've been doing stuff > from the Linux command line using vim for so long. I'd like something > more graphical that (hopefully) supports SVN. Looking for more point- > and-click. :) > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
Re: CakePHP in subdirectory, but in the url
Hi, I haven't done this yet but by looking at http://api13.cakephp.org/file/cake/libs/router.php#method-Routerurl, I think you can set the 'base' for URLs. Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 22, 2010 at 6:21 AM, Luos wrote: > Hi! > > I want to place my CakePHP app to a subdirectory like this: > > web (server document root) > cake_app > app > cake > etc > > > I made a htaccess to the document root: > > > RewriteEngine on > RewriteBase / > RewriteRule^$ cideo/app/webroot/[L] > RewriteRule(.*) cideo/app/webroot/$1 [L] > > > (cideo is the name of the app) > > Evrything works well at first look, but if i make links with html > helper, the links will look like this: > > http://domain.com/cideo/controller/action > but i want only > http://domain.com/controller/action > > is there any way to solve this? > > I looked at the source of Router but i only figured out that i have to > modify the $base variable, but i didnt find out where (how) it gets > value. > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
Re: Short Names Navigation (like Twitter and Facebook)
Hi, Please have a look at routing configuration, http://book.cakephp.org/view/945/Routes-Configuration Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 22, 2010 at 4:53 AM, tcornett wrote: > I am trying to get an app to work with Twitter-like and Facebook-like short > names for navigation (like http://twitter.com/) where is a value > referenced in the database. > > Where should I be looking to do the URL manipulation? I am having trouble > getting to the request prior to the normal CakePHP Framework behavior which > will return 'No Such Controller'. > > I can handle the development, just a little confused on where I need to > look in the process when Cake breaks down the URL request. > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
Re: Custom Function Password Match Always Triggered
Hi Ryan what is a wrapper ? Does it make it less secure ? but seeing that it has salted added doesn't sound like so. On Dec 22, 11:43 am, Ryan Schmidt wrote: > On Dec 21, 2010, at 21:37, John Maxim wrote: > > > So is it Security::hash() another function to encrypt password such > > as, md5() ? > > Security::hash() is CakePHP's wrapper around md5, sha1, sha256, and maybe > other hash algorithms, with salt added. 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
Re: CakePHP HABTM association rules
Hi, Instead of writing custom SQL queries in controller's action, it would be preferred to write respective methods in related (for example, product) models to run those queries (and to build the needed data from them, if needed) and then call those methods in controller's action. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Dec 21, 2010 at 8:44 PM, halfasleeps wrote: > > Hi Amit, thank you for your answer. Your query makes sense to me, but > how do I use that in a cakephp controller/model? > > I should probably mention I have a few years experience with PHP but > this is my first MVC framework experience. From the tutorials I am > supposed to use someting like $this->Model->find() .. should I use > $this->Model->query() inside the controller? > > > Thanks! > > > On Dec 21, 12:15 am, Amit Badkas wrote: > > Hi, > > > > Try to build the SQL query something like > > > > SELECT *, COUNT(DISTINCT tags.name) AS uniques FROM products, > products_tags, > > tags WHERE products.id = products_tags.product_id AND tags.id = > > products_tags.tag_id AND tags.name IN ('ruby', 'earrings') GROUP BY > > products_tags.photo_id HAVING uniques = 2 > > > > Please feel free to change the table and field names as per your need but > > have a look at the use of 'uniques'. We used 2 for its value for HAVING > as > > the number of tags to use are 2 ('ruby' and 'earrings'). > > > > Hope this helps. > > > > Amit Badkas > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > > > > > > > > > > On Tue, Dec 21, 2010 at 1:43 AM, halfasleeps > wrote: > > > > > If I want to create a category and be able to link products to it by > > > tags I can like so: > > > > > - Create the category and product tables. > > > - Create a tags table with tags like: Ruby, Earrings, White-Gold > > > - Create a category_tags and product_tags table to map them > > > - Set category and product to hasAndBelongsToMany tags > > > - Set tags to hasAndBelongsToMany products and hasAndBelongsToMany > > > categories > > > - Now say I have 2 products one with tags: Ruby and Earrings and > > > another with tags: Ruby and Bracelet > > > > > Say I want to create a "Ruby Earrings" category. > > > > > I could add the Ruby and Earrings tags to the category. But under > > > normal HABTM Model associations both products will be returned because > > > even though only 1 has an earrings tag they both have a ruby tag. > > > > > How can I make it only match products that have ALL of the same tags > > > as the category (products can have more tags but must have all the > > > tags the corresponding category has) in order be returned? > > > > > Also, taking that even further, how could I add -tags to a category > > > that the products must NOT have these tags to be returned? > > > > > 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 at > > >http://groups.google.com/group/cake-php?hl=en > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
Re: Custom Function Password Match Always Triggered
Hi bujanga, Thanks for your complex password validation code, does it solve the problem for auto-fill password value if I used Auth ? On Dec 22, 11:16 am, bujanga wrote: > On Tue, Dec 21, 2010 at 2:57 PM, Ryan Schmidt > > wrote: > > I should add that Security::hash() does not use the salt unless you tell it > > to, by passing true in the third parameter. The Auth component does pass > > true in the third parameter, so if you want to write code today that will > > store passwords in the database that will be compatible with the Auth > > component when you switch to it later, you should hash with: > > > Security::hash($this->data['User']['password'], null, true) > > Definitely follow Ryan's clue here else you will have more work later. > I think you might find just going straight to Auth will save you a lot > of extra work but if you insist... > > Why don't you just verify the passwords match before you hash it? > > As a bonus here is my complexity validation on password > > 'password' => array( > 'create' => array( > 'rule' => array('g_isComplex'), > 'required' => TRUE, > 'allowEmpty' => FALSE, > 'on' => 'create', > 'message' => 'Password must have at least 6 characters and > must > contain at least 1 upper case letter, 1 lower case letter and 1 > number' > ), > 'update' => array( > 'rule' => array('g_isComplex'), > 'required' => FALSE, > 'allowEmpty' => TRUE, > 'on' => 'update', > 'message' => 'Password must have at least 6 characters and > must > contain at least 1 upper case letter, 1 lower case letter and 1 > number' > ), > ), > > function g_isComplex($check){ > if ( !isset($this->data['User']['verify']) ) return FALSE; > if ( $this->passwordComplex($this->data['User']['verify']) ) > return TRUE; > return FALSE; > > } > > function passwordComplex($password=null){ > if ( $this->enforceComplex ){ > if > (preg_match('/\A(?=[-_a-zA-Z0-9]*?[A-Z])(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])\S{6,}\z/', > $password)){ > return TRUE; > }else{ > return FALSE; > } > }else{ > if ( preg_match('/^[a-zA-Z0-9_]{3,40}$/i', $password) ){ > return TRUE; > }else{ > return FALSE; > } > } > > } > > Where $this->enforceComplex is a configuration setting and > this->data['User']['verify'] is the plaintext verifying password. > Sorry not really a pro on regex, so I'm sure it could be more concise. 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
Re: Problem with Password validation ?
Thanks Stephen! This is solved. However, I'm just curious is it we have to create password_confirm field just to validate password? Is this the only way ? On Dec 22, 12:54 am, Stephen wrote: > No problem John. > > This may help with ACL implementation > > I strongly recommend you study some articles online to get your head around > how it works as well however. > > http://bakery.cakephp.org/articles/alaxos/2010/11/21/acl_plugin_5 > > -- > Kind Regards > Stephen @ NinjaCoderMonkey > > www.ninjacodermonkey.co.uk 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
Re: Custom Function Password Match Always Triggered
On Dec 21, 2010, at 21:37, John Maxim wrote: > So is it Security::hash() another function to encrypt password such > as, md5() ? Security::hash() is CakePHP's wrapper around md5, sha1, sha256, and maybe other hash algorithms, with salt added. 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
Re: Custom Function Password Match Always Triggered
Thanks Ryan, it works nicely. So is it Security::hash() another function to encrypt password such as, md5() ? On Dec 22, 4:57 am, Ryan Schmidt wrote: > On Dec 21, 2010, at 12:02, Ryan Schmidt wrote: > > > On Dec 21, 2010, at 11:42, John Maxim wrote: > >> $this->data['User']['password'] = > >> md5($this->data['User']['password']); > > > As I said in my previous message, use Security::hash(). Do not use md5(). > > If you want Security::hash() to use the md5 algorithm internally, use > > "Security::setHash('md5');" in your config file. > > > Security::hash() doesn't just call the requested hash function on the given > > data; it also makes use of the salt specified in your config file. That's > > why it doesn't match what you get when you just call md5() manually without > > the salt. > > I should add that Security::hash() does not use the salt unless you tell it > to, by passing true in the third parameter. The Auth component does pass true > in the third parameter, so if you want to write code today that will store > passwords in the database that will be compatible with the Auth component > when you switch to it later, you should hash with: > > Security::hash($this->data['User']['password'], null, true) 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
Re: Custom Function Password Match Always Triggered
On Tue, Dec 21, 2010 at 2:57 PM, Ryan Schmidt wrote: > I should add that Security::hash() does not use the salt unless you tell it > to, by passing true in the third parameter. The Auth component does pass true > in the third parameter, so if you want to write code today that will store > passwords in the database that will be compatible with the Auth component > when you switch to it later, you should hash with: > > Security::hash($this->data['User']['password'], null, true) > > Definitely follow Ryan's clue here else you will have more work later. I think you might find just going straight to Auth will save you a lot of extra work but if you insist... Why don't you just verify the passwords match before you hash it? As a bonus here is my complexity validation on password 'password' => array( 'create'=> array( 'rule' => array('g_isComplex'), 'required' => TRUE, 'allowEmpty'=> FALSE, 'on' => 'create', 'message' => 'Password must have at least 6 characters and must contain at least 1 upper case letter, 1 lower case letter and 1 number' ), 'update'=> array( 'rule' => array('g_isComplex'), 'required' => FALSE, 'allowEmpty'=> TRUE, 'on' => 'update', 'message' => 'Password must have at least 6 characters and must contain at least 1 upper case letter, 1 lower case letter and 1 number' ), ), function g_isComplex($check){ if ( !isset($this->data['User']['verify']) )return FALSE; if ( $this->passwordComplex($this->data['User']['verify']) )return TRUE; return FALSE; } function passwordComplex($password=null){ if ( $this->enforceComplex ){ if (preg_match('/\A(?=[-_a-zA-Z0-9]*?[A-Z])(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])\S{6,}\z/', $password)){ return TRUE; }else{ return FALSE; } }else{ if ( preg_match('/^[a-zA-Z0-9_]{3,40}$/i', $password) ){ return TRUE; }else{ return FALSE; } } } Where $this->enforceComplex is a configuration setting and this->data['User']['verify'] is the plaintext verifying password. Sorry not really a pro on regex, so I'm sure it could be more concise. 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
Re: Timestamp values not returning the time
Ah yep, I had an afterFind function buried in that model that I'd forgotten about that was messing with the created field. Sorry, ID 10 T error. On Dec 21, 12:14 pm, cricket wrote: > On Tue, Dec 21, 2010 at 3:01 PM, mikeottinger wrote: > > > I'm seeing this value using a line like $this->log($created); I'm > > pretty certain it's more than just formatting because the output of > > the sorting looked wrong. > > It's definitely formatting. A MySQL date column shouldn't look like > that. Something somewhere is formatting the date or you've got > formatted strings in the DB itself. Probably the reason the sorting is > wrong is that it's a string, not a date. > > Check the DB directly (from terminal if possible). Use DESCRIBE to > check the table columns. If the dates all look good then check the > data Cake returns. Use die(debug($data)). > > Also, what does the SQL query look like? 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
Re: IDE
Netbeans all the way. Just download the one without all the java plugins. On Dec 21, 4:07 pm, Felipe Roman wrote: > On Tue, Dec 21, 2010 at 2:28 PM, Kristofer wrote: > > Ah, I saw NetBeans several years ago but forgot about it! I will give > > it another look. Thanks! > > I got used to use NetBeans for Java development several years ago but this > year I started for PHP and it is very good. I've been using Eclipse PHP for > a while too. For me both are very good IDEs but a little bit slow(in my > computer). > > -- > Best Regards, > Felipe Roman > Phone 55 51 8454 8110 > LinkedInhttp://au.linkedin.com/in/feliperoman 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
Re: ACL Aro id problem
aros_acos.aro_id is the FK pointing to aros.id, while the FK point to your Group would be aros.foreign_key. On Tue, Dec 21, 2010 at 3:06 PM, hcentelles wrote: > Hi > > The field aro_id in table aros_acos is the id of the aro or the > foreign key of the aro?. > > The allow method of the acl componet creates the rows with the aro id, > but that dont work, in the groups case, only work if the aro id and > the foreign key are equals, however if are diferent dont work, but if > i replace the aro id with the id of the group work perfect. > > 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 > 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
Re: $this->Session->setFlash problem
what version are u using? sounds to me like you you use cake1.2 but this piece of code is cake1.3 style dont echo it in 1.2 $session->flash(); On 22 Dez., 02:02, Ryan Schmidt wrote: > On Dec 21, 2010, at 18:51, sherzo wrote: > > > I have the following lines in my controller: > > $this->Session->setFlash('blabla'); > > $this->redirect(array('action'=>'unsuccessful')); > > exit(); > > > and this part in my view: > > if ($session->check('Message.flash')) { > > echo $session->flash(); > > } > > > but the result will be : > > blabla1 > > > I have that 1 extra in my view!!! > > My layout has: > > echo $this->Session->flash(); > > Not sure if that makes a difference (vs. your "echo $session->flash();"). > > If not, then I suspect you have another echo somewhere else in your code > that's printing that 1. 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
Re: $this->Session->setFlash problem
On Dec 21, 2010, at 18:51, sherzo wrote: > I have the following lines in my controller: > $this->Session->setFlash('blabla'); > $this->redirect(array('action'=>'unsuccessful')); > exit(); > > and this part in my view: > if ($session->check('Message.flash')) { > echo $session->flash(); > } > > but the result will be : > blabla1 > > I have that 1 extra in my view!!! My layout has: echo $this->Session->flash(); Not sure if that makes a difference (vs. your "echo $session->flash();"). If not, then I suspect you have another echo somewhere else in your code that's printing that 1. 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
CakePHP in subdirectory, but in the url
Hi! I want to place my CakePHP app to a subdirectory like this: web (server document root) cake_app app cake etc I made a htaccess to the document root: RewriteEngine on RewriteBase / RewriteRule^$ cideo/app/webroot/[L] RewriteRule(.*) cideo/app/webroot/$1 [L] (cideo is the name of the app) Evrything works well at first look, but if i make links with html helper, the links will look like this: http://domain.com/cideo/controller/action but i want only http://domain.com/controller/action is there any way to solve this? I looked at the source of Router but i only figured out that i have to modify the $base variable, but i didnt find out where (how) it gets value. 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
$this->Session->setFlash problem
Hi All I have the following lines in my controller: $this->Session->setFlash('blabla'); $this->redirect(array('action'=>'unsuccessful')); exit(); and this part in my view: if ($session->check('Message.flash')) { echo $session->flash(); } but the result will be : blabla1 I have that 1 extra in my view!!! can anyone help me please! Thanks Sherry -- View this message in context: http://cakephp.19694.n2.nabble.com/this-Session-setFlash-problem-tp5856173p5856173.html Sent from the CakePHP mailing list archive at Nabble.com. 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
Re: IDE
On Tue, Dec 21, 2010 at 2:28 PM, Kristofer wrote: > Ah, I saw NetBeans several years ago but forgot about it! I will give > it another look. Thanks! > I got used to use NetBeans for Java development several years ago but this year I started for PHP and it is very good. I've been using Eclipse PHP for a while too. For me both are very good IDEs but a little bit slow(in my computer). -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman 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
ACL Aro id problem
Hi The field aro_id in table aros_acos is the id of the aro or the foreign key of the aro?. The allow method of the acl componet creates the rows with the aro id, but that dont work, in the groups case, only work if the aro id and the foreign key are equals, however if are diferent dont work, but if i replace the aro id with the id of the group work perfect. 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
Re: IDE
I use eclipse with PDT. On Dec 21, 4:57 pm, Kristofer wrote: > What IDE do people typically use with CakePHP? I've been doing stuff > from the Linux command line using vim for so long. I'd like something > more graphical that (hopefully) supports SVN. Looking for more point- > and-click. :) 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
Re: IDE
Hey, You can also use CodeLobster with the CakePHP plugin. Although the CodeLobster is free, the CakePHP plugin is not; still you have a trial period for the latter :) Best regards, Joel 2010/12/21 Felipe Roman > Hi Kristofer, > > I've been using NetBeans PHP[1] IDE, there are all IDE common features like > code auto-complete, support SVN integration and also other Control Version > tools. > > 1. php.netbeans.org > > > On Tue, Dec 21, 2010 at 12:57 PM, Kristofer wrote: > >> What IDE do people typically use with CakePHP? I've been doing stuff >> from the Linux command line using vim for so long. I'd like something >> more graphical that (hopefully) supports SVN. Looking for more point- >> and-click. :) >> >> 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.comFor >> more options, visit this group at >> http://groups.google.com/group/cake-php?hl=en >> > > > > -- > Best Regards, > Felipe Roman > Phone 55 51 8454 8110 > LinkedIn http://au.linkedin.com/in/feliperoman > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
Re: Short Names Navigation (like Twitter and Facebook)
Check out the sluggable behavior http://bakery.cakephp.org/articles/mariano/2007/03/24/sluggable-behavior On Wed, Dec 22, 2010 at 1:23 AM, tcornett wrote: > I am trying to get an app to work with Twitter-like and Facebook-like short > names for navigation (like http://twitter.com/) where is a value > referenced in the database. > > Where should I be looking to do the URL manipulation? I am having trouble > getting to the request prior to the normal CakePHP Framework behavior which > will return 'No Such Controller'. > > I can handle the development, just a little confused on where I need to > look in the process when Cake breaks down the URL request. > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
Short Names Navigation (like Twitter and Facebook)
I am trying to get an app to work with Twitter-like and Facebook-like short names for navigation (like http://twitter.com/) where is a value referenced in the database. Where should I be looking to do the URL manipulation? I am having trouble getting to the request prior to the normal CakePHP Framework behavior which will return 'No Such Controller'. I can handle the development, just a little confused on where I need to look in the process when Cake breaks down the URL request. 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
Re: IDE
I use zend studio but autocomplete feature is no use since all the data is handle in array. Sent from my iPhone On Dec 21, 2010, at 2:04 PM, "Robert J. Maiolo" wrote: > eclipse for the win > > On Tue, Dec 21, 2010 at 6:57 AM, Kristofer wrote: > What IDE do people typically use with CakePHP? I've been doing stuff > from the Linux command line using vim for so long. I'd like something > more graphical that (hopefully) supports SVN. Looking for more point- > and-click. :) > > 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 > > 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 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
Re: IDE
eclipse for the win On Tue, Dec 21, 2010 at 6:57 AM, Kristofer wrote: > What IDE do people typically use with CakePHP? I've been doing stuff > from the Linux command line using vim for so long. I'd like something > more graphical that (hopefully) supports SVN. Looking for more point- > and-click. :) > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
Re: IDE
I've been using Code Lobster for a while now and I see no reason to change. On Dec 21, 9:57 am, Kristofer wrote: > What IDE do people typically use with CakePHP? I've been doing stuff > from the Linux command line using vim for so long. I'd like something > more graphical that (hopefully) supports SVN. Looking for more point- > and-click. :) 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
Re: Custom Function Password Match Always Triggered
On Dec 21, 2010, at 12:02, Ryan Schmidt wrote: > On Dec 21, 2010, at 11:42, John Maxim wrote: >> $this->data['User']['password'] = >> md5($this->data['User']['password']); > > As I said in my previous message, use Security::hash(). Do not use md5(). If > you want Security::hash() to use the md5 algorithm internally, use > "Security::setHash('md5');" in your config file. > > Security::hash() doesn't just call the requested hash function on the given > data; it also makes use of the salt specified in your config file. That's why > it doesn't match what you get when you just call md5() manually without the > salt. I should add that Security::hash() does not use the salt unless you tell it to, by passing true in the third parameter. The Auth component does pass true in the third parameter, so if you want to write code today that will store passwords in the database that will be compatible with the Auth component when you switch to it later, you should hash with: Security::hash($this->data['User']['password'], null, true) 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
Re: IDE
I use and love jedit. Jedit.org Great plugin system, can be as simple or advanced as you want it to be. On Dec 21, 7:57 am, Kristofer wrote: > What IDE do people typically use with CakePHP? I've been doing stuff > from the Linux command line using vim for so long. I'd like something > more graphical that (hopefully) supports SVN. Looking for more point- > and-click. :) 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
Re: Timestamp values not returning the time
On Tue, Dec 21, 2010 at 3:01 PM, mikeottinger wrote: > > I'm seeing this value using a line like $this->log($created); I'm > pretty certain it's more than just formatting because the output of > the sorting looked wrong. It's definitely formatting. A MySQL date column shouldn't look like that. Something somewhere is formatting the date or you've got formatted strings in the DB itself. Probably the reason the sorting is wrong is that it's a string, not a date. Check the DB directly (from terminal if possible). Use DESCRIBE to check the table columns. If the dates all look good then check the data Cake returns. Use die(debug($data)). Also, what does the SQL query look like? 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
Re: Timestamp values not returning the time
I'm seeing this value using a line like $this->log($created); I'm pretty certain it's more than just formatting because the output of the sorting looked wrong. Thanks! On Dec 21, 11:23 am, cricket wrote: > On Tue, Dec 21, 2010 at 10:03 AM, mikeottinger wrote: > > Hi Guys, > > > I really haven't seen any posts that describe my simple problem. I > > have some rows in the database with the standard created and modified > > "magi-columns". I need to retrieve a grouping of these rows and sort > > them by their created date. A lot of these rows are created within > > minutes of each other, so comparing by their time is important. If I > > run a SQL statement within phpmyadmin (it's a mysql5 database) I see > > results like: 2010-11-17 05:43:07. But a find through my Model shows: > > 11/17/2010 but no time! Any help on this would be greatly appreciated. > > I'm running cakephp 1.2.7 and php 5.3.2 and the mysqli extension. > > Where are you seeing this date? It's been formatted somewhere to look > like that. Try debugging your data. It should look the same as in the > database. 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
Re: IDE
+1 for Netbeans. I was using eclipse but it was so slow... On Dec 21, 5:26 pm, LipeDjow wrote: > I've been using NetBeans too, but someone may say it's slow.. for these, > there is a lightweight option: > > http://www.geany.org/ > > On Tuesday, December 21, 2010 1:11:46 PM UTC-2, Felipe Roman wrote: > > > Hi Kristofer, > > > I've been using NetBeans PHP[1] IDE, there are all IDE common features like > > code auto-complete, support SVN integration and also other Control Version > > tools. > > > 1. php.netbeans.org > > > On Tue, Dec 21, 2010 at 12:57 PM, Kristofer wrote: > > >> What IDE do people typically use with CakePHP? I've been doing stuff > >> from the Linux command line using vim for so long. I'd like something > >> more graphical that (hopefully) supports SVN. Looking for more point- > >> and-click. :) > > >> 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...@googlegroups.com > >> To unsubscribe from this group, send email to > >> cake-php+u...@googlegroups.com For more options, visit this group at > >>http://groups.google.com/group/cake-php?hl=en > > > -- > > Best Regards, > > Felipe Roman > > Phone 55 51 8454 8110 > > LinkedInhttp://au.linkedin.com/in/feliperoman 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
Re: Timestamp values not returning the time
On Tue, Dec 21, 2010 at 10:03 AM, mikeottinger wrote: > Hi Guys, > > I really haven't seen any posts that describe my simple problem. I > have some rows in the database with the standard created and modified > "magi-columns". I need to retrieve a grouping of these rows and sort > them by their created date. A lot of these rows are created within > minutes of each other, so comparing by their time is important. If I > run a SQL statement within phpmyadmin (it's a mysql5 database) I see > results like: 2010-11-17 05:43:07. But a find through my Model shows: > 11/17/2010 but no time! Any help on this would be greatly appreciated. > I'm running cakephp 1.2.7 and php 5.3.2 and the mysqli extension. Where are you seeing this date? It's been formatted somewhere to look like that. Try debugging your data. It should look the same as in the database. 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
Re: Custom Function Password Match Always Triggered
Hi Ryan, Thanks I think I get what you're saying, going to change tomorrow, gtg, Thanks ! On Dec 22, 2:02 am, Ryan Schmidt wrote: > On Dec 21, 2010, at 11:42, John Maxim wrote: > > > > > the controller register function code is here: > > > function register() > > { > > if (!empty($this->data)) > > { > > $this->data['User']['password'] = md5($this->data['User'] > > ['password']); > > > if ($this->User->save($this->data)) > > > { > > $this->Session->setFlash('Your registration > > information was > > accepted.'); > > $this->Session->write('user', > > $this->data['User']['username']); > > $this->redirect(array('action' => 'index'), > > null, true); > > > }else{ > > $this->data['User']['password'] = ''; > > $this->Session->setFlash('There was a problem saving > > this information'); > > } > > } > > > } > > > -- > > I know already some veterans here have suggested Auth but I'm in a bit > > rush to complete a milestone and have a meeting, at least something > > going on what I initially started, I'd be using Auth after I fix this > > thing, is Md5 above wrongly used ? > > > Does it affect my validation model code ? Why is it always triggered > > even though the same passwords for both fields are entered ? > > As I said in my previous message, use Security::hash(). Do not use md5(). If > you want Security::hash() to use the md5 algorithm internally, use > "Security::setHash('md5');" in your config file. > > Security::hash() doesn't just call the requested hash function on the given > data; it also makes use of the salt specified in your config file. That's why > it doesn't match what you get when you just call md5() manually without the > salt. 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
Re: Custom Function Password Match Always Triggered
Hi Stephen, I checked on your codes, thanks. But I tried Auth earlier and I had to include this: var $components = array('Auth'); --- function beforeFilter() { parent::beforeFilter(); this->Auth->autoRedirect = false; } -- The password field would be automatically filled if left blank. I was reading solutions from the net couldn't find one for this yet.. it's 2:08AM have a morning meeting later. See you guys tomorrow, thanks for the replies ! On Dec 22, 1:42 am, John Maxim wrote: > Hi, > > the controller register function code is here: > > function register() > { > if (!empty($this->data)) > { > $this->data['User']['password'] = md5($this->data['User'] > ['password']); > > if ($this->User->save($this->data)) > > { > $this->Session->setFlash('Your registration > information was > accepted.'); > $this->Session->write('user', > $this->data['User']['username']); > $this->redirect(array('action' => 'index'), > null, true); > > }else{ > $this->data['User']['password'] = ''; > $this->Session->setFlash('There was a problem saving > this information'); > } > } > > } > > -- > I know already some veterans here have suggested Auth but I'm in a bit > rush to complete a milestone and have a meeting, at least something > going on what I initially started, I'd be using Auth after I fix this > thing, is Md5 above wrongly used ? > > Does it affect my validation model code ? Why is it always triggered > even though the same passwords for both fields are entered ? > > Thanks, guys.. > > On Dec 22, 1:22 am, Stephen wrote: > > > Maybe this will help > > >http://pastie.org/private/cku2m7kpvmfd7pub3q24ga > > > On 21 December 2010 17:19, Ryan Schmidt wrote: > > > > On Dec 21, 2010, at 11:13, John Maxim wrote: > > > > > By the way I'm using md5 in controller for register function, could > > > > that be that reason that hinders the validation? > > > > *How* are you "using md5"? If you mean you have specified md5 as the hash > > > algorithm for the security class by writing "Security::setHash('md5');" in > > > your config file, and you are using Security::hash() every time you want > > > to > > > hash a password, then that should be fine. If you mean something else, > > > that > > > might not be fine. > > > >http://book.cakephp.org/view/1254/Change-Hash-Function > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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.comFor > > > more options, visit this group at > > >http://groups.google.com/group/cake-php?hl=en > > > -- > > Kind Regards > > Stephen @ NinjaCoderMonkey > > > www.ninjacodermonkey.co.uk 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
Re: Custom Function Password Match Always Triggered
On Dec 21, 2010, at 11:42, John Maxim wrote: > the controller register function code is here: > > function register() > { > if (!empty($this->data)) > { > $this->data['User']['password'] = md5($this->data['User'] > ['password']); > > > if ($this->User->save($this->data)) > > { > $this->Session->setFlash('Your registration > information was > accepted.'); > $this->Session->write('user', > $this->data['User']['username']); > $this->redirect(array('action' => 'index'), > null, true); > > }else{ > $this->data['User']['password'] = ''; >$this->Session->setFlash('There was a problem saving > this information'); > } > } > > } > > -- > I know already some veterans here have suggested Auth but I'm in a bit > rush to complete a milestone and have a meeting, at least something > going on what I initially started, I'd be using Auth after I fix this > thing, is Md5 above wrongly used ? > > Does it affect my validation model code ? Why is it always triggered > even though the same passwords for both fields are entered ? As I said in my previous message, use Security::hash(). Do not use md5(). If you want Security::hash() to use the md5 algorithm internally, use "Security::setHash('md5');" in your config file. Security::hash() doesn't just call the requested hash function on the given data; it also makes use of the salt specified in your config file. That's why it doesn't match what you get when you just call md5() manually without the salt. 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
Re: Custom Function Password Match Always Triggered
Hi, the controller register function code is here: function register() { if (!empty($this->data)) { $this->data['User']['password'] = md5($this->data['User'] ['password']); if ($this->User->save($this->data)) { $this->Session->setFlash('Your registration information was accepted.'); $this->Session->write('user', $this->data['User']['username']); $this->redirect(array('action' => 'index'), null, true); }else{ $this->data['User']['password'] = ''; $this->Session->setFlash('There was a problem saving this information'); } } } -- I know already some veterans here have suggested Auth but I'm in a bit rush to complete a milestone and have a meeting, at least something going on what I initially started, I'd be using Auth after I fix this thing, is Md5 above wrongly used ? Does it affect my validation model code ? Why is it always triggered even though the same passwords for both fields are entered ? Thanks, guys.. On Dec 22, 1:22 am, Stephen wrote: > Maybe this will help > > http://pastie.org/private/cku2m7kpvmfd7pub3q24ga > > On 21 December 2010 17:19, Ryan Schmidt wrote: > > > > > > > On Dec 21, 2010, at 11:13, John Maxim wrote: > > > > By the way I'm using md5 in controller for register function, could > > > that be that reason that hinders the validation? > > > *How* are you "using md5"? If you mean you have specified md5 as the hash > > algorithm for the security class by writing "Security::setHash('md5');" in > > your config file, and you are using Security::hash() every time you want to > > hash a password, then that should be fine. If you mean something else, that > > might not be fine. > > >http://book.cakephp.org/view/1254/Change-Hash-Function > > > 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.comFor > > more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en > > -- > Kind Regards > Stephen @ NinjaCoderMonkey > > www.ninjacodermonkey.co.uk 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
Re: Bake not writing files on Mac OS X with XAMPP
On Dec 20, 2010, at 01:23, Sam Rae wrote: > I'm having trouble with the bake process on Mac OS X, running XAMPP. > > The bake process works fine (it takes me through all the questions and > steps and detects things from my database correctly) but it just > doesn't write the files to disk. > > For example, it says: > > Creating file /Applications/XAMPP/xamppfiles/htdocs/MusicDB/app/tests/ > fixtures/publisher_fixture.php > Wrote /Applications/XAMPP/xamppfiles/htdocs/MusicDB/app/tests/fixtures/ > publisher_fixture.php > > … but the files do not actually exist. > > I have permissions to write to the destination directories, so I'm not > quite sure what's going on. You're not able to bake anything at all, or just this file? Does the directory (/Applications/XAMPP/xamppfiles/htdocs/MusicDB/app/tests/fixtures/) exist? If not, make it. Make sure ownership and permissions are also correct on every directory leading up to that one. When I set up my first CakePHP project, I had trouble with the tmp directory. Since I knew CakePHP would write temporary files there in the course of serving the web site, I changed the ownership of the tmp directory to the web server user, but this turned out not to be the right thing to do since it prevented bake from working, since bake wants to write files there as well and is running as me, not as the web server user. In the end, I changed the tmp directory's ownership back to me, and just set its permissions wide open. Once I publish this site to a production web server, I'll probably set it back the way I had it initially, since I won't need to bake anything on the production server. 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
Re: IDE
i prefer phpDesigner...i tried many IDEs and phpDesigner is best choice. -- Lep pozdrav, Tilen Majerle http://majerle.eu 2010/12/21 Kristofer > > I've been using NetBeans PHP[1] IDE, there are all IDE common features > like > > code auto-complete, support SVN integration and also other Control > Version > > tools. > > Ah, I saw NetBeans several years ago but forgot about it! I will give > it another look. Thanks! > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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
Re: Custom Function Password Match Always Triggered
Maybe this will help http://pastie.org/private/cku2m7kpvmfd7pub3q24ga On 21 December 2010 17:19, Ryan Schmidt wrote: > > On Dec 21, 2010, at 11:13, John Maxim wrote: > > > By the way I'm using md5 in controller for register function, could > > that be that reason that hinders the validation? > > *How* are you "using md5"? If you mean you have specified md5 as the hash > algorithm for the security class by writing "Security::setHash('md5');" in > your config file, and you are using Security::hash() every time you want to > hash a password, then that should be fine. If you mean something else, that > might not be fine. > > http://book.cakephp.org/view/1254/Change-Hash-Function > > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk 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
Re: Custom Function Password Match Always Triggered
On Dec 21, 2010, at 11:13, John Maxim wrote: > By the way I'm using md5 in controller for register function, could > that be that reason that hinders the validation? *How* are you "using md5"? If you mean you have specified md5 as the hash algorithm for the security class by writing "Security::setHash('md5');" in your config file, and you are using Security::hash() every time you want to hash a password, then that should be fine. If you mean something else, that might not be fine. http://book.cakephp.org/view/1254/Change-Hash-Function 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
Re: Custom Function Password Match Always Triggered
By the way I'm using md5 in controller for register function, could that be that reason that hinders the validation? On Dec 22, 12:42 am, John Maxim wrote: > function confirmPassword() { > return (($this->data[$this->alias]['password']) == > Security::hash($this->data[$this->alias]['confirm_password'], > null, > true)); > > } > > Code 1 > > function confirmPassword() { > $hash = Security::hash($this->data[$this->alias] > ['confirm_password'], null, true); > > if($this->data[$this->alias]['password'] == $hash) { > return true; > } > > return false; > > } > Code 2 > - > > Hi, > The custom function to check password if matched is always triggered > which means it is always not the same, I tried entering the same value > for both fields every time but it is triggered. > > The full code is below: > _ > class User extends AppModel > { > var $name = 'User'; > > var $validate = array ( > > 'username' => array( > 'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'This field cannot be blank.', > 'last' => true, > ), > 'uniqueCheck' => array( > 'rule' => 'isUnique', > 'message' => 'That username has already been > taken.', > 'last' => true, > ), > 'lengthCheck' => array( > 'rule' => '/^.{6,40}$/', > 'message' => 'Minimum username 6 characters.', > 'last' => true, > ), > ), > > 'email' => array( > 'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'This field cannot be blank.', > 'last' => true, > ), > 'email' => array( > 'rule' => 'email', > 'message' => 'That is not a valid email address.', > 'last' => true, > ), > ), > > 'confirm_password' => array( > 'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'This field cannot be blank.', > 'last' => true, > ), > 'lengthCheck' => array( > 'rule' => '/^.{6,40}$/', > 'message' => 'Minimum password 6 characters.', > 'last' => true, > ), > 'checkMatch' => array( > 'rule' => 'confirmPassword', > 'message' => 'Both passwords should match.', > 'last' => true, > ), > > ), > > ); > > function confirmPassword() { > $hash = Security::hash($this->data[$this->alias] > ['confirm_password'], null, true); > > if($this->data[$this->alias]['password'] == $hash) { > return true; > } > > return false; > } > > } > > _ > > Can anyone see how the function be triggered indefinitely for every > same passwords entered? 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
Re: Problem with Password validation ?
No problem John. This may help with ACL implementation I strongly recommend you study some articles online to get your head around how it works as well however. http://bakery.cakephp.org/articles/alaxos/2010/11/21/acl_plugin_5 -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk 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
Custom Function Password Match Always Triggered
function confirmPassword() { return (($this->data[$this->alias]['password']) == Security::hash($this->data[$this->alias]['confirm_password'], null, true)); } Code 1 function confirmPassword() { $hash = Security::hash($this->data[$this->alias] ['confirm_password'], null, true); if($this->data[$this->alias]['password'] == $hash) { return true; } return false; } Code 2 - Hi, The custom function to check password if matched is always triggered which means it is always not the same, I tried entering the same value for both fields every time but it is triggered. The full code is below: _ class User extends AppModel { var $name = 'User'; var $validate = array ( 'username' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'uniqueCheck' => array( 'rule' => 'isUnique', 'message' => 'That username has already been taken.', 'last' => true, ), 'lengthCheck' => array( 'rule' => '/^.{6,40}$/', 'message' => 'Minimum username 6 characters.', 'last' => true, ), ), 'email' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'email' => array( 'rule' => 'email', 'message' => 'That is not a valid email address.', 'last' => true, ), ), 'confirm_password' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'lengthCheck' => array( 'rule' => '/^.{6,40}$/', 'message' => 'Minimum password 6 characters.', 'last' => true, ), 'checkMatch' => array( 'rule' => 'confirmPassword', 'message' => 'Both passwords should match.', 'last' => true, ), ), ); function confirmPassword() { $hash = Security::hash($this->data[$this->alias] ['confirm_password'], null, true); if($this->data[$this->alias]['password'] == $hash) { return true; } return false; } } _ Can anyone see how the function be triggered indefinitely for every same passwords entered? 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
Re: How to display password_2 field in asterisk ?
Solved, Thanks ! On Dec 21, 6:37 pm, euromark wrote: > best to use 'type' => 'password' > > On 21 Dez., 10:33, Yasir Arafat Hasib wrote: > > > just add a class "required" in your field it will auto create a stat(*) > > > On Tue, Dec 21, 2010 at 3:30 PM, Amit Badkas wrote: > > > > Hi, > > > > If you are using input() method of form helper then set 'type' as > > > 'password' (http://book.cakephp.org/view/1392/options-type) otherwise use > > > password() method (http://book.cakephp.org/view/1428/password). > > > > Hope this helps. > > > > Amit Badkas > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > On Tue, Dec 21, 2010 at 1:18 PM, John Maxim wrote: > > > >> I have 2 password fields; > > > >> 1. password > > >> 2. password_2 > > > >> The value displayed in field password_2 is in plain text, how to > > >> change it to asterisks/dots ? > > > >> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp > > >> 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 > >> om>For more options, visit this group at > > >>http://groups.google.com/group/cake-php?hl=en > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp > > > 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 > > om>For more options, visit this group at > > >http://groups.google.com/group/cake-php?hl=en > > > -- > > Thanks & regards. > > > > Yasir Arafat (Hasib) > > Software Engineer > > Epsilon Consulting and Development Services (ECDS) > > Contact Information: > > Cell : +8801816536901 > > Web:http://arafats.info 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
Re: IDE
> I've been using NetBeans PHP[1] IDE, there are all IDE common features like > code auto-complete, support SVN integration and also other Control Version > tools. Ah, I saw NetBeans several years ago but forgot about it! I will give it another look. Thanks! 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
Re: IDE
I've been using NetBeans too, but someone may say it's slow.. for these, there is a lightweight option: http://www.geany.org/ On Tuesday, December 21, 2010 1:11:46 PM UTC-2, Felipe Roman wrote: > > Hi Kristofer, > > I've been using NetBeans PHP[1] IDE, there are all IDE common features like > code auto-complete, support SVN integration and also other Control Version > tools. > > 1. php.netbeans.org > > > On Tue, Dec 21, 2010 at 12:57 PM, Kristofer wrote: > >> What IDE do people typically use with CakePHP? I've been doing stuff >> from the Linux command line using vim for so long. I'd like something >> more graphical that (hopefully) supports SVN. Looking for more point- >> and-click. :) >> >> 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...@googlegroups.com >> To unsubscribe from this group, send email to >> cake-php+u...@googlegroups.com For more options, visit this group at >> http://groups.google.com/group/cake-php?hl=en >> > > > > -- > Best Regards, > Felipe Roman > Phone 55 51 8454 8110 > LinkedIn http://au.linkedin.com/in/feliperoman > 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
Re: IDE
I use NetBeans IDE too... i'ts amazing =) www.netbeans.org 2010/12/21 Jeremy Burns | Class Outfit > Coda. > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.com > http://www.classoutfit.com > > On 21 Dec 2010, at 14:57, Kristofer wrote: > > > What IDE do people typically use with CakePHP? I've been doing stuff > > from the Linux command line using vim for so long. I'd like something > > more graphical that (hopefully) supports SVN. Looking for more point- > > and-click. :) > > > > 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.comFor > > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- __ "As pessoas que vencem neste mundo são as que procuram as circunstâncias de que precisam e, quando não as encontram, as criam." "O progresso é impossível sem mudança. Aqueles que não conseguem mudar as suas mentes não conseguem mudar nada. " George Bernard Shaw __ Att. Jefferson Souza - Desenvolvedor Web Íparos Design Studio (http://www.iparos.com.br) (21) 8286-6123 / (21) 2282-5381 Twitter: www.twitter.com/jeffersonsouza __ 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
Re: Problem with Password validation ?
In preceding earlier post, I asked whether putting outside array validation.. I went and try outside of the class model which was not working. Now I learned that Stephen's code is outside of the array validation but inside the class model which makes sense. And it works ! Thanks, man. Hope this can help me in building a fuller ACI component later. Do you know of any nice beginner chapters for ACI components?--I'm building an admin centre and member centre each has their own CMS. I went briefly on the internet and found it difficult to begin with. I can only move on to intermediate later after I learned exactly what ACI is. Do you have suggestions for both beginner and intermediate (ACI) components ? @Stephen &, Amit, Thank you very much. On Dec 21, 11:59 pm, Stephen wrote: > Looks to me like the error is to do with the lines before line 60. > > Looking back at Amit's suggestion, the validate array wasn't ended properly > (I think due to it being a impartial example) > > 'confirm_password' => array( > 'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'This field cannot be blank.', > 'last' => true, > ), > 'lengthCheck' => array( > 'rule' => '/^.{6,40}$/', > 'message' => 'Minimum password 6 > characters.', > 'last' => true, > ), > 'confirmed' => array( > 'rule' => 'confirmPassword' > 'message' => 'Both passwords should match.' > ), > ), > > Should be something like this > > var $validate = array( > 'confirm_password' => array( > 'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'This field cannot be blank.', > 'last' => true > ), > 'lengthCheck => array( > 'rule' => '/^.{6,40}$/', > 'message' => 'Minimum password 6 characters.', > 'last' => true > ), > 'confirmed' => array( > 'rule' => 'confirmPassword', > 'message' => 'Both passwords should match.' > ) > ) > ); > > function confirmPassword() { > ... > > } > > Be sure to include any other validation and the function. > > On 21 December 2010 15:12, John Maxim wrote: > > > Just to repost the error message: > > > Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app > > \models\user.php on line 60 > > > On Dec 21, 11:11 pm, John Maxim wrote: > > > Hi Stephen, > > > > wow it gives exactly the same error. Where it points at line 60 > > > > ==>Line 60 ===> function confirmPassword() { > > > $hash = > > Security::hash($this->data[$this->alias] > > > ['confirm_password'], null, true); > > > > if($this->data[$this->alias]['password'] == > > $hash) { > > > return true; > > > > return false; > > > > } > > > > Same like the previous one. It points at the same line where the > > > function name is... > > > > On Dec 21, 11:01 pm, Stephen wrote: > > > > >http://api.cakephp.org/view_source/security/#line-113 > > > > > Try something like this maybe? > > > > > function confirmPassword() { > > > > $hash = > > Security::hash($this->data[$this->alias]['confirm_password'], > > > > null, true); > > > > > if($this->data[$this->alias]['password'] == $hash) { > > > > return true; > > > > } > > > > > return false; > > > > > } > > > > > On 21 December 2010 14:51, John Maxim wrote: > > > > > > I checked many times, based on your explanation here: > > > > > > (($variable) == condition(param1, param2, param3)) > > > > > > Even cleared browser cookies... > > > > > > and it gives exactly the same error. > > > > > > -the whole piece of model code: > > > > > class User extends AppModel > > > > > { > > > > > var $name = 'User'; > > > > > > var $validate = array ( > > > > > > 'username' => array( > > > > > 'notEmpty' => array( > > > > > 'rule' => 'notEmpty', > > > > > 'message' => 'This field cannot be > > blank.', > > > > > 'last' => true, > > > > > ), > > > > > 'uniqueCheck' => array( > > > > > 'rule' => 'isUnique', > > > > > 'message' => 'That username has > > already been > > > > > taken.', > > > > > 'last' => true, > > > > > ), > > > > > 'lengthCheck' => array( > > > > >
Re: Problem with Password validation ?
Looks to me like the error is to do with the lines before line 60. Looking back at Amit's suggestion, the validate array wasn't ended properly (I think due to it being a impartial example) 'confirm_password' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'lengthCheck' => array( 'rule' => '/^.{6,40}$/', 'message' => 'Minimum password 6 characters.', 'last' => true, ), 'confirmed' => array( 'rule' => 'confirmPassword' 'message' => 'Both passwords should match.' ), ), Should be something like this var $validate = array( 'confirm_password' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true ), 'lengthCheck => array( 'rule' => '/^.{6,40}$/', 'message' => 'Minimum password 6 characters.', 'last' => true ), 'confirmed' => array( 'rule' => 'confirmPassword', 'message' => 'Both passwords should match.' ) ) ); function confirmPassword() { ... } Be sure to include any other validation and the function. On 21 December 2010 15:12, John Maxim wrote: > Just to repost the error message: > > Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app > \models\user.php on line 60 > > On Dec 21, 11:11 pm, John Maxim wrote: > > Hi Stephen, > > > > wow it gives exactly the same error. Where it points at line 60 > > > > ==>Line 60 ===> function confirmPassword() { > > $hash = > Security::hash($this->data[$this->alias] > > ['confirm_password'], null, true); > > > > if($this->data[$this->alias]['password'] == > $hash) { > > return true; > > > > return false; > > > > } > > > > Same like the previous one. It points at the same line where the > > function name is... > > > > On Dec 21, 11:01 pm, Stephen wrote: > > > > >http://api.cakephp.org/view_source/security/#line-113 > > > > > Try something like this maybe? > > > > > function confirmPassword() { > > > $hash = > Security::hash($this->data[$this->alias]['confirm_password'], > > > null, true); > > > > > if($this->data[$this->alias]['password'] == $hash) { > > > return true; > > > } > > > > > return false; > > > > > } > > > > > On 21 December 2010 14:51, John Maxim wrote: > > > > > > I checked many times, based on your explanation here: > > > > > > (($variable) == condition(param1, param2, param3)) > > > > > > Even cleared browser cookies... > > > > > > and it gives exactly the same error. > > > > > > -the whole piece of model code: > > > > class User extends AppModel > > > >{ > > > >var $name = 'User'; > > > > > >var $validate = array ( > > > > > >'username' => array( > > > >'notEmpty' => array( > > > >'rule' => 'notEmpty', > > > >'message' => 'This field cannot be > blank.', > > > >'last' => true, > > > >), > > > >'uniqueCheck' => array( > > > >'rule' => 'isUnique', > > > >'message' => 'That username has > already been > > > > taken.', > > > >'last' => true, > > > >), > > > >'lengthCheck' => array( > > > >'rule' => '/^.{6,40}$/', > > > >'message' => 'Minimum username 6 > > > > characters.', > > > >'last' => true, > > > >), > > > >), > > > > > >'email' => array( > > > >'notEmpty' => array( > > > > 'rule' => 'notEmpty', > > > > 'message' => 'This field cannot be blank.', > > > > 'last' => true, > > > > ), > > > >'email' => array( > > > > 'rule' => 'email', > > > > 'message' => 'That is not a valid email address.', > > > > 'last' => true, > > > > ), > > > > ), > > > > > > 'confirm_password' => array( > > > >'notEmpty' => array( > > > >'rule' => 'notEmpty', > > > >'m
oracle connection with user prefix to tables
Hello all, I am starting a cakephp project which runs atop oracle (imposed, not willingly chosen). There are two user accounts, an ADMIN one (with read access), and a READER one. For accessing to a given table using the READER account, I need to refer to a table as ADMIN.table. In cake, if I set the prefix to 'ADMIN.', however, it doesn't work. I get a message saying that the table in question has not been found. Is there any other way to specify this? Cheers, Manohar 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
Re: IDE
Coda. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 21 Dec 2010, at 14:57, Kristofer wrote: > What IDE do people typically use with CakePHP? I've been doing stuff > from the Linux command line using vim for so long. I'd like something > more graphical that (hopefully) supports SVN. Looking for more point- > and-click. :) > > 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 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
Re: CakePHP HABTM association rules
Hi Amit, thank you for your answer. Your query makes sense to me, but how do I use that in a cakephp controller/model? I should probably mention I have a few years experience with PHP but this is my first MVC framework experience. From the tutorials I am supposed to use someting like $this->Model->find() .. should I use $this->Model->query() inside the controller? Thanks! On Dec 21, 12:15 am, Amit Badkas wrote: > Hi, > > Try to build the SQL query something like > > SELECT *, COUNT(DISTINCT tags.name) AS uniques FROM products, products_tags, > tags WHERE products.id = products_tags.product_id AND tags.id = > products_tags.tag_id AND tags.name IN ('ruby', 'earrings') GROUP BY > products_tags.photo_id HAVING uniques = 2 > > Please feel free to change the table and field names as per your need but > have a look at the use of 'uniques'. We used 2 for its value for HAVING as > the number of tags to use are 2 ('ruby' and 'earrings'). > > Hope this helps. > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > > On Tue, Dec 21, 2010 at 1:43 AM, halfasleeps wrote: > > > If I want to create a category and be able to link products to it by > > tags I can like so: > > > - Create the category and product tables. > > - Create a tags table with tags like: Ruby, Earrings, White-Gold > > - Create a category_tags and product_tags table to map them > > - Set category and product to hasAndBelongsToMany tags > > - Set tags to hasAndBelongsToMany products and hasAndBelongsToMany > > categories > > - Now say I have 2 products one with tags: Ruby and Earrings and > > another with tags: Ruby and Bracelet > > > Say I want to create a "Ruby Earrings" category. > > > I could add the Ruby and Earrings tags to the category. But under > > normal HABTM Model associations both products will be returned because > > even though only 1 has an earrings tag they both have a ruby tag. > > > How can I make it only match products that have ALL of the same tags > > as the category (products can have more tags but must have all the > > tags the corresponding category has) in order be returned? > > > Also, taking that even further, how could I add -tags to a category > > that the products must NOT have these tags to be returned? > > > 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 > om>For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en 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
Re: Problem with Password validation ?
Just to repost the error message: Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app \models\user.php on line 60 On Dec 21, 11:11 pm, John Maxim wrote: > Hi Stephen, > > wow it gives exactly the same error. Where it points at line 60 > > ==>Line 60 ===> function confirmPassword() { > $hash = Security::hash($this->data[$this->alias] > ['confirm_password'], null, true); > > if($this->data[$this->alias]['password'] == $hash) { > return true; > > return false; > > } > > Same like the previous one. It points at the same line where the > function name is... > > On Dec 21, 11:01 pm, Stephen wrote: > > >http://api.cakephp.org/view_source/security/#line-113 > > > Try something like this maybe? > > > function confirmPassword() { > > $hash = Security::hash($this->data[$this->alias]['confirm_password'], > > null, true); > > > if($this->data[$this->alias]['password'] == $hash) { > > return true; > > } > > > return false; > > > } > > > On 21 December 2010 14:51, John Maxim wrote: > > > > I checked many times, based on your explanation here: > > > > (($variable) == condition(param1, param2, param3)) > > > > Even cleared browser cookies... > > > > and it gives exactly the same error. > > > > -the whole piece of model code: > > > class User extends AppModel > > > { > > > var $name = 'User'; > > > > var $validate = array ( > > > > 'username' => array( > > > 'notEmpty' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'This field cannot be blank.', > > > 'last' => true, > > > ), > > > 'uniqueCheck' => array( > > > 'rule' => 'isUnique', > > > 'message' => 'That username has already > > > been > > > taken.', > > > 'last' => true, > > > ), > > > 'lengthCheck' => array( > > > 'rule' => '/^.{6,40}$/', > > > 'message' => 'Minimum username 6 > > > characters.', > > > 'last' => true, > > > ), > > > ), > > > > 'email' => array( > > > 'notEmpty' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'This field cannot be blank.', > > > 'last' => true, > > > ), > > > 'email' => array( > > > 'rule' => 'email', > > > 'message' => 'That is not a valid email address.', > > > 'last' => true, > > > ), > > > ), > > > > 'confirm_password' => array( > > > 'notEmpty' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'This field cannot be blank.', > > > 'last' => true, > > > ), > > > 'lengthCheck' => array( > > > 'rule' => '/^.{6,40}$/', > > > 'message' => 'Minimum password 6 > > > characters.', > > > 'last' => true, > > > ), > > > 'checkMatch' => array( > > > 'rule' => 'confirmPassword', > > > 'message' => 'Both passwords should > > > match.', > > > 'last' => true, > > > ), > > > > ), > > > > function confirmPassword() { > > > return (($this->data[$this->alias]['password']) == > > > > Security::hash($this->data[$this->alias]['confirm_password'], null, > > > true)); > > > > } > > > > ); > > > > } > > > > > > > > Just in case I might done wrong else where but I don't think so. See > > > somewhere else wrong ? > > > > On Dec 21, 10:45 pm, John Maxim wrote: > > > > Yes, the error is the same even using your code and I've checked a few > > > > times. It gave the same error. > > > > > function confirmPassword() { > > > > return (($this->data[$this->alias]['password']) == > > > > Security::hash($this->data[$this->alias]['confirm_password'], null, > > > > true)); > > > > > } > > > > > On Dec 21, 10:32 pm, Stephen wrote: > > > > > > To me it seems the bracket is misplaced. > > > > > > You were doing this > > > > > > (($variable) == condition(param1), param2, param3) > > > > > > The parameters for Security::hash should be contained within the > > > brackets. > > > > > > (($variable) == condition(param1, param2, param3)) > > > > > > Is the
Re: IDE
Hi Kristofer, I've been using NetBeans PHP[1] IDE, there are all IDE common features like code auto-complete, support SVN integration and also other Control Version tools. 1. php.netbeans.org On Tue, Dec 21, 2010 at 12:57 PM, Kristofer wrote: > What IDE do people typically use with CakePHP? I've been doing stuff > from the Linux command line using vim for so long. I'd like something > more graphical that (hopefully) supports SVN. Looking for more point- > and-click. :) > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Best Regards, Felipe Roman Phone 55 51 8454 8110 LinkedIn http://au.linkedin.com/in/feliperoman 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
Re: Problem with Password validation ?
Hi Stephen, wow it gives exactly the same error. Where it points at line 60 ==>Line 60 ===> function confirmPassword() { $hash = Security::hash($this->data[$this->alias] ['confirm_password'], null, true); if($this->data[$this->alias]['password'] == $hash) { return true; return false; } Same like the previous one. It points at the same line where the function name is... On Dec 21, 11:01 pm, Stephen wrote: > http://api.cakephp.org/view_source/security/#line-113 > > Try something like this maybe? > > function confirmPassword() { > $hash = Security::hash($this->data[$this->alias]['confirm_password'], > null, true); > > if($this->data[$this->alias]['password'] == $hash) { > return true; > } > > return false; > > } > > On 21 December 2010 14:51, John Maxim wrote: > > > I checked many times, based on your explanation here: > > > (($variable) == condition(param1, param2, param3)) > > > Even cleared browser cookies... > > > and it gives exactly the same error. > > > -the whole piece of model code: > > class User extends AppModel > > { > > var $name = 'User'; > > > var $validate = array ( > > > 'username' => array( > > 'notEmpty' => array( > > 'rule' => 'notEmpty', > > 'message' => 'This field cannot be blank.', > > 'last' => true, > > ), > > 'uniqueCheck' => array( > > 'rule' => 'isUnique', > > 'message' => 'That username has already been > > taken.', > > 'last' => true, > > ), > > 'lengthCheck' => array( > > 'rule' => '/^.{6,40}$/', > > 'message' => 'Minimum username 6 > > characters.', > > 'last' => true, > > ), > > ), > > > 'email' => array( > > 'notEmpty' => array( > > 'rule' => 'notEmpty', > > 'message' => 'This field cannot be blank.', > > 'last' => true, > > ), > > 'email' => array( > > 'rule' => 'email', > > 'message' => 'That is not a valid email address.', > > 'last' => true, > > ), > > ), > > > 'confirm_password' => array( > > 'notEmpty' => array( > > 'rule' => 'notEmpty', > > 'message' => 'This field cannot be blank.', > > 'last' => true, > > ), > > 'lengthCheck' => array( > > 'rule' => '/^.{6,40}$/', > > 'message' => 'Minimum password 6 > > characters.', > > 'last' => true, > > ), > > 'checkMatch' => array( > > 'rule' => 'confirmPassword', > > 'message' => 'Both passwords should match.', > > 'last' => true, > > ), > > > ), > > > function confirmPassword() { > > return (($this->data[$this->alias]['password']) == > > > Security::hash($this->data[$this->alias]['confirm_password'], null, > > true)); > > > } > > > ); > > > } > > > > > > Just in case I might done wrong else where but I don't think so. See > > somewhere else wrong ? > > > On Dec 21, 10:45 pm, John Maxim wrote: > > > Yes, the error is the same even using your code and I've checked a few > > > times. It gave the same error. > > > > function confirmPassword() { > > > return (($this->data[$this->alias]['password']) == > > > Security::hash($this->data[$this->alias]['confirm_password'], null, > > > true)); > > > > } > > > > On Dec 21, 10:32 pm, Stephen wrote: > > > > > To me it seems the bracket is misplaced. > > > > > You were doing this > > > > > (($variable) == condition(param1), param2, param3) > > > > > The parameters for Security::hash should be contained within the > > brackets. > > > > > (($variable) == condition(param1, param2, param3)) > > > > > Is the error the same? > > > > > On 21 December 2010 14:18, John Maxim wrote: > > > > > > I crossed replied with your previous message Stephen, sorry, > > > > > > and I tried your code it gave the same error. > > > > > > Thanks for your time, too.. > > > > > > What is your thoughts on this error ? > > > > > > On Dec 21, 10:13 pm, John Maxim wrote: > > > > > > I tried putting it outside the array validation whe
Timestamp values not returning the time
Hi Guys, I really haven't seen any posts that describe my simple problem. I have some rows in the database with the standard created and modified "magi-columns". I need to retrieve a grouping of these rows and sort them by their created date. A lot of these rows are created within minutes of each other, so comparing by their time is important. If I run a SQL statement within phpmyadmin (it's a mysql5 database) I see results like: 2010-11-17 05:43:07. But a find through my Model shows: 11/17/2010 but no time! Any help on this would be greatly appreciated. I'm running cakephp 1.2.7 and php 5.3.2 and the mysqli extension. Thanks! 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
Re: Problem with Password validation ?
http://api.cakephp.org/view_source/security/#line-113 Try something like this maybe? function confirmPassword() { $hash = Security::hash($this->data[$this->alias]['confirm_password'], null, true); if($this->data[$this->alias]['password'] == $hash) { return true; } return false; } On 21 December 2010 14:51, John Maxim wrote: > I checked many times, based on your explanation here: > > (($variable) == condition(param1, param2, param3)) > > Even cleared browser cookies... > > and it gives exactly the same error. > > -the whole piece of model code: > class User extends AppModel >{ >var $name = 'User'; > >var $validate = array ( > >'username' => array( >'notEmpty' => array( >'rule' => 'notEmpty', >'message' => 'This field cannot be blank.', >'last' => true, >), >'uniqueCheck' => array( >'rule' => 'isUnique', >'message' => 'That username has already been > taken.', >'last' => true, >), >'lengthCheck' => array( >'rule' => '/^.{6,40}$/', >'message' => 'Minimum username 6 > characters.', >'last' => true, >), >), > > >'email' => array( >'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'This field cannot be blank.', > 'last' => true, > ), >'email' => array( > 'rule' => 'email', > 'message' => 'That is not a valid email address.', > 'last' => true, > ), > ), > > 'confirm_password' => array( >'notEmpty' => array( >'rule' => 'notEmpty', >'message' => 'This field cannot be blank.', >'last' => true, >), >'lengthCheck' => array( >'rule' => '/^.{6,40}$/', >'message' => 'Minimum password 6 > characters.', >'last' => true, >), > 'checkMatch' => array( >'rule' => 'confirmPassword', >'message' => 'Both passwords should match.', >'last' => true, >), > >), > >function confirmPassword() { >return (($this->data[$this->alias]['password']) == > > Security::hash($this->data[$this->alias]['confirm_password'], null, > true)); > >} > > > ); > > > } > > > > Just in case I might done wrong else where but I don't think so. See > somewhere else wrong ? > > > On Dec 21, 10:45 pm, John Maxim wrote: > > Yes, the error is the same even using your code and I've checked a few > > times. It gave the same error. > > > > function confirmPassword() { > > return (($this->data[$this->alias]['password']) == > > > Security::hash($this->data[$this->alias]['confirm_password'], null, > > true)); > > > > } > > > > On Dec 21, 10:32 pm, Stephen wrote: > > > > > To me it seems the bracket is misplaced. > > > > > You were doing this > > > > > (($variable) == condition(param1), param2, param3) > > > > > The parameters for Security::hash should be contained within the > brackets. > > > > > (($variable) == condition(param1, param2, param3)) > > > > > Is the error the same? > > > > > On 21 December 2010 14:18, John Maxim wrote: > > > > > > I crossed replied with your previous message Stephen, sorry, > > > > > > and I tried your code it gave the same error. > > > > > > Thanks for your time, too.. > > > > > > What is your thoughts on this error ? > > > > > > On Dec 21, 10:13 pm, John Maxim wrote: > > > > > I tried putting it outside the array validation where it gives > parsing > > > > > error without the bracket sign "(" > > > > > > > On Dec 21, 9:58 pm, John Maxim wrote: > > > > > > > > Hi, thanks Amit, but > > > > > > > > I got an error here: > > > > > > > > Parse error: parse error, expecting `')'' in > C:\wamp\www\cakephp\app > > > > > > \models\user.php on line 66 > > > > > > > > On line 66 is: > > > > > > > > function confirmPassword() > > > > > > { > > > > > > return > (($this->data[$this->alias]['password']) > > > > == > > > > > > Security::hash($this->data[$this->alias]['confirm_password']), > null, > > > > > > true); > > > > > > } > > > > > > > > I modified a few times to include and exclud
IDE
What IDE do people typically use with CakePHP? I've been doing stuff from the Linux command line using vim for so long. I'd like something more graphical that (hopefully) supports SVN. Looking for more point- and-click. :) 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
Re: Problem with Password validation ?
I checked many times, based on your explanation here: (($variable) == condition(param1, param2, param3)) Even cleared browser cookies... and it gives exactly the same error. -the whole piece of model code: class User extends AppModel { var $name = 'User'; var $validate = array ( 'username' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'uniqueCheck' => array( 'rule' => 'isUnique', 'message' => 'That username has already been taken.', 'last' => true, ), 'lengthCheck' => array( 'rule' => '/^.{6,40}$/', 'message' => 'Minimum username 6 characters.', 'last' => true, ), ), 'email' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'email' => array( 'rule' => 'email', 'message' => 'That is not a valid email address.', 'last' => true, ), ), 'confirm_password' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'lengthCheck' => array( 'rule' => '/^.{6,40}$/', 'message' => 'Minimum password 6 characters.', 'last' => true, ), 'checkMatch' => array( 'rule' => 'confirmPassword', 'message' => 'Both passwords should match.', 'last' => true, ), ), function confirmPassword() { return (($this->data[$this->alias]['password']) == Security::hash($this->data[$this->alias]['confirm_password'], null, true)); } ); } Just in case I might done wrong else where but I don't think so. See somewhere else wrong ? On Dec 21, 10:45 pm, John Maxim wrote: > Yes, the error is the same even using your code and I've checked a few > times. It gave the same error. > > function confirmPassword() { > return (($this->data[$this->alias]['password']) == > Security::hash($this->data[$this->alias]['confirm_password'], > null, > true)); > > } > > On Dec 21, 10:32 pm, Stephen wrote: > > > To me it seems the bracket is misplaced. > > > You were doing this > > > (($variable) == condition(param1), param2, param3) > > > The parameters for Security::hash should be contained within the brackets. > > > (($variable) == condition(param1, param2, param3)) > > > Is the error the same? > > > On 21 December 2010 14:18, John Maxim wrote: > > > > I crossed replied with your previous message Stephen, sorry, > > > > and I tried your code it gave the same error. > > > > Thanks for your time, too.. > > > > What is your thoughts on this error ? > > > > On Dec 21, 10:13 pm, John Maxim wrote: > > > > I tried putting it outside the array validation where it gives parsing > > > > error without the bracket sign "(" > > > > > On Dec 21, 9:58 pm, John Maxim wrote: > > > > > > Hi, thanks Amit, but > > > > > > I got an error here: > > > > > > Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app > > > > > \models\user.php on line 66 > > > > > > On line 66 is: > > > > > > function confirmPassword() > > > > > { > > > > > return > > > > > (($this->data[$this->alias]['password']) > > > == > > > > > Security::hash($this->data[$this->alias]['confirm_password']), null, > > > > > true); > > > > > } > > > > > > I modified a few times to include and exclude some of the brackets, > > > > > but it gives the same error as shown above. *I used Amit code as > > > > > originally and it started with the error above. > > > > > > Do I add this function inside the var $validate = array ( ); > > > > > > or it has to be outside the array validation ? > > > > > > Can someone look where the function go wrong ? > > > > > > On Dec 21, 5:41 pm, Amit Badkas wrote: > > > > > > > Hi, > > > > > > > You need to use custom validation method for this in your model, > > > something > > > > > > like > > > > > > >
Re: Problem with Password validation ?
Yes, the error is the same even using your code and I've checked a few times. It gave the same error. function confirmPassword() { return (($this->data[$this->alias]['password']) == Security::hash($this->data[$this->alias]['confirm_password'], null, true)); } On Dec 21, 10:32 pm, Stephen wrote: > To me it seems the bracket is misplaced. > > You were doing this > > (($variable) == condition(param1), param2, param3) > > The parameters for Security::hash should be contained within the brackets. > > (($variable) == condition(param1, param2, param3)) > > Is the error the same? > > On 21 December 2010 14:18, John Maxim wrote: > > > I crossed replied with your previous message Stephen, sorry, > > > and I tried your code it gave the same error. > > > Thanks for your time, too.. > > > What is your thoughts on this error ? > > > On Dec 21, 10:13 pm, John Maxim wrote: > > > I tried putting it outside the array validation where it gives parsing > > > error without the bracket sign "(" > > > > On Dec 21, 9:58 pm, John Maxim wrote: > > > > > Hi, thanks Amit, but > > > > > I got an error here: > > > > > Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app > > > > \models\user.php on line 66 > > > > > On line 66 is: > > > > > function confirmPassword() > > > > { > > > > return (($this->data[$this->alias]['password']) > > == > > > > Security::hash($this->data[$this->alias]['confirm_password']), null, > > > > true); > > > > } > > > > > I modified a few times to include and exclude some of the brackets, > > > > but it gives the same error as shown above. *I used Amit code as > > > > originally and it started with the error above. > > > > > Do I add this function inside the var $validate = array ( ); > > > > > or it has to be outside the array validation ? > > > > > Can someone look where the function go wrong ? > > > > > On Dec 21, 5:41 pm, Amit Badkas wrote: > > > > > > Hi, > > > > > > You need to use custom validation method for this in your model, > > something > > > > > like > > > > > > 'confirm_password' => array( > > > > > 'notEmpty' => array( > > > > > 'rule' => 'notEmpty', > > > > > 'message' => 'This field cannot be > > blank.', > > > > > 'last' => true, > > > > > ), > > > > > 'lengthCheck' => array( > > > > > 'rule' => '/^.{6,40}$/', > > > > > 'message' => 'Minimum password 6 > > > > > characters.', > > > > > 'last' => true, > > > > > ), > > > > > 'confirmed' => array( > > > > > 'rule' => 'confirmPassword' > > > > > 'message' => 'Both passwords should > > match.' > > > > > ), > > > > > ), > > > > > > function confirmPassword() > > > > > { > > > > > return ($this->data[$this->alias]['password'] == > > > > > Security::hash($this->data[$this->alias]['confirm_password'], null, > > true)); > > > > > > } > > > > > > FYI, password hash mechanism uses Security::hash(), that's why we > > also need > > > > > to hash our confirmed password for comparison. > > > > > > Hope this helps. > > > > > > Amit Badkas > > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > On Tue, Dec 21, 2010 at 2:39 PM, John Maxim > > wrote: > > > > > > Hi, > > > > > > > Do you know how to match value in password with confirm_password ? > > I > > > > > > tried equalTo but it is meant for fixed value ? > > > > > > > I have tried what you suggested before this, since your first post, > > I > > > > > > understand, however, the passwords matching for the 2 password > > fields > > > > > > using validation--do you think it is possible without creating a > > > > > > function ? > > > > > > > @previous post, I was referring to the Solution 1 where it created > > a > > > > > > function, I think it was put in model. > > > > > > > Solution 2 is something what I'm trying to do half-way > > > > > > > thanks for you time. > > > > > > > On Dec 21, 4:45 pm, Amit Badkas wrote: > > > > > > > Hi, > > > > > > > > Use name of password confirmation field instead of 'password' in > > validate > > > > > > > array, something like > > > > > > > > 'confirm_password' => array( > > > > > > > 'notEmpty' => array( > > > > > > > 'rule' => 'notEmpty', > > > > > > > 'message' => 'This field cannot be > > > > > > blank.', > > > > > > > 'last' => true, > > > > > > > ), > > > > > > > 'lengthCheck' => array( > > > > > > > 'rule' =>
Re: Problem with Password validation ?
To me it seems the bracket is misplaced. You were doing this (($variable) == condition(param1), param2, param3) The parameters for Security::hash should be contained within the brackets. (($variable) == condition(param1, param2, param3)) Is the error the same? On 21 December 2010 14:18, John Maxim wrote: > I crossed replied with your previous message Stephen, sorry, > > and I tried your code it gave the same error. > > Thanks for your time, too.. > > What is your thoughts on this error ? > > On Dec 21, 10:13 pm, John Maxim wrote: > > I tried putting it outside the array validation where it gives parsing > > error without the bracket sign "(" > > > > On Dec 21, 9:58 pm, John Maxim wrote: > > > > > Hi, thanks Amit, but > > > > > I got an error here: > > > > > Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app > > > \models\user.php on line 66 > > > > > On line 66 is: > > > > > function confirmPassword() > > > { > > > return (($this->data[$this->alias]['password']) > == > > > Security::hash($this->data[$this->alias]['confirm_password']), null, > > > true); > > > } > > > > > I modified a few times to include and exclude some of the brackets, > > > but it gives the same error as shown above. *I used Amit code as > > > originally and it started with the error above. > > > > > Do I add this function inside the var $validate = array ( ); > > > > > or it has to be outside the array validation ? > > > > > Can someone look where the function go wrong ? > > > > > On Dec 21, 5:41 pm, Amit Badkas wrote: > > > > > > Hi, > > > > > > You need to use custom validation method for this in your model, > something > > > > like > > > > > > 'confirm_password' => array( > > > > 'notEmpty' => array( > > > > 'rule' => 'notEmpty', > > > > 'message' => 'This field cannot be > blank.', > > > > 'last' => true, > > > > ), > > > > 'lengthCheck' => array( > > > > 'rule' => '/^.{6,40}$/', > > > > 'message' => 'Minimum password 6 > > > > characters.', > > > > 'last' => true, > > > > ), > > > > 'confirmed' => array( > > > > 'rule' => 'confirmPassword' > > > > 'message' => 'Both passwords should > match.' > > > > ), > > > > ), > > > > > > function confirmPassword() > > > > { > > > > return ($this->data[$this->alias]['password'] == > > > > Security::hash($this->data[$this->alias]['confirm_password'], null, > true)); > > > > > > } > > > > > > FYI, password hash mechanism uses Security::hash(), that's why we > also need > > > > to hash our confirmed password for comparison. > > > > > > Hope this helps. > > > > > > Amit Badkas > > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > On Tue, Dec 21, 2010 at 2:39 PM, John Maxim > wrote: > > > > > Hi, > > > > > > > Do you know how to match value in password with confirm_password ? > I > > > > > tried equalTo but it is meant for fixed value ? > > > > > > > I have tried what you suggested before this, since your first post, > I > > > > > understand, however, the passwords matching for the 2 password > fields > > > > > using validation--do you think it is possible without creating a > > > > > function ? > > > > > > > @previous post, I was referring to the Solution 1 where it created > a > > > > > function, I think it was put in model. > > > > > > > Solution 2 is something what I'm trying to do half-way > > > > > > > thanks for you time. > > > > > > > On Dec 21, 4:45 pm, Amit Badkas wrote: > > > > > > Hi, > > > > > > > > Use name of password confirmation field instead of 'password' in > validate > > > > > > array, something like > > > > > > > > 'confirm_password' => array( > > > > > >'notEmpty' => array( > > > > > >'rule' => 'notEmpty', > > > > > >'message' => 'This field cannot be > > > > > blank.', > > > > > >'last' => true, > > > > > >), > > > > > >'lengthCheck' => array( > > > > > >'rule' => '/^.{6,40}$/', > > > > > >'message' => 'Minimum password 6 > > > > > > characters.', > > > > > >'last' => true, > > > > > >), > > > > > >), > > > > > > > > Hope this helps. > > > > > > > > Amit Badkas > > > > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > > On Tue, Dec 21, 2010 at 1:22 PM, John Maxim > wrote: > > > > > > > @Amit > > > > > > > First, > > > > >
Re: Problem with Password validation ?
I crossed replied with your previous message Stephen, sorry, and I tried your code it gave the same error. Thanks for your time, too.. What is your thoughts on this error ? On Dec 21, 10:13 pm, John Maxim wrote: > I tried putting it outside the array validation where it gives parsing > error without the bracket sign "(" > > On Dec 21, 9:58 pm, John Maxim wrote: > > > Hi, thanks Amit, but > > > I got an error here: > > > Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app > > \models\user.php on line 66 > > > On line 66 is: > > > function confirmPassword() > > { > > return (($this->data[$this->alias]['password']) == > > Security::hash($this->data[$this->alias]['confirm_password']), null, > > true); > > } > > > I modified a few times to include and exclude some of the brackets, > > but it gives the same error as shown above. *I used Amit code as > > originally and it started with the error above. > > > Do I add this function inside the var $validate = array ( ); > > > or it has to be outside the array validation ? > > > Can someone look where the function go wrong ? > > > On Dec 21, 5:41 pm, Amit Badkas wrote: > > > > Hi, > > > > You need to use custom validation method for this in your model, something > > > like > > > > 'confirm_password' => array( > > > 'notEmpty' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'This field cannot be > > > blank.', > > > 'last' => true, > > > ), > > > 'lengthCheck' => array( > > > 'rule' => '/^.{6,40}$/', > > > 'message' => 'Minimum password 6 > > > characters.', > > > 'last' => true, > > > ), > > > 'confirmed' => array( > > > 'rule' => 'confirmPassword' > > > 'message' => 'Both passwords should > > > match.' > > > ), > > > ), > > > > function confirmPassword() > > > { > > > return ($this->data[$this->alias]['password'] == > > > Security::hash($this->data[$this->alias]['confirm_password'], null, > > > true)); > > > > } > > > > FYI, password hash mechanism uses Security::hash(), that's why we also > > > need > > > to hash our confirmed password for comparison. > > > > Hope this helps. > > > > Amit Badkas > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > On Tue, Dec 21, 2010 at 2:39 PM, John Maxim wrote: > > > > Hi, > > > > > Do you know how to match value in password with confirm_password ? I > > > > tried equalTo but it is meant for fixed value ? > > > > > I have tried what you suggested before this, since your first post, I > > > > understand, however, the passwords matching for the 2 password fields > > > > using validation--do you think it is possible without creating a > > > > function ? > > > > > @previous post, I was referring to the Solution 1 where it created a > > > > function, I think it was put in model. > > > > > Solution 2 is something what I'm trying to do half-way > > > > > thanks for you time. > > > > > On Dec 21, 4:45 pm, Amit Badkas wrote: > > > > > Hi, > > > > > > Use name of password confirmation field instead of 'password' in > > > > > validate > > > > > array, something like > > > > > > 'confirm_password' => array( > > > > > 'notEmpty' => array( > > > > > 'rule' => 'notEmpty', > > > > > 'message' => 'This field cannot be > > > > blank.', > > > > > 'last' => true, > > > > > ), > > > > > 'lengthCheck' => array( > > > > > 'rule' => '/^.{6,40}$/', > > > > > 'message' => 'Minimum password 6 > > > > > characters.', > > > > > 'last' => true, > > > > > ), > > > > > ), > > > > > > Hope this helps. > > > > > > Amit Badkas > > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > On Tue, Dec 21, 2010 at 1:22 PM, John Maxim wrote: > > > > > > @Amit > > > > > > First, > > > > > > > Thanks man. > > > > > > > Second..., > > > > > > Do you know how to implement Solution 1 above ? > > > > > > > On Dec 21, 12:47 pm, Amit Badkas wrote: > > > > > > > Hi, > > > > > > > > If your form has password confirmation field then you can add 'not > > > > empty' > > > > > > > and 'length check' validations for that field as it won't contain > > > > hashed > > > > > > > value. > > > > > > > > Amit Badkas > > > > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > > On Mon, Dec 20, 2010 at 10:43 PM, John Maxim > > > > wr
Re: Problem with Password validation ?
I tried putting it outside the array validation where it gives parsing error without the bracket sign "(" On Dec 21, 9:58 pm, John Maxim wrote: > Hi, thanks Amit, but > > I got an error here: > > Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app > \models\user.php on line 66 > > On line 66 is: > > function confirmPassword() > { > return (($this->data[$this->alias]['password']) == > Security::hash($this->data[$this->alias]['confirm_password']), null, > true); > } > > I modified a few times to include and exclude some of the brackets, > but it gives the same error as shown above. *I used Amit code as > originally and it started with the error above. > > Do I add this function inside the var $validate = array ( ); > > or it has to be outside the array validation ? > > Can someone look where the function go wrong ? > > On Dec 21, 5:41 pm, Amit Badkas wrote: > > > Hi, > > > You need to use custom validation method for this in your model, something > > like > > > 'confirm_password' => array( > > 'notEmpty' => array( > > 'rule' => 'notEmpty', > > 'message' => 'This field cannot be blank.', > > 'last' => true, > > ), > > 'lengthCheck' => array( > > 'rule' => '/^.{6,40}$/', > > 'message' => 'Minimum password 6 > > characters.', > > 'last' => true, > > ), > > 'confirmed' => array( > > 'rule' => 'confirmPassword' > > 'message' => 'Both passwords should match.' > > ), > > ), > > > function confirmPassword() > > { > > return ($this->data[$this->alias]['password'] == > > Security::hash($this->data[$this->alias]['confirm_password'], null, true)); > > > } > > > FYI, password hash mechanism uses Security::hash(), that's why we also need > > to hash our confirmed password for comparison. > > > Hope this helps. > > > Amit Badkas > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > On Tue, Dec 21, 2010 at 2:39 PM, John Maxim wrote: > > > Hi, > > > > Do you know how to match value in password with confirm_password ? I > > > tried equalTo but it is meant for fixed value ? > > > > I have tried what you suggested before this, since your first post, I > > > understand, however, the passwords matching for the 2 password fields > > > using validation--do you think it is possible without creating a > > > function ? > > > > @previous post, I was referring to the Solution 1 where it created a > > > function, I think it was put in model. > > > > Solution 2 is something what I'm trying to do half-way > > > > thanks for you time. > > > > On Dec 21, 4:45 pm, Amit Badkas wrote: > > > > Hi, > > > > > Use name of password confirmation field instead of 'password' in > > > > validate > > > > array, something like > > > > > 'confirm_password' => array( > > > > 'notEmpty' => array( > > > > 'rule' => 'notEmpty', > > > > 'message' => 'This field cannot be > > > blank.', > > > > 'last' => true, > > > > ), > > > > 'lengthCheck' => array( > > > > 'rule' => '/^.{6,40}$/', > > > > 'message' => 'Minimum password 6 > > > > characters.', > > > > 'last' => true, > > > > ), > > > > ), > > > > > Hope this helps. > > > > > Amit Badkas > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > On Tue, Dec 21, 2010 at 1:22 PM, John Maxim wrote: > > > > > @Amit > > > > > First, > > > > > > Thanks man. > > > > > > Second..., > > > > > Do you know how to implement Solution 1 above ? > > > > > > On Dec 21, 12:47 pm, Amit Badkas wrote: > > > > > > Hi, > > > > > > > If your form has password confirmation field then you can add 'not > > > empty' > > > > > > and 'length check' validations for that field as it won't contain > > > hashed > > > > > > value. > > > > > > > Amit Badkas > > > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > On Mon, Dec 20, 2010 at 10:43 PM, John Maxim > > > wrote: > > > > > > > 'password' => array( > > > > > > > 'notEmpty' => array( > > > > > > > 'rule' => 'notEmpty', > > > > > > > 'message' => 'This field cannot be > > > > > blank.', > > > > > > > 'last' => true, > > > > > > > ), > > > > > > > 'lengthCheck' => array( > > > > > > >
Re: Problem with Password validation ?
Try this: function confirmPassword() { return (($this->data[$this->alias]['password']) == Security::hash($this->data[$this->alias]['confirm_password'], null, true)); } Kind Regards Stephen 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
Re: Problem with Password validation ?
Hi, thanks Amit, but I got an error here: Parse error: parse error, expecting `')'' in C:\wamp\www\cakephp\app \models\user.php on line 66 On line 66 is: function confirmPassword() { return (($this->data[$this->alias]['password']) == Security::hash($this->data[$this->alias]['confirm_password']), null, true); } I modified a few times to include and exclude some of the brackets, but it gives the same error as shown above. *I used Amit code as originally and it started with the error above. Do I add this function inside the var $validate = array ( ); or it has to be outside the array validation ? Can someone look where the function go wrong ? On Dec 21, 5:41 pm, Amit Badkas wrote: > Hi, > > You need to use custom validation method for this in your model, something > like > > 'confirm_password' => array( > 'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'This field cannot be blank.', > 'last' => true, > ), > 'lengthCheck' => array( > 'rule' => '/^.{6,40}$/', > 'message' => 'Minimum password 6 > characters.', > 'last' => true, > ), > 'confirmed' => array( > 'rule' => 'confirmPassword' > 'message' => 'Both passwords should match.' > ), > ), > > function confirmPassword() > { > return ($this->data[$this->alias]['password'] == > Security::hash($this->data[$this->alias]['confirm_password'], null, true)); > > } > > FYI, password hash mechanism uses Security::hash(), that's why we also need > to hash our confirmed password for comparison. > > Hope this helps. > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > On Tue, Dec 21, 2010 at 2:39 PM, John Maxim wrote: > > Hi, > > > Do you know how to match value in password with confirm_password ? I > > tried equalTo but it is meant for fixed value ? > > > I have tried what you suggested before this, since your first post, I > > understand, however, the passwords matching for the 2 password fields > > using validation--do you think it is possible without creating a > > function ? > > > @previous post, I was referring to the Solution 1 where it created a > > function, I think it was put in model. > > > Solution 2 is something what I'm trying to do half-way > > > thanks for you time. > > > On Dec 21, 4:45 pm, Amit Badkas wrote: > > > Hi, > > > > Use name of password confirmation field instead of 'password' in validate > > > array, something like > > > > 'confirm_password' => array( > > > 'notEmpty' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'This field cannot be > > blank.', > > > 'last' => true, > > > ), > > > 'lengthCheck' => array( > > > 'rule' => '/^.{6,40}$/', > > > 'message' => 'Minimum password 6 > > > characters.', > > > 'last' => true, > > > ), > > > ), > > > > Hope this helps. > > > > Amit Badkas > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > On Tue, Dec 21, 2010 at 1:22 PM, John Maxim wrote: > > > > @Amit > > > > First, > > > > > Thanks man. > > > > > Second..., > > > > Do you know how to implement Solution 1 above ? > > > > > On Dec 21, 12:47 pm, Amit Badkas wrote: > > > > > Hi, > > > > > > If your form has password confirmation field then you can add 'not > > empty' > > > > > and 'length check' validations for that field as it won't contain > > hashed > > > > > value. > > > > > > Amit Badkas > > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > On Mon, Dec 20, 2010 at 10:43 PM, John Maxim > > wrote: > > > > > > 'password' => array( > > > > > > 'notEmpty' => array( > > > > > > 'rule' => 'notEmpty', > > > > > > 'message' => 'This field cannot be > > > > blank.', > > > > > > 'last' => true, > > > > > > ), > > > > > > 'lengthCheck' => array( > > > > > > 'rule' => '/^.{6,40}$/', > > > > > > 'message' => 'Minimum password 6 > > > > > > characters.', > > > > > > 'last' => true, > > > > > > ), > > > > > > ), > > > > > > > ** > > > > > > The registration validation is affected when hash password is > > enabled. >
Select box and jQuery ajax calls
Hello, I'm trying to make ajax calls and requests with new CakePHP 1.3 helpers (especially JsHelper) and Jquery. Here is what I do: a simple select box: echo $this->Form->input('Sync.selection', array('type'=>'select', 'options'=>$sync_elements, 'id'=>'selection', 'label'=>'What will sync')); and the code for ajax call $this->Js->get('#selection')->event('change', $this->Js->request(array('controller'=>'Syncs', 'action'=>'syncSelection'), array('async'=>true, 'method'=>'post', 'type'=>'json', 'update'=>'#result')); I have two problems with this code: 1. It doesn't matter what type (html or json) I write, the resulting jquery code is always "dataType: "html"" 2. Using method=post doesn't work - no requests are made (according to apache access logs) and nothing happens on select box change. If I change method to get it works. Any ideas on this? 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
Re: How to display password_2 field in asterisk ?
best to use 'type' => 'password' On 21 Dez., 10:33, Yasir Arafat Hasib wrote: > just add a class "required" in your field it will auto create a stat(*) > > On Tue, Dec 21, 2010 at 3:30 PM, Amit Badkas wrote: > > > > > > > > > > > Hi, > > > If you are using input() method of form helper then set 'type' as > > 'password' (http://book.cakephp.org/view/1392/options-type) otherwise use > > password() method (http://book.cakephp.org/view/1428/password). > > > Hope this helps. > > > Amit Badkas > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > On Tue, Dec 21, 2010 at 1:18 PM, John Maxim wrote: > > >> I have 2 password fields; > > >> 1. password > >> 2. password_2 > > >> The value displayed in field password_2 is in plain text, how to > >> change it to asterisks/dots ? > > >> 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 >> om>For more options, visit this group at > >>http://groups.google.com/group/cake-php?hl=en > > > 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 > om>For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en > > -- > Thanks & regards. > > Yasir Arafat (Hasib) > Software Engineer > Epsilon Consulting and Development Services (ECDS) > Contact Information: > Cell : +8801816536901 > Web:http://arafats.info 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
Re: SQL Query & Search Tutorial for CakePHP
Try the cakephp cookbook git clone https://github.com/cakephp/cookbook.git On Mon, Dec 20, 2010 at 5:45 AM, OldWest wrote: > Does anyone know of a good tutorial using Cake convention for writing > SQL queries with multiple search field types e.g. select menu, text > entry, radio, checkboxes etc? > > I cannot locate anything very specific like this. > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Regards, Zaky Katalan-Ezra QA Administrator www.IGeneriX.com Sites.IGeneriX.com 054-7762312 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
Re: Problem with Password validation ?
Hi, You need to use custom validation method for this in your model, something like 'confirm_password' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'lengthCheck' => array( 'rule' => '/^.{6,40}$/', 'message' => 'Minimum password 6 characters.', 'last' => true, ), 'confirmed' => array( 'rule' => 'confirmPassword' 'message' => 'Both passwords should match.' ), ), function confirmPassword() { return ($this->data[$this->alias]['password'] == Security::hash($this->data[$this->alias]['confirm_password'], null, true)); } FYI, password hash mechanism uses Security::hash(), that's why we also need to hash our confirmed password for comparison. Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Dec 21, 2010 at 2:39 PM, John Maxim wrote: > Hi, > > Do you know how to match value in password with confirm_password ? I > tried equalTo but it is meant for fixed value ? > > I have tried what you suggested before this, since your first post, I > understand, however, the passwords matching for the 2 password fields > using validation--do you think it is possible without creating a > function ? > > @previous post, I was referring to the Solution 1 where it created a > function, I think it was put in model. > > Solution 2 is something what I'm trying to do half-way > > thanks for you time. > > On Dec 21, 4:45 pm, Amit Badkas wrote: > > Hi, > > > > Use name of password confirmation field instead of 'password' in validate > > array, something like > > > > 'confirm_password' => array( > >'notEmpty' => array( > >'rule' => 'notEmpty', > >'message' => 'This field cannot be > blank.', > >'last' => true, > >), > >'lengthCheck' => array( > >'rule' => '/^.{6,40}$/', > >'message' => 'Minimum password 6 > > characters.', > >'last' => true, > >), > >), > > > > Hope this helps. > > > > Amit Badkas > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > On Tue, Dec 21, 2010 at 1:22 PM, John Maxim wrote: > > > @Amit > > > First, > > > > > Thanks man. > > > > > Second..., > > > Do you know how to implement Solution 1 above ? > > > > > On Dec 21, 12:47 pm, Amit Badkas wrote: > > > > Hi, > > > > > > If your form has password confirmation field then you can add 'not > empty' > > > > and 'length check' validations for that field as it won't contain > hashed > > > > value. > > > > > > Amit Badkas > > > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > On Mon, Dec 20, 2010 at 10:43 PM, John Maxim > wrote: > > > > > 'password' => array( > > > > >'notEmpty' => array( > > > > >'rule' => 'notEmpty', > > > > >'message' => 'This field cannot be > > > blank.', > > > > >'last' => true, > > > > >), > > > > >'lengthCheck' => array( > > > > >'rule' => '/^.{6,40}$/', > > > > >'message' => 'Minimum password 6 > > > > > characters.', > > > > >'last' => true, > > > > >), > > > > >), > > > > > > > ** > > > > > The registration validation is affected when hash password is > enabled. > > > > > It doesn't matter how the hash was enabled; using Auth component; > or > > > > > Md5, once hash is enabled, the password validation no longer can be > > > > > triggered. So, I think something wrong with the above validation ? > > > > > > > The full validations for all fields are below: (Note: only the > > > > > password validation is affected) > > > > > > > 'username' => array( > > > > >'notEmpty' => array( > > > > >'rule' => 'notEmpty', > > > > >'message' => 'This field cannot be > > > blank.', > > > > >'last' => true, > > > > >), > > > > >'uniqueCheck' => array( > > > > >'rule' => 'isUnique', > > > > >'message' => 'That username has > already > > > been > > > > > taken.', > > > > >
Re: How to display password_2 field in asterisk ?
just add a class "required" in your field it will auto create a stat(*) On Tue, Dec 21, 2010 at 3:30 PM, Amit Badkas wrote: > Hi, > > If you are using input() method of form helper then set 'type' as > 'password' (http://book.cakephp.org/view/1392/options-type) otherwise use > password() method (http://book.cakephp.org/view/1428/password). > > Hope this helps. > > Amit Badkas > > PHP Applications for E-Biz: http://www.sanisoft.com > > > > On Tue, Dec 21, 2010 at 1:18 PM, John Maxim wrote: > >> I have 2 password fields; >> >> 1. password >> 2. password_2 >> >> The value displayed in field password_2 is in plain text, how to >> change it to asterisks/dots ? >> >> 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.comFor >> more options, visit this group at >> http://groups.google.com/group/cake-php?hl=en >> > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Thanks & regards. Yasir Arafat (Hasib) Software Engineer Epsilon Consulting and Development Services (ECDS) Contact Information: Cell : +8801816536901 Web: http://arafats.info 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
Re: Problem with Password validation ?
Hi, Do you know how to match value in password with confirm_password ? I tried equalTo but it is meant for fixed value ? I have tried what you suggested before this, since your first post, I understand, however, the passwords matching for the 2 password fields using validation--do you think it is possible without creating a function ? @previous post, I was referring to the Solution 1 where it created a function, I think it was put in model. Solution 2 is something what I'm trying to do half-way thanks for you time. On Dec 21, 4:45 pm, Amit Badkas wrote: > Hi, > > Use name of password confirmation field instead of 'password' in validate > array, something like > > 'confirm_password' => array( > 'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'This field cannot be blank.', > 'last' => true, > ), > 'lengthCheck' => array( > 'rule' => '/^.{6,40}$/', > 'message' => 'Minimum password 6 > characters.', > 'last' => true, > ), > ), > > Hope this helps. > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > On Tue, Dec 21, 2010 at 1:22 PM, John Maxim wrote: > > @Amit > > First, > > > Thanks man. > > > Second..., > > Do you know how to implement Solution 1 above ? > > > On Dec 21, 12:47 pm, Amit Badkas wrote: > > > Hi, > > > > If your form has password confirmation field then you can add 'not empty' > > > and 'length check' validations for that field as it won't contain hashed > > > value. > > > > Amit Badkas > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > On Mon, Dec 20, 2010 at 10:43 PM, John Maxim wrote: > > > > 'password' => array( > > > > 'notEmpty' => array( > > > > 'rule' => 'notEmpty', > > > > 'message' => 'This field cannot be > > blank.', > > > > 'last' => true, > > > > ), > > > > 'lengthCheck' => array( > > > > 'rule' => '/^.{6,40}$/', > > > > 'message' => 'Minimum password 6 > > > > characters.', > > > > 'last' => true, > > > > ), > > > > ), > > > > > ** > > > > The registration validation is affected when hash password is enabled. > > > > It doesn't matter how the hash was enabled; using Auth component; or > > > > Md5, once hash is enabled, the password validation no longer can be > > > > triggered. So, I think something wrong with the above validation ? > > > > > The full validations for all fields are below: (Note: only the > > > > password validation is affected) > > > > > 'username' => array( > > > > 'notEmpty' => array( > > > > 'rule' => 'notEmpty', > > > > 'message' => 'This field cannot be > > blank.', > > > > 'last' => true, > > > > ), > > > > 'uniqueCheck' => array( > > > > 'rule' => 'isUnique', > > > > 'message' => 'That username has already > > been > > > > taken.', > > > > 'last' => true, > > > > ), > > > > 'lengthCheck' => array( > > > > 'rule' => '/^.{6,40}$/', > > > > 'message' => 'Minimum username 6 > > > > characters.', > > > > 'last' => true, > > > > ), > > > > ), > > > > > 'email' => array( > > > > 'notEmpty' => array( > > > > 'rule' => 'notEmpty', > > > > 'message' => 'This field cannot be blank.', > > > > 'last' => true, > > > > ), > > > > 'email' => array( > > > > 'rule' => 'email', > > > > 'message' => 'That is not a valid email address.', > > > > 'last' => true, > > > > ), > > > > ), > > > > > 'password' => array( > > > > 'notEmpty' => array( > > > > 'rule' => 'notEmpty', > > > > 'message' => 'This field cannot be > > blank.', > > > > 'last' => true, > > > > ), > > > > 'lengthCheck' => array( > > > > 'rule' => '/^.{6,40}$/', > > > > 'message' => 'Minimum password 6 > > > > characters.', > > > > 'last' => true, > > > > ), > >
Re: Problem with Password validation ?
Hi, Use name of password confirmation field instead of 'password' in validate array, something like 'confirm_password' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'This field cannot be blank.', 'last' => true, ), 'lengthCheck' => array( 'rule' => '/^.{6,40}$/', 'message' => 'Minimum password 6 characters.', 'last' => true, ), ), Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Dec 21, 2010 at 1:22 PM, John Maxim wrote: > @Amit > First, > > Thanks man. > > Second..., > Do you know how to implement Solution 1 above ? > > > > On Dec 21, 12:47 pm, Amit Badkas wrote: > > Hi, > > > > If your form has password confirmation field then you can add 'not empty' > > and 'length check' validations for that field as it won't contain hashed > > value. > > > > Amit Badkas > > > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > On Mon, Dec 20, 2010 at 10:43 PM, John Maxim wrote: > > > 'password' => array( > > >'notEmpty' => array( > > >'rule' => 'notEmpty', > > >'message' => 'This field cannot be > blank.', > > >'last' => true, > > >), > > >'lengthCheck' => array( > > >'rule' => '/^.{6,40}$/', > > >'message' => 'Minimum password 6 > > > characters.', > > >'last' => true, > > >), > > >), > > > > > ** > > > The registration validation is affected when hash password is enabled. > > > It doesn't matter how the hash was enabled; using Auth component; or > > > Md5, once hash is enabled, the password validation no longer can be > > > triggered. So, I think something wrong with the above validation ? > > > > > The full validations for all fields are below: (Note: only the > > > password validation is affected) > > > > > 'username' => array( > > >'notEmpty' => array( > > >'rule' => 'notEmpty', > > >'message' => 'This field cannot be > blank.', > > >'last' => true, > > >), > > >'uniqueCheck' => array( > > >'rule' => 'isUnique', > > >'message' => 'That username has already > been > > > taken.', > > >'last' => true, > > >), > > >'lengthCheck' => array( > > >'rule' => '/^.{6,40}$/', > > >'message' => 'Minimum username 6 > > > characters.', > > >'last' => true, > > >), > > >), > > > > >'email' => array( > > >'notEmpty' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'This field cannot be blank.', > > > 'last' => true, > > > ), > > >'email' => array( > > > 'rule' => 'email', > > > 'message' => 'That is not a valid email address.', > > > 'last' => true, > > > ), > > > ), > > > > >'password' => array( > > >'notEmpty' => array( > > >'rule' => 'notEmpty', > > >'message' => 'This field cannot be > blank.', > > >'last' => true, > > >), > > >'lengthCheck' => array( > > >'rule' => '/^.{6,40}$/', > > >'message' => 'Minimum password 6 > > > characters.', > > >'last' => true, > > >), > > >), > > > > > ** > > > Is there an alternative way to write these validations?; I have no > > > clue why the password validation is nullified when hash password is > > > enabled using any way. > > > > > 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 at > > >http://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site
Re: How to display password_2 field in asterisk ?
Hi, If you are using input() method of form helper then set 'type' as 'password' (http://book.cakephp.org/view/1392/options-type) otherwise use password() method (http://book.cakephp.org/view/1428/password). Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Dec 21, 2010 at 1:18 PM, John Maxim wrote: > I have 2 password fields; > > 1. password > 2. password_2 > > The value displayed in field password_2 is in plain text, how to > change it to asterisks/dots ? > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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