-

Note: You are currently viewing documentation for Moodle 3.10. Up-to-date documentation for the latest stable version of Moodle may be available here: AuthMoodle.

AuthMoodle: Difference between revisions

From MoodleDocs
No edit summary
(Added some unofficial fixes for mediawiki 1.7)
Line 20: Line 20:


==Bugs with AuthMoodle in mediawiki 1.7==
==Bugs with AuthMoodle in mediawiki 1.7==
* preferences are no longer sticky (they pretend to save but don't really save)
* preferences are no longer sticky (they pretend to save but don't really save)<br>'''fix:''' disable this '''if''' in includes/SpecialPreferences.php around line 290:
* the moodle database prefix is different from the mediawiki database prefix must match (or be blank)
 
'''/*'''
if (!$wgAuth->updateExternalDB($wgUser)) {
    $this->mainPrefsForm( wfMsg( 'externaldberror' ) );
    return;
}
'''*/'''
* if the moodle database prefix is different from the mediawiki database prefix must match (or be blank)<br>'''fix:''' edit the function tableName in includes/Database.php around line 1310 and 1313:
 
function tableName( $name ) {
    global $wgSharedDB''', $wgAuth''';
    # Skip quoted literals
    if ( $name{0} != '`' ) {
        if ( $this->mTablePrefix !== '' &&  strpos( '.', $name ) === false
            '''&& strpos ($name, $wgAuth->mAuthMoodleTablePrefix) === false''' ) {
 
* for mediawiki 1.7, I had to change line 33 to '''includes/'''AuthPlugin.php and comment out line 223-226 (refers to a non-existent function)
* for mediawiki 1.7, I had to change line 33 to '''includes/'''AuthPlugin.php and comment out line 223-226 (refers to a non-existent function)


==Useful Information==
==Useful Information==

Revision as of 19:58, 11 September 2006

AuthMoodle.php

quoting Martin's instructions based on the root folder of the wikimedia installation:

Save it in extensions/AuthMoodle.php.
Then you just put this in LocalSettings.php:
require_once( 'extensions/AuthMoodle.php' );
$wgAuth = new AuthMoodle();
$wgAuth->setAuthMoodleTablePrefix();
$wgAuth->setAuthMoodleDBServer('yoursite.org');
$wgAuth->setAuthMoodleDBName('yourdb');
$wgAuth->setAuthMoodleUser('yourdbuser');
$wgAuth->setAuthMoodlePassword('yourdbpass');

Bugs with AuthMoodle in mediawiki 1.7

  • preferences are no longer sticky (they pretend to save but don't really save)
    fix: disable this if in includes/SpecialPreferences.php around line 290:
/*
if (!$wgAuth->updateExternalDB($wgUser)) {
    $this->mainPrefsForm( wfMsg( 'externaldberror' ) );
    return;
}
*/ 
  • if the moodle database prefix is different from the mediawiki database prefix must match (or be blank)
    fix: edit the function tableName in includes/Database.php around line 1310 and 1313:
function tableName( $name ) {
   global $wgSharedDB, $wgAuth;
   # Skip quoted literals
   if ( $name{0} != '`' ) {
       if ( $this->mTablePrefix !==  &&  strpos( '.', $name ) === false 
            && strpos ($name, $wgAuth->mAuthMoodleTablePrefix) === false ) {
  • for mediawiki 1.7, I had to change line 33 to includes/AuthPlugin.php and comment out line 223-226 (refers to a non-existent function)

Useful Information