authentication - CakePHP auth and validation -


i have app uses auth component. logedin members can alter data long have no validation rules in users model. when add array $validate in model logedin users cannot submit data database.

i use 1 mysql table named users.

in other words works don't have validation in signup view

 <?php class user extends appmodel { var $name = 'user'; ?> 

but when add validation this:

 <?php class user extends appmodel { var $name = 'user'; var $validate = array(   'email' => array(     'email' => array('rule' => 'email','required'=>true,'message' => 'enter proper mail')   ) ); } ?> 

validation in signup view works users in secret area cannot enter data database.

my guess is: happening because have set required true.

this enforces rule when submitted data of user model, email key needs set. therefore, works in sign form has email key. on other hand, form you're using in secret area not have email field.

just remove "required" condition validation rule:

'email' => array(     'email' => array(         'rule' => array('email'),         'message' => 'please enter valid email',     ), ), 

let me know if works you.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -