Add users to Joomla not working properly

  • Rick Houghton
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 8 months ago #1 by Rick Houghton
Add users to Joomla not working properly was created by Rick Houghton
OK I am back with a new problem. I THOUGHT I had it solved but it was not to be!

I originally had 800 users on the Moodle which were previously bulk imported. Many of those users have now changed their passwords and are actively using the system (school just started). When I set up Joomdle, I tried to "Add Users to Joomla" and then I clicked the "Migrate Users to Joomdle" and all checks showed green. But when users try to log in from Joomla they get a "Bad Username Password" message.

When I create a user in Joomla first it all works as expected. What is happening here? I thought the migrate tool was supposed to move the passwords over to Joomla from Moodle. I obviously don't want to delete all the Moodle users and add them to Joomla (which I don't think I can anyway, as Joomla doesn't support bulk import). Does Joomdle support the import of users originally created in Moodle?

Any advice, as always, gratefully appreciated.

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Re: Add users to Joomla not working properly
Hi.

Here is the doc for this feature:
www.joomdle.com/wiki/Migrating_existing_...Joomla_installations

* Add users to Joomla: create user accounts in Joomla for selected Moodle accounts.
o This creates accounts in Joomla for selected users, setting random passwords that are emailed to the users.

Setting random passwords is done because Moodle password is crypted, and we cannot read it to copy it to joomla, so we need to set a new one (which will work for both joomla and moodle).

Please Log in or Create an account to join the conversation.

  • Rick Houghton
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 8 months ago #3 by Rick Houghton
Replied by Rick Houghton on topic Re: Add users to Joomla not working properly
Hey Antonio:

OK. I am a little farther ahead, here is what I did:
  • Created a user in Moodle
  • Migrated user to Joomla with the "Add Users to Joomla" button
  • Migrated the user to Joomdl and received the "new password"
  • Logged in to the Joomla front end... so far so good!
  • However, when I click on the Moodle courses and click on a course to see the description I get the error (at the top of the page) "JUser::_load: Unable to load user with id: 007007". However when I disregard the error and click the "enter course" or "enroll" button anyways, it works as advertised.

  • I guess the question now is, how do I get rid of the above error?

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic Re: Add users to Joomla not working properly
Hi.

Are you using numeric-only usernames? If so, can you check if alpha user names give different results?

We have had problems with that in the past, so maybe there is some bug still around...

Please Log in or Create an account to join the conversation.

  • Rick Houghton
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 8 months ago #5 by Rick Houghton
Replied by Rick Houghton on topic Re: Add users to Joomla not working properly
All our usernames have to be numeric (student number). They are bulk uploaded from the school enrollment list. We can't let students choose their own usernames unfortunately.

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #6 by Antonio Durán
Replied by Antonio Durán on topic Re: Add users to Joomla not working properly
Ok. But what I wanted is you to test with a fake student, with an username containing alpha chars, using the same process, just to know if this error is related to that (which seems likely).

Please Log in or Create an account to join the conversation.

  • Rick Houghton
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 8 months ago - 14 years 8 months ago #7 by Rick Houghton
Replied by Rick Houghton on topic Re: Add users to Joomla not working properly
Yes you are right. A username with an alpha is OK. All works as expected. So can we file this a a bug?
Last edit: 14 years 8 months ago by Rick Houghton.

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #8 by Antonio Durán
Replied by Antonio Durán on topic Re: Add users to Joomla not working properly
Yes, it is a bug.

To fix it, you only need to change function is_enroled(), in file administrator/components/com_joomdle/helpers/content.php.

Change:
Code:
if ($username) $user = & JFactory::getUser($username);

By:
Code:
if ($username) { $user_id = JUserHelper::getUserId($username); $user = & JFactory::getUser($user_id); }

I think we may have some other places with this bug, so I will make a code review looking for possible problems. Also, if you see something strange you think can be related, just tell me.

Thanks for reporting the problem and taking the time to debug it.

Please Log in or Create an account to join the conversation.

  • Rick Houghton
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 8 months ago #9 by Rick Houghton
Replied by Rick Houghton on topic Re: Add users to Joomla not working properly
I'll make the change and get back to you. Thanks again!!

Please Log in or Create an account to join the conversation.