mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
set pwdExperiation to a valid date before saving in database
This commit is contained in:
parent
1a72e2bc4e
commit
a20043ff10
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user