ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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"
 

Private Member Functions

 mailSent ($usr_id)
 
 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 69 of file class.ilCronDeleteInactiveUserReminderMail.php.

70 {
71 global $ilDB;
72 $query = "SELECT ts FROM " . self::TABLE_NAME . " WHERE usr_id = %s";
73 $res = $ilDB->queryF($query, array('integer'), array($user->getId()));
74 $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
75 if($row->ts == null)
76 {
77 self::sendReminder($user, $reminderTime, $time_frame_for_deletion);
78 return true;
79 }
80 return false;
81 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
sendReminder(ilObjUser $user, $reminderTime, $time_frame_for_deletion)
getId()
get object id @access public
global $ilDB

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

+ Here is the call graph for this function:

◆ flushDataTable()

static ilCronDeleteInactiveUserReminderMail::flushDataTable ( )
static

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

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

References $ilDB.

Referenced by ilCronDeleteInactiveUserAccounts\saveCustomSettings().

+ Here is the caller graph for this function:

◆ mailSent()

ilCronDeleteInactiveUserReminderMail::mailSent (   $usr_id)
private

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

17 {
18 global $ilDB;
19 $ilDB->manipulateF("INSERT INTO " . self::TABLE_NAME . " (usr_id, ts) VALUES (%s, %s)",
20 array(
21 "integer",
22 "integer"
23 ),
24 array(
25 $usr_id,
26 time()
27 )
28 );
29 }

References $ilDB.

Referenced by sendReminder().

+ Here is the caller graph for this function:

◆ removeEntriesFromTableIfLastLoginIsNewer()

static ilCronDeleteInactiveUserReminderMail::removeEntriesFromTableIfLastLoginIsNewer ( )
static

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

48 {
49 global $ilDB;
50 $query = "SELECT usr_id,ts FROM " . self::TABLE_NAME;
51 $res = $ilDB->queryF($query, array(
52 'integer',
53 'integer'
54 ), array(
55 'usr_id',
56 'ts'
57 ));
58 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
59 {
60 $lastLoginUnixtime = strtotime(ilObjUser::_lookupLastLogin($row->usr_id));
61 $lastReminderSent = (int)$row->ts;
62 if($lastLoginUnixtime >= $lastReminderSent)
63 {
65 }
66 }
67 }
_lookupLastLogin($a_user_id)
lookup last login

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

+ Here is the call graph for this function:

◆ removeSingleUserFromTable()

static ilCronDeleteInactiveUserReminderMail::removeSingleUserFromTable (   $usr_id)
static

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

90 {
91 global $ilDB;
92 $query = "DELETE FROM " . self::TABLE_NAME . " WHERE usr_id = %s";
93 $ilDB->manipulateF($query, array('integer'), array($usr_id));
94 }

References $ilDB, and $query.

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

+ Here is the caller graph for this function:

◆ sendReminder()

ilCronDeleteInactiveUserReminderMail::sendReminder ( ilObjUser  $user,
  $reminderTime,
  $time_frame_for_deletion 
)
private

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

32 {
33 include_once 'Services/User/classes/class.ilCronDeleteInactiveUserReminderMailNotification.php';
35 $mail->setRecipients(array($user));
36 $mail->setAdditionalInformation(
37 array(
38 "www" => ilUtil::_getHttpPath(),
39 "days" => $reminderTime,
40 "date" => $time_frame_for_deletion
41 )
42 );
43 $mail->send();
44 self::mailSent($user->getId());
45 }
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: