Example #1
0
        while (false !== ($file = readdir($handle))) {
            if (substr($file, -5) == '.lang') {
                $locale = substr($file, 0, strlen($file) - strlen(substr($file, -5)));
                $REX['LANGUAGES'][] = $locale;
                if ($requestLang == $locale) {
                    $REX['LANG'] = $locale;
                }
            }
        }
    }
    closedir($handle);
    if ($REX['LANG'] == '') {
        $REX['LANG'] = 'de_de';
    }
    $I18N = rex_create_lang($REX['LANG']);
    $REX['PAGES']['setup'] = rex_be_navigation::getSetupPage();
    $REX['PAGE'] = "setup";
} else {
    // ----------------- CREATE LANG OBJ
    $I18N = rex_create_lang($REX['LANG']);
    // ---- prepare login
    $REX['LOGIN'] = new rex_backend_login($REX['TABLE_PREFIX'] . 'user');
    $rex_user_login = rex_post('rex_user_login', 'string');
    $rex_user_psw = rex_post('rex_user_psw', 'string');
    if ($REX['PSWFUNC'] != '') {
        $REX['LOGIN']->setPasswordFunction($REX['PSWFUNC']);
    }
    if (rex_get('rex_logout', 'boolean')) {
        $REX['LOGIN']->setLogout(true);
    }
    $REX['LOGIN']->setLogin($rex_user_login, $rex_user_psw);