Example #1
0
 public function getUserPasswordExpiredSoonByContextID($cid, $portal_item = NULL)
 {
     $days_before_expiring_sendmail = $portal_item->getDaysBeforeExpiringPasswordSendMail();
     if (isset($days_before_expiring_sendmail)) {
         $date = getCurrentDateTimePlusDaysInMySQL($days_before_expiring_sendmail);
     } else {
         $date = getCurrentDateTimePlusDaysInMySQL('14');
     }
     $user = NULL;
     $query = "SELECT * FROM " . $this->addDatabasePrefix("user") . " WHERE " . $this->addDatabasePrefix("user") . ".expire_date IS NOT NULL AND " . $this->addDatabasePrefix("user") . ".context_id = '" . encode(AS_DB, $cid) . "' AND " . $this->addDatabasePrefix("user") . ".deletion_date IS NULL AND " . $this->addDatabasePrefix("user") . ".expire_date BETWEEN now() AND '" . encode(AS_DB, $date) . "'";
     $result = $this->_db_connector->performQuery($query);
     if (!isset($result)) {
         include_once 'functions/error_functions.php';
         trigger_error('Problems selecting list of ' . $this->_type . ' items.', E_USER_WARNING);
     } else {
         foreach ($result as $rs) {
             $user_array[] = $this->_buildItem($rs);
         }
         unset($result);
         unset($query);
     }
     return $user_array;
 }
Example #2
0
 function setDaysForLoginAs($days)
 {
     $this->_addExtra('LOGIN_AS_TMSP', getCurrentDateTimePlusDaysInMySQL($days));
 }