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 $incomingMail = $ilSetting->get(
"mail_incoming_mail",
IL_MAIL_BOTH);
74 $statement = $ilDB->manipulateF(
'
75 INSERT INTO '.$this->table_mail_options.
'
82 VALUES(%s, %s, %s, %s, %s)',
83 array(
'integer',
'integer',
'text',
'integer',
'integer'),
84 array($this->user_id, DEFAULT_LINEBREAK, NULL, $incomingMail,
'0'));
100 $res = $ilDB->queryf(
'
101 SELECT * FROM '.$this->table_mail_options.
'
103 array(
'integer'), array($this->user_id));
107 $this->cronjob_notification = stripslashes(
$row->cronjob_notification);
108 $this->signature = stripslashes(
$row->signature);
109 $this->linebreak = stripslashes(
$row->linebreak);
110 $this->incoming_type =
$row->incoming_type;
128 function updateOptions($a_signature, $a_linebreak, $a_incoming_type, $a_cronjob_notification)
133 $data_types = array();
135 $query =
'UPDATE '.$this->table_mail_options.
'
139 array_push($data_types,
'text',
'integer');
140 array_push($data, $a_signature, $a_linebreak);
142 if ($ilias->getSetting(
'mail_notification'))
144 $query .=
'cronjob_notification = %s, ';
145 array_push($data_types,
'integer');
146 array_push($data, $a_cronjob_notification);
149 $query .=
'incoming_type = %s WHERE user_id = %s';
150 array_push($data, $a_incoming_type, $this->user_id);
151 array_push($data_types,
'integer',
'integer');
153 $statement = $ilDB->manipulateF(
$query, $data_types, $data);
155 $this->cronjob_notification = $a_cronjob_notification;
156 $this->signature = $a_signature;
157 $this->linebreak = $a_linebreak;
158 $this->incoming_type = $a_incoming_type;