48 $this->log->write(
'Cron: Start ilCronCheckUserAccounts::check()');
51 $two_weeks_in_seconds = $now + (60 * 60 * 24 * 14);
53 $query =
"SELECT * FROM usr_data,usr_pref ".
54 "WHERE time_limit_message = '0' ".
55 "AND time_limit_unlimited = '0' ".
56 "AND time_limit_from < ".$ilDB->quote($now,
"integer").
" ".
57 "AND time_limit_until > ".$ilDB->quote($now,
"integer").
" ".
58 "AND time_limit_until < ".$ilDB->quote($two_weeks_in_seconds,
"integer").
" ".
59 "AND usr_data.usr_id = usr_pref.usr_id ".
60 "AND keyword = ".$ilDB->quote(
"language",
"text");
62 $res = $ilDB->query($query);
64 while(
$row = $ilDB->fetchObject(
$res))
66 include_once
'Services/Mail/classes/class.ilMimeMail.php';
68 $data[
'expires'] =
$row->time_limit_until;
78 $mail->From(
'noreply');
79 $mail->To(
$data[
'email']);
80 $mail->Subject($this->
txt(
$data[
'language'],
'account_expires_subject'));
81 $mail->Body($this->
txt(
$data[
'language'],
'account_expires_body').
" ".strftime(
'%Y-%m-%d %R',
$data[
'expires']));
85 $query =
"UPDATE usr_data SET time_limit_message = '1' WHERE usr_id = '".$data[
'usr_id'].
"'";
86 $this->db->query($query);
89 $this->log->write(
'Cron: (checkUserAccounts()) sent message to '.
$data[
'login'].
'.');
94 $this->log->write(
'Cron: End ilCronCheckUserAccounts::check()');
98 function txt($language,$key,$module =
'common')
100 include_once
'Services/Language/classes/class.ilLanguage.php';
108 $this->log->write(
'Cron: Start '.__METHOD__);
110 require_once
'Services/Registration/classes/class.ilRegistrationSettings.php';
113 $query =
'SELECT usr_id FROM usr_data '
114 .
'WHERE reg_hash IS NOT NULL '
116 .
'AND create_date < %s';
117 $res = $ilDB->queryF(
119 array(
'integer',
'timestamp'),
120 array(0, date(
'Y-m-d H:i:s', time() - (
int)$oRegSettigs->getRegistrationHashLifetime()))
122 while(
$row = $ilDB->fetchAssoc(
$res))
126 $this->log->write(
'Cron: Deleted '.$oUser->getLogin().
' ['.$oUser->getId().
'] '.__METHOD__);
129 $this->log->write(
'Cron: End '.__METHOD__);