http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96609

Revision: 96609
Author:   laner
Date:     2011-09-08 20:04:57 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
Adding support for domain in mail-me-a-password form.

Modified Paths:
--------------
    trunk/extensions/LdapAuthentication/LdapAuthentication.php

Modified: trunk/extensions/LdapAuthentication/LdapAuthentication.php
===================================================================
--- trunk/extensions/LdapAuthentication/LdapAuthentication.php  2011-09-08 
20:00:55 UTC (rev 96608)
+++ trunk/extensions/LdapAuthentication/LdapAuthentication.php  2011-09-08 
20:04:57 UTC (rev 96609)
@@ -88,6 +88,7 @@
 $wgLDAPUniqueBlockLogin = array(); //Currently unused
 $wgLDAPUniqueRenameUser = array(); //Currently unused
 $wgLDAPUseFetchedUsername = array();
+$wgPasswordResetRoutes['domain'] = true;
 
 define( "LDAPAUTHVERSION", "1.2f" );
 
@@ -440,9 +441,7 @@
         * @access public
         */
        function modifyUITemplate( &$template ) {
-               global $wgLDAPDomainNames, $wgLDAPUseLocal;
                global $wgLDAPAddLDAPUsers;
-               global $wgLDAPAutoAuthDomain;
                global $wgLDAPMailPassword;
 
                $this->printDebug( "Entering modifyUITemplate", NONSENSITIVE );
@@ -455,6 +454,14 @@
                $template->set( 'useemail', isset( 
$wgLDAPMailPassword[$_SESSION['wsDomain']] ) && 
$wgLDAPMailPassword[$_SESSION['wsDomain']] );
                $template->set( 'canreset', isset( 
$wgLDAPMailPassword[$_SESSION['wsDomain']] ) && 
$wgLDAPMailPassword[$_SESSION['wsDomain']] );
 
+
+               $template->set( 'domainnames', $this->domainList() );
+               wfRunHooks( 'LDAPModifyUITemplate', array( &$template ) );
+       }
+
+       function domainList() {
+               global $wgLDAPDomainNames, $wgLDAPUseLocal, 
$wgLDAPAutoAuthDomain;
+
                $tempDomArr = $wgLDAPDomainNames;
                if ( $wgLDAPUseLocal ) {
                        $this->printDebug( "Allowing the local domain, adding 
it to the list.", NONSENSITIVE );
@@ -469,8 +476,11 @@
                        unset( $tempDomArr[array_search( $wgLDAPAutoAuthDomain, 
$tempDomArr )] );
                }
 
-               $template->set( 'domainnames', $tempDomArr );
-               wfRunHooks( 'LDAPModifyUITemplate', array( &$template ) );
+               $domains = array();
+               foreach ( $tempDomArr as $tempDom ) {
+                       $domains["$tempDom"] = $tempDom;
+               }
+               return $domains;
        }
 
        /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to