From e6e0611937053370a4e06a47fa937d6cc20bb98b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 14 Feb 2017 11:34:10 +0100 Subject: [PATCH] pwdexpiration can be 'never' or 'now' --- SeedDMS_Core/Core/inc.ClassDMS.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index c109a33b3..14d9066e0 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -1279,8 +1279,10 @@ class SeedDMS_Core_DMS { } if($role == '') $role = '0'; - if(trim($pwdexpiration) == '') + if(trim($pwdexpiration) == '' || trim($pwdexpiration) == 'never') $pwdexpiration = '0000-00-00 00:00:00'; + elseif(trim($pwdexpiration) == 'now') + $pwdexpiration = 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)."', ".$db->qstr($pwdexpiration).", '".intval($quota)."', ".($homefolder ? intval($homefolder) : "NULL").")"; $res = $this->db->getResult($queryStr); if (!$res)