Exemple #1
0
    }
    return $db;
}
include 'defines.php';
include 'members.php';
include 'disp_body.php';
include 'disp_panels.php';
$test = test_inscription();
if ($test == '0') {
    connexion($_POST['i_name'], $_POST['i_mdp']);
    unset($_GET['id']);
    $_GET['p'] = 'inscr_ok';
} elseif ($test != '1') {
    $error = $test;
}
$test = test_connexion();
if ($test == '0') {
    unset($_GET['id']);
    $_GET['p'] = 'co_ok';
} elseif ($test != '1') {
    $error = $test;
}
if (isset($_GET['p'])) {
    if ($_GET['p'] == 'dc') {
        deconnexion();
    }
}
if (!isset($redir)) {
    ?>
<!DOCTYPE html>
<html>
}
if (preg_match("#--force#", implode(" ", $argv))) {
    $GLOBALS["FORCE"] = true;
}
if ($GLOBALS["VERBOSE"]) {
    ini_set('html_errors', 0);
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
}
if (posix_getuid() != 0) {
    die("Cannot be used in web server mode\n\n");
}
include_once dirname(__FILE__) . '/ressources/class.ldap.inc';
include_once dirname(__FILE__) . "/framework/frame.class.inc";
if ($argv[1] == "--test-connexion") {
    test_connexion();
    die;
}
$ldap = new clladp();
if ($ldap->suffix == null) {
    die;
}
$sock = new sockets();
if ($sock->GET_INFO("EnableLDAPSyncProvClient") == 1) {
    die;
}
if (!$ldap->ExistsDN("dc=organizations,{$ldap->suffix}")) {
    writelogs("Create new entry dc=organizations,{$ldap->suffix}", __FUNCTION, __FILE__, __LINE__);
    $upd["objectClass"][] = "top";
    $upd["objectClass"][] = "organization";
    $upd["objectClass"][] = "dcObject";