fix sql for add user when pwdexpiration has a date

This commit is contained in:
Uwe Steinmann 2017-02-28 08:00:45 +01:00
parent 742d91cc68
commit 3635b92edb

View File

@ -1300,10 +1300,12 @@ class SeedDMS_Core_DMS {
$role = '0';
if(trim($pwdexpiration) == '' || trim($pwdexpiration) == 'never') {
$pwdexpiration = 'NULL';
} elseif(trim($pwdexpiration) == 'now')
} elseif(trim($pwdexpiration) == 'now') {
$pwdexpiration = $db->qstr(date('Y-m-d H:i:s'));
} else {
$pwdexpiration = $db->qstr($pwdexpiration);
}
$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").")";
echo $queryStr;
$res = $this->db->getResult($queryStr);
if (!$res)
return false;