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;
72 if (!($incomingMail = $this->ilias->getSetting(
"mail_incoming_mail")))
78 $statement = $ilDB->manipulateF(
'
79 INSERT INTO '.$this->table_mail_options.
'
86 VALUES(%s, %s, %s, %s, %s)',
87 array(
'integer',
'integer',
'text',
'integer',
'integer'),
88 array($this->user_id, DEFAULT_LINEBREAK, NULL, $incomingMail,
'0'));
104 $res = $ilDB->queryf(
'
105 SELECT * FROM '.$this->table_mail_options.
'
107 array(
'integer'), array($this->user_id));
111 $this->cronjob_notification = stripslashes(
$row->cronjob_notification);
112 $this->signature = stripslashes(
$row->signature);
113 $this->linebreak = stripslashes(
$row->linebreak);
114 $this->incoming_type =
$row->incoming_type;
132 function updateOptions($a_signature, $a_linebreak, $a_incoming_type, $a_cronjob_notification)
137 $data_types = array();
139 $query =
'UPDATE '.$this->table_mail_options.
'
143 array_push($data_types,
'text',
'integer');
144 array_push(
$data, $a_signature, $a_linebreak);
146 if ($ilias->getSetting(
'mail_notification'))
148 $query .=
'cronjob_notification = %s, ';
149 array_push($data_types,
'integer');
150 array_push(
$data, $a_cronjob_notification);
153 $query .=
'incoming_type = %s WHERE user_id = %s';
154 array_push(
$data, $a_incoming_type, $this->user_id);
155 array_push($data_types,
'integer',
'integer');
157 $statement = $ilDB->manipulateF(
$query, $data_types,
$data);
159 $this->cronjob_notification = $a_cronjob_notification;
160 $this->signature = $a_signature;
161 $this->linebreak = $a_linebreak;
162 $this->incoming_type = $a_incoming_type;