mirror of https://github.com/MISP/MISP
Merge branch 'password_script' into develop
commit
4c0e82e8b1
|
@ -49,6 +49,6 @@ There are 2 branches:
|
|||
License
|
||||
-------
|
||||
|
||||
This software is licensed under GNU Affero General Public License version 3
|
||||
This software is licensed under [GNU Affero General Public License version 3](http://www.gnu.org/licenses/agpl-3.0.html)
|
||||
|
||||
Copyright (c) 2012, 2013 Christophe Vandeplas, Belgian Defence, NATO / NCIRC.
|
||||
|
|
|
@ -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