ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCronDeleteInactiveUserReminderMail Class Reference
+ Collaboration diagram for ilCronDeleteInactiveUserReminderMail:

Static Public Member Functions

static removeEntriesFromTableIfLastLoginIsNewer ()
 
static checkIfReminderMailShouldBeSend (ilObjUser $user, $reminderTime, $time_frame_for_deletion)
 
static flushDataTable ()
 
static removeSingleUserFromTable ($usr_id)
 

Data Fields

const TABLE_NAME = "usr_cron_mail_reminder"
 

Static Private Member Functions

static mailSent ($usr_id)
 
static sendReminder (ilObjUser $user, $reminderTime, $time_frame_for_deletion)
 

Detailed Description

Member Function Documentation

◆ checkIfReminderMailShouldBeSend()

static ilCronDeleteInactiveUserReminderMail::checkIfReminderMailShouldBeSend ( ilObjUser  $user,
  $reminderTime,
  $time_frame_for_deletion 
)
static

Definition at line 72 of file class.ilCronDeleteInactiveUserReminderMail.php.

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and ilObject\getId().

Referenced by ilCronDeleteInactiveUserAccounts\hasCustomSettings().

73  {
74  global $DIC;
75 
76  $ilDB = $DIC['ilDB'];
77  $query = "SELECT ts FROM " . self::TABLE_NAME . " WHERE usr_id = %s";
78  $res = $ilDB->queryF($query, array('integer'), array($user->getId()));
80  if ($row->ts == null) {
81  self::sendReminder($user, $reminderTime, $time_frame_for_deletion);
82  return true;
83  }
84  return false;
85  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
getId()
get object id public
$query
$row
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flushDataTable()

static ilCronDeleteInactiveUserReminderMail::flushDataTable ( )
static

Definition at line 87 of file class.ilCronDeleteInactiveUserReminderMail.php.

References $DIC, and $ilDB.

Referenced by ilCronDeleteInactiveUserAccounts\saveCustomSettings().

88  {
89  global $DIC;
90 
91  $ilDB = $DIC['ilDB'];
92  $ilDB->manipulate("DELETE FROM " . self::TABLE_NAME);
93  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ mailSent()

static ilCronDeleteInactiveUserReminderMail::mailSent (   $usr_id)
staticprivate

Definition at line 16 of file class.ilCronDeleteInactiveUserReminderMail.php.

References $DIC, and $ilDB.

17  {
18  global $DIC;
19 
20  $ilDB = $DIC['ilDB'];
21  $ilDB->manipulateF(
22  "INSERT INTO " . self::TABLE_NAME . " (usr_id, ts) VALUES (%s, %s)",
23  array(
24  "integer",
25  "integer"
26  ),
27  array(
28  $usr_id,
29  time()
30  )
31  );
32  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ removeEntriesFromTableIfLastLoginIsNewer()

static ilCronDeleteInactiveUserReminderMail::removeEntriesFromTableIfLastLoginIsNewer ( )
static

Definition at line 50 of file class.ilCronDeleteInactiveUserReminderMail.php.

References $DIC, $ilDB, $query, $res, $row, ilObjUser\_lookupLastLogin(), ilDBConstants\FETCHMODE_OBJECT, and if.

Referenced by ilCronDeleteInactiveUserAccounts\hasCustomSettings().

51  {
52  global $DIC;
53 
54  $ilDB = $DIC['ilDB'];
55  $query = "SELECT usr_id,ts FROM " . self::TABLE_NAME;
56  $res = $ilDB->queryF($query, array(
57  'integer',
58  'integer'
59  ), array(
60  'usr_id',
61  'ts'
62  ));
63  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
64  $lastLoginUnixtime = strtotime(ilObjUser::_lookupLastLogin($row->usr_id));
65  $lastReminderSent = (int) $row->ts;
66  if ($lastLoginUnixtime >= $lastReminderSent) {
67  self::removeSingleUserFromTable($row->usr_id);
68  }
69  }
70  }
global $DIC
Definition: saml.php:7
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
static _lookupLastLogin($a_user_id)
lookup last login
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeSingleUserFromTable()

static ilCronDeleteInactiveUserReminderMail::removeSingleUserFromTable (   $usr_id)
static

Definition at line 95 of file class.ilCronDeleteInactiveUserReminderMail.php.

References $DIC, $ilDB, and $query.

Referenced by ilObjUser\delete().

96  {
97  global $DIC;
98 
99  $ilDB = $DIC['ilDB'];
100  $query = "DELETE FROM " . self::TABLE_NAME . " WHERE usr_id = %s";
101  $ilDB->manipulateF($query, array('integer'), array($usr_id));
102  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the caller graph for this function:

◆ sendReminder()

static ilCronDeleteInactiveUserReminderMail::sendReminder ( ilObjUser  $user,
  $reminderTime,
  $time_frame_for_deletion 
)
staticprivate

Definition at line 34 of file class.ilCronDeleteInactiveUserReminderMail.php.

References ilUtil\_getHttpPath(), and ilObject\getId().

35  {
36  include_once 'Services/User/classes/class.ilCronDeleteInactiveUserReminderMailNotification.php';
38  $mail->setRecipients(array($user));
39  $mail->setAdditionalInformation(
40  array(
41  "www" => ilUtil::_getHttpPath(),
42  "days" => $reminderTime,
43  "date" => $time_frame_for_deletion
44  )
45  );
46  $mail->send();
47  self::mailSent($user->getId());
48  }
getId()
get object id public
static _getHttpPath()
+ Here is the call graph for this function:

Field Documentation

◆ TABLE_NAME

const ilCronDeleteInactiveUserReminderMail::TABLE_NAME = "usr_cron_mail_reminder"

The documentation for this class was generated from the following file: