kohana registration returns error -
kohana registration returns error -
i have working registration script problem not know how check if username exist because if email or username exist returns me fatal error: orm_validation_exception [ 0 ]: failed validate array ~ modpath/orm/classes/kohana/orm.php [ 1174 ]
and here script:
$validate = validation::factory($values) ->rule('name', 'not_empty') ->rule('password', 'matches', array(':validation', 'password', 'repeat-password')) ->rule('password', 'not_empty') ->rule('email', 'email')->rule('email', 'not_empty') if(!$validate->check()){ $errors = $validate->errors('registration', true); foreach($errors $value){ echo $value . "<br />"; } return; } $model = orm::factory('user'); $model->values(array( 'username' => $values['name'], 'email' => $values['email'], 'password' => $values['password'], 'password_confirm' => $values['repeat-password'], ));
im using 3.2 version.
to find out if entry exists...
$model = orm::factory('user', $values['name']); if ( !$model->is_loaded() ) { // registration }
this seek search user model username (if set primary key).
kohana-3 kohana-orm kohana-auth
Comments
Post a Comment