allow for forced passwordchange on next login at account creation time

This commit is contained in:
Klaus Leithoff 2010-09-27 07:51:32 +00:00
parent 40d786871e
commit 61812f4dc5
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -156,7 +156,6 @@ class accounts_sql
//echo "<p>accounts_sql::save(".print_r($data,true).")</p>\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;