the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("config", "w");
$notificationmail = new NotificationMailSetting();
if (!empty($_POST["test_smtp_send"])) {
    NotificationMail::testNotification();
    Html::back();
} else {
    if (!empty($_POST["update"])) {
        $config = new Config();
        $config->update($_POST);
        Html::back();
    }
}
Html::header(Notification::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailing", "config");
$notificationmail->showForm(1);
Html::footer();
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("config", UPDATE);
$notificationmail = new NotificationMailSetting();
if (!empty($_POST["test_smtp_send"])) {
    NotificationMail::testNotification();
    Html::back();
} else {
    if (!empty($_POST["update"])) {
        $config = new Config();
        $config->update($_POST);
        Html::back();
    }
}
Html::header(Notification::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "config", "notification", "config");
$notificationmail->display(array('id' => 1));
Html::footer();
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
header_nocache();
checkRight("config", 'r');
if (!isset($_POST['id'])) {
    exit;
}
if (!isset($_REQUEST['glpi_tab'])) {
    exit;
}
if ($_POST['id'] > 0) {
    $target = new NotificationMailSetting();
    switch ($_REQUEST['glpi_tab']) {
        case -1:
            $target->showFormMailServerConfig();
            if ($CFG_GLPI['use_mailing']) {
                $target->showFormAlerts();
                Plugin::displayAction($target, $_REQUEST['glpi_tab']);
            }
            break;
        case 1:
            $target->showFormMailServerConfig();
            break;
        case 2:
            if ($CFG_GLPI['use_mailing']) {
                $target->showFormAlerts();
            }