Ejemplo n.º 1
0
                    $_SESSION["LDAP_TEST_MESSAGE"] = sprintf(__('Test failed: %s'), sprintf(__('Main server %s'), $config_ldap->fields["name"]));
                }
                Html::back();
            } else {
                if (isset($_POST["test_ldap_replicate"])) {
                    $replicate = new AuthLdapReplicate();
                    $replicate->getFromDB($_POST["ldap_replicate_id"]);
                    if (AuthLdap::testLDAPConnection($_POST["id"], $_POST["ldap_replicate_id"])) {
                        //TRANS: %s is the description of the test
                        $_SESSION["LDAP_TEST_MESSAGE"] = sprintf(__('Test successful: %s'), sprintf(__('Replicate %s'), $replicate->fields["name"]));
                    } else {
                        //TRANS: %s is the description of the test
                        $_SESSION["LDAP_TEST_MESSAGE"] = sprintf(__('Test failed: %s'), sprintf(__('Replicate %s'), $replicate->fields["name"]));
                    }
                    Html::back();
                } else {
                    if (isset($_POST["add_replicate"])) {
                        $replicate = new AuthLdapReplicate();
                        unset($_POST["next"]);
                        unset($_POST["id"]);
                        $replicate->add($_POST);
                        Html::back();
                    }
                }
            }
        }
    }
}
Html::header(AuthLDAP::getTypeName(1), $_SERVER['PHP_SELF'], 'config', 'auth', 'ldap');
$config_ldap->display($_GET);
Html::footer();