Advertisement:

Author Topic: I cannot login to SMF directly via Mambo CB (Solved - partly)  (Read 12419 times)

Offline aht961

  • Newbie
  • *
  • Posts: 6
I cannot login to SMF directly via Mambo CB (Solved - partly)
« on: January 30, 2012, 04:49:34 PM »
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
« Last Edit: February 01, 2012, 03:38:16 PM by aht961 »

Offline Kindred

  • The Mean One
  • Local Moderator
  • SMF Master
  • *
  • Posts: 42,799
  • Gender: Male
    • wagner999 on Facebook
    • Kindred-999 on GitHub
    • www.linkedin.com/in/wdwagner/ on LinkedIn
    • @Kindred_999 on Twitter
Re: I cannot login to SMF directly via Mambo CB
« Reply #1 on: January 30, 2012, 08:15:43 PM »
Actually, as far as know, the mambo bridge does network with the current SMF/mambo combo.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline aht961

  • Newbie
  • *
  • Posts: 6
Re: I cannot login to SMF directly via Mambo CB
« Reply #2 on: January 31, 2012, 01:16:49 AM »
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?

Offline Kindred

  • The Mean One
  • Local Moderator
  • SMF Master
  • *
  • Posts: 42,799
  • Gender: Male
    • wagner999 on Facebook
    • Kindred-999 on GitHub
    • www.linkedin.com/in/wdwagner/ on LinkedIn
    • @Kindred_999 on Twitter
Re: I cannot login to SMF directly via Mambo CB
« Reply #3 on: January 31, 2012, 01:48:11 AM »
no, actually, I gave up on mambo ages ago -- I decided that I could do everything that mambo does using SMF mods.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline aht961

  • Newbie
  • *
  • Posts: 6
Re: I cannot login to SMF directly via Mambo CB
« Reply #4 on: February 01, 2012, 03:44:37 AM »
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.

Offline Kindred

  • The Mean One
  • Local Moderator
  • SMF Master
  • *
  • Posts: 42,799
  • Gender: Male
    • wagner999 on Facebook
    • Kindred-999 on GitHub
    • www.linkedin.com/in/wdwagner/ on LinkedIn
    • @Kindred_999 on Twitter
Re: I cannot login to SMF directly via Mambo CB
« Reply #5 on: February 01, 2012, 07:45:56 AM »
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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline aht961

  • Newbie
  • *
  • Posts: 6
Re: I cannot login to SMF directly via Mambo CB
« Reply #6 on: February 01, 2012, 04:18:28 PM »
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.

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

replace with:

Code: [Select]
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:

   
Code: [Select]
global $language, $synch_lang, $language_conversion, $smf_path;

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

Replace with this:

   
Code: [Select]
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)

   
Code: [Select]
function integrate_pre_load () {

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

Add there also the configuration like as follows:

   
Code: [Select]
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)
          
Code: [Select]
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

         
Code: [Select]
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.

« Last Edit: February 01, 2012, 05:33:58 PM by aht961 »

Offline Kindred

  • The Mean One
  • Local Moderator
  • SMF Master
  • *
  • Posts: 42,799
  • Gender: Male
    • wagner999 on Facebook
    • Kindred-999 on GitHub
    • www.linkedin.com/in/wdwagner/ on LinkedIn
    • @Kindred_999 on Twitter
Re: I cannot login to SMF directly via Mambo CB (Solved - partly)
« Reply #7 on: February 01, 2012, 05:10:48 PM »
nicely done. :)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline aht961

  • Newbie
  • *
  • Posts: 6
Re: I cannot login to SMF directly via Mambo CB (Solved - partly)
« Reply #8 on: February 02, 2012, 01:40:43 PM »
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?


Offline Kindred

  • The Mean One
  • Local Moderator
  • SMF Master
  • *
  • Posts: 42,799
  • Gender: Male
    • wagner999 on Facebook
    • Kindred-999 on GitHub
    • www.linkedin.com/in/wdwagner/ on LinkedIn
    • @Kindred_999 on Twitter
Re: I cannot login to SMF directly via Mambo CB (Solved - partly)
« Reply #9 on: February 02, 2012, 02:01:51 PM »
did you install SMF with the UTF-8 language and UTF-8 database?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.

Offline aht961

  • Newbie
  • *
  • Posts: 6
Re: I cannot login to SMF directly via Mambo CB (Solved - partly)
« Reply #10 on: February 02, 2012, 02:33:24 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.
« Last Edit: February 02, 2012, 03:27:58 PM by aht961 »

Offline Kindred

  • The Mean One
  • Local Moderator
  • SMF Master
  • *
  • Posts: 42,799
  • Gender: Male
    • wagner999 on Facebook
    • Kindred-999 on GitHub
    • www.linkedin.com/in/wdwagner/ on LinkedIn
    • @Kindred_999 on Twitter
Re: I cannot login to SMF directly via Mambo CB (Solved - partly)
« Reply #11 on: February 28, 2012, 11:27:34 AM »
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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support forums.  Thank you.