I cannot login to SMF directly via Mambo CB (Solved - partly)

Started by aht961, January 30, 2012, 04:49:34 PM

Previous topic - Next topic

aht961

Hi everybody,

After two days of trying, reading, searching, I decided to ask my problem here. I have installed SMF 2.0.2 and the Bridge 2.0_mambo_4-6 and I have mambo 4.6.5 with CB 1.2.2. The Community Builder is an old version since my service provider is using still pHp 4.4.9.

The reason why I ended in SMF and Mambo was the fact of this available bridge between both. All I want is to have the visitor register and log via my main website as a gateway and then enter to the forums without any need for retyping the username or registering.

I have installed the component without any errors, and adjusted the settings according to the guides given here.

Bridge configured as follows:
- Unwrapped, registration via Community Builder (check the sync and I could migrate the users from CB/Mambo to SMF without any problems,
- All reside in the same database
- SMF-login and logout UNPUBLISHED and SMF_register published.
- Site module CB-login published, bridge login (mod_smf_login) unpublished
- Component added to main menu and linked to user submenu
- In SMF I have removed friendly URL links
- Turned on domainbased cookies

1. After I register / login to Mambo, I could direct the user via mambo to SMF but there the user is shown as a guest, not logged. If I enter the credentials, the user is not recognised by SMF. I f I hit "register" then the user is redirected to Mambo where it says "you are already logged in".

2. I could only transfer my users manually via Admin panel in mambo (sync / migrate button). None of the users are transferred automaticaaly.

3. If I login directly to the forum via mysite/forum/index.php, I am redirected to Mambo after I logout.

I am going crazy. I have tried all other possibilities (using bridge reg, mambo reg, direct SMF reg), still the users are not transferred and could not log automatically.

I thank you for your attention and look forward to hearing some solution / suggestion.

wbw - thank you

Kindred

Actually, as far as know, the mambo bridge does network with the current SMF/mambo combo.
Сл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."

aht961

It is not only me then :( Any suggestion with regard to the version that works for sure? The version of SMF and the bridge that could be compatable with 4.6.5 mambo?

Kindred

no, actually, I gave up on mambo ages ago -- I decided that I could do everything that mambo does using SMF mods.
Сл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."

aht961

Kindred Hi, I have just noticed that you have been around here for a while, so you might know something about the roadmap for this bridge. I am trying to integrate SMF into Mambo, since on the mambo side I have a few self coded additions which I need to keep at my site and it seems a huge burden to go over all these and integrate them to mambo. However, my site has been down now for 10 days and I am stucked with this forum part. So, could you please comment on the follwoing so I might have some better idea.

1) Even the newest bridge seems to be quite old (I have suprised, since I thought at the beginning it is new, hence I decided to stick with SMF & mambo combination and gave phpBB3 away). Do you think it is reasonable to wait that this Bridge <-> SMF version 2 <-> Mambo 4.6.5 problem will be solved by the developer - or has he/she gave up development process for good?

2) After a few install/reinstall and tens of different combinations, I managed to have some communication between mambo and SMF: when I use the mambo's own registration and SMF-login options inside tha bridge, I get "we have a new member Mr X" notice on the first page of SMF board, however, there exists no Mr X on the memberlist of the SMF.

3) For the time being, I would be even satisfied if I could get the Mambo members transferred to the SMF site automatically via a cron job maybe? I could do this via the bridge menu in the admin panel, but I do not want to get involved of doing manual syncs. Is it doable?

I thank you for your time.

Regards.
Aht.

Kindred

Hi...

The problem is - we are a volunteer group and none of the current developers is much interested in the bridges... :(   So, unfortunately, I can not even estimate any update.

the current bridge dates back to the beta versions of SMF 2.0 -- which means it is going to require some tweaking (code-side) to get it to work because the code, variables, functions and database have all changed between 2.0 beta4 and 2.0.2.

I'd suggest you try sending a message to Andre (the creator of the SMF2_API files) he might be willing to take a look at updating the bridge.
Сл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."

aht961

#6
Finally I have managed to solve the problem - at least partly. Since this was a painstaking experience I want to share my experience with you. In case if you are interested, I will try to go through the modifications one by one. This will let you use the most recent bridge (v2 beta) with the most recent SMF (2.0.2) and mambo, 4.6.5 (partly the community builder as well). Consequently in the only scenario which I have managed to function, the new registrations/cancellations will be made via SMF (unwrapped but accessed via mambo component), however, all the new registrations will be migrated automatically to your mambo database (and if you have community builder as well).

Before doing this we have to make some modifications and corrections. All of these, except one hard code change in the database table, could be found over these forums, but they are all scattered around. many thanks go to the developer of the bridge and to others who have suggested the solution in different messages.

1. Install the most recent bridge and the SMF and mambo. Then go through the decent installation guides given here, especially underlined by Kindred. Make sure to publish all mambots as well as the mod_smf_login. Choose as a part of the main menu, the bridge component and make it open to public. In SMF choose subdomaincookies and databased sessions (untick the local cookies). Don't use cache. Choose activation method (by email) for your registrations.

2. You will have a very messy board if you access it unwrapped, so go and correct the follwing in /com_smf/smf.php
Find (around row 1245): You will have a nice template thereafter.

function integrate_load_theme() {
global $context, $simpleActions;
if (!WIRELESS && !isset($_REQUEST['xml']))
$context['template_layers'] = array('body');
}


replace with:

function integrate_load_theme() {
global $context, $simpleActions, $wrapped;
if (!WIRELESS && !isset($_REQUEST['xml']) && $wrapped == 'true')
$context['template_layers'] = array('body');
}


2. You will get errors concerning the smf.php concerning three rows starting at row 1109

Find this:

   global $language, $synch_lang, $language_conversion, $smf_path;

$configuration =& mamboCore::getMamboCore();
$database =& mamboDatabase::getInstance();
$mainframe =& mosMainFrame::getInstance();


Replace with this:

   global $language, $synch_lang, $language_conversion, $smf_path, $configuration, $database, $mainframe;

3. You will get another error concerning mod.smf.login file:

Find (around row 50-52)

   function integrate_pre_load () {

global $lang, $mosConfig_lang, $synch_lang, $smf_lang, $smf_path;


Add there also the configuration like as follows:

   
function integrate_pre_load () {

global $lang, $mosConfig_lang, $synch_lang, $smf_lang, $smf_path, $configuration;


You are done if you have not got community builder on the mambo side. If you want to have the members entered also in "mos_comprofiler" table you need following changes:

4. The mos_comprofiler table misses a row called "is_admin", so any attempts to copy a user via the bridge causes errors. You need to go to the database and add a row named "is_admin". That will be text field with default value "N". This means that any new user will considered as a normal registered member not a administrator (in which case the "N" changes to "Y" = yes).

5. Then you must change the SQL query in smf.registration.php file in order to be able to copy this row as well, otherwise the Community Builder will give server errors. So, fetch "/components/com_smf_registration/smf.registration.php"

Find (row 192)
         if ($cb_reg=="on")
                               $sql = mysql_query("
INSERT INTO {$mosConfig_dbprefix}comprofiler
(id, user_id)
VALUES ('$mos_id', '$mos_id')");


Add also "is_admin" there with default value N

         if ($cb_reg=="on")
$sql = mysql_query("
INSERT INTO {$mosConfig_dbprefix}comprofiler
(id, user_id, is_admin)
VALUES ('$mos_id', '$mos_id', $mos_is_admin)");


That's it -you are done!

Hope this helps others.


Kindred

Сл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."

aht961

Not everything is solved, though. If I keep the language sync with mambo, the SMF does not allow me to change the language from ISO-8859-1 to utf8 version of Finnish locale. If I don't sync the language with mambo, the email sent to the the member to be is full of "weird" characters and e.g. my Web based email client does not show the content , so one cannot click the confirmation link. Some mail clients (like iPhone's mail) show it, though. This means some of the members will not be able to confirm their registration. If I keep sync, I cannot change the default language from English to Finnish (although it is fi_FI and utf-8 in mambo config).

If I keep the default language in English, every thing is ok. If I choose the ISO-8859 version of the Finnish language, the mail is shown but the forum is full of these undefined characters.

Long story in short: Is there any way that I keep the language sync but still could change the language after login?

Weird thing is mambo's locale is using utf-8 character set, however, SMF thinks that it is ISO-8859-1. Hope I made myself clear?


Kindred

did you install SMF with the UTF-8 language and UTF-8 database?
Сл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."

aht961

Quote from: Kindred on February 02, 2012, 02:01:51 PM
did you install SMF with the UTF-8 language and UTF-8 database?
Yes I did, and without the "bridge" it functions flawlessly. When the bridge is "on" with lang sync, the forum just keeps the ISO-8859 charset language. If you try to choose the utf-8 version, it just falls back to the default. Turn the bridge's sync off, everything is fine (but then the email's body is not displayed in the browser (in some). I get the impression, that SMF gets a wrong parameter from mambo and assumes that it is a ISO-8859 charset :(

SOLVED: In the file /com_smf/smf.php, are there three rows which clean the sended email - and I believe that these linese cause the problem. I commented these (the following) out, turned the sync off on the bridge side in mambo, and now could read the body of the confirmation mail and see the link to click and could change the default language. So, now, happy again.

Starting around row 624 find these and get rid of:

//THis is an email, after all, so let's make sure entities and special characters are text, not HTML
//   $message = trim($message);
//     $message = html_entity_decode($message);
//   $message = un_htmlspecialchars($message);
//   $hotmail_fix = false;
//   return true;

Could you Kindred kindly check if this is ok to get rid of these lines from the point of functionality?. I am so novice when comes to the code stuff.

Kindred

hmmm....   that is a security thing, in that it cleans html out of the message.

I'm not a proficient enough coder to tell you what security might be affected by removing those checks.
Сл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."

Advertisement: