From 7ce04ed3c6b33fa21279a665b2f8b190585c85af Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 29 Nov 2003 18:54:10 +0000 Subject: [PATCH] Reformatted cookie check functions. --- includes/SpecialUserlogin.php | 37 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index fbe1e50c7f..bd43239c49 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -373,39 +373,38 @@ $cambutton /* private */ function hasSessionCookie() { - global $HTTP_COOKIE_VARS; - global $wgDisableCookieCheck; + global $HTTP_COOKIE_VARS; + global $wgDisableCookieCheck; - return ( $wgDisableCookieCheck ) ? true : ( "" != $HTTP_COOKIE_VARS[session_name()]); + return ( $wgDisableCookieCheck ) ? true : ( "" != $HTTP_COOKIE_VARS[session_name()]); } /* private */ function cookieRedirectCheck( $type ) { - global $wgOut, $wgLang; + global $wgOut, $wgLang; - $check = wfLocalUrl( $wgLang->specialPage( "Userlogin" ), - "wpCookieCheck=$type" ); + $check = wfLocalUrl( $wgLang->specialPage( "Userlogin" ), + "wpCookieCheck=$type" ); - return $wgOut->redirect( $check ); + return $wgOut->redirect( $check ); } /* private */ function onCookieRedirectCheck( $type ) { - global $wgUser; + global $wgUser; - if (!hasSessionCookie()) { - if ( $type == "new" ) { - return mainLoginForm( wfMsg( "nocookiesnew" ) ); - } else if ( $type == "login" ) { - return mainLoginForm( wfMsg( "nocookieslogin" ) ); - } else { + if (!hasSessionCookie()) { + if ( $type == "new" ) { + return mainLoginForm( wfMsg( "nocookiesnew" ) ); + } else if ( $type == "login" ) { + return mainLoginForm( wfMsg( "nocookieslogin" ) ); + } else { # shouldn't happen - return mainLoginForm( wfMsg( "error" ) ); + return mainLoginForm( wfMsg( "error" ) ); + } + } else { + return successfulLogin( wfMsg( "loginsuccess", $wgUser->getName() ) ); } - } else { - return successfulLogin( wfMsg( "loginsuccess", $wgUser->getName() ) ); - } } - ?> -- 2.20.1