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.

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 }
static sendReminder(ilObjUser $user, $reminderTime, $time_frame_for_deletion)
$user
Definition: migrateto20.php:57
$row
$query
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB

References $DIC, $ilDB, $query, $res, $row, $user, ilDBConstants\FETCHMODE_OBJECT, and sendReminder().

+ Here is the call graph for this function:

◆ flushDataTable()

static ilCronDeleteInactiveUserReminderMail::flushDataTable ( )
static

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

88 {
89 global $DIC;
90
91 $ilDB = $DIC['ilDB'];
92 $ilDB->manipulate("DELETE FROM " . self::TABLE_NAME);
93 }

References $DIC, and $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 $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 }

References $DIC, and $ilDB.

Referenced by sendReminder().

+ Here is the caller graph for this function:

◆ removeEntriesFromTableIfLastLoginIsNewer()

static ilCronDeleteInactiveUserReminderMail::removeEntriesFromTableIfLastLoginIsNewer ( )
static

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

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) {
68 }
69 }
70 }
static _lookupLastLogin($a_user_id)
lookup last login
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12

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

+ Here is the call graph for this function:

◆ removeSingleUserFromTable()

static ilCronDeleteInactiveUserReminderMail::removeSingleUserFromTable (   $usr_id)
static

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

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 }

References $DIC, $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 34 of file class.ilCronDeleteInactiveUserReminderMail.php.

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

References $user, ilUtil\_getHttpPath(), 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: