Error after login on Special:SpecialPages

Jump to: navigation, search

I've configured LDAP and got it working. However, after I login, if I visit the Special:SpecialPages page, I get this error:

PHP Warning: strtok() expects parameter 1 to be string, array given in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 566 
PHP Warning: ldap_start_tls(): Unable to start TLS: Can't contact LDAP server in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 589 
PHP Warning: strtok() expects parameter 1 to be string, array given in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 566 
PHP Warning: ldap_start_tls(): Unable to start TLS: Can't contact LDAP server in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 589 

Once I get the error, I get it on every page until I manually go to the logout page and logout. I'm quite confused why I get this error after the LDAP authentication has already happened. I'm just using basic authentication - no searches or groups, and every other page I've tested works. Only Special:SpecialPages is having trouble. If I logout, I can visit SpecialPages without issue. The problem only occurs after I've logged in.

  • MediaWiki 1.18
  • LDAPAuthentication Revision 107956 pulled from SVN on 3-Jan-2012
  • PHP 5.3.8
  • WIMP architecture on Windows 2008 R2
require_once( "$IP/extensions/LdapAuthentication/LdapAuthentication.php" );
$wgAuth                         = new LdapAuthenticationPlugin();
# production setup
$wgLDAPDomainNames              = array("domain.com");
$wgLDAPBaseDNs                  = array("domain.com" =>"dc=domain,dc=com");
$wgLDAPServerNames              = array("domain.com" => "dc1.domain.com");
$wgLDAPSearchStrings            = array("domain.com" => "USER-NAME@domain.com");
$wgLDAPEncryptionType           = array("domain.com" => "clear"); # replace "clear" with "ssl" if that is necessary
$wgLDAPProxyAgent               = array("domain.com" => "CN=LDAP-reader-account,DC=domain,DC=com");
$wgLDAPProxyAgentPassword       = array("domain.com" => "password");
JasonPenney02:38, 4 January 2012

This is a bug in MediaWiki. I fixed this in MediaWiki trunk, you can easily backport it.

Ryan lane01:30, 5 January 2012

Ryan, you rule. Super easy fix, even for someone who doesn't know anything about PHP. I was just about to disable LDAP authentication and now I don't have to. Thanks for making this extension and providing such quick support. JasonPenney 14:36, 5 January 2012 (UTC)

JasonPenney14:36, 5 January 2012

You're welcome. Thankfully this will just be fixed in the next release, so no more patching needed :).

Ryan lane19:25, 5 January 2012

Ryan, FYI, I'm still getting this error when an unauthenticated user visits a "redlink" page. Since you sound confident that the next Mediawiki release will deal with the underlying issue, I'm not that worried, but if you're the one making those fixes, if figured you'd want to know.

PHP Warning: strtok() expects parameter 1 to be string, array given in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 566
PHP Warning: ldap_start_tls(): Unable to start TLS: Can't contact LDAP server in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 589
PHP Warning: strtok() expects parameter 1 to be string, array given in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 566
PHP Warning: ldap_start_tls(): Unable to start TLS: Can't contact LDAP server in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 589
PHP Warning: strtok() expects parameter 1 to be string, array given in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 566
PHP Warning: ldap_start_tls(): Unable to start TLS: Can't contact LDAP server in C:\inetpub\wwwroot\twiki\extensions\LdapAuthentication\LdapAuthentication.php on line 589 

This is the code change I made in SpecialUserLogin.php

                if( !$wgAuth->validDomain( $this->mDomain ) ) {
# JPenney - changed this code based on http://www.mediawiki.org/wiki/Special:Code/MediaWiki/107129
#                       $this->mDomain = 'invaliddomain';
                        if ( isset( $_SESSION['wsDomain'] ) ) {
                                $this->mDomain = $_SESSION['wsDomain'];
                        } else {
                                $this->mDomain = 'invaliddomain';
                        }
                }
                $wgAuth->setDomain( $this->mDomain );
JasonPenney19:11, 10 January 2012

The warnings you are getting were fixed in LdapAuthentication r108179. It may also fix your problem.

Ryan lane22:31, 10 January 2012
 
 
 
 
 
Personal tools

Variants
Actions
Navigation
Support
Download
Development
Communication
Toolbox