diff --git a/Services/Mail/classes/Form/class.ilIncomingMailInputGUI.php b/Services/Mail/classes/Form/class.ilIncomingMailInputGUI.php index de4aca47411a..d830228984f0 100644 --- a/Services/Mail/classes/Form/class.ilIncomingMailInputGUI.php +++ b/Services/Mail/classes/Form/class.ilIncomingMailInputGUI.php @@ -141,36 +141,36 @@ private function addSubOptions() : void $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') { $this->setDisabled(true); } - - if ($DIC->user()->getEmail() === '' || - $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1' - ) { - $sub_mail_opt1->setDisabled(true); + + if ($DIC->user()->getEmail() === '') { $sub_mail_opt1->setInfo($DIC->language()->txt('first_email_missing_info')); - $sub_mail_opt3->setDisabled(true); $sub_mail_opt3->setInfo($DIC->language()->txt('first_email_missing_info')); - $sub_both_opt1->setDisabled(true); $sub_both_opt1->setInfo($DIC->language()->txt('first_email_missing_info')); - $sub_both_opt3->setDisabled(true); $sub_both_opt3->setInfo($DIC->language()->txt('first_email_missing_info')); } else { $email_info[] = $DIC->user()->getEmail(); } - - if ($DIC->user()->getSecondEmail() === '' || - $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1' - ) { - $sub_mail_opt2->setDisabled(true); - $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info')); + if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') { + $sub_mail_opt1->setDisabled(true); $sub_mail_opt3->setDisabled(true); + $sub_both_opt1->setDisabled(true); + $sub_both_opt3->setDisabled(true); + } + + if ($DIC->user()->getSecondEmail() === '') { + $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info')); $sub_mail_opt3->setInfo($DIC->language()->txt('second_email_missing_info')); - $sub_both_opt2->setDisabled(true); $sub_both_opt2->setInfo($DIC->language()->txt('second_email_missing_info')); - $sub_both_opt3->setDisabled(true); $sub_both_opt3->setInfo($DIC->language()->txt('second_email_missing_info')); } else { $email_info[] = $DIC->user()->getSecondEmail(); } + if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') { + $sub_mail_opt2->setDisabled(true); + $sub_mail_opt3->setDisabled(true); + $sub_both_opt2->setDisabled(true); + $sub_both_opt3->setDisabled(true); + } if (count($email_info) > 1) { $sub_mail_opt1->setInfo($email_info[0]);