Exemplo n.º 1
0
        default:
            $message = $_REQUEST['message'];
    }
}
/* Got a formular answer, validate and try to log in */
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['login'])) {
    /* Reset error messages */
    $message = "";
    /* Destroy old sessions, they cause a successfull login to relog again ...*/
    if (session::global_is_set('_LAST_PAGE_REQUEST')) {
        session::global_set('_LAST_PAGE_REQUEST', time());
    }
    /* Admin-logon and verify */
    $ldap = $config->get_ldap_link();
    if (is_null($ldap) || is_int($ldap) && $ldap == 0) {
        msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()), LDAP_ERROR);
        displayLogin();
        exit;
    }
    /* Check for schema file presence */
    if ($config->get_cfg_value("schemaCheck") == "TRUE") {
        $recursive = $config->get_cfg_value("ldapFollowReferrals") == "TRUE";
        $tls = $config->get_cfg_value("ldapTLS") == "TRUE";
        if (!count($ldap->get_objectclasses())) {
            msg_dialog::display(_("LDAP error"), _("Cannot detect information about the installed LDAP schema!"), ERROR_DIALOG);
            displayLogin();
            exit;
        } else {
            $cfg = array();
            $cfg['admin'] = $config->current['ADMINDN'];
            $cfg['password'] = $config->current['ADMINPASSWORD'];