grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026. -------------------------------------------------------------------------- */ /** @file * @brief */ /** * Class used to manage Auth mail config **/ class AuthMail extends CommonDBTM { // From CommonDBTM public $dohistory = true; static $rightname = 'config'; static function getTypeName($nb=0) { return _n('Mail server', 'Mail servers', $nb); } function prepareInputForUpdate($input) { if (isset($input['mail_server']) && !empty($input['mail_server'])) { $input["connect_string"] = Toolbox::constructMailServerConfig($input); } return $input; } static function canCreate() { return static::canUpdate(); } /** * @since version 0.85 **/ static function canPurge() { return static::canUpdate(); } function prepareInputForAdd($input) { if (isset($input['mail_server']) && !empty($input['mail_server'])) { $input["connect_string"] = Toolbox::constructMailServerConfig($input); } return $input; } function defineTabs($options=array()) { $ong = array(); $this->addDefaultFormTab($ong); $this->addStandardTab(__CLASS__, $ong, $options); $this->addStandardTab('Log', $ong, $options); return $ong; } function getSearchOptions() { $tab = array(); $tab['common'] = __('Email server'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[1]['massiveaction'] = false; $tab[2]['table'] = $this->getTable(); $tab[2]['field'] = 'id'; $tab[2]['name'] = __('ID'); $tab[2]['datatype'] = 'number'; $tab[2]['massiveaction'] = false; $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'host'; $tab[3]['name'] = __('Server'); $tab[3]['datatype'] = 'string'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'connect_string'; $tab[4]['name'] = __('Connection string'); $tab[4]['massiveaction'] = false; $tab[4]['datatype'] = 'string'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'is_active'; $tab[6]['name'] = __('Active'); $tab[6]['datatype'] = 'bool'; $tab[19]['table'] = $this->getTable(); $tab[19]['field'] = 'date_mod'; $tab[19]['name'] = __('Last update'); $tab[19]['datatype'] = 'datetime'; $tab[19]['massiveaction'] = false; $tab[16]['table'] = $this->getTable(); $tab[16]['field'] = 'comment'; $tab[16]['name'] = __('Comments'); $tab[16]['datatype'] = 'text'; return $tab; } /** * Print the auth mail form * * @param $ID Integer : ID of the item * @param $options array * * @return Nothing (display) **/ function showForm($ID, $options=array()) { if (!Config::canUpdate()) { return false; } $spotted = false; if (empty($ID)) { if ($this->getEmpty()) { $spotted = true; } } else { if ($this->getFromDB($ID)) { $spotted = true; } } if (Toolbox::canUseImapPop()) { $options['colspan'] = 1; $this->showFormHeader($options); echo "
| " . __('Email server configuration') . " | |
|---|---|
| ";
echo " ".__('Your PHP parser was compiled without the IMAP functions')." "; echo "". __('Impossible to use email server as external source of connection')." "; echo " | |