PHP User::setSessionVariable Examples

PHP User::setSessionVariable - 2 examples found. These are the top rated real world PHP examples of User::setSessionVariable extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 $tw_screen_name = $token->getParam('screen_name');
 $tw_token = serialize($token);
 /**
  * Now that we have an Access Token, we can discard the Request Token
  */
 $_SESSION['TWITTER_REQUEST_TOKEN'] = null;
 /**
  * Record the Access Token if necessary and return to the appropriate page
  */
 if (isset($_SESSION['TWITTER_ENTRY'])) {
     if ($_SESSION['TWITTER_ENTRY'] == 'user_login.php') {
         $iduser = $do_twitter->getOfuzUserID($tw_user_id);
         if ($iduser) {
             $do_user = new User();
             $do_user->iduser = $iduser;
             $do_user->setSessionVariable();
             $do_login_audit = new LoginAudit();
             $do_login_audit->do_login_audit('Twitter');
             header('Location: index.php');
             exit;
         } else {
             $config = $do_twitter->getTwitterConfig();
             $ofuz_twitter = new Ofuz_Service_Twitter($tw_user_id, $config, $token);
             $userdetail = $ofuz_twitter->userShow($tw_user_id);
             list($firstname, $lastname) = split(' ', $userdetail->name);
             $_SESSION['TWITTER_REGISTER'] = array('tw_user_id' => $tw_user_id, 'tw_screen_name' => $tw_screen_name, 'tw_token' => $tw_token, 'firstname' => $firstname, 'lastname' => $lastname);
             header('Location: tw_user_register.php');
             exit;
         }
         header('Location: user_login.php');
     } else {
require_once 'ZendOfuz/OpenId/Ak33m_OpenId_Consumer.php';
require_once 'ZendOfuz/OpenId/Extension/Sreg.php';
require_once 'ZendOfuz/OpenId/Extension/Ax.php';
$sreg = new Ak33m_OpenId_Extension_Ax(array('firstname' => true, 'email' => true, 'lastname' => true, 'dob' => true, 'gender' => true, 'postcode' => true, 'country' => true, 'language' => true, 'timezone' => true), null, 1.1);
if (isset($_GET['openid_mode'])) {
    if ($_GET['openid_mode'] == "id_res") {
        require_once "config.php";
        $consumer = new Ak33m_OpenId_Consumer();
        if ($consumer->verify($_GET, $id, $sreg)) {
            $array = preg_split("/[\\s]*[=][\\s]*/", $id);
            $google_openid_identity = $array[1];
            $do_user_openid = new User();
            $do_user_openid->setRegistry(false);
            $do_user_openid->googleOpenIdIdentityExists($google_openid_identity);
            if ($do_user_openid->getNumRows()) {
                $do_user_openid->setSessionVariable();
                header('Location: index.php');
                exit;
            } else {
                $data = $sreg->getProperties();
                $_SESSION["google"]["openid_identity"] = $google_openid_identity;
                $_SESSION["google"]["firstname"] = $data["firstname"];
                $_SESSION["google"]["lastname"] = $data["lastname"];
                $_SESSION["google"]["email"] = $data["email"];
                $_SESSION["google"]["lang"] = $data["en"];
                header('Location: user_glogin.php?message=Welcome to Ofuz Google login. You do not seem to have an Ofuz account linked to your google login.');
                exit;
            }
        } else {
            //$status = "INVALID " . htmlspecialchars($id);
            header('Location: user_login.php?message=Sorry! Google has identified your login as INVALID. Please try with VALID login.');