Home arrow Forum Latest posts of: Philippe Vanhaesendonck
  Welcome, Guest. Please login or register.
Did you miss your activation email?
January 07, 2009, 11:15:10 PM
Home New Posts Search Calendar


Login with username, password and session length
  Show Posts
Pages: [1]
1  Joomla Hacks / Joomla-SMF 2.0.x / Re: 2.0.3 Tester Questions and report Topic on: April 05, 2007, 04:22:22 PM
Bug report: when 'Synchronize Usernames Only' flag is set, and the user updates its Name in Joomla!, the DisplayName is set to blank in SMF.

Problem analysis: in file administrator/components/com_smf/admin.smf.class.php $data is used as an object while at this point it is an array

Fix:
Code:
--- administrator/components/com_smf/admin.smf.class.php.orig   2007-04-05 21:22:37.000000000 +0200
+++ administrator/components/com_smf/admin.smf.class.php        2007-04-05 21:15:00.000000000 +0200
@@ -1342,7 +1342,7 @@

                     case 'realName':
                         if ($jsmfConfig->sync_uname) {
-                               $val = $data->username;
+                               $val = $data['username'];
                         }
                         break;
                     case 'gender':
====================================================================

Issue: I do not get smf_id in my CB profile.

Analysis: from what I can see from the code, the only place where the smf_id is added to CB is in integrateChangeMemberData, which is called when something changes in SMF (at least that's my understanding, but I can be wrong with that)
Since in my setup, registration and profile maintenance is only done in Joomla!/CB, I never get the smf_id in my joomla! profile...

Proposed solution: my knowledge of the bridge is limitted, but the following hack seems to work: when a user is registered in CB and inserted in SMF, we retrieve the smf_id and update CB
Code:
--- components/com_smf/smf.class.php.orig       2007-04-05 23:17:44.000000000 +0200
+++ components/com_smf/smf.class.php    2007-04-05 23:16:31.000000000 +0200
@@ -990,6 +990,32 @@
             $data->password = $password;
             if (!$this->createSMFUser($data)) {
                return false;
+            } else {
+              // PVanhaes
+              // We can update CB with SMFID....
+              // We could be more efficient, but this should work...
+              if ($this->isComInstalled('Community Builder%')) {
+                    $jid = $this->getJid(null, $data->username);
+                    if (empty($jid)) {
+                        mosErrorAlert($jsmf->err);
+                        return false;
+                    }
+                    $sid = $this->getSMFid(null, $data->username);
+                    if (empty($sid)) {
+                        mosErrorAlert($jsmf->err);
+                        return false;
+                    }
+                    $query =
+                        "UPDATE #__comprofiler " .
+                        "SET cb_jsmfid = '$sid' " .
+                        "WHERE id = '$jid' " .
+                        "LIMIT 1";
+                    $database->setQuery($query);
+                    if (!$database->query()) {
+                        mosErrorAlert($database->getErrorMsg().' ~~~ FROM::'.__FILE__.' || '.__FUNCTION__.' || '.__LINE__);
+                        return false;
+                    }
+                }
             }
         }
         return true;

===================================================================
Issue: cannot change username in CB (Error: Username (MyNewName) does not exist in SMF or not able to retrieve userid )

Analysis: in administrator/components/com_smf/admin.smf.class.php, function updateMember we have:
Code:
        //check if we already have the user's smf id from CB
        if (empty($extras->cb_jsmfid)) {
            $uid = $this->getSMFid($data->id, $data->username);
            if (!$uid || empty($uid)) {
                //might be updating their username
                if ($jsmfConfig->cache_user_array && $jsmfConfig->caching) {
                    $user_array = $jsmfCache->get('user_array');
                    if (empty($user_array)) {
                        jsmfFrontend::_buildUserArray();
                        $user_array = $jsmfCache->get('user_array');
                    }
                    $uid = array_search($data->id, $user_array);
                }
                if (empty($uid)) {
                    //user doesn't exist, no good
                    $this->err = 'Username ('.$data->username.') does not exist in SMF or not able to retrieve userid ~~~ FROM::'.__FILE__.' || '.__FUNCTION__.' || '.__LINE__;
                    return false;
                }
            }

Now,
  • getSMFid fails since we are changing username (normal behaviour)
  • the cache lookup fail as well, since I have user cache disabled (normal behaviour as well)
  • but what is strange is that cb_jsmfid is not in $extras, while I do have the smf_id in CB!
It took me some time to understand why the cb_jsmfid was not in extras.
Looking at the CB code, it appears that CB will only exposes in $extras the fields that are published and not readonly. The issue here is that jsmf create the field readonly...
I have switched that readonly flag, and now it works.
This is not very nice since the field appears in the profile with no value (hidden).

Again this may not be the proper fix here, just wanted to highlight the issue and a possible workaround...



Modarator Note: please edit your post.In stat of posting a new one Wink We merged all post to one.

Contributor Note: This is your decision, but I was reporting 3 separate issues that in my view deserves 3 different posts -- Now if somebody want to comment on one of these issues, they are all mixed.
Are you on a post-saving quest?
Groetjes
Philippe
2  Joomla Hacks / Joomla-SMF 2.0.x / Re: Some issues with large user base... on: March 06, 2007, 04:02:59 AM
Hi Wolverine!

For #3, I don't know either -- I am not an expert in Joolma API & error reporting Wink

But just to set up the scene, in my 12000 users synch, I had roughly 500 rejects. So even with minimal output, we will be in trouble with the mosRedirect stuff...

An easy way to avoid the problem would be to say:
xxx users not synched, first errors where:
....


By doing that, we know how big is our problem, and with a sample of the data in error we know how to tackle it (again in my case, it was 400 users with a '-' in the name, 100 with an invalid e-mail addresses, plus a handfull of special cases)

I am attaching a quick patch to illustrate my point
3  Joomla Hacks / Joomla-SMF 2.0.x / Some issues with large user base... on: March 03, 2007, 02:20:47 PM
Hi!

I had some major headaches in synchronizing my SMF user base (12000 users) with an empty Joomla! instance.

The proplem is that the 'Synchronize' (sync usernames) never returned: the browser would 'wait' for a while for an anser, then just stay on the same page.

There are a couple of reasons for this:

1. Apache / PHP parameters: Since the synchronize really takes time, we need to ensure that the Apache 'Timeout' and the php 'max_execution_time' are set high enough to allow the script to complete (roughly one hour in my case)

2. The query:
Code:
SELECT memberName, realName, passwd, emailAddress, dateRegistered, is_activated, validation_code
FROM smf_members
LEFT JOIN jos_users ON jos_users.username=smf_members.memberName
WHERE jos_users.username IS NULL
is rather slow once you have 'enough' users in Joomla!
I have created an index on jos_users.username, and the whole procedure runs much faster now

3. The synchronize procedures gives feedback through
Code:
mosRedirect("index2.php?option=com_smf&task=install", $msg);
with the error messages in $msg.
The problem is that Joomla! passes $msg as parameter in the URL, which does not work if you have loads of errors: the URL is too long. If you are lucky, Apache will tell you, otherwhise the whole string will just be ignored, and that's eventually why I did not received any feedback from JSMF...

All in all, none of these issues are really JSMF bugs (although maybe for the last one, one should have a better error reporting mechanism), but it is good to have that in mind if you have to migrate a big userbase...


Versions: Joomla! 1.0.12 / CB 1.0.2 / SMF 1.1.2 / JSMF 2.0.2
4  Joomla Hacks / Joomla-SMF 2.0.x / Re: Need CB testers for JSMF 2.0.3 on: March 01, 2007, 10:38:38 AM
Just picking up this thread...

I am still in the process of migrating a communtity with 12000 members from Nuke to Joomla! 1.0.12 / CB 1.0.2 / SMF 1.1.2

At this stage my users and the forum threads have been migrated successfully in SMF, but Joomla!/CB are still pretty much vanilla, no bridge installed.

So if your are still looking for testers, I am happy to give it a try...
5  Joomla Hacks / Joomla-SMF 2.0.x / CB Login... on: January 23, 2007, 06:39:15 PM
Hello everybody...

I am scratching my head since a couple of days, searching though the forum, but nothing found so far...

So here it is: I have the following installed:
Joomla! 1.0.11
CB 1.0.2
SMF 1.1.1
JSMF 2.0
SMF CB Plug-in 2.0.2

And I use the CB Login.

So far so good, I can login/logout as admin.

Then I migrated my Nuke/phpBB forum into SMF (11000 users / 220000 messages) with the SMF migration tools, and synched the users between SMF an Joomla! (hopefully it went well, since I have all my users in Joomla!/CB, but the JSMF script never seemed to return)

And now, if I pick a test user, I am not able to login from the CB Login box... (invalid password)

I eventually installed the JSMF Login box, and from that one I was able to login. Then I reverted back to the CB Login and it also worked for that user (as the bridge synched the passwords when I logged in successfully), but the problem remains for the other users.

Is there something I overlooked?

Also what are the differences between the CB and the JSMF login boxes? Do I loose any CB functionality if I decide to go for the JSMF one?
(and yes, I am a newbee in that area  Lips Sealed )
Pages: [1]


Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
i-Vibe.com
Search Contact About Advertise Blogs Topsites Submit News Register Login