Пример #1
0
 function execute()
 {
     $this->content = '
     <h1>' . _('Logout') . '</h1>';
     if (LoginManager::isLogged()) {
         $this->content .= '
             <p>' . sprintf(_('Logout from \'%s\' success.'), LoginManager::getLogin()) . '</p>';
     } else {
         $this->content .= '
             <p>' . _('You are not logged.') . '</p>';
     }
     $this->content .= '
         <p><a href="' . RessourceManager::getInnerUrl('index') . '">' . _('Return to index') . '</a></p>';
     LoginManager::logout();
 }
Пример #2
0
 function execute()
 {
     require_once 'openid.php';
     $openid = new Dope_OpenID($_GET['openid_identity']);
     $validate_result = $openid->validateWithServer();
     if ($validate_result === TRUE) {
         $userinfo = $openid->filterUserInfo($_GET);
         LoginManager::login($_GET['openid_identity'], $userinfo['email'], $userinfo['fullname']);
     } else {
         if ($openid->isError() === TRUE) {
             LoginManager::logout();
             $error = $openid->GetError();
             $this->error = _("Login failed.") . '<br />';
             $this->error .= "Error code: " . $error['code'] . "<br/>";
             $this->error .= "Error description: " . $error['description'] . "<br/>";
         } else {
             LoginManager::logout();
             // Signature Verification Failed
             $this->error = _("Login failed.");
         }
     }
     /*
             $openid = new SimpleOpenID;
             $openid->SetIdentity($_GET['openid_identity']);
     
             $openid_validation_result = $openid->ValidateWithServer();
             if ($openid_validation_result == true){         // OK HERE KEY IS VALID
                 print_r($openid->fields['required']);
                 LoginManager::login($_GET['openid_identity']);
     
             }else if($openid->IsError() == true){            // ON THE WAY, WE GOT SOME ERROR
                 LoginManager::logout();
                 $error = $openid->GetError();
                 $this->error = _("Login failed.").'<br />';
                 $this->error .= "Error code: " . $error['code'] . "<br/>";
                 $this->error .= "Error description: " . $error['description'] . "<br/>";
             }else{
                 LoginManager::logout();// Signature Verification Failed
                 $this->error = _("Login failed.");
             }
     */
 }
Пример #3
0
<?php

require_once "classes/LoginManager.php";
$login = new LoginManager();
$login->logout();
Пример #4
0
/**
* doLogout will logout the user and output a login field
**/
function doLogout()
{
    $LoginManager = new LoginManager();
    $registerresult = $LoginManager->logout();
    echo '<hr/>';
    echo '<p><strong>Logout complete.</strong> Goodbye</p>';
    echo '<table>';
    echo '<tr><td>User </td> <td><input type="text"  id="usrfield" name="usr" /></td> </tr>';
    echo '<tr><td>Password </td> <td><input type="text"  id="pwdfield" name="psw" /></td> </tr>';
    echo '<tr><td><input type="submit" value="Login" onclick="doLogin();"/></td><td><input type="submit" value="Register" onclick="doRegister();"/></td></tr>';
    echo '</table>';
    echo '<hr/>';
}
Пример #5
0
<?php

include_once 'LoginManager.php';
if (!isset($_POST['submit'])) {
    header("Location: ../index.php");
    exit;
}
$source = filter_input(INPUT_POST, 'source');
$loginManager = new LoginManager($source);
if (!isset($_POST['email'])) {
    $loginManager->logout();
    header("Location: ../{$source}");
    exit;
} else {
    $email = filter_input(INPUT_POST, 'email');
    $password = filter_input(INPUT_POST, 'password');
    $loginManager->login($email, $password);
}
if (strpos($source, "?") !== FALSE) {
    $notificationGets = "&signin=" . $loginManager->getLoggedInUserName();
} else {
    $notificationGets = "?signin=" . $loginManager->getLoggedInUserName();
}
header("Location: ../{$source}{$notificationGets}");