Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class myValidatorLogin extends sfValidatorBase {
- protected function doClean($values) {
- $username = isset($values['username']) ? $values['username'] : '';
- $password = isset($values['password']) ? $values['password'] : '';
- if ($user = Doctrine::getTable('User')->authenticate($username, $password)) {
- return array_merge($values, array('user' => $user));
- }
- throw new sfValidatorErrorSchema($this, array('username' => new sfValidatorError($this, 'invalid')));
- }
- }
Add Comment
Please, Sign In to add comment