Password reset fix

pull/422/merge
iglocska 2015-05-12 11:28:36 +02:00
parent 963646cf6d
commit 644b0cd512
1 changed files with 2 additions and 7 deletions

View File

@ -11,15 +11,10 @@ class PasswordShell extends AppShell {
public function main() {
// get the users that need their password hashed
$results = $this->User->findByEmail($this->args[0]);
//$this->out(print_r($results, true));
App::import('Component','Auth');
$this->Auth = new AuthComponent(new ComponentCollection());
$count = count($results);
$results = $this->User->find('first', array('conditions' => array('email' => $this->args[0])));
$results['User']['password'] = $this->args[1];
$results['User']['confirm_password'] = $this->args[1];
$results['User']['change_pw'] = 1;
if (!$this->User->save($results)) {
echo 'Could not update account for User.id = ', $results['User']['id'], PHP_EOL;