ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCronCheckUserAccounts Class Reference
+ Collaboration diagram for ilCronCheckUserAccounts:

Public Member Functions

 ilCronCheckUserAccounts ()
 check ()
 txt ($language, $key, $module= 'common')

Protected Member Functions

 checkNotConfirmedUserAccounts ()

Detailed Description

Definition at line 34 of file class.ilCronCheckUserAccounts.php.

Member Function Documentation

ilCronCheckUserAccounts::check ( )

Definition at line 44 of file class.ilCronCheckUserAccounts.php.

References $data, $ilDB, $query, $res, $row, checkNotConfirmedUserAccounts(), and txt().

{
global $ilDB;
$two_weeks_in_seconds = 60 * 60 * 24 * 14;
$this->log->write('Cron: Start ilCronCheckUserAccounts::check()');
$query = "SELECT * FROM usr_data,usr_pref ".
"WHERE time_limit_message = '0' ".
"AND time_limit_unlimited = '0' ".
"AND time_limit_from < ".$ilDB->quote(time(), "integer")." ".
"AND time_limit_until > ".$ilDB->quote($two_weeks_in_seconds, "integer")." ".
"AND usr_data.usr_id = usr_pref.usr_id ".
"AND keyword = ".$ilDB->quote("language", "text");
$res = $ilDB->query($query);
while($row = $ilDB->fetchObject($res))
{
include_once 'Services/Mail/classes/class.ilMimeMail.php';
$data['expires'] = $row->time_limit_until;
$data['email'] = $row->email;
$data['login'] = $row->login;
$data['usr_id'] = $row->usr_id;
$data['language'] = $row->value;
$data['owner'] = $row->time_limit_owner;
// Send mail
$mail =& new ilMimeMail();
$mail->From('noreply');
$mail->To($data['email']);
$mail->Subject($this->txt($data['language'],'account_expires_subject'));
$mail->Body($this->txt($data['language'],'account_expires_body')." ".strftime('%Y-%m-%d %R',$data['expires']));
$mail->send();
// set status 'mail sent'
$query = "UPDATE usr_data SET time_limit_message = '1' WHERE usr_id = '".$data['usr_id']."'";
$this->db->query($query);
// Send log message
$this->log->write('Cron: (checkUserAccounts()) sent message to '.$data['login'].'.');
}
$this->log->write('Cron: End ilCronCheckUserAccounts::check()');
}

+ Here is the call graph for this function:

ilCronCheckUserAccounts::checkNotConfirmedUserAccounts ( )
protected

Definition at line 102 of file class.ilCronCheckUserAccounts.php.

References $ilDB, $query, $res, $row, and ilObjectFactory\getInstanceByObjId().

Referenced by check().

{
global $ilDB;
$this->log->write('Cron: Start '.__METHOD__);
require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
$oRegSettigs = new ilRegistrationSettings();
$query = 'SELECT usr_id FROM usr_data '
. 'WHERE reg_hash IS NOT NULL '
. 'AND active = %s '
. 'AND create_date < %s';
$res = $ilDB->queryF(
array('integer', 'timestamp'),
array(0, date('Y-m-d H:i:s', time() - (int)$oRegSettigs->getRegistrationHashLifetime()))
);
while($row = $ilDB->fetchAssoc($res))
{
$oUser = ilObjectFactory::getInstanceByObjId((int)$row['usr_id']);
$oUser->delete();
$this->log->write('Cron: Deleted '.$oUser->getLogin().' ['.$oUser->getId().'] '.__METHOD__);
}
$this->log->write('Cron: End '.__METHOD__);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCronCheckUserAccounts::ilCronCheckUserAccounts ( )

Definition at line 36 of file class.ilCronCheckUserAccounts.php.

References $ilDB, and $ilLog.

{
global $ilLog,$ilDB;
$this->log =& $ilLog;
$this->db =& $ilDB;
}
ilCronCheckUserAccounts::txt (   $language,
  $key,
  $module = 'common' 
)

Definition at line 96 of file class.ilCronCheckUserAccounts.php.

References ilLanguage\_lookupEntry().

Referenced by check().

{
include_once 'Services/Language/classes/class.ilLanguage.php';
return ilLanguage::_lookupEntry($language, $module, $key);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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