Extension talk:AuthJoomla/ja

Hi

Thanks for a very useful extension. However, it does not work when the MediaWiki database tables are given a prefix. The problem is that the SQL user authentication query tries to parse a table in the joomla database containing both the joomla prefix, example (jos_) and the MediaWiki prefix, example (mw_). The table which is searched has the form "joomla_db.mw_jos_users". This table does not exist and an error is returned. The correct table should have been joomla_db.jos_users which is what results without the mw_ prefix attached.

Has anyone managed to get the extension to work with the MediaWiki database tablenames prefixed?

P.S. The extension works fine when no prefix is attached to the MediaWiki database tables.

I am running : Joomla 1.5.3 MediaWiki 1.12 (same result on 1.11.1) PHP 5.2.5 MySQL 5.0.45 Apache 2.2.6

Thanks

You can try to write yourself the queries: I made this: $query = 'SELECT password FROM jos_users WHERE username = \''. $username. '\' LIMIT 1'; $hash_password = mysql_fetch_object(mysql_query($query));

and this: $query = 'SELECT password FROM jos_users WHERE username = \''. $user->mName. '\' LIMIT 1'; $juser = mysql_fetch_object(mysql_query($query));

Thanks for replying but I am a bit lost. Where (in which file) do I place those queries??? It would be much more helpful, if you could provide a step by step guide.

Password Problems
I'm connecting to the DB fine and can authenticate the username; however, something's going wrong with the password authentication in this segment so that I always get an "incorrect password" response:

---

function authenticate( $username, $password ) {       $db = $this->connectToDB; $hash_password = $db->selectRow($this->userTable, array ( 'password' ), array ( 'username' => $username ), __METHOD__ ); $parts = explode( ':', $hash_password->password ); $crypt = $parts[0]; $salt = @$parts[1]; if ( is_file($GLOBALS['wgAuthJoomla_Path'].'/libraries/joomla/user/helper.php')) {           require_once $GLOBALS['wgAuthJoomla_Path'].'/libraries/joomla/user/helper.php'; $testcrypt = JUserHelper::getCryptedPassword($password, $salt); }       if ($crypt == $testcrypt) { return true; }       return false; } ---

My configuration:
 * Joomla 1.5.2
 * MediaWiki 1.12
 * PHP 5.2.6
 * MySQL 5.0.45

I'd appreciate any advice on how to fix. Thanks!

Joomla 1.0.x
Hi, I want to use this with Joomla 1.0.12 or higher versions. Is it possible, or I need to change things in the script?

DB prefix "wiki_"
hi! how setup AuthJoomla in new MediaWiki-1.14 install with DB prefix 'wiki_'? "AuthJoomla::authenticate". MySQL error "1146: Table 'table_name.wiki_jos_users' doesn't exist (localhost)".--Mazapura 21:38, 8 March 2009 (UTC)
 * I have exacty the same problem. But to fix it? --87.158.199.77 17:55, 22 March 2009 (UTC)

Bugs Fix

 * Hi! The problem is that it is using the MediaWiki database prefix with either "wiki_" or another, you must remove the code that database and everything works properly. I translated the post for the extension to all Spanish and notifying users of the same to use the database without any prefix. This is the link: http://www.mediawiki.org/wiki/Extension:AuthJoomla/es -- Alakentu 21:31, 27 April 2009 (UTC)