Open VHlede opened 9 years ago
This looks like it's happening because you've already got a user called "Admin" created in Moodle, and the auth plugin is try to recreate that user, but can't so it's giving a database error.
The easiest way to fix this would be to delete the admin user in Moodle, then log in to the Drupal site as the admin user and visit the Moodle site. That will create the user properly for use with the drupalservices auth plugin. I had to do this on my site when I had already created an admin user on Moodle that had the same username and password as the one on Drupal.
Just make sure you've got another account with admin privileges on Moodle so that you can add the "Admin" user back to the site administrators once it's been recreated.
There's probably another "proper" way to do this by syncing the accounts somehow, but the above works fine for me.
Thanks a lot Cheesenbizkitz, It works fine now. I just change the username of the old admin to super-admin. Then a new user "admin" was created by drupalservices auth plugin. I added the admin role to that user. Works perfectly. The only challenge I have right now is that the new admin - although it can do all admin tasks, does not have access to admin links. "Site administration" links are missing. I tried with another theme, cleared cache... but again the menu is missing. I'm using Moodle 2.8. Any suggestion? Thanks, Vjeko
Did you add the new admin into the list of site administrators under Site Administration -> Users -> Permissions -> Site administrators?
Yes, I did it here: http://mymoodle.drupalsite.org/admin/roles/admins.php
With both accounts I can do whatever as admin I want - except as "admin" (account created with drupalservices sso) I can not see "Site administration" links. I even converted that account in the "Main Admin" (blue arrow) - but no changes. The images below illustrates what I can see with booth accounts. Please advise, Thanks!
Ou... this is a standard Moodle issue. It is described here under: https://docs.moodle.org/28/en/Blocks_FAQ >> My Administration block links don't expand!
I had the same issue in all browsers, but after doing what is described under 2) and 3) it works fine. Sometimes it may take a few seconds for the links to pop up. However, knowingly how many admin links (and permissions) Moodle has... that may be understandable.
Thanks Cheesenbizkitz!
I'm going to reopen this issue as a feature request. I think there should be an option upon setup that lets users correlate user:1 in drupal with user:2 in moodle (both are the super admins). Also there should be some kind of username-clash detection to prevent this specific problem.
You guys willing to do some testing on this? :)
Hi, How can I match Drupal and Moodle super admins? Below is the error I'm getting when I try to login to Moodle as Drupal super admin. It works fine with other accounts.
Thanks,
Vjeko