set pwdExperiation to a valid date before saving in database

This commit is contained in:
Uwe Steinmann 2014-05-16 11:29:25 +02:00
parent 1a72e2bc4e
commit a20043ff10

View File

@ -129,7 +129,7 @@ class SeedDMS_Core_User {
const role_admin = '1';
const role_guest = '2';
function SeedDMS_Core_User($id, $login, $pwd, $fullName, $email, $language, $theme, $comment, $role, $isHidden=0, $isDisabled=0, $pwdExpiration='', $loginFailures=0, $quota=0) {
function SeedDMS_Core_User($id, $login, $pwd, $fullName, $email, $language, $theme, $comment, $role, $isHidden=0, $isDisabled=0, $pwdExpiration='0000-00-00 00:00:00', $loginFailures=0, $quota=0) {
$this->_id = $id;
$this->_login = $login;
$this->_pwd = $pwd;
@ -200,6 +200,8 @@ class SeedDMS_Core_User {
function setPwdExpiration($newPwdExpiration) { /* {{{ */
$db = $this->_dms->getDB();
if(trim($newPwdExpiration) == '')
$newPwdExpiration = '0000-00-00 00:00:00';
$queryStr = "UPDATE tblUsers SET pwdExpiration =".$db->qstr($newPwdExpiration)." WHERE id = " . $this->_id;
$res = $db->getResult($queryStr);
if (!$res)