Esempio n. 1
0
                    eZSession::start($rememberMeTimeout);
                } else {
                    $GLOBALS['RememberMeTimeout'] = $rememberMeTimeout;
                    eZSessionStop();
                    eZSessionStart();
                    unset($GLOBALS['RememberMeTimeout']);
                }
            }
        }
        $http->removeSessionVariable('eZUserLoggedInID');
        $http->setSessionVariable('eZUserLoggedInID', $userID);
        // Remove all temporary drafts
        //include_once( 'kernel/classes/ezcontentobject.php' );
        eZContentObject::cleanupAllInternalDrafts($userID);
        // check if we're should do SSO or just do a normal redirect
        return eZVLoginHelper::doSSORedirect($Module, $redirectionURI);
    }
} else {
    // called from outside of a template (?)
    $requestedURI = $GLOBALS['eZRequestedURI'];
    if ($requestedURI instanceof eZURI) {
        $requestedModule = $requestedURI->element(0, false);
        $requestedView = $requestedURI->element(1, false);
        if ($requestedModule != 'vlogin' or $requestedView != 'login') {
            $userRedirectURI = $requestedURI->originalURIString(false);
            eZDebug::writeNotice('originalURIString = ' . $userRedirectURI, 'vuser/login');
        }
    }
}
if ($http->hasPostVariable("RegisterButton")) {
    $Module->redirectToView('register');
Esempio n. 2
0
//
// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
//
//include_once( "lib/ezutils/classes/ezhttptool.php" );
//include_once( "kernel/classes/datatypes/ezuser/ezuser.php" );
include_once 'extension/ezvlogin/classes/ezvloginhelper.php';
$Module = $Params['Module'];
// check if we're back from a SSO redirection loop
if (($redirectionURI = eZVLoginHelper::isSSOStart($Module)) !== false) {
    // Makes sure this is not cached by proxy
    header('Cache-Control: no-cache, must-revalidate');
    return $Module->redirectTo($redirectionURI);
}
$ini = eZINI::instance();
$user = eZUser::instance();
$http = eZHTTPTool::instance();
// Remove all temporary drafts
//include_once( 'kernel/classes/ezcontentobject.php' );
eZContentObject::cleanupAllInternalDrafts($user->attribute('contentobject_id'));
// Remove eZVLogin cookies
eZVLoginHelper::setUserCookie($user);
$user->logoutCurrent();
// HACK! seems to be no trigger for login/logout
if (class_exists('sCacheCookieHelper')) {
    sCacheCookieHelper::setCookie();
}
$http->setSessionVariable('force_logout', 1);
$redirectURL = $ini->variable('UserSettings', 'LogoutRedirect');
// check if we're should do SSO or just do a normal redirect
return eZVLoginHelper::doSSORedirect($Module, $redirectURL);