set pwdExpiration to null

This commit is contained in:
Uwe Steinmann 2017-02-20 15:01:58 +01:00
parent 8996c14a12
commit 2b154cc468
2 changed files with 3 additions and 9 deletions

View File

@ -1280,10 +1280,7 @@ class SeedDMS_Core_DMS {
if($role == '')
$role = '0';
if(trim($pwdexpiration) == '' || trim($pwdexpiration) == 'never') {
if($db->getDriver() == 'sqlite')
$pwdexpiration = $db->qstr('0000-00-00 00:00:00');
else
$pwdexpiration = 'DEFAULT';
$pwdexpiration = 'NULL';
} elseif(trim($pwdexpiration) == 'now')
$pwdexpiration = $db->qstr(date('Y-m-d H:i:s'));
$queryStr = "INSERT INTO `tblUsers` (`login`, `pwd`, `fullName`, `email`, `language`, `theme`, `comment`, `role`, `hidden`, `disabled`, `pwdExpiration`, `quota`, `homefolder`) VALUES (".$db->qstr($login).", ".$db->qstr($pwd).", ".$db->qstr($fullName).", ".$db->qstr($email).", '".$language."', '".$theme."', ".$db->qstr($comment).", '".intval($role)."', '".intval($isHidden)."', '".intval($isDisabled)."', ".$pwdexpiration.", '".intval($quota)."', ".($homefolder ? intval($homefolder) : "NULL").")";

View File

@ -134,7 +134,7 @@ class SeedDMS_Core_User { /* {{{ */
const role_admin = '1';
const role_guest = '2';
function __construct($id, $login, $pwd, $fullName, $email, $language, $theme, $comment, $role, $isHidden=0, $isDisabled=0, $pwdExpiration='0000-00-00 00:00:00', $loginFailures=0, $quota=0, $homeFolder=null) {
function __construct($id, $login, $pwd, $fullName, $email, $language, $theme, $comment, $role, $isHidden=0, $isDisabled=0, $pwdExpiration='', $loginFailures=0, $quota=0, $homeFolder=null) {
$this->_id = $id;
$this->_login = $login;
$this->_pwd = $pwd;
@ -269,10 +269,7 @@ class SeedDMS_Core_User { /* {{{ */
$db = $this->_dms->getDB();
if(trim($newPwdExpiration) == '' || trim($newPwdExpiration) == 'never') {
if($db->getDriver() == 'sqlite')
$queryStr = "UPDATE `tblUsers` SET `pwdExpiration` = '0000-00-00 00:00:00' WHERE `id` = " . $this->_id;
else
$queryStr = "UPDATE `tblUsers` SET `pwdExpiration` = DEFAULT WHERE `id` = " . $this->_id;
$queryStr = "UPDATE `tblUsers` SET `pwdExpiration` = NULL WHERE `id` = " . $this->_id;
} else {
if(trim($newPwdExpiration) == 'now')
$newPwdExpiration = date('Y-m-d H:i:s');