42 define(
'SOCKET_TIMEOUT',5);
49 include_once
'../Services/Logging/classes/class.ilLog.php';
56 function txt($language,$key,$module =
'common')
58 $query =
"SELECT value FROM lng_data ".
59 "WHERE module = '".$module.
"' ".
60 "AND identifier = '".$key.
"' ".
61 "AND lang_key = '".$language.
"'";
63 $res = $this->db->query($query);
68 return $value ? $value : $key;
87 $two_weeks_in_seconds = 60 * 60 * 24 * 14;
89 $this->log->write(
'Cron: Start checkUserAccounts()');
90 $query =
"SELECT * FROM usr_data,usr_pref ".
91 "WHERE time_limit_message = '0' ".
92 "AND time_limit_unlimited = '0' ".
93 "AND time_limit_from < '".time().
"' ".
94 "AND time_limit_until > '".$two_weeks_in_seconds.
"' ".
95 "AND usr_data.usr_id = usr_pref.usr_id ".
96 "AND keyword = 'language'";
98 $res = $this->db->query($query);
102 include_once
'../Services/Mail/classes/class.ilMimeMail.php';
104 $data[
'expires'] = $row->time_limit_until;
105 $data[
'email'] = $row->email;
106 $data[
'login'] = $row->login;
107 $data[
'usr_id'] = $row->usr_id;
108 $data[
'language'] = $row->value;
109 $data[
'owner'] = $row->time_limit_owner;
112 $query =
"SELECT email FROM usr_data WHERE usr_id = '".$data[
'owner'].
"'";
114 $res2 = $this->db->query($query);
124 $mail->To(
$data[
'email']);
125 $mail->Subject($this->
txt(
$data[
'language'],
'account_expires_subject'));
126 $mail->Body($this->
txt(
$data[
'language'],
'account_expires_body').
" ".strftime(
'%Y-%m-%d %R',
$data[
'expires']));
130 $query =
"UPDATE usr_data SET time_limit_message = '1' WHERE usr_id = '".$data[
'usr_id'].
"'";
131 $this->db->query($query);
134 $this->log->write(
'Cron: (checkUserAccounts()) sent message to '.
$data[
'login'].
'.');
142 include_once
'../classes/class.ilLinkChecker.php';
145 $link_checker->setMailStatus(
true);
147 $invalid = $link_checker->checkLinks();
148 foreach($link_checker->getLogMessages() as $message)
150 $this->log->write($message);
158 $query =
"SELECT * FROM settings ".
159 "WHERE keyword = '".$a_keyword.
"'";
161 $res = $this->db->query($query);
164 return $row->value ? $row->value : 0;