Page MenuHomePhabricator

Add SQLite Support to LDAP Authentication extension
Closed, ResolvedPublic


The latest version of LDAP Authentication (REL1_25-d4db6f0) does not include any support for SQLite and the "updatedb.php" step necessary for it to work silently fails.

More details about this bug discovery are here: but I did not see a bug report filed on it. Apologies if this is a duplicate.

To fix the problem, create a schema/ldap-sqlite.sql file containing the following:

CREATE TABLE ldap_domains (
        -- IF for domain

        -- domain itself
        domain TEXT,

        -- User to which this domain belongs
        user_id TEXT

) /*$wgDBTableOptions*/;

CREATE INDEX user_id on ldap_domains (user_id);

And apply this patch to LdapAuthentication.php:

*** LdapAuthentication.php.orig 2015-08-07 10:26:56.912671115 -0700
--- LdapAuthentication.php      2015-08-07 10:39:17.729696047 -0700
*** 114,120 ****
        case 'postgres':
                $updater->addExtensionTable( 'ldap_domains', "$base/schema/ldap-postgres.sql" );
!       }
        return true;

--- 114,123 ----
        case 'postgres':
                $updater->addExtensionTable( 'ldap_domains', "$base/schema/ldap-postgres.sql" );
!         case 'sqlite':
!                 $updater->addExtensionTable( 'ldap_domains', "$base/schema/ldap-sqlite.sql" );
!                 break;
!         }
        return true;

Incorporating something like that as a permanent fix would be great for other SQLite users.


  • Steve Bonds

Event Timeline

sbonds raised the priority of this task from to Needs Triage.
sbonds updated the task description. (Show Details)
sbonds added a subscriber: sbonds.
saper triaged this task as Medium priority.
saper set Security to None.

Change 262707 had a related patch set uploaded (by saper):
Add SQLite Support to LDAP Authentication extension

Hi @sbonds - I have pushed your patch to the "code review" (i.e. the red tape needed to get this thing included), I only would love to include your name and email address in the git commit, since you are the author. Can you mail me at Thanks

Sorry for the late reply, @saper. I have E-mailed you from my account.

Change 262707 merged by jenkins-bot:
[mediawiki/extensions/LdapAuthentication@master] Add SQLite Support to LDAP Authentication extension

Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Mass-moving all items tagged for MediaWiki 1.30.0-wmf.3, as that was never released; instead, we're using -wmf.4.

@saper: The patch in Gerrit has been merged, so I assume this task has been resolved. (If I misunderstand, please reset the task status via Add Action...Change Status in the dropdown menu). Thanks!