コード例 #1
0
 /** 
  * Called if the user pushes the submit button of the mail options form.
  * Passes the post data to the mail options model instance to store them.
  * 
  * @access public
  * 
  */
 public function saveOptions()
 {
     global $lng, $ilUser, $ilSetting;
     $this->tpl->setTitle($lng->txt('mail'));
     $this->initMailOptionsForm();
     $mailOptions = new ilMailOptions($ilUser->getId());
     if ($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1' && $ilSetting->get('usr_settings_disable_mail_incoming_mail') != '1') {
         $incoming_type = (int) $_POST['incoming_type'];
     } else {
         $incoming_type = $mailOptions->getIncomingType();
     }
     if ($this->form->checkInput()) {
         $mailOptions->updateOptions(ilUtil::stripSlashes($_POST['signature']), (int) $_POST['linebreak'], $incoming_type, (int) $_POST['cronjob_notification']);
         ilUtil::sendSuccess($lng->txt('mail_options_saved'));
     }
     $this->form->setValuesByPost();
     $this->tpl->setContent($this->form->getHTML());
     $this->tpl->show();
 }
コード例 #2
0
 /** 
  * Called if the user pushes the submit button of the mail options form.
  * Passes the post data to the mail options model instance to store them.
  */
 public function saveMailOptions()
 {
     /**
      * @var $ilTabs ilTabsGUI
      * @var $lng ilLanguage
      * @var $rbacsystem ilRbacSystem
      * @var $ilUser ilObjUser
      * @var $ilSetting ilSetting
      */
     global $ilUser, $lng, $ilTabs, $ilSetting, $rbacsystem;
     include_once 'Services/Mail/classes/class.ilMailGlobalServices.php';
     if (!$rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId())) {
         $this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
     }
     $lng->loadLanguageModule('mail');
     $this->__initSubTabs('showMailOptions');
     $ilTabs->activateTab('mail_settings');
     $this->setHeader();
     require_once 'Services/Mail/classes/class.ilMailOptions.php';
     $mailOptions = new ilMailOptions($ilUser->getId());
     if ($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1' && $ilSetting->get('usr_settings_disable_mail_incoming_mail') != '1') {
         $incoming_type = (int) $_POST['incoming_type'];
     } else {
         $incoming_type = $mailOptions->getIncomingType();
     }
     $this->initMailOptionsForm();
     if ($this->form->checkInput()) {
         $mailOptions->updateOptions(ilUtil::stripSlashes($_POST['signature']), (int) $_POST['linebreak'], $incoming_type, (int) $_POST['cronjob_notification']);
         ilUtil::sendSuccess($lng->txt('mail_options_saved'));
     }
     if (!isset($_POST['incoming_type'])) {
         $_POST['incoming_type'] = $mailOptions->getIncomingType();
     }
     $this->form->setValuesByPost();
     $this->tpl->setContent($this->form->getHTML());
     $this->tpl->show();
 }
コード例 #3
0
 private function updateMailPreferences($usr_id)
 {
     if (array_key_exists("mail_incoming_type", $this->prefs) || array_key_exists("mail_signature", $this->prefs) || array_key_exists("mail_linebreak", $this->prefs)) {
         include_once "Services/Mail/classes/class.ilMailOptions.php";
         $mailOptions = new ilMailOptions($usr_id);
         $mailOptions->updateOptions(array_key_exists("mail_signature", $this->prefs) ? $this->prefs["mail_signature"] : $mailOptions->getSignature(), array_key_exists("mail_linebreak", $this->prefs) ? $this->prefs["mail_linebreak"] : $mailOptions->getLinebreak(), array_key_exists("mail_incoming_type", $this->prefs) ? $this->prefs["mail_incoming_type"] : $mailOptions->getIncomingType(), $mailOptions->getCronjobNotification());
     }
 }
コード例 #4
0
 /**
  * Reset mail options to "local only"
  * 
  */
 protected function resetMailOptions($a_usr_id)
 {
     include_once './Services/Mail/classes/class.ilMailOptions.php';
     $options = new ilMailOptions($a_usr_id);
     $options->updateOptions($options->getSignature(), $options->getLinebreak(), IL_MAIL_LOCAL, $options->getCronjobNotification());
 }