Beispiel #1
0
$cidRequired = isset($_REQUEST['cidRequired']) ? $_REQUEST['cidRequired'] : false;
//TODO: possibility to continue in anonymous
$uidRequired = true;
// The script needs the user to be authentificated
if (!claro_is_user_authenticated() && $uidRequired) {
    $defaultLoginValue = '';
    $dialogBox = new DialogBox();
    if (isset($_SESSION['lastUserName'])) {
        $defaultLoginValue = strip_tags($_SESSION['lastUserName']);
        unset($_SESSION['lastUserName']);
    }
    if (get_conf('claro_displayLocalAuthForm', true) == true) {
        if ($claro_loginRequested && !$claro_loginSucceeded) {
            if (AuthManager::getFailureMessage()) {
                // need to use get_lang two times...
                $dialogBox->error(get_lang(AuthManager::getFailureMessage()));
            } else {
                $dialogBox->error(get_lang('Login failed.') . ' ' . get_lang('Please try again.'));
            }
            if (get_conf('allowSelfReg', false)) {
                $dialogBox->warning(get_lang('If you haven\'t a user account yet, use the <a href="%url">the account creation form</a>.', array('%url' => get_path('url') . '/claroline/auth/inscription.php')));
            } else {
                $dialogBox->error(get_lang('Contact your administrator.'));
            }
            $dialogBox->warning(get_lang('Warning the system distinguishes uppercase (capital) and lowercase (small) letters'));
        }
        if (get_conf('claro_secureLogin', false)) {
            $formAction = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
        } else {
            $formAction = $_SERVER['PHP_SELF'];
        }