Reformatted cookie check functions.
authorEvan Prodromou <evanprodromou@users.mediawiki.org>
Sat, 29 Nov 2003 18:54:10 +0000 (18:54 +0000)
committerEvan Prodromou <evanprodromou@users.mediawiki.org>
Sat, 29 Nov 2003 18:54:10 +0000 (18:54 +0000)
includes/SpecialUserlogin.php

index fbe1e50..bd43239 100644 (file)
@@ -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() ) );
-  }
 }
 
-
 ?>