From: Evan Prodromou Date: Sat, 29 Nov 2003 18:54:10 +0000 (+0000) Subject: Reformatted cookie check functions. X-Git-Tag: 1.1.0~55 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=7ce04ed3c6b33fa21279a665b2f8b190585c85af;p=lhc%2Fweb%2Fwiklou.git Reformatted cookie check functions. --- 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() ) ); - } } - ?>