News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Some Login Issue and the Fix

Started by wedge, February 13, 2007, 04:18:25 AM

Previous topic - Next topic

wedge

Hello.

We've just installed the latest version of the bridge on our site hxxp:www.adventure-eu.com/ [nonactive] and it works quite good. We're using Joomla 1.0.12 and SMF 1.1.1 we've not yet made the update to 1.1.2 which will not change the problem.

Our site is quite special as we're having one user database for several language on the site, we're using a little hack in the database.php file to redirect all request to the users and core tables to the same one. So the thing is that your component is working using directly mysql_query and others and so at it is not passing through the database core file of mambo it is not working on our subsites. I've made the fix by manually rewriting the query using the mosConfig_dbprefix to match our system tables.

Will it be possible in a future uptade to use $database for queries so that it will work propoerly whatever is going on ? :)

There is only one issue that stills which is that when you login onto let's say hxxp:www.adventure-eu.com/ [nonactive] you will be logged correctly on the forum, but on hxxp:www.adventure-eu.com/fr/ [nonactive] you will not be logged, I don't really know yet where to look to fix this trouble.

Kindred

what bridge version are you using?

As far as I know, orstio's bridge DOES use the variables for the database name and prefix. The info is not hard-coded anywhere...

As for the other issue...    the bridge is not intended to run with multiple installations of joomla...  the problem is that the JOOMLA cookie is set specific to the joomla setup...   so http://www.adventure-eu.com/  sets a different cookie from http://www.adventure-eu.com/fr/...    and joomla has no option for subdomain independent cookies...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wedge

Hell well I'm using the latest bridge here.

And yes the query are using the $db_prefix from the configuration file, but not using the $database class provided by Joomla to run database queries. For example a bit of code is :

$request = mysql_query("
SELECT username, id, gid, block, usertype
FROM {$mosConfig_dbprefix}users
WHERE username = '$username'
AND password = '$passwd'");


Where obviously it uses the database prefix, but not doing something like that :

$database -> setQuery("
SELECT username, id, gid, block, usertype
FROM #__users
WHERE username = '$username'
AND password = '$passwd'");


Which mambo/joomla way of providing db support and it is at the level of this class that I made a little modification to ensure there are a single database for login in but not for all the other stuffs (content and so on). For me it looks weird not using $database as it is at the core of mambo and to access the database. Using mysql_query without argument. The problem with that is that it makes me have to edit the component file, and that it might end with unpredicted behavior. I did not checked everything, but if another compoents set up another database connection with a mysql_connect, it might be this last one that would be used instead of the one used by mambo/joomla which would endup in some troubles.

Anyway thanks for the tip about the subdomain I'll check to find out some way to make it work, there must be some way to do it. We don't have lot of ways to do things otherwise while having various languages and content for one single database.

Kindred

latest is not a version...

and your query only works if the joomla and smf installations are in the same database and could cause other problems...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wedge

yeah well if that is so, only the smf request should be using a traditionnal mysql_query not the joomla ones. Anyway that's just a thing that would ensure a better integration with joomla/mambo

Advertisement: