grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); } /** * This class manages the mail settings */ class NotificationMailSetting extends CommonDBTM { public $table = 'glpi_configs'; protected $displaylist = false; static $rightname = 'config'; // Temproray hack for this class in 0.84 static function getTable() { return 'glpi_configs'; } static function getTypeName($nb=0) { return __('Email followups configuration'); } function defineTabs($options=array()) { $ong = array(); $this->addStandardTab(__CLASS__, $ong, $options); return $ong; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch ($item->getType()) { case __CLASS__ : $tabs[1] = __('Setup'); return $tabs; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == __CLASS__) { switch ($tabnum) { case 1 : $item->showFormMailServerConfig(); break; } } return true; } /** * Print the mailing config form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - tabs integer : ID of the tab to display * * @return Nothing (display) **/ function showForm($ID, $options=array()) { global $CFG_GLPI; if (!Config::canUpdate()) { return false; } if (!$CFG_GLPI['use_mailing']) { $options['colspan'] = 1; } $this->getFromDB($ID); return true; } function showFormMailServerConfig() { global $CFG_GLPI; echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; if ($CFG_GLPI['use_mailing']) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (!function_exists('mail')) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //TRANS: SMTP port echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } else { echo ""; } $options['candel'] = false; if ($CFG_GLPI['use_mailing']) { $options['addbuttons'] = array('test_smtp_send' => __('Send a test email to the administrator')); } $this->showFormButtons($options); } }
"._n('Notification', 'Notifications', Session::getPluralNumber())."
" . __('Enable followup via email') . ""; Dropdown::showYesNo("use_mailing", $CFG_GLPI["use_mailing"]); echo "
" . __('Administrator email') . ""; if (!NotificationMail::isUserAddressValid($CFG_GLPI["admin_email"])) { echo " ".__('Invalid email address').""; } echo "" . __('Administrator name') . ""; echo "
" . __('Administrator reply-to email (if needed)') . ""; if (!NotificationMail::isUserAddressValid($CFG_GLPI["admin_reply"])) { echo " ".__('Invalid email address').""; } echo " " . __('Response name (if needed)') . ""; echo "
" . __('Add documents into ticket notifications') . ""; Dropdown::showYesNo("attach_ticket_documents_to_mail", $CFG_GLPI["attach_ticket_documents_to_mail"]); echo "
"; echo "" . __('The PHP mail function is unknown or is not activated on your system.') . "
". __('The use of a SMTP is needed.') . "
" . __('Email signature') . "
".__('Mail server')."
" . __('Way of sending emails') . ""; $mail_methods = array(MAIL_MAIL => __('PHP'), MAIL_SMTP => __('SMTP'), MAIL_SMTPSSL => __('SMTP+SSL'), MAIL_SMTPTLS => __('SMTP+TLS')); Dropdown::showFromArray("smtp_mode", $mail_methods, array('value' => $CFG_GLPI["smtp_mode"])); echo "" . __("Check certificate") . ""; Dropdown::showYesNo('smtp_check_certificate', $CFG_GLPI["smtp_check_certificate"]); echo "
" . __('SMTP host') . ""; echo "" . __('Port') . ""; echo "
" . __('SMTP login (optional)') . "" . __('SMTP password (optional)') . ""; echo "
 ".__('Clear'); echo "