24 define(
"IL_MAIL_LOCAL", 0);
 
   25 define(
"IL_MAIL_EMAIL", 1);
 
   26 define(
"IL_MAIL_BOTH", 2);
 
   72                 define(
"DEFAULT_LINEBREAK",60);
 
   75                 $this->table_mail_options = 
'mail_options';
 
   77                 $this->user_id = $a_user_id;
 
   92                 if (!($incomingMail = $this->ilias->getSetting(
"mail_incoming_mail")))
 
   98                 $statement = $ilDB->manipulateF(
' 
   99                         INSERT INTO '.$this->table_mail_options.
' 
  106                         VALUES(%s, %s, %s, %s, %s)', 
 
  107                         array(
'integer', 
'integer', 
'text', 
'integer', 
'integer'),
 
  108                         array($this->user_id, DEFAULT_LINEBREAK, NULL, $incomingMail, 
'0'));
 
  124                 $res = $ilDB->queryf(
' 
  125                         SELECT * FROM '.$this->table_mail_options.
' 
  127                         array(
'integer'), array($this->user_id));
 
  131                 $this->cronjob_notification = stripslashes(
$row->cronjob_notification);
 
  132                 $this->signature = stripslashes(
$row->signature);
 
  133                 $this->linebreak = stripslashes(
$row->linebreak);
 
  134                 $this->incoming_type = 
$row->incoming_type;
 
  152         function updateOptions($a_signature, $a_linebreak, $a_incoming_type, $a_cronjob_notification)
 
  157                 $data_types = array();
 
  159                 $query = 
'UPDATE '.$this->table_mail_options.
'  
  163                 array_push($data_types, 
'text', 
'integer');
 
  164                 array_push(
$data, $a_signature, $a_linebreak);
 
  166                 if ($ilias->getSetting(
'mail_notification'))
 
  168                         $query .= 
'cronjob_notification = %s, ';
 
  169                         array_push($data_types, 
'integer');
 
  170                         array_push(
$data, $a_cronjob_notification);                     
 
  173                 $query .=
'incoming_type = %s WHERE user_id =  %s';                      
 
  174                 array_push(
$data, $a_incoming_type, $this->user_id);
 
  175                 array_push($data_types, 
'integer', 
'integer');
 
  177                 $statement = $ilDB->manipulateF(
$query, $data_types, 
$data);
 
  179                 $this->cronjob_notification = $a_cronjob_notification;
 
  180                 $this->signature = $a_signature;
 
  181                 $this->linebreak = $a_linebreak;
 
  182                 $this->incoming_type = $a_incoming_type;