along with GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief */ include '../inc/includes.php'; Session::checkRight("config", "w"); $config = new Config(); $config_ldap = new AuthLDAP(); if (!isset($_GET['id'])) { $_GET['id'] = ""; } //LDAP Server add/update/delete if (isset($_POST["update"])) { $config_ldap->update($_POST); Html::back(); } else { if (isset($_POST["add"])) { //If no name has been given to this configuration, then go back to the page without adding if ($_POST["name"] != "") { if ($newID = $config_ldap->add($_POST)) { if (AuthLdap::testLDAPConnection($newID)) { Session::addMessageAfterRedirect(__('Test successful')); } else { Session::addMessageAfterRedirect(__('Test failed'), false, ERROR); } Html::redirect($CFG_GLPI["root_doc"] . "/front/authldap.php?next=extauth_ldap&id=" . $newID); } } Html::back();