mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
sewPwdExpiration() sets date internally not 'now'
This commit is contained in:
parent
b6a308e630
commit
39ec44cd41
|
@ -76,10 +76,10 @@ class SeedDMS_Core_Role { /* {{{ */
|
||||||
* @param string|integer $id Id, login name, or email of user, depending
|
* @param string|integer $id Id, login name, or email of user, depending
|
||||||
* on the 3rd parameter.
|
* on the 3rd parameter.
|
||||||
* @param object $dms instance of dms
|
* @param object $dms instance of dms
|
||||||
* @param string $by search by [name|email]. If 'name' is passed, the method
|
* @param string $by search by name. If 'name' is passed, the method
|
||||||
* will check for the 4th paramater and also filter by email. If this
|
* will search by name instead of id. If this
|
||||||
* parameter is left empty, the user will be search by its Id.
|
* parameter is left empty, the role will be searched by its Id.
|
||||||
* @param string $email optional email address if searching for name
|
*
|
||||||
* @return object instance of class SeedDMS_Core_User
|
* @return object instance of class SeedDMS_Core_User
|
||||||
*/
|
*/
|
||||||
public static function getInstance($id, $dms, $by='') { /* {{{ */
|
public static function getInstance($id, $dms, $by='') { /* {{{ */
|
||||||
|
@ -631,10 +631,11 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
if(trim($newPwdExpiration) == '' || trim($newPwdExpiration) == 'never') {
|
if(trim($newPwdExpiration) == '' || trim($newPwdExpiration) == 'never') {
|
||||||
$newPwdExpiration = null;
|
$newPwdExpiration = null;
|
||||||
$queryStr = "UPDATE `tblUsers` SET `pwdExpiration` = NULL WHERE `id` = " . $this->_id;
|
$queryStr = "UPDATE `tblUsers` SET `pwdExpiration` = NULL WHERE `id` = " . $this->_id;
|
||||||
} elseif(trim($newPwdExpiration) == 'now')
|
} else {
|
||||||
$queryStr = "UPDATE `tblUsers` SET `pwdExpiration` =".$db->qstr(date('Y-m-d H:i:s'))." WHERE `id` = " . $this->_id;
|
if(trim($newPwdExpiration) == 'now')
|
||||||
else
|
$newPwdExpiration = date('Y-m-d H:i:s');
|
||||||
$queryStr = "UPDATE `tblUsers` SET `pwdExpiration` =".$db->qstr($newPwdExpiration)." WHERE `id` = " . $this->_id;
|
$queryStr = "UPDATE `tblUsers` SET `pwdExpiration` =".$db->qstr($newPwdExpiration)." WHERE `id` = " . $this->_id;
|
||||||
|
}
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (!$res)
|
if (!$res)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user