ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 68 of file class.ilCronDeleteInactiveUserReminderMail.php.

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

Referenced by ilCronDeleteInactiveUserAccounts\hasCustomSettings().

69  {
70  global $ilDB;
71  $query = "SELECT ts FROM " . self::TABLE_NAME . " WHERE usr_id = %s";
72  $res = $ilDB->queryF($query, array('integer'), array($user->getId()));
74  if ($row->ts == null) {
75  self::sendReminder($user, $reminderTime, $time_frame_for_deletion);
76  return true;
77  }
78  return false;
79  }
foreach($_POST as $key=> $value) $res
getId()
get object id public
$query
Create styles array
The data for the language used.
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 81 of file class.ilCronDeleteInactiveUserReminderMail.php.

References $ilDB.

Referenced by ilCronDeleteInactiveUserAccounts\saveCustomSettings().

82  {
83  global $ilDB;
84  $ilDB->manipulate("DELETE FROM " . self::TABLE_NAME);
85  }
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 $ilDB, array, and time.

17  {
18  global $ilDB;
19  $ilDB->manipulateF(
20  "INSERT INTO " . self::TABLE_NAME . " (usr_id, ts) VALUES (%s, %s)",
21  array(
22  "integer",
23  "integer"
24  ),
25  array(
26  $usr_id,
27  time()
28  )
29  );
30  }
Create styles array
The data for the language used.
global $ilDB
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.

◆ removeEntriesFromTableIfLastLoginIsNewer()

static ilCronDeleteInactiveUserReminderMail::removeEntriesFromTableIfLastLoginIsNewer ( )
static

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

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

Referenced by ilCronDeleteInactiveUserAccounts\hasCustomSettings().

49  {
50  global $ilDB;
51  $query = "SELECT usr_id,ts FROM " . self::TABLE_NAME;
52  $res = $ilDB->queryF($query, array(
53  'integer',
54  'integer'
55  ), array(
56  'usr_id',
57  'ts'
58  ));
59  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
60  $lastLoginUnixtime = strtotime(ilObjUser::_lookupLastLogin($row->usr_id));
61  $lastReminderSent = (int) $row->ts;
62  if ($lastLoginUnixtime >= $lastReminderSent) {
63  self::removeSingleUserFromTable($row->usr_id);
64  }
65  }
66  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
static _lookupLastLogin($a_user_id)
lookup last login
PHPExcel root directory.
Definition: Database.php:30
+ 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 87 of file class.ilCronDeleteInactiveUserReminderMail.php.

References $ilDB, $query, and array.

Referenced by ilObjUser\delete().

88  {
89  global $ilDB;
90  $query = "DELETE FROM " . self::TABLE_NAME . " WHERE usr_id = %s";
91  $ilDB->manipulateF($query, array('integer'), array($usr_id));
92  }
$query
Create styles array
The data for the language used.
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 32 of file class.ilCronDeleteInactiveUserReminderMail.php.

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

33  {
34  include_once 'Services/User/classes/class.ilCronDeleteInactiveUserReminderMailNotification.php';
36  $mail->setRecipients(array($user));
37  $mail->setAdditionalInformation(
38  array(
39  "www" => ilUtil::_getHttpPath(),
40  "days" => $reminderTime,
41  "date" => $time_frame_for_deletion
42  )
43  );
44  $mail->send();
45  self::mailSent($user->getId());
46  }
getId()
get object id public
Create styles array
The data for the language used.
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: