From 61812f4dc59cbd149b190370e4e7187bba71abe0 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 27 Sep 2010 07:51:32 +0000 Subject: [PATCH] allow for forced passwordchange on next login at account creation time --- admin/inc/class.soaccounts.inc.php | 2 +- phpgwapi/inc/class.accounts_sql.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/inc/class.soaccounts.inc.php b/admin/inc/class.soaccounts.inc.php index 0f27e16b9a..c63fdad3d4 100755 --- a/admin/inc/class.soaccounts.inc.php +++ b/admin/inc/class.soaccounts.inc.php @@ -25,7 +25,7 @@ { $userData['account_email'] = $userData['email']; } - + if ($userData['mustchangepassword'] == 1) $userData['account_lastpwd_change']=0; if (!($userData['account_id'] = $GLOBALS['egw']->accounts->create($userData))) { return false; diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index 89de3a9b7d..d1abb98555 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -156,7 +156,6 @@ class accounts_sql //echo "

accounts_sql::save(".print_r($data,true).")

\n"; $to_write = $data; unset($to_write['account_passwd']); - // encrypt password if given or unset it if not if ($data['account_passwd']) { @@ -169,6 +168,7 @@ class accounts_sql $to_write['account_pwd'] = $data['account_passwd']; $to_write['account_lastpwd_change'] = time(); } + if ($data['mustchangepassword'] == 1) $to_write['account_lastpwd_change']=0; if (!(int)$data['account_id'] || !$this->id2name($data['account_id'])) { if ($to_write['account_id'] < 0) $to_write['account_id'] *= -1; @@ -176,7 +176,7 @@ class accounts_sql if (!isset($to_write['account_pwd'])) $to_write['account_pwd'] = ''; // is NOT NULL! if (!isset($to_write['account_status'])) $to_write['account_status'] = ''; // is NOT NULL! - // postgres requires the auto-id field to be unset! + // postgres requires the auto-id field to be unset! if (isset($to_write['account_id']) && !$to_write['account_id']) unset($to_write['account_id']); if (!in_array($to_write['account_type'],array('u','g')) ||