PHP User::Logout Examples

PHP User::Logout - 9 examples found. These are the top rated real world PHP examples of User::Logout extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 /**
  * Logout (void)
  * Destroys the session
  *
  */
 function UserLogout()
 {
     if (isset($_SESSION['userid'])) {
         $user = new User($_SESSION['userid']);
         $user->Logout();
         unset($_SESSION['userid']);
     }
 }
Example #2
0
 static function LoadPage($PageName, $Wrapper = true)
 {
     if (KERNEL::IsValidPage($PageName) == false) {
         KERNEL::OnError("Attempt to load invalid page '" . $PageName . "'");
     }
     if (!is_null(KERNEL::$Pages[$PageName][2])) {
         $Result = call_user_func(KERNEL::$Pages[$PageName][2]);
         if ($Result !== true) {
             KERNEL::OnError("Access Denied - " . $Result);
             die("");
             // Force cancel just incase
         }
     }
     if ($Wrapper) {
         global $GMDConfig;
         $OpenID = new LightOpenID($GMDConfig["Domain"]);
         if ($OpenID->validate()) {
             $ID = $OpenID->identity;
             $URL_Parts = explode("/", $ID);
             // Get their SteamID
             $CommunityID = $URL_Parts[sizeof($URL_Parts) - 1];
             $SteamID = CommunityToSteam($CommunityID);
             // Try and authenticate them
             $User = User::GetByField("User", "SteamID", $SteamID);
             if ($User->IsReal()) {
                 $User->AuthToUser();
             } else {
                 User::RegisterUser($SteamID, $_SERVER['REMOTE_ADDR'])->AuthToUser();
             }
             KERNEL::HardNavigate("home");
         } elseif ($_GET["page"] == "login") {
             if (User::$ActiveUser != false) {
                 if (isset($_GET["logout"])) {
                     User::Logout();
                 }
                 KERNEL::HardNavigate("home");
             } else {
                 $OpenID->identity = 'http://steamcommunity.com/openid';
                 header('Location: ' . $OpenID->authUrl());
             }
         }
         LightOpenID::revalidate();
     }
     global $OutputData;
     $OutputData = "";
     if ($Wrapper) {
         require "includes/util/header.php";
     }
     require "pages/" . $PageName . "/_process.php";
     require "pages/" . $PageName . "/_display.php";
     echo $OutputData;
     if ($Wrapper) {
         require "includes/util/footer.php";
     }
 }
Example #3
0
<?php

require_once '../bootstrap.php';
$user = new User();
$user->Logout();
echo json_encode(true);
Example #4
0
<?php

/**
 * @package    zoneideas
 * @subpackage idea
 * @author     Serg Podtynnyi <serg.podtynnyi@gmail.com>
 */
/**
 *
 *
 */
ob_start();
include_once "../core.php";
User::Logout();
header("Location:" . PREFIX . "/");
ob_end_flush();
Example #5
0
 public static function logout()
 {
     $user = new User(isset($_SESSION['user']) ? $_SESSION['user'] : array());
     $user->Logout();
     session_destroy();
 }
Example #6
0
 private function ShowLogout()
 {
     User::Logout();
     return $this->ReturnTemplate("user_login");
 }
Example #7
0
function main()
{
    try {
        global $pageTitle;
        global $editable;
        global $session;
        global $user;
        $post = $_POST['blnPost'];
        $username = $_GET['username'];
        $selUser = new User("username = '{$username}'");
        $logout = $_GET['logout'];
        if ($selUser->IsEmpty()) {
            print GetCap('capUserNotFound');
            $session->ViewedNotFound("Movie", $username);
            UpdateObject($session, false);
            Dump();
        }
        if ($logout) {
            $selUser->Logout();
            $session->ForcedLogout($selUser->ID());
        }
        if (isset($user)) {
            if ($user->ID() == $selUser->ID()) {
                $sameUser = true;
            }
        }
        if (!$editable && !$selUser->Enabled()) {
            echo GetCap('capThisAccountHasBeenDisabled');
            Dump();
        }
        if ($post) {
            if (!$editable && !$sameUser) {
                BlockIfViolation('update');
            }
            ThrowExceptionOnMaliciousInput($_POST['txtInfo'], 'USER_INFO');
            if ($editable) {
                $selUser->Enabled($_POST['chkEnabled'] == '1' ? 1 : 0);
            }
            $selUser->PlayTimesLocation($_POST['txtPlayTimesLocation']);
            $selUser->Email($_POST['txtEmail']);
            $selUser->Info(strip_tags($_POST['txtInfo']));
            UpdateObject($selUser);
        } else {
            $session->Viewed("User", $selUser->ID());
        }
        $username = $selUser->UserName();
        $pageTitle = $username;
        $email = $selUser->Email();
        $playTimesLocation = $selUser->PlayTimesLocation();
        $enabled = $selUser->Enabled();
        $info = $selUser->Info();
        ?>
        <br />
        <form name="frm" method="post" action="<?php 
        echo $PHP_SELF . "?username=" . urlencode($username);
        ?>
">
            <table>
                <tr> 
                    <td>
                        <font size=6><b><?php 
        echo $username;
        ?>
</b></font>
                        <?php 
        if (!$sameUser) {
            echo PublicizedInfo($info);
        }
        ?>
                    </td>
                </tr> 
                    <?php 
        if ($editable || $sameUser) {
            ?>
                        <tr> 
                            <td>
                                <b><?php 
            echo GetCap('capEmailAddress');
            ?>
: </b>
                            </td>
                            <td>
                                <input type="text" size=50 name="txtEmail" value="<?php 
            echo $email;
            ?>
"/>
                                <?php 
            echo "<i>(" . GetCap('capPrivate') . ")</i>";
            ?>
                            </td>
                        </tr> 
                     <?php 
        }
        if ($editable || $sameUser) {
            ?>
                    <tr> 
                        <td>
                            <b><?php 
            echo GetCap('capPlayTimesLocation');
            ?>
: </b>
                        </td>
                        <td>
                            <input type="text" size=50 name="txtPlayTimesLocation" value="<?php 
            echo $playTimesLocation;
            ?>
"/>
                            <?php 
            echo "<i>(" . GetCap('capPrivate') . ")</i>";
            ?>
                        </td>
                    </tr> 
                <?php 
        }
        if ($editable || $sameUser) {
            ?>
                <tr> 
                        <td valign=top>
                            <b><?php 
            echo GetCap('capTellUsAboutYourself');
            ?>
: </b>
                            <br/>
                            <i>(<?php 
            echo GetCap('capEditAnywayYouWish');
            ?>
)</i>
                        </td>
                        <td valign=top>
                            <textarea rows="10" cols="57" name="txtInfo"><?php 
            echo $info;
            ?>
</textarea>
                            <?php 
            echo "<i>(" . GetCap('capPublic') . ")</i>";
            ?>
                        </td>
                </tr> 
                <tr valign=top> 
                        <td>
                            <b><?php 
            echo GetCap('capPublicView');
            ?>
: </b>
                        </td>
                        <td>
                            <?php 
            echo PublicizedInfo($info);
            ?>
                        </td>
                </tr> 
                <?php 
        }
        if ($editable) {
            ?>
                    <tr> 
                        <td>
                            <b><?php 
            echo GetCap('capLoggedIn');
            ?>
: </b>
                            <?php 
            if ($selUser->LoggedIn()) {
                print GetCap("capYes");
                if ($admin) {
                    print "<a href=\"user.php?username={$username}&logout=1\">[" . GetCap('capLogout') . "]</a>";
                }
            } else {
                print GetCap("capNo");
            }
            ?>
                    </tr> 
                    <tr> 
                        <td>
                            <b><?php 
            echo GetCap('capEnabled');
            ?>
: </b>
                            <?php 
            print "<input type=\"checkbox\" name=\"chkEnabled\" value=\"1\" " . ($enabled ? 'checked="checked"' : '') . "/>";
            ?>
                    </tr> 
                <?php 
        }
        if ($editable || $sameUser) {
            ?>
                    <tr> 
                        <td>
                            <input type="submit" name="btnLogin" value="<?php 
            echo GetCap('capSave');
            ?>
"/>
                        </td>
                        <td>
                            <input type="hidden" name="blnPost" value="1"/>
                        </td>
                    </tr> 
                <?php 
        }
        ?>
        </table>
    </form>
    <?php 
    } catch (Exception $ex) {
        ProcessException($ex);
    }
}
 private function showRequestedContent()
 {
     $this->Tool = new Toolbox();
     $this->Template->setVar('%%PROJECTS%%', $this->Tool->showSelectedProject());
     if (!isset($_GET['action'])) {
         $_GET['action'] = 'last5';
     }
     switch ($_GET['action']) {
         case 'last5':
             self::last7();
             break;
         case 'edit':
             self::EditKeywords();
             break;
         case 'batch':
             self::batchKeywords();
             break;
         case 'csv':
             self::CSVKeywords();
             break;
         case 'settings':
             self::showSettings();
             break;
         case 'summary':
             self::genSummary();
             break;
         case 'chart':
             self::genChart();
             break;
         case 'history':
             self::genHistory();
             break;
         case 'logout':
             User::Logout();
             break;
         default:
             self::last7();
     }
 }
Example #9
0
 public function __construct()
 {
     $this->Infos['Title'] = Language::Get('com.sbb.page.logout');
     User::Logout();
     header("Location: index.php");
 }