ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjMailGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
10{
13
14 const PASSWORD_PLACE_HOLDER = '***********************';
15
19 protected $tabs;
20
24 protected $rbacsystem;
25
29 protected $settings;
30
37 public function __construct($a_data, $a_id, $a_call_by_reference)
38 {
39 global $DIC;
40
41 $this->type = 'mail';
42 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
43
44 $this->tabs = $DIC->tabs();
45 $this->rbacsystem = $DIC->rbac()->system();
46 $this->settings = $DIC['ilSetting'];
47
48 $this->lng->loadLanguageModule('mail');
49 }
50
54 public function executeCommand()
55 {
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
58 $this->prepareOutput();
59
60 switch ($next_class) {
61 case 'ilpermissiongui':
62 $perm_gui = new ilPermissionGUI($this);
63 $this->ctrl->forwardCommand($perm_gui);
64 break;
65
66 case 'ilmailtemplategui':
67 if (!$this->isViewAllowed()) {
68 $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
69 }
70
71 $this->ctrl->forwardCommand(new ilMailTemplateGUI($this->object));
72 break;
73
74 default:
75 if (!$cmd) {
76 $cmd = 'view';
77 }
78 $cmd .= 'Object';
79 $this->$cmd();
80 break;
81 }
82
83 return true;
84 }
85
89 private function isEditingAllowed()
90 {
91 return $this->rbacsystem->checkAccess('write', $this->object->getRefId());
92 }
93
97 private function isViewAllowed()
98 {
99 return $this->rbacsystem->checkAccess('read', $this->object->getRefId());
100 }
101
105 private function isPermissionChangeAllowed()
106 {
107 return $this->rbacsystem->checkAccess('edit_permission', $this->object->getRefId());
108 }
109
113 public function getAdminTabs()
114 {
115 $this->getTabs();
116 }
117
121 protected function getTabs()
122 {
123 if ($this->isViewAllowed()) {
124 $this->tabs->addTarget(
125 'settings',
126 $this->ctrl->getLinkTarget($this, 'view'),
127 array(
128 'view',
129 'save',
130 '',
131 'showExternalSettingsForm',
132 'saveExternalSettingsForm',
133 'sendTestUserMail',
134 'sendTestSystemMail'
135 ),
136 '',
137 ''
138 );
139 }
140
141 if ($this->isViewAllowed()) {
142 $this->tabs->addTarget(
143 'mail_templates',
144 $this->ctrl->getLinkTargetByClass('ilmailtemplategui', 'showTemplates'),
145 '',
146 'ilmailtemplategui'
147 );
148 }
149
150 if ($this->isPermissionChangeAllowed()) {
151 $this->tabs->addTarget(
152 'perm_settings',
153 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), 'perm'),
154 array('perm', 'info', 'owner'),
155 'ilpermissiongui'
156 );
157 }
158 }
159
163 protected function buildSettingsSubTabs($activeSubTab)
164 {
165 if ($this->isViewAllowed()) {
166 $this->tabs->addSubTab(
167 self::SETTINGS_SUB_TAB_ID_GENERAL,
168 $this->lng->txt('mail_settings_general_tab'),
169 $this->ctrl->getLinkTarget($this, 'view')
170 );
171
172 if ($this->settings->get('mail_allow_external')) {
173 $this->tabs->addSubTab(
174 self::SETTINGS_SUB_TAB_ID_EXTERNAL,
175 $this->lng->txt('mail_settings_external_tab'),
176 $this->ctrl->getLinkTarget($this, 'showExternalSettingsForm')
177 );
178 }
179
180 $this->tabs->activateSubTab($activeSubTab);
181 }
182 }
183
187 public function viewObject()
188 {
190 }
191
195 protected function showGeneralSettingsForm(ilPropertyFormGUI $form = null)
196 {
197 if (!$this->isViewAllowed()) {
198 $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
199 }
200
201 $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_GENERAL);
202
203 if ($form === null) {
204 $form = $this->getGeneralSettingsForm();
205 $this->populateGeneralSettingsForm($form);
206 }
207
208 $this->tpl->setContent($form->getHTML());
209 }
210
214 protected function getGeneralSettingsForm()
215 {
216 $form = new ilPropertyFormGUI();
217
218 $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
219 $form->setTitle($this->lng->txt('general_settings'));
220
221 $cb = new ilCheckboxInputGUI($this->lng->txt('mail_allow_external'), 'mail_allow_external');
222 $cb->setInfo($this->lng->txt('mail_allow_external_info'));
223 $cb->setValue(1);
224 $cb->setDisabled(!$this->isEditingAllowed());
225 $form->addItem($cb);
226
227 include_once 'Services/Mail/classes/Form/class.ilIncomingMailInputGUI.php';
228 $incoming_mail_gui = new ilIncomingMailInputGUI($this->lng->txt('mail_incoming'), 'incoming_type');
229 $incoming_mail_gui->setDisabled(!$this->isEditingAllowed());
230 $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID);
231 $incoming_mail_gui->setInfo(sprintf(
232 $this->lng->txt('mail_settings_incoming_type_see_also'),
233 $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings')
234 ));
235 $this->ctrl->clearParametersByClass('ilobjuserfoldergui');
236 $form->addItem($incoming_mail_gui);
237
238 $show_mail_settings_gui = new ilCheckboxInputGUI($this->lng->txt('show_mail_settings'), 'show_mail_settings');
239 $show_mail_settings_gui->setInfo($this->lng->txt('show_mail_settings_info'));
240 $show_mail_settings_gui->setValue(1);
241 $form->addItem($show_mail_settings_gui);
242
243 $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
244 $ti->setSuffix($this->lng->txt('kb'));
245 $ti->setInfo($this->lng->txt('mail_max_size_attachments_total'));
246 $ti->setMaxLength(10);
247 $ti->setSize(10);
248 $ti->setDisabled(!$this->isEditingAllowed());
249 $form->addItem($ti);
250
251 $mn = new ilFormSectionHeaderGUI();
252 $mn->setTitle($this->lng->txt('mail_member_notification'));
253 $form->addItem($mn);
254
255 $cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification');
256 $cron_options = array(
257 0 => $this->lng->txt('cron_mail_notification_never'),
258 1 => $this->lng->txt('cron_mail_notification_cron')
259 );
260 $cron_mail->setOptions($cron_options);
261 $cron_mail->setInfo(sprintf(
262 $this->lng->txt('cron_mail_notification_desc'),
263 $this->lng->txt('mail_allow_external')
264 ));
265 $cron_mail->setDisabled(!$this->isEditingAllowed());
266 $form->addItem($cron_mail);
267
270 $form,
271 $this
272 );
273
274 if ($this->isEditingAllowed()) {
275 $form->addCommandButton('save', $this->lng->txt('save'));
276 }
277
278 return $form;
279 }
280
285 {
286 $form->setValuesByArray(array(
287 'mail_allow_external' => $this->settings->get('mail_allow_external'),
288 'incoming_type' => (int) $this->settings->get('mail_incoming_mail'),
289 'mail_address_option' => strlen($this->settings->get('mail_address_option')) ? $this->settings->get('mail_address_option') : ilMailOptions::FIRST_EMAIL,
290 'mail_address_option_both' => strlen($this->settings->get('mail_address_option')) ? $this->settings->get('mail_address_option') : ilMailOptions::FIRST_EMAIL,
291 'show_mail_settings' => $this->settings->get('show_mail_settings', 1),
292 'mail_maxsize_attach' => $this->settings->get('mail_maxsize_attach'),
293 'mail_notification' => $this->settings->get('mail_notification')
294 ));
295 }
296
300 public function saveObject()
301 {
302 if (!$this->isEditingAllowed()) {
303 $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
304 }
305
306 $form = $this->getGeneralSettingsForm();
307 if ($form->checkInput()) {
308 $incoming_type = (int) $form->getInput('incoming_type');
309
310 $mail_address_option = ilMailOptions::FIRST_EMAIL;
311 if ($incoming_type == ilMailOptions::INCOMING_EMAIL) {
312 $mail_address_option = (int) $form->getInput('mail_address_option');
313 } else {
314 if ($incoming_type == ilMailOptions::INCOMING_BOTH) {
315 $mail_address_option = (int) $form->getInput('mail_address_option_both');
316 }
317 }
318
319 $this->settings->set('mail_allow_external', (int) $form->getInput('mail_allow_external'));
320 $this->settings->set('mail_incoming_mail', $incoming_type);
321 $this->settings->set('show_mail_settings', (int) $form->getInput('show_mail_settings'));
322
323 $this->settings->set('mail_address_option', $mail_address_option);
324 $this->settings->set('mail_maxsize_attach', $form->getInput('mail_maxsize_attach'));
325 $this->settings->set('mail_notification', (int) $form->getInput('mail_notification'));
326
327 ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
328 $this->ctrl->redirect($this);
329 }
330
331 $form->setValuesByPost();
332 $this->showGeneralSettingsForm($form);
333 }
334
338 protected function showExternalSettingsFormObject(ilPropertyFormGUI $form = null)
339 {
340 if (!$this->isViewAllowed()) {
341 $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
342 }
343
344 $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_EXTERNAL);
345
346 if ($form === null) {
347 $form = $this->getExternalSettingsForm();
348 $this->populateExternalSettingsForm($form);
349 }
350
351 if (strlen($GLOBALS['DIC']->user()->getEmail()) > 0) {
353 $btn->setUrl($this->ctrl->getLinkTarget($this, 'sendTestUserMail'));
354 $btn->setCaption('mail_external_send_test_usr');
355 $GLOBALS['DIC']->toolbar()->addButtonInstance($btn);
356
358 $btn->setUrl($this->ctrl->getLinkTarget($this, 'sendTestSystemMail'));
359 $btn->setCaption('mail_external_send_test_sys');
360 $GLOBALS['DIC']->toolbar()->addButtonInstance($btn);
361 }
362
363 $this->tpl->setContent($form->getHTML());
364 }
365
366 protected function sendTestUserMailObject()
367 {
368 $this->sendTestMail(true);
369 }
370
371 protected function sendTestSystemMailObject()
372 {
373 $this->sendTestMail();
374 }
375
379 protected function sendTestMail($isManualMail = false)
380 {
381 if (!$this->isViewAllowed()) {
382 $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
383 }
384
385 if (strlen($GLOBALS['DIC']->user()->getEmail()) == 0) {
386 return $this->showExternalSettingsFormObject();
387 }
388
389 if ($isManualMail) {
390 $mail = new ilMail($GLOBALS['DIC']->user()->getId());
391 } else {
392 $mail = new ilMail(ANONYMOUS_USER_ID);
393 }
394
395 $mail->setSaveInSentbox(false);
396 $mail->appendInstallationSignature(true);
397
398 $lngVariablePrefix = 'sys';
399 if ($isManualMail) {
400 $lngVariablePrefix = 'usr';
401 }
402
403 $mail->enqueue(
404 $GLOBALS['DIC']->user()->getEmail(),
405 '',
406 '',
407 $this->lng->txt('mail_email_' . $lngVariablePrefix . '_subject'),
408 $this->lng->txt('mail_email_' . $lngVariablePrefix . '_body'),
409 []
410 );
411
412 ilUtil::sendSuccess($this->lng->txt('mail_external_test_sent'));
414 }
415
419 protected function getExternalSettingsForm()
420 {
421 $form = new ilPropertyFormGUI();
422
423 $form->setFormAction($this->ctrl->getFormAction($this, 'saveExternalSettingsForm'));
424 $form->setTitle($this->lng->txt('mail_settings_external_frm_head'));
425
426 $smtp = new ilCheckboxInputGUI($this->lng->txt('mail_smtp_status'), 'mail_smtp_status');
427 $smtp->setInfo($this->lng->txt('mail_smtp_status_info'));
428 $smtp->setValue(1);
429 $smtp->setDisabled(!$this->isEditingAllowed());
430 $form->addItem($smtp);
431
432 $host = new ilTextInputGUI($this->lng->txt('mail_smtp_host'), 'mail_smtp_host');
433 $host->setInfo($this->lng->txt('mail_smtp_host_info'));
434 $host->setRequired(true);
435 $host->setDisabled(!$this->isEditingAllowed());
436 $smtp->addSubItem($host);
437
438 $port = new ilNumberInputGUI($this->lng->txt('mail_smtp_port'), 'mail_smtp_port');
439 $port->setInfo($this->lng->txt('mail_smtp_port_info'));
440 $port->allowDecimals(false);
441 $port->setMinValue(0);
442 $port->setMinValue(0);
443 $port->setRequired(true);
444 $port->setDisabled(!$this->isEditingAllowed());
445 $smtp->addSubItem($port);
446
447 $encryption = new ilSelectInputGUI($this->lng->txt('mail_smtp_encryption'), 'mail_smtp_encryption');
448 $encryptionOptions = array(
449 '' => $this->lng->txt('please_choose'),
450 'tls' => $this->lng->txt('mail_smtp_encryption_tls'),
451 'ssl' => $this->lng->txt('mail_smtp_encryption_ssl')
452 );
453
454 $encryption->setOptions($encryptionOptions);
455 $encryption->setDisabled(!$this->isEditingAllowed());
456 $smtp->addSubItem($encryption);
457
458 $user = new ilTextInputGUI($this->lng->txt('mail_smtp_user'), 'mail_smtp_user');
459 $user->setDisabled(!$this->isEditingAllowed());
460 $user->setDisableHtmlAutoComplete(true);
461 $smtp->addSubItem($user);
462
463 $password = new ilPasswordInputGUI($this->lng->txt('mail_smtp_password'), 'mail_smtp_password');
464 $password->setRetype(false);
465 $password->setSkipSyntaxCheck(true);
466 $password->setDisabled(!$this->isEditingAllowed());
467 $password->setDisableHtmlAutoComplete(true);
468 $smtp->addSubItem($password);
469
470 $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix');
471 $pre->setSize(12);
472 $pre->setMaxLength(32);
473 $pre->setInfo($this->lng->txt('mail_subject_prefix_info'));
474 $pre->setDisabled(!$this->isEditingAllowed());
475 $form->addItem($pre);
476
477 $send_html = new ilCheckboxInputGUI($this->lng->txt('mail_send_html'), 'mail_send_html');
478 $send_html->setInfo($this->lng->txt('mail_send_html_info'));
479 $send_html->setValue(1);
480 $send_html->setDisabled(!$this->isEditingAllowed());
481 $form->addItem($send_html);
482
483 $sh = new ilFormSectionHeaderGUI();
484 $sh->setTitle($this->lng->txt('mail_settings_user_frm_head'));
485 $form->addItem($sh);
486
487 $user_from_address = new ilEMailInputGUI(
488 $this->lng->txt('mail_system_usr_from_addr'),
489 'mail_system_usr_from_addr'
490 );
491 $user_from_address->setInfo($this->lng->txt('mail_system_usr_from_addr_info'));
492 $user_from_address->setRequired(true);
493 $user_from_address->setDisabled(!$this->isEditingAllowed());
494 $form->addItem($user_from_address);
495
496 $useGlobalReplyToAddress = new ilCheckboxInputGUI($this->lng->txt('mail_use_global_reply_to_addr'), 'use_global_reply_to_addr');
497 $useGlobalReplyToAddress->setInfo($this->lng->txt('mail_use_global_reply_to_addr_info'));
498 $useGlobalReplyToAddress->setValue(1);
499 $useGlobalReplyToAddress->setDisabled(!$this->isEditingAllowed());
500 $form->addItem($useGlobalReplyToAddress);
501 $globalReplyTo = new ilEMailInputGUI(
502 $this->lng->txt('mail_global_reply_to_addr'),
503 'global_reply_to_addr'
504 );
505 $globalReplyTo->setInfo($this->lng->txt('mail_global_reply_to_addr_info'));
506 $globalReplyTo->setRequired(true);
507 $globalReplyTo->setDisabled(!$this->isEditingAllowed());
508 $useGlobalReplyToAddress->addSubItem($globalReplyTo);
509
510 $user_from_name = new ilTextInputGUI($this->lng->txt('mail_system_usr_from_name'), 'mail_system_usr_from_name');
511 $user_from_name->setInfo($this->lng->txt('mail_system_usr_from_name_info'));
512 $user_from_name->setRequired(true);
513 $user_from_name->setDisabled(!$this->isEditingAllowed());
514 $form->addItem($user_from_name);
515
516 $user_envelope_from_addr = new ilEMailInputGUI(
517 $this->lng->txt('mail_system_usr_env_from_addr'),
518 'mail_system_usr_env_from_addr'
519 );
520 $user_envelope_from_addr->setInfo($this->lng->txt('mail_system_usr_env_from_addr_info'));
521 $user_envelope_from_addr->setDisabled(!$this->isEditingAllowed());
522 $form->addItem($user_envelope_from_addr);
523
524 $sh = new ilFormSectionHeaderGUI();
525 $sh->setTitle($this->lng->txt('mail_settings_system_frm_head'));
526 $form->addItem($sh);
527
528 $system_from_addr = new ilEMailInputGUI(
529 $this->lng->txt('mail_system_sys_from_addr'),
530 'mail_system_sys_from_addr'
531 );
532 $system_from_addr->setInfo($this->lng->txt('mail_system_sys_from_addr_info'));
533 $system_from_addr->setRequired(true);
534 $system_from_addr->setDisabled(!$this->isEditingAllowed());
535 $form->addItem($system_from_addr);
536
537 $system_from_name = new ilTextInputGUI(
538 $this->lng->txt('mail_system_sys_from_name'),
539 'mail_system_sys_from_name'
540 );
541 $system_from_name->setRequired(true);
542 $system_from_name->setDisabled(!$this->isEditingAllowed());
543 $form->addItem($system_from_name);
544
545 $system_reply_to_addr = new ilEMailInputGUI(
546 $this->lng->txt('mail_system_sys_reply_to_addr'),
547 'mail_system_sys_reply_to_addr'
548 );
549 $system_reply_to_addr->setRequired(true);
550 $system_reply_to_addr->setDisabled(!$this->isEditingAllowed());
551 $form->addItem($system_reply_to_addr);
552
553 $system_return_path = new ilEMailInputGUI(
554 $this->lng->txt('mail_system_sys_env_from_addr'),
555 'mail_system_sys_env_from_addr'
556 );
557 $system_return_path->setInfo($this->lng->txt('mail_system_sys_env_from_addr_info'));
558 $system_return_path->setDisabled(!$this->isEditingAllowed());
559 $form->addItem($system_return_path);
560
561 $signature = new ilTextAreaInputGUI($this->lng->txt('mail_system_sys_signature'), 'mail_system_sys_signature');
562 $signature->setRows(8);
563 $signature->setDisabled(!$this->isEditingAllowed());
564 $form->addItem($signature);
565
566 $placeholders = new ilManualPlaceholderInputGUI('mail_system_sys_signature');
567 foreach (array(
568 array('placeholder' => 'CLIENT_NAME', 'label' => $this->lng->txt('mail_nacc_client_name')),
569 array('placeholder' => 'CLIENT_DESC', 'label' => $this->lng->txt('mail_nacc_client_desc')),
570 array('placeholder' => 'CLIENT_URL', 'label' => $this->lng->txt('mail_nacc_ilias_url'))
571 ) as $key => $value) {
572 $placeholders->addPlaceholder($value['placeholder'], $value['label']);
573 }
574 $placeholders->setDisabled(!$this->isEditingAllowed());
575 $form->addItem($placeholders);
576
577 if ($this->isEditingAllowed()) {
578 $form->addCommandButton('saveExternalSettingsForm', $this->lng->txt('save'));
579 }
580
581 return $form;
582 }
583
588 {
589 $subjectPrefix = $this->settings->get('mail_subject_prefix');
590 if (false === $subjectPrefix) {
591 $subjectPrefix = ilMimeMail::MAIL_SUBJECT_PREFIX;
592 }
593
594 $form->setValuesByArray(array(
595 'mail_smtp_status' => (bool) $this->settings->get('mail_smtp_status'),
596 'mail_smtp_host' => $this->settings->get('mail_smtp_host'),
597 'mail_smtp_port' => (int) $this->settings->get('mail_smtp_port'),
598 'mail_smtp_user' => $this->settings->get('mail_smtp_user'),
599 'mail_smtp_password' => strlen($this->settings->get('mail_smtp_password')) > 0 ? self::PASSWORD_PLACE_HOLDER : '',
600 'mail_smtp_encryption' => $this->settings->get('mail_smtp_encryption'),
601 'mail_subject_prefix' => $subjectPrefix,
602 'mail_send_html' => (int) $this->settings->get('mail_send_html'),
603 'mail_system_usr_from_addr' => $this->settings->get('mail_system_usr_from_addr'),
604 'mail_system_usr_from_name' => $this->settings->get('mail_system_usr_from_name'),
605 'mail_system_usr_env_from_addr' => $this->settings->get('mail_system_usr_env_from_addr'),
606 'mail_system_sys_from_addr' => $this->settings->get('mail_system_sys_from_addr'),
607 'mail_system_sys_from_name' => $this->settings->get('mail_system_sys_from_name'),
608 'mail_system_sys_reply_to_addr' => $this->settings->get('mail_system_sys_reply_to_addr'),
609 'mail_system_sys_env_from_addr' => $this->settings->get('mail_system_sys_env_from_addr'),
610 'mail_system_sys_signature' => $this->settings->get('mail_system_sys_signature'),
611 'use_global_reply_to_addr' => (bool) $this->settings->get('use_global_reply_to_addr'),
612 'global_reply_to_addr' => $this->settings->get('global_reply_to_addr'),
613 ));
614 }
615
620 {
621 if (!$this->isEditingAllowed()) {
622 $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
623 }
624
625 $form = $this->getExternalSettingsForm();
626 $isFormValid = $form->checkInput();
627
628 if (!$isFormValid) {
629 $form->setValuesByPost();
630 $this->showExternalSettingsFormObject($form);
631 return;
632 }
633
634 $isSmtpEnabled = (bool) $form->getInput('mail_smtp_status');
635 if ($isSmtpEnabled && $form->getInput('mail_smtp_user') && !$form->getInput('mail_smtp_password')) {
636 $form->getItemByPostVar('mail_smtp_password')->setRequired(true);
637 $form->getItemByPostVar('mail_smtp_password')->setAlert($this->lng->txt('mail_smtp_password_req'));
638 $form->setValuesByPost();
639 $this->showExternalSettingsFormObject($form);
640 return;
641 }
642
643 $this->settings->set('mail_smtp_status', (int) $form->getInput('mail_smtp_status'));
644 $this->settings->set('mail_smtp_host', $form->getInput('mail_smtp_host'));
645 $this->settings->set('mail_smtp_port', (int) $form->getInput('mail_smtp_port'));
646 $this->settings->set('mail_smtp_user', $form->getInput('mail_smtp_user'));
647 if ($form->getInput('mail_smtp_password') != self::PASSWORD_PLACE_HOLDER) {
648 $this->settings->set('mail_smtp_password', $form->getInput('mail_smtp_password'));
649 }
650 $this->settings->set('mail_smtp_encryption', $form->getInput('mail_smtp_encryption'));
651
652 $this->settings->set('mail_send_html', $form->getInput('mail_send_html'));
653 $this->settings->set('mail_subject_prefix', $form->getInput('mail_subject_prefix'));
654 $this->settings->set('mail_system_usr_from_addr', $form->getInput('mail_system_usr_from_addr'));
655 $this->settings->set('mail_system_usr_from_name', $form->getInput('mail_system_usr_from_name'));
656 $this->settings->set('mail_system_usr_env_from_addr', $form->getInput('mail_system_usr_env_from_addr'));
657 $this->settings->set('mail_system_sys_from_addr', $form->getInput('mail_system_sys_from_addr'));
658 $this->settings->set('mail_system_sys_from_name', $form->getInput('mail_system_sys_from_name'));
659 $this->settings->set('mail_system_sys_reply_to_addr', $form->getInput('mail_system_sys_reply_to_addr'));
660 $this->settings->set('mail_system_sys_env_from_addr', $form->getInput('mail_system_sys_env_from_addr'));
661 $this->settings->set('use_global_reply_to_addr', (int) $form->getInput('use_global_reply_to_addr'));
662 $this->settings->set('global_reply_to_addr', $form->getInput('global_reply_to_addr'));
663 $this->settings->set('mail_system_sys_signature', $form->getInput('mail_system_sys_signature'));
664
665 ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
666 $this->ctrl->redirect($this, 'showExternalSettingsForm');
667 }
668
672 public static function _goto($a_target)
673 {
674 global $DIC;
675
676 $mail = new ilMail($DIC->user()->getId());
677
678 if ($DIC->rbac()->system()->checkAccess('internal_mail', $mail->getMailObjectReferenceId())) {
679 ilUtil::redirect('ilias.php?baseClass=ilMailGUI');
680 } else {
681 if ($DIC->access()->checkAccess('read', '', ROOT_FOLDER_ID)) {
682 $_GET['cmd'] = 'frameset';
683 $_GET['target'] = '';
684 $_GET['ref_id'] = ROOT_FOLDER_ID;
685 $_GET['baseClass'] = 'ilRepositoryGUI';
687 sprintf(
688 $DIC->language()->txt('msg_no_perm_read_item'),
690 ),
691 true
692 );
693
694 include 'ilias.php';
695 exit();
696 }
697 }
698
699 $DIC['ilErr']->raiseError($DIC->language()->txt('msg_no_perm_read'), $DIC['ilErr']->FATAL);
700 }
701}
user()
Definition: user.php:4
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
This class represents a checkbox property in a property form.
This class represents a email property in a property form.
This class represents a section header in a property form.
Class ilIncomingMailInputGUI.
static getInstance()
Factory.
Class ilMailTemplateGUI.
Class ilManualPlaceholderInputGUI.
const MAIL_SUBJECT_PREFIX
This class represents a number property in a property form.
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions"ilObjectExcep...
__construct($a_data, $a_id, $a_call_by_reference)
ilObjMailGUI constructor.
saveObject()
save object@access public
const SETTINGS_SUB_TAB_ID_GENERAL
populateGeneralSettingsForm(ilPropertyFormGUI $form)
sendTestMail($isManualMail=false)
const SETTINGS_SUB_TAB_ID_EXTERNAL
getAdminTabs()
administration tabs show only permissions and trash folder
static _goto($a_target)
showExternalSettingsFormObject(ilPropertyFormGUI $form=null)
getTabs()
get tabs abstract method.@abstract overwrite in derived GUI class of your object type @access public
buildSettingsSubTabs($activeSubTab)
showGeneralSettingsForm(ilPropertyFormGUI $form=null)
executeCommand()
execute command
populateExternalSettingsForm(ilPropertyFormGUI $form)
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
This class represents a password property in a property form.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a property form user interface.
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const USER_FOLDER_ID
Definition: constants.php:31
const ANONYMOUS_USER_ID
Definition: constants.php:25
const ROOT_FOLDER_ID
Definition: constants.php:30
$password
Definition: cron.php:14
global $DIC
Definition: goto.php:24
exit
Definition: login.php:29
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)
settings()
Definition: settings.php:2