48 $two_weeks_in_seconds = 60 * 60 * 24 * 14;
50 $this->log->write(
'Cron: Start ilCronCheckUserAccounts::check()');
52 $query =
"SELECT * FROM usr_data,usr_pref ".
53 "WHERE time_limit_message = '0' ".
54 "AND time_limit_unlimited = '0' ".
55 "AND time_limit_from < ".$ilDB->quote(time(),
"integer").
" ".
56 "AND time_limit_until > ".$ilDB->quote($two_weeks_in_seconds,
"integer").
" ".
57 "AND usr_data.usr_id = usr_pref.usr_id ".
58 "AND keyword = ".$ilDB->quote(
"language",
"text");
62 while(
$row = $ilDB->fetchObject(
$res))
64 include_once
'Services/Mail/classes/class.ilMimeMail.php';
66 $data[
'expires'] =
$row->time_limit_until;
76 $mail->From(
'noreply');
77 $mail->To(
$data[
'email']);
78 $mail->Subject($this->
txt(
$data[
'language'],
'account_expires_subject'));
79 $mail->Body($this->
txt(
$data[
'language'],
'account_expires_body').
" ".strftime(
'%Y-%m-%d %R',
$data[
'expires']));
83 $query =
"UPDATE usr_data SET time_limit_message = '1' WHERE usr_id = '".$data[
'usr_id'].
"'";
87 $this->log->write(
'Cron: (checkUserAccounts()) sent message to '.
$data[
'login'].
'.');
92 $this->log->write(
'Cron: End ilCronCheckUserAccounts::check()');
96 function txt($language,$key,$module =
'common')
98 include_once
'Services/Language/classes/class.ilLanguage.php';
106 $this->log->write(
'Cron: Start '.__METHOD__);
108 require_once
'Services/Registration/classes/class.ilRegistrationSettings.php';
111 $query =
'SELECT usr_id FROM usr_data '
112 .
'WHERE reg_hash IS NOT NULL '
114 .
'AND create_date < %s';
115 $res = $ilDB->queryF(
117 array(
'integer',
'timestamp'),
118 array(0, date(
'Y-m-d H:i:s', time() - (
int)$oRegSettigs->getRegistrationHashLifetime()))
120 while(
$row = $ilDB->fetchAssoc(
$res))
124 $this->log->write(
'Cron: Deleted '.$oUser->getLogin().
' ['.$oUser->getId().
'] '.__METHOD__);
127 $this->log->write(
'Cron: End '.__METHOD__);