Merge branch 'password_script' into develop

pull/516/head
iglocska 2015-05-12 11:29:49 +02:00
commit 4c0e82e8b1
2 changed files with 3 additions and 8 deletions

View File

@ -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.

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;