r50109 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50108‎ | r50109 | r50110 >
Date:18:19, 1 May 2009
Author:laner
Status:deferred
Tags:
Comment:
Fixing backwards compatibility for MediaWiki 1.12 and below. Patch from Gabe Van Engel.
Modified paths:
  • /trunk/extensions/LdapAuthentication/LdapAuthentication.php (modified) (history)
  • /trunk/extensions/LdapAuthentication/LdapAutoAuthentication.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LdapAuthentication/LdapAutoAuthentication.php
@@ -7,7 +7,7 @@
88 *
99 * @access public
1010 */
11 - static function Authenticate( $user, &$result ) {
 11+ static function Authenticate( $user, &$result = null ) {
1212 global $wgUser;
1313 global $wgAuth;
1414 global $wgLDAPAutoAuthUsername;
Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php
@@ -1739,7 +1739,11 @@
17401740 if( $wgLDAPAutoAuthUsername != null ) {
17411741 $wgAuth->printDebug( "wgLDAPAutoAuthUsername is not null, adding hooks.", NONSENSITIVE );
17421742 if ( version_compare( $wgVersion, '1.14.0', '<' ) ) {
1743 - $wgHooks['UserLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate';
 1743+ if ( version_compare( $wgVersion, '1.13.0', '<' ) ) {
 1744+ $wgHooks['AutoAuthenticate'][] = 'LdapAutoAuthentication::Authenticate';
 1745+ } else {
 1746+ $wgHooks['UserLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate';
 1747+ }
17441748 } else {
17451749 $wgHooks['UserLoadAfterLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate';
17461750 }

Status & tagging log