mirror of https://github.com/MISP/MISP
Password reset fix
parent
963646cf6d
commit
644b0cd512
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue