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.

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 }
static sendReminder(ilObjUser $user, $reminderTime, $time_frame_for_deletion)
getId()
get object id @access public
$query
foreach($_POST as $key=> $value) $res
global $ilDB

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

+ Here is the call graph for this function:

◆ flushDataTable()

static ilCronDeleteInactiveUserReminderMail::flushDataTable ( )
static

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

82 {
83 global $ilDB;
84 $ilDB->manipulate("DELETE FROM " . self::TABLE_NAME);
85 }

References $ilDB.

Referenced by ilCronDeleteInactiveUserAccounts\saveCustomSettings().

+ Here is the caller graph for this function:

◆ mailSent()

static ilCronDeleteInactiveUserReminderMail::mailSent (   $usr_id)
staticprivate

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

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 }

References $ilDB.

Referenced by sendReminder().

+ Here is the caller graph for this function:

◆ removeEntriesFromTableIfLastLoginIsNewer()

static ilCronDeleteInactiveUserReminderMail::removeEntriesFromTableIfLastLoginIsNewer ( )
static

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

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) {
64 }
65 }
66 }
PHPExcel root directory.
Definition: PHPExcel.php:30
static _lookupLastLogin($a_user_id)
lookup last login

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

+ Here is the call graph for this function:

◆ removeSingleUserFromTable()

static ilCronDeleteInactiveUserReminderMail::removeSingleUserFromTable (   $usr_id)
static

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

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 }

References $ilDB, and $query.

Referenced by ilObjUser\delete(), and removeEntriesFromTableIfLastLoginIsNewer().

+ 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.

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 }
static _getHttpPath()

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

Referenced by checkIfReminderMailShouldBeSend().

+ Here is the call graph for this function:
+ Here is the caller 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: