4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
23 public function __construct($a_data,$a_id,$a_call_by_reference)
28 $this->lng->loadLanguageModule(
'mail');
35 if(!$ilAccess->checkAccess(
'write,read',
'', $this->object->getRefId()))
37 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'), $this->ilias->error_obj->WARNING);
42 $this->tpl->setContent($this->form->getHTML());
47 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
50 $this->form->setFormAction($this->ctrl->getFormAction($this,
'save'));
51 $this->form->setTitle($this->lng->txt(
'general_settings'));
54 $pre =
new ilTextInputGUI($this->lng->txt(
'mail_subject_prefix'),
'mail_subject_prefix');
56 $pre->setMaxLength(32);
57 $pre->setInfo($this->lng->txt(
'mail_subject_prefix_info'));
58 $this->form->addItem($pre);
61 include_once
'Services/Mail/classes/class.ilMailOptions.php';
69 $this->ctrl->setParameterByClass(
'ilobjuserfoldergui',
'ref_id',
USER_FOLDER_ID);
70 $si->setInfo(sprintf($this->lng->txt(
'mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass(
'ilobjuserfoldergui',
'settings')));
71 $this->ctrl->clearParametersByClass(
'ilobjuserfoldergui');
72 $this->form->addItem($si);
75 $ti =
new ilTextInputGUI($this->lng->txt(
'mail_external_sender_noreply'),
'mail_external_sender_noreply');
76 $ti->
setInfo($this->lng->txt(
'info_mail_external_sender_noreply'));
77 $ti->setMaxLength(255);
78 $this->form->addItem($ti);
80 $system_sender_name =
new ilTextInputGUI($this->lng->txt(
'mail_system_sender_name'),
'mail_system_sender_name');
81 $system_sender_name->
setInfo($this->lng->txt(
'mail_system_sender_name_info'));
82 $system_sender_name->setMaxLength(255);
83 $this->form->addItem($system_sender_name);
85 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'mail_use_pear_mail'),
'pear_mail_enable');
86 $cb->
setInfo($this->lng->txt(
'mail_use_pear_mail_info'));
88 $this->form->addItem($cb);
91 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'mail_prevent_smtp_globally'),
'prevent_smtp_globally');
93 $this->form->addItem($cb);
95 $cron_mail =
new ilSelectInputGUI($this->lng->txt(
'cron_mail_notification'),
'mail_notification');
96 $cron_options = array(
97 0 => $this->lng->txt(
'cron_mail_notification_never'),
98 1 => $this->lng->txt(
'cron_mail_notification_cron')
102 $cron_mail->setInfo($this->lng->txt(
'cron_mail_notification_desc'));
103 $this->form->addItem($cron_mail);
107 $sh->setTitle($this->lng->txt(
'mail').
' ('.$this->lng->txt(
'internal_system').
')');
108 $this->form->addItem($sh);
111 $ti =
new ilNumberInputGUI($this->lng->txt(
'mail_maxsize_attach'),
'mail_maxsize_attach');
113 $ti->setInfo($this->lng->txt(
'mail_max_size_attachments_total'));
114 $ti->setMaxLength(10);
116 $this->form->addItem($ti);
120 $mn->setTitle($this->lng->txt(
'mail_member_notification'));
121 $this->form->addItem($mn);
123 include_once
"Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
130 $this->form->addCommandButton(
'save', $this->lng->txt(
'save'));
135 $settings = $this->ilias->getAllSettings();
136 $this->form->setValuesByArray(array(
137 'mail_subject_prefix' => $settings[
'mail_subject_prefix'] ? $settings[
'mail_subject_prefix'] :
'[ILIAS]',
138 'mail_incoming_mail' => (
int)$settings[
'mail_incoming_mail'],
139 'pear_mail_enable' => $settings[
'pear_mail_enable'] ?
true :
false,
140 'mail_external_sender_noreply' => $settings[
'mail_external_sender_noreply'],
141 'prevent_smtp_globally' => ($settings[
'prevent_smtp_globally'] ==
'1') ?
true :
false,
142 'mail_maxsize_attach' => $settings[
'mail_maxsize_attach'],
143 'mail_notification' => $settings[
'mail_notification'],
144 'mail_system_sender_name' => $settings[
'mail_system_sender_name']
152 if(!$ilAccess->checkAccess(
'write,read',
'', $this->object->getRefId()))
154 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'), $this->ilias->error_obj->WARNING);
158 if($this->form->checkInput())
160 $this->ilias->setSetting(
'mail_subject_prefix',$this->form->getInput(
'mail_subject_prefix'));
161 $this->ilias->setSetting(
'mail_incoming_mail', (
int)$this->form->getInput(
'mail_incoming_mail'));
162 $this->ilias->setSetting(
'mail_maxsize_attach', $this->form->getInput(
'mail_maxsize_attach'));
163 $this->ilias->setSetting(
'pear_mail_enable', (
int)$this->form->getInput(
'pear_mail_enable'));
164 $this->ilias->setSetting(
'mail_external_sender_noreply', $this->form->getInput(
'mail_external_sender_noreply'));
165 $this->ilias->setSetting(
'prevent_smtp_globally', (
int)$this->form->getInput(
'prevent_smtp_globally'));
166 $this->ilias->setSetting(
'mail_notification', (
int)$this->form->getInput(
'mail_notification'));
167 $ilSetting->set(
'mail_system_sender_name', $this->form->getInput(
'mail_system_sender_name'));
171 $this->form->setValuesByPost();
173 $this->tpl->setContent($this->form->getHTML());
178 global $rbacsystem,
$lng;
180 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
182 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
184 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.mail_import.html",
"Services/Mail");
188 if($this->file_obj->findXMLFile())
190 $this->tpl->setVariable(
"TXT_IMPORTED_FILE",$lng->txt(
"checked_files"));
191 $this->tpl->setVariable(
"XML_FILE",basename($this->file_obj->getXMLFile()));
193 $this->tpl->setVariable(
"BTN_IMPORT",$this->lng->txt(
"import"));
196 $this->tpl->setVariable(
"FORMACTION",
197 $this->ctrl->getFormAction($this));
198 $this->tpl->setVariable(
"TXT_IMPORT_MAIL",$this->lng->txt(
"table_mail_import"));
199 $this->tpl->setVariable(
"TXT_IMPORT_FILE",$this->lng->txt(
"mail_import_file"));
200 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
"cancel"));
201 $this->tpl->setVariable(
"BTN_UPLOAD",$this->lng->txt(
"upload"));
208 global $rbacsystem,
$lng;
210 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
212 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
215 $this->file_obj->findXMLFile();
217 $this->parser_obj->startParsing();
218 $number = $this->parser_obj->getCountImported();
221 $this->ctrl->redirect($this,
"import");
228 global $rbacsystem,
$lng;
230 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
232 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
236 if(!$this->file_obj->storeUploadedFile($_FILES[
"importFile"]))
238 $this->message = $lng->txt(
"import_file_not_valid");
239 $this->file_obj->unlinkLast();
241 else if(!$this->file_obj->unzip())
243 $this->message = $lng->txt(
"cannot_unzip_file");
244 $this->file_obj->unlinkLast();
246 else if(!$this->file_obj->findXMLFile())
248 $this->message = $lng->txt(
"cannot_find_xml");
249 $this->file_obj->unlinkLast();
253 $this->message = $lng->txt(
"error_parser");
255 else if(!$this->parser_obj->startParsing())
257 $this->message = $lng->txt(
"users_not_imported").
":<br/>";
258 $this->message .= $this->parser_obj->getNotAssignableUsers();
263 $this->message = $lng->txt(
"uploaded_and_checked");
267 $this->ctrl->redirect($this,
"import");
273 include_once
"./Services/Mail/classes/class.ilFileDataImportMail.php";
281 include_once
"Services/Mail/classes/class.ilMailImportParser.php";
295 $next_class = $this->ctrl->getNextClass($this);
296 $cmd = $this->ctrl->getCmd();
301 case 'ilpermissiongui':
302 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
304 $ret =& $this->ctrl->forwardCommand($perm_gui);
334 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
336 $tabs_gui->addTarget(
"settings",
337 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
'save',
""),
"",
"");
340 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
342 $tabs_gui->addTarget(
"perm_settings",
343 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
350 public static function _goto($a_target)
354 require_once
'Services/Mail/classes/class.ilMail.php';
356 if($rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId()))
363 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
365 $_GET[
"cmd"] =
"frameset";
366 $_GET[
"target"] =
"";
367 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
368 $_GET[
"baseClass"] =
"ilRepositoryGUI";
371 include(
"ilias.php");
375 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);