Guest User

Untitled

a guest
Jun 18th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <?php
  2.  
  3. class myValidatorLogin extends sfValidatorBase {
  4.  
  5. protected function doClean($values) {
  6. $username = isset($values['username']) ? $values['username'] : '';
  7. $password = isset($values['password']) ? $values['password'] : '';
  8. if ($user = Doctrine::getTable('User')->authenticate($username, $password)) {
  9. return array_merge($values, array('user' => $user));
  10. }
  11. throw new sfValidatorErrorSchema($this, array('username' => new sfValidatorError($this, 'invalid')));
  12. }
  13.  
  14. }
Add Comment
Please, Sign In to add comment