예제 #1
0
 public function testLogout()
 {
     $login = new rex_backend_login();
     $login->setLogin($this->login, $this->password, false);
     $this->assertTrue($login->checkLogin());
     $login->setLogout(true);
     $this->assertFalse($login->checkLogin());
 }
예제 #2
0
 $charset_alt = str_replace('iso-', 'iso', $charset);
 setlocale(LC_ALL, $locale . '.' . $charset, $locale . '.' . $charset_alt, $locale);
 header('Content-Type: text/html; charset=' . $I18N->msg('htmlcharset'));
 header('Cache-Control: no-cache');
 header('Pragma: no-cache');
 // ---- prepare login
 $REX_LOGIN = new rex_backend_login($REX['TABLE_PREFIX'] . 'user');
 $REX_ULOGIN = rex_post('REX_ULOGIN', 'string');
 $REX_UPSW = rex_post('REX_UPSW', 'string');
 if ($REX['PSWFUNC'] != '') {
     $REX_LOGIN->setPasswordFunction($REX['PSWFUNC']);
 }
 if (isset($FORM['logout']) and $FORM['logout'] == 1) {
     $REX_LOGIN->setLogout(true);
 }
 $REX_LOGIN->setLogin($REX_ULOGIN, $REX_UPSW);
 $loginCheck = $REX_LOGIN->checkLogin();
 if ($loginCheck !== true) {
     // login failed
     $FORM['loginmessage'] = $REX_LOGIN->message;
     // Fehlermeldung von der Datenbank
     if (is_string($loginCheck)) {
         $FORM['loginmessage'] = $loginCheck;
     }
     $LOGIN = FALSE;
     $page = 'login';
 } else {
     // login ok
     if ($REX_ULOGIN != "") {
         // redirect to startpage, after successfull login
         header('Location: index.php?page=' . $REX['START_PAGE']);