ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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

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

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

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

{
global $ilDB;
$query = "SELECT ts FROM " . self::TABLE_NAME . " WHERE usr_id = %s";
$res = $ilDB->queryF($query, array('integer'), array($user->getId()));
if($row->ts == null)
{
self::sendReminder($user, $reminderTime, $time_frame_for_deletion);
return true;
}
return false;
}

+ Here is the call graph for this function:

static ilCronDeleteInactiveUserReminderMail::flushDataTable ( )
static

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

References $ilDB.

Referenced by ilCronDeleteInactiveUserAccounts\saveCustomSettings().

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

+ Here is the caller graph for this function:

ilCronDeleteInactiveUserReminderMail::mailSent (   $usr_id)
private

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

References $ilDB.

Referenced by sendReminder().

{
global $ilDB;
$ilDB->manipulateF("INSERT INTO " . self::TABLE_NAME . " (usr_id, ts) VALUES (%s, %s)",
array(
"integer",
"integer"
),
array(
$usr_id,
time()
)
);
}

+ Here is the caller graph for this function:

static ilCronDeleteInactiveUserReminderMail::removeEntriesFromTableIfLastLoginIsNewer ( )
static

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

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

{
global $ilDB;
$query = "SELECT usr_id,ts FROM " . self::TABLE_NAME;
$res = $ilDB->queryF($query, array(
'integer',
'integer'
), array(
'usr_id',
'ts'
));
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$lastLoginUnixtime = strtotime(ilObjUser::_lookupLastLogin($row->usr_id));
$lastReminderSent = (int)$row->ts;
if($lastLoginUnixtime >= $lastReminderSent)
{
}
}
}

+ Here is the call graph for this function:

static ilCronDeleteInactiveUserReminderMail::removeSingleUserFromTable (   $usr_id)
static

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

References $ilDB, and $query.

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

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

+ Here is the caller graph for this function:

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

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

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

Referenced by checkIfReminderMailShouldBeSend().

{
include_once 'Services/User/classes/class.ilCronDeleteInactiveUserReminderMailNotification.php';
$mail->setRecipients(array($user));
$mail->setAdditionalInformation(
array(
"days" => $reminderTime,
"date" => $time_frame_for_deletion
)
);
$mail->send();
self::mailSent($user->getId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

const ilCronDeleteInactiveUserReminderMail::TABLE_NAME = "usr_cron_mail_reminder"

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