Elgg plugin for mediawiki v0.2

Release Notes

This plugin is for Mediawiki (tested with 1.14)

It allows Elgg users to log into Mediawiki (same domain) transparently, without any specific action : if you're logged into Elgg, you're logged into MW when you visit it.

Mediawiki users can't use their existing account to log in without Elgg (bug detected in previous version, unsolved).

If account doesn't exist, it's created into MW using Elgg data (also validate email and activate notifications by mail - assuming that emails are validated in Elgg).


see also http://community.elgg.org/pg/plugins/computermacgyver/read/64330/mediawiki-elgg-15-integration for a pure MW-slave-mode plugin :)


Plugin ameliorations welcome !


Based on Aperto Elearning Solutions (2006, http://www.aperto-elearning.com/ ) plugin revised by Ed Lyons (2008, ejlyons@ix.netcom.com).

  • Hi, this plugin has integrated the media wiki package ? or I have to install my own package of media wiki separately in my domain ?

  • Hi,

    this is actually not an Elgg plugin : this script works on Mediawiki's side ; so there's no included package, and you have to install Mediawiki (and Elgg) separately.

    You may get Mediawiki on http://www.mediawiki.org/wiki/Download , then add this "extension" (let's meet MW's vocabulary) to your new install.

  • 2 questions:  1) What is anything is needed on the Elgg side?  2) Do you know of a plugin or widget  that pulls in data mediawiki? (Like recent changes, random page, current events, etc.)

  • 1) nothing is needed on Elgg's side  :)

    2) i don't know such plugins "as is", but there are some plugins that might do quite the same, especially Cash's "SimplePie Feed Integrator" plugin => http://community.elgg.org/pg/plugins/costelloc/read/37480/simplepie-feed-integrator  - get the feed from MW, and pull it into Elgg..

    There are various extensions on MW's side that can extend the way it produces feeds (especially DPL combined with WikiArticleFeeds  ;)

  • If you have both scripts installed, is there any way you know of to integrate search over both areas of the site? I guess I could do google search integration, but I'd rather have search controlled by my own site rather than 3rd party.

  • nope, sorry : i didn't look forward in this direction.

    btw, MW and Elgg's search are quite different, as Elgg's search seems to be purely based on tags, and Mediawiki's allows fulltext search.

    I guess you could integrate search using both REST API (i'd do that rather on elgg's side)

    URL template is WIKI_ROOT_URL/Special:Search?search=SEARCHTEXT&fulltext=Search for MW (or give a look at api.php for API parameters), and ELGG_ROOT_URL/search/?tag=SEARCHTEXT for Elgg

    hope it helps ?-)

  • Has this been tested with MediaWiki 1.15.0?  Is there a newer version?  I am about to try to installed this afternoon.


  • Ok I did install and followed directions in the README.txt file.  However I can't tell that the plugin is doing anything on the mediawiki side. Everything is readable and editable even if I'm not logged in. (Using MediaWiki 1.15)

    Long term I want an open garden for reading and a closed garden for editing.   Anyone know how to configure that with this plugin.

  • pwb70

    I can confirm - this plugin works as expected with latest MW, but same configuration's action needed at the MW side beside this  extension.

    F.e you have to disable anonymous editing of MW pages. Our Elgg-Mediawiki pair works here

  • Thanks for feedback, i hadn't tested yet  ;)

    @pwd70 : User rights are defined independantly, directly into LocalSettings.php ( http://www.mediawiki.org/wiki/Manual:LocalSettings.php )

    You can also define new roles, and attribute rights to them..

    BTW, rights management work just like CSS : first define overall behaviour, then customise precise rights for specific roles.

  • Ok, are there logs I can look at the see what is happening?  I am not getting automaticlly logged in to the wiki if logged into elgg.  The ip address shows where the loginname should be. 


    I did follow the instructions and get the User rights configured as I wanted for mediawiki.  Thanks for that?

  • I noticed that sometimes you don't appear logged in at first, but only after you've clicked on any internal link in the site.. Maybe it's what's happening ?

    Are the settings OK ?  especially the domain (without http:// ) + have you checked the MX cookie prefix ? (as it appears in your browser's cookie viewer)

    Documentation is a bit messy (i only added a few lines before previous version by Ed Lyons, and didn't rewrite it at all)

  • hey all i tryed to do this application and it just does not let me go onto the wiki site as it comes up with some error in french (Impossible de vous identifier. Condition d'erreur 333.) i have tryed every thing... Please Help

  • english (Unable to identify you. Error condition 111.)

  • This plugin won't let you login directly to Mediawiki, but only from Elgg (though i'd prefer to let users use various identification method).

    Any details on what precisely doesn't work ? (MW version ?  have you checked cookie's name, paths, etc. ?)

  • i have done every thing the redme said. MW 1.15 and did the cookies thing etc

  • Plugin was tested on 1.14 only..

    I'll try to upload a new version some day, but i'm not really on it right now - rather at the end of the year ; i hope someone else release a better plugin till then ;)

  • i think i have found where there may be a problem. Elgg 1.5 and most likly 1.6 no longer have the table elggusers_sessions so what have they changed it to

  • I have it working with MW 1.14 + Elgg 1.5 - original plugin was indeed for Elgg 1.x ; haven't tested on Elgg 1.6 btw..

  • well do are you plaining on updating this plugin and if not how could i fix it to look at some place other then elggusers_sessions as this is not available in 1.5 or 6

  • No update planned..

    btw, there IS a "users_sessions" table in Elgg version 1.5  // original plugin was updated to reflect these changes   - the exact name depends on which db-prefix you use : mine is "elgg_" => "elgg_users_sessions"

  • i can find elgguser_apisessions would that do the same thing. my extention is "elgg"

  • and do you give me permission to update the plugin (if i can)

  • this thing is not the easiest thing to mod lol i found where it looks into the database for information for the users session and i have also looked at sessions.php which comes with elgg. i need to rewrite the following code.


        function elggGetUser($cookieValue) {
          $elggUser = NULL;
    //      $md5cookie = md5($cookieValue);
          $users = ELGG_DB_PREFIX . 'users_entity';
          $users_sess = ELGG_DB_PREFIX . 'users_sessions';
      /* Code for Elgg 1.1 DB
          $rs = $this->elggDbQuery("select $users.ident id, $users.username username, $users.name name, " .
                                   "$users.email email, $users.active active, $user_flags.value banned " .
                                   "from $users left join $user_flags " .
                                   "on $users.ident = $user_flags.user_id " .
                                   "and $user_flags.flag = 'banned' " .
                                   "where $users.user_type = 'person'" .
                                   "and $users.code = '$md5cookie';");
          $rs = $this->elggDbQuery("select $users.guid id, $users.username username, $users.name name, " .
                                   "$users.email email, $users.banned banned, $users_sess.session " .
                                   "from $users left join $users_sess on $users.last_action = $users_sess.ts " .
                                   "where $users_sess.session = '$cookieValue' ;");
          if(count($rs) > 0) {
              $row = $rs[0];
              $elggUser->username = $row['username'];
              $elggUser->name = $row['name'];
              $elggUser->email = $row['email'];
              $elggUser->active = 'yes';  // seems deprecated in Elgg v1.5 (merged with "banned" ?)
              $elggUser->banned = $row['banned']=='yes';
          return $elggUser;


    as the database when i have looked at it has a table called "elgg prefix"user_apisessions, this is where elgg place all its session information now you are looking for a row called seassions which nolonger exists the database now has the following

    id, user_guid, site_guid, token, expires

    so we need to find which one of these enteries will allow us to see the seassion information

  • Sure, feel free to adapt and update the plugin !   i'm pretty sure there are much better way to do SSO than this plugin -maybe easier from Elgg than from Mediawiki- as there are now much better APIs (at least on Elgg's side) - i simply don't have time to work on this these months  :-s

    in this plugin, the SQL code is at lines 222-225 in ElggAuthPlugin.php (though i'm not sure this is the part that needs to be adapted)


    btw, i confirm that table prefix_users_sessions still exists on 1.6, with rows "session", "ts", "data" : see DB schema on https://trac.elgg.org/elgg/browser/releases/core/elgg1.6/engine/schema/mysql.sql   (prefix_apisessions is used to stored API sessions, not 'normal' sessions - if you don't use the API, it should remain empty)

Florian DANIEL aka Facyla

Web consultant, Elgg developer, entrepreneur @ Facyla & natural idées


  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 2134
  • Recommendations: 0

Other Projects

View Florian DANIEL aka Facyla's plugins