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 ilTextInputGUI($this->lng->txt(
'mail_maxsize_attach'),
'mail_maxsize_attach');
112 $ti->
setInfo($this->lng->txt(
'kb'));
113 $ti->setMaxLength(10);
115 $this->form->addItem($ti);
119 $mn->setTitle($this->lng->txt(
'mail_member_notification'));
120 $this->form->addItem($mn);
123 $cn =
new ilCheckboxInputGUI($this->lng->txt(
'mail_enable_crs_member_notification'),
'mail_crs_member_notification');
124 $cn->
setInfo($this->lng->txt(
'mail_enable_crs_member_notification_info'));
125 $this->form->addItem($cn);
128 $gn =
new ilCheckboxInputGUI($this->lng->txt(
'mail_enable_grp_member_notification'),
'mail_grp_member_notification');
129 $gn->
setInfo($this->lng->txt(
'mail_enable_grp_member_notification_info'));
130 $this->form->addItem($gn);
132 $this->form->addCommandButton(
'save', $this->lng->txt(
'save'));
137 $settings = $this->ilias->getAllSettings();
138 $this->form->setValuesByArray(array(
139 'mail_subject_prefix' => $settings[
'mail_subject_prefix'] ? $settings[
'mail_subject_prefix'] :
'[ILIAS]',
140 'mail_incoming_mail' => (
int)$settings[
'mail_incoming_mail'],
141 'pear_mail_enable' => $settings[
'pear_mail_enable'] ?
true :
false,
142 'mail_external_sender_noreply' => $settings[
'mail_external_sender_noreply'],
143 'prevent_smtp_globally' => ($settings[
'prevent_smtp_globally'] ==
'1') ?
true :
false,
144 'mail_maxsize_attach' => $settings[
'mail_maxsize_attach'],
145 'mail_notification' => $settings[
'mail_notification'],
146 'mail_crs_member_notification' => isset($settings[
'mail_crs_member_notification']) ? $settings[
'mail_crs_member_notification'] : 1,
147 'mail_grp_member_notification' => isset($settings[
'mail_grp_member_notification']) ? $settings[
'mail_grp_member_notification'] : 1,
148 'mail_system_sender_name' => $settings[
'mail_system_sender_name']
156 if(!$ilAccess->checkAccess(
'write,read',
'', $this->object->getRefId()))
158 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'), $this->ilias->error_obj->WARNING);
162 if($this->form->checkInput())
164 $this->ilias->setSetting(
'mail_subject_prefix',$this->form->getInput(
'mail_subject_prefix'));
165 $this->ilias->setSetting(
'mail_incoming_mail', (
int)$this->form->getInput(
'mail_incoming_mail'));
166 $this->ilias->setSetting(
'mail_maxsize_attach', $this->form->getInput(
'mail_maxsize_attach'));
167 $this->ilias->setSetting(
'pear_mail_enable', (
int)$this->form->getInput(
'pear_mail_enable'));
168 $this->ilias->setSetting(
'mail_external_sender_noreply', $this->form->getInput(
'mail_external_sender_noreply'));
169 $this->ilias->setSetting(
'prevent_smtp_globally', (
int)$this->form->getInput(
'prevent_smtp_globally'));
170 $this->ilias->setSetting(
'mail_notification', (
int)$this->form->getInput(
'mail_notification'));
171 $ilSetting->set(
'mail_crs_member_notification', (
int) $this->form->getInput(
'mail_crs_member_notification'));
172 $ilSetting->set(
'mail_grp_member_notification', (
int) $this->form->getInput(
'mail_grp_member_notification'));
173 $ilSetting->set(
'mail_system_sender_name', $this->form->getInput(
'mail_system_sender_name'));
177 $this->form->setValuesByPost();
179 $this->tpl->setContent($this->form->getHTML());
184 global $rbacsystem,
$lng;
186 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
188 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
190 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.mail_import.html",
"Services/Mail");
194 if($this->file_obj->findXMLFile())
196 $this->tpl->setVariable(
"TXT_IMPORTED_FILE",$lng->txt(
"checked_files"));
197 $this->tpl->setVariable(
"XML_FILE",basename($this->file_obj->getXMLFile()));
199 $this->tpl->setVariable(
"BTN_IMPORT",$this->lng->txt(
"import"));
202 $this->tpl->setVariable(
"FORMACTION",
203 $this->ctrl->getFormAction($this));
204 $this->tpl->setVariable(
"TXT_IMPORT_MAIL",$this->lng->txt(
"table_mail_import"));
205 $this->tpl->setVariable(
"TXT_IMPORT_FILE",$this->lng->txt(
"mail_import_file"));
206 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
"cancel"));
207 $this->tpl->setVariable(
"BTN_UPLOAD",$this->lng->txt(
"upload"));
214 global $rbacsystem,
$lng;
216 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
218 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
221 $this->file_obj->findXMLFile();
223 $this->parser_obj->startParsing();
224 $number = $this->parser_obj->getCountImported();
227 $this->ctrl->redirect($this,
"import");
234 global $rbacsystem,
$lng;
236 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
238 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
242 if(!$this->file_obj->storeUploadedFile($_FILES[
"importFile"]))
244 $this->message = $lng->txt(
"import_file_not_valid");
245 $this->file_obj->unlinkLast();
247 else if(!$this->file_obj->unzip())
249 $this->message = $lng->txt(
"cannot_unzip_file");
250 $this->file_obj->unlinkLast();
252 else if(!$this->file_obj->findXMLFile())
254 $this->message = $lng->txt(
"cannot_find_xml");
255 $this->file_obj->unlinkLast();
259 $this->message = $lng->txt(
"error_parser");
261 else if(!$this->parser_obj->startParsing())
263 $this->message = $lng->txt(
"users_not_imported").
":<br/>";
264 $this->message .= $this->parser_obj->getNotAssignableUsers();
269 $this->message = $lng->txt(
"uploaded_and_checked");
273 $this->ctrl->redirect($this,
"import");
279 include_once
"./Services/Mail/classes/class.ilFileDataImportMail.php";
287 include_once
"Services/Mail/classes/class.ilMailImportParser.php";
301 $next_class = $this->ctrl->getNextClass($this);
302 $cmd = $this->ctrl->getCmd();
307 case 'ilpermissiongui':
308 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
310 $ret =& $this->ctrl->forwardCommand($perm_gui);
340 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
342 $tabs_gui->addTarget(
"settings",
343 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
'save',
""),
"",
"");
346 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
348 $tabs_gui->addTarget(
"perm_settings",
349 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
360 require_once
'Services/Mail/classes/class.ilMail.php';
362 if($rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId()))
369 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
371 $_GET[
"cmd"] =
"frameset";
372 $_GET[
"target"] =
"";
373 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
374 $_GET[
"baseClass"] =
"ilRepositoryGUI";
377 include(
"ilias.php");
381 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);