r23337 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23336‎ | r23337 | r23338 >
Date:20:58, 24 June 2007
Author:laner
Status:old
Tags:
Comment:
Added back the return statements in the autoauth hook, ensuring each return statement is returning the right thing.
Modified paths:
  • /trunk/extensions/LdapAuthentication/LdapAuthentication.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php
@@ -1669,7 +1669,7 @@
16701670 //They already with us? If so, quit this function.
16711671 if( $tmpuser->isLoggedIn() ) {
16721672 $wgAuth->printDebug( "User is already logged in.", self::NONSENSITIVE );
1673 - return;
 1673+ return true;
16741674 }
16751675
16761676 //Let regular authentication plugins configure themselves for auto
@@ -1683,7 +1683,7 @@
16841684 //If the user doesn't exist in LDAP, there isn't much reason to
16851685 //go any further.
16861686 $wgAuth->printDebug("User wasn't found in LDAP, exiting.", self::NONSENSITIVE );
1687 - return;
 1687+ return false;
16881688 }
16891689
16901690 //We need the username that MediaWiki will always use, *not* the one we
@@ -1697,7 +1697,7 @@
16981698
16991699 if ( $tmpuser == null ) {
17001700 $wgAuth->printDebug( "Username is not a valid MediaWiki username.", self::NONSENSITIVE );
1701 - return;
 1701+ return false;
17021702 }
17031703
17041704 //If exists, log them in
@@ -1707,7 +1707,7 @@
17081708 $wgAuth->updateUser( $wgUser );
17091709 $wgUser->setCookies();
17101710 $wgUser->setupSession();
1711 - return;
 1711+ return true;
17121712 }
17131713 $wgAuth->printDebug( "User does not exist in local database; creating.", self::NONSENSITIVE );
17141714
@@ -1741,5 +1741,7 @@
17421742 //Initialize the user
17431743 $wgUser->setupSession();
17441744 $wgUser->setCookies();
 1745+
 1746+ return true;
17451747 }
17461748 ?>

Status & tagging log