How To / General

User hooks interferes with CB logout module redirect

  • Phoenix
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 11 months ago #1 by Phoenix
Hello,

I recently installed Joomdle and so far I seem to have everything working correctly, except for one issue:

I use the Community Builder module for login and logout of users. The CB module allows for a redirect to a specific URL upon logging out.
After installing Joomdle, the logout redirect to an URL is no longer working.

I found that this is caused by the plugin "User hooks - Joomdle". When I disable the plugin, then the CB logout redirect is working again. I have tried both "OnUserLogin" and "OnUserAfterLogin" settings (even though I don't even know what the difference is between the two), but both interfere with the CB logout redirect.

How can I fix this?

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

More
8 years 11 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic User hooks interferes with CB logout module redirect
Hi.

If you have Joomla and Moodle on the same domain, and have CURL enabled, you can set redirect-less logout in Joomdle configuration in Joomla backend.
As they other way of doing logout uses a redirect to Moodle, it can conflict with the redirect set on CB.

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

  • Phoenix
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 11 months ago #3 by Phoenix
Hello,

Yes, now it works! Thank you!

One more question:

Since I am using an existing installation of Joomla (with already registered users) but a new installation of Moodle (no users yet), do I need to manually add them to Moodle through the Joomdle component in Joomla? Or will they automatically be added to Moodle once they login to Joomla and visit Moodle after?

If I need to do so manually, which button(s) do I need to use?
Add users to Moodle / Migrate users to Joomdle / Sync Moodle profiles / Sync Joomla profiles

Thanks!

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

More
8 years 11 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic User hooks interferes with CB logout module redirect
> Or will they automatically be added to Moodle once they login to Joomla and visit Moodle after?

No, they won't be created automatically.

> do I need to manually add them to Moodle through the Joomdle component in Joomla?

Usually, not really, although it depends on your setup.

Right now your users are not Moodle users, but they don't have nothing to do in Moodle, as they are not enroled in any course (because they don't even have an account).
So, in more common scenario, user will enrol in a course through Joomdle (be it self-enrol, or course purchase in shop, etc). In that moment, account will be created in Moodle and synced to Joomla account, and then enrolment is made.

If you want to have all your users in moodle right away, you would need to migrate them, using "Add users to Moodle" button.

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

  • Phoenix
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 11 months ago #5 by Phoenix
Hello,

Thanks again for the fast response!

On our website, we work with the enrollment in a bit different way. We ask potential students to fill out an application form, after which they receive an enrolment key that they need to fill out themselves when accessing the course for the first time.

Seeing that we will continue working like this, the enrolling itself will not go through Joomdle, and therefore I don't think that Joomdle will automatically do the registration, and I will just have to migrate all users in moodle right away. But any new registration on Joomla afterwards will automatically also register in Moodle anyway, right?

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

More
8 years 11 months ago #6 by Antonio Durán
Replied by Antonio Durán on topic User hooks interferes with CB logout module redirect
You are correct: if existing users are to enrol themselves directly in Moodle, accounts won't be synced by Joomdle, so you will need to batch sync account first.
For new users, as you say, Moodle account creation is automatic.

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

  • Phoenix
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 11 months ago #7 by Phoenix
Hello,

Thanks for your help. I have just now synced all Joomla accounts to Moodle (over 4000 accounts).

I notice that there are some accounts that have not been imported in Moodle. I don't know why, because they are normal accounts that are not disabled. I tried several times, but they don't import, and there is no error.

How can I import these accounts?

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

More
8 years 11 months ago #8 by Antonio Durán
Replied by Antonio Durán on topic User hooks interferes with CB logout module redirect
Hi.
You can check a couple of things for non-synced users:
- That his email account is valid, and does not exist already in Moodle
- That username does not contain special chars

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

  • Phoenix
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 11 months ago #9 by Phoenix
Hello again,

Thank you. It appears that many of these accounts have a space in their username (they are old registered accounts from before I had spaces in usernames disabled in Joomla). When I change their username and replace the space with, for example, an underscore, then they are immediately imported into Moodle (I don't even have to go back to Joomdle for this).

I have one more curiosity question. I notice, in the list of users in the Joomdle extension in Joomla, that there are some users "duplicate" in the list:
one with only Joomla, then the duplicate with only moodle & joomdle.

Then there are others, who have no duplicate and one account has all three (joomla/moodle/joomdle).

In both cases, the accounts and single-sign on for them are working fine. I was just wondering why that some are listed duplicated, and others are not?

Thanks!

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

More
8 years 11 months ago #10 by Antonio Durán
Replied by Antonio Durán on topic User hooks interferes with CB logout module redirect
Yes, Moodle won't allow special chars, including spaces, in username, so sync fails.

The other issue is caused by uppercase chars.
You can see first user has an uppercase char in username in Joomla, while he does not have it in Moodle (because in Moodle uppercase is not allowed in username).
That's why they show as 2 users in the list.
But, even in this case, Joomdle will convert username to lowercase when calling Moodle, so these accounts should work just fine, even if they show weird in the list.

For new users, the Joomdle user check plugin (that I guess you are using) will not allow the creation of new accounts with uppercase in username, same that it does not let you use spaces either.

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