How To / General

Do not sync Joomla user password to Moodle

  • Perfect Web Team
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 months ago #1 by Perfect Web Team
Do not sync Joomla user password to Moodle was created by Perfect Web Team
Hello,

We have a need for users not to be able to login to Moodle directly, only via Joomla except for administrators. I thought to just empty the password field but when a user saves their profile in Joomla, the data including password is synced to Moodle.

Is there a setting/option to prevent the users password from being synced?

I did check the code but did not see anything that would help except a core hack :silly:

Looking forward to your reply.

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

More
3 years 3 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Do not sync Joomla user password to Moodle
Hi.

The problem is not that the password is synced, because users with auth=joomdle won't check the password stored in Moodle. Authentication is performed against Joomla, so even if you have a blank password in Moodle, you will still be able to log in.

There's no setting to prevent direct login from Moodle, but you can use a Moodle setting to redirect login to Joomla:
www.joomdle.com/wiki/Installing_Joomdle_...page_to_Joomla.21.29

Then, you would need to use a different URL for admins to log in directly to Moodle:
www.joomdle.com/wiki/Installing_Joomdle_...e.27s_Administrators

Alternatively, for your use case, you could modify the Joomdle plugin to disable login for Joomdle users.
For that, I think it would be enough to add "return false;" at the start of user_login function in auth/joomdle/auth.php

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

  • Perfect Web Team
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 months ago #3 by Perfect Web Team
Replied by Perfect Web Team on topic Do not sync Joomla user password to Moodle
Hello Antonio,

Thank you very much for your answer, really appreciated.

Ouch, I was wrong about the password :)

Your proposed solution sounds like the way to go.

Have a nice day.

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

  • Perfect Web Team
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 months ago #4 by Perfect Web Team
Replied by Perfect Web Team on topic Do not sync Joomla user password to Moodle
Hello Antonio,

This works beautifully. There are two things I would like to give feedback on.

The link in the wiki page is incorrect, the correct link to the login page is
Code:
https://yoursite.com/auth/joomdle/joomdle_login.php?login=moodle
I removed the moodle/ from the URL.

Second, I have added the line
Code:
<meta name="robots" content="noindex, nofollow">
just to be sure it is not indexed by search engines.

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

More
3 years 3 months ago #5 by Antonio Durán
Replied by Antonio Durán on topic Do not sync Joomla user password to Moodle
Thanks for your comments.
I have added a note in the wiki to make it clearer. I will also add your robots line for next release, as I think it is a good idea, thank you!

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