4 define(
"IL_MAIL_LOCAL", 0);
5 define(
"IL_MAIL_EMAIL", 1);
6 define(
"IL_MAIL_BOTH", 2);
52 define(
"DEFAULT_LINEBREAK",60);
55 $this->table_mail_options =
'mail_options';
57 $this->user_id = $a_user_id;
70 $incomingMail = $ilSetting->get(
'mail_incoming_mail') ? $ilSetting->get(
'mail_incoming_mail'):
IL_MAIL_LOCAL;
71 $ilDB->insert(
'mail_options',
73 'user_id' =>
array(
'integer', $this->user_id),
74 'linebreak' =>
array(
'integer', DEFAULT_LINEBREAK),
75 'signature' =>
array(
'text', NULL),
76 'incoming_type' =>
array(
'integer', $incomingMail),
77 'cronjob_notification' =>
array(
'integer', 0)
94 $res = $ilDB->queryf(
' 95 SELECT * FROM '.$this->table_mail_options.
' 101 $this->cronjob_notification = stripslashes(
$row->cronjob_notification);
102 $this->signature = stripslashes(
$row->signature);
103 $this->linebreak = stripslashes(
$row->linebreak);
104 $this->incoming_type =
$row->incoming_type;
122 public function updateOptions($a_signature, $a_linebreak, $a_incoming_type, $a_cronjob_notification)
130 $this->cronjob_notification = $a_cronjob_notification;
131 $this->signature = $a_signature;
132 $this->linebreak = $a_linebreak;
133 $this->incoming_type = $a_incoming_type;
136 'signature' =>
array(
'text', $this->signature),
137 'linebreak' =>
array(
'integer', $this->linebreak),
138 'incoming_type' =>
array(
'integer', $this->incoming_type)
140 if($ilSetting->get(
'mail_notification'))
142 $data[
'cronjob_notification'] =
array(
'integer', $this->cronjob_notification);
146 $data[
'cronjob_notification'] =
array(
'integer', self::lookupNotificationSetting($this->user_id));
150 $this->table_mail_options,
152 'user_id' =>
array(
'integer', $this->user_id)
197 protected static function lookupNotificationSetting($usr_id)
204 $query =
"SELECT cronjob_notification FROM mail_options WHERE user_id = " . $ilDB->quote($usr_id,
'integer');
205 $row = $ilDB->fetchAssoc($ilDB->query(
$query));
206 return (
int)
$row[
'cronjob_notification'];
Class UserMail this class handles user mails.
getLinebreak()
get linebreak of user public
getOptions()
get options of user and set variables $signature and $linebreak this method shouldn't bew called from...
createMailOptionsEntry()
create entry in table_mail_options for a new user this method should only be called from createUser()...
__construct($a_user_id)
Constructor setup an mail object.
redirection script todo: (a better solution should control the processing via a xml file) ...
Create styles array
The data for the language used.
static _lookupEmail($a_user_id)
Lookup email.
getSignature()
get signature of user public