Beispiel #1
0
 /**
  * Query used for check accounts which expire
  *
  * @return query
  **/
 private static function queryAccountsWhichExpire()
 {
     $config = new PluginAccountsConfig();
     $notif = new PluginAccountsNotificationState();
     $config->getFromDB('1');
     $delay = $config->fields["delay_whichexpire"];
     $query = "SELECT *\n      FROM `glpi_plugin_accounts_accounts`\n      WHERE `date_expiration` IS NOT NULL\n      AND `is_deleted` = '0'\n      AND DATEDIFF(CURDATE(),`date_expiration`) > -{$delay}\n      AND DATEDIFF(CURDATE(),`date_expiration`) < 0 ";
     $query .= "AND `plugin_accounts_accountstates_id` NOT IN (999999";
     $query .= $notif->findStates();
     $query .= ") ";
     return $query;
 }