function prepareInputForAdd($input) { if (isset($input['mail_server']) && !empty($input['mail_server'])) { $input["connect_string"] = Toolbox::constructMailServerConfig($input); } return $input; }
/** * @see CommonDBTM::prepareInputForAdd() **/ function prepareInputForAdd($input) { if (isset($input["passwd"])) { if (empty($input["passwd"])) { unset($input["passwd"]); } else { $input["passwd"] = Toolbox::encrypt(stripslashes($input["passwd"]), GLPIKEY); } } if (isset($input['mail_server']) && !empty($input['mail_server'])) { $input["host"] = Toolbox::constructMailServerConfig($input); } if (!NotificationMail::isUserAddressValid($input['name'])) { Session::addMessageAfterRedirect(__('Invalid email address'), false, ERROR); } return $input; }