logged_in){ //USER IS IN JPMASTER77 $localUserName = $session->username; $localSignedIn = true; $localPassport = 'JPMaster77'; header("Location: home.php?user=$session->username"); } else { include_once 'common.php'; /* Includes all the required library, classes and starts the session */ $authInfo = array(); /* This empty array will hold RPX authinfo data */ $rpxProfileRowInfo = null; /* This will hold database ROW record of identifier if it existed before */ $rpxHelper = new RpxHelper(); // creating RPX-helper class to use sign-in related tasks // check if user is already logged in if(checkValidUserInfoOrRedirect()){ set_action_message('You are already logged in.', 'info'); redirect(RPX_APP_HOME_PAGE); } if( getUserAuthenticationInfo($authInfo) ) { redirectNewUser($rpxProfileRowInfo,$authInfo); $appUserID = $rpxProfileRowInfo[RpxProfile::USER_ID_COLUMN_KEY]; /********************************************************************************** * DEVELOPER INTEGRATION POINT * ------------------------------------------------------------------------------- * * >> Following code will execute only IFF authenticated user already registered * with us. * * >> Returning user's unique id is mapped to RPX-profile data and loaded to * $appUserID variable. * * >> So, in general you might want to load existing user information and save * that info to session and mark the user as authenticated user for your * application. * * For example, here we are loading user data from our application-specific user * table and saving it to session (which ideally makes the user as authenticated) **********************************************************************************/ $appUserObj = new User(); $appUserObj->Get($appUserID); setUserInfoToSession($appUserObj); set_action_message('You are already a registered member.', 'info'); set_action_message('You have successfully logged in.', 'success'); //surely i don't need BOTH of the following!!!! $localUserName = $userObject->preferred_username; if(!isset($localUserName)) { $localUserName =($_SESSION[USER_OPENID_PROFILE_SESSION_KEY]['preferredUsername']); } $localSignedIn = true; $localPassport = 'OpenID'; // Redirect user to home page redirect(RPX_APP_HOME_PAGE); } else { $localUserName = 'Stranger!'; $localSignedIn = false; $localPassport = ''; if(isset($authInfo['err']['msg'])){ /* error only if authentication was completed */ set_action_message("Authentication error: " .$authInfo['err']['msg'], 'error'); } } /* ###################### END OF LOGIC BLOCK ####################### */ } ?>