Apologies for the rubbish thread title but I am in need of desperate help ASAP!!!!
I have been trying for ages to stop students enrolling themselves, and in users > enrollments I have just changed it from Internal Enrollements to LDAP admittedly not knowing what it is after reading a reply to my thread !
How do I change it back? The error is the following:
Fatal error: Call to undefined function ldap_connect() in C:\Inetpub\wwwroot\moodle\moodle\enrol\ldap\enrol.php on line 472
We are supposed to go live in a few weeks. I am going to hide in the desert and never return if I've broke this completely
Can you log in as admin, go to Administration, Users, Authentication Options and select manual accounts only from the pulldown called choose authentication mode? If yes, then click Save Changes at the bottom of the page. If no, where do things go wrong?
LDAP authentication means Moodle will try to connect to an LDAP Database which contains users and use those. Various details need to be had from an LDAP user database administrator for this to work.
In principle, changing those settings back to manual authentication should not be a problem. You can always read what the options mean by clicking on the ? next to the pulldown menu before you choose an option.
Hope this helps
Norbert
I can't log in as admin, a student, no-one, hence how I can't change it back
That was the only setting I changed (The drop down box one) - I didn't enter any settings or anything so I just need to revert back to the 'Internal' rather than the LDAP.
Regards
Liam
I have another moodle setup on my webspace which I used as a sample to see how the thing works - i don't suppose it would be as simple as replacing the folders?
Try to reset the password manually by using these steps (you need to be logged in as root/administrator):
- Stop the mysql server.
- Restart the server with the --skip-grant-tables option, e.g.
#mysqld --skip-grant-tables
- Start a new shell/command prompt session and connect to the mysql server:
#mysql -u root mysql
- At the mysql client, issue these commands (I've shown the mysql responses also):
mysql> USE moodle;
Database changed
mysql> UPDATE mdl_user SET auth=('manual') WHERE username='admin';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> UPDATE mdl_user SET password=md5('newpass') WHERE username='admin';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.08 sec)
- Close the all the mysql sessions.
- You should now be able to connect using the user admin and password "newpass".
- Finish off by stopping and starting mysql again.
Let us know how you get on.
Ken
Before I get the network technician to follow all those steps above, does that change the option back to internal enrollment from LDAP? I know the password, just need the enrollment setting changed back to what it was before??
Thanks
Liam
Liam
The first UPDATE statement changes the authentication method to manual for just the admin user. Try that first, and skip the UPDATE which changes the password. If you still cannot get in, change use the second UPDATE statement to change the admin password also.
Once you can login as admin, go to administration -> users -> authentication options as before and change the default authentication back to what it was.
I've tested this on our Windows 2003 test server running MySQL 5.0 and it seems to work fine (!)
Ken
Ken, I have passed that on to the Network Technician to do. If(When!) this works I think I will be eternally grateful!!!!
I will post back on Saturday/Sunday as I'm off for the weekend now to tell you how it's gone.
Many thanks for all your help
If anyone also has any other suggestions incase the unthinkable happens and i doesn't work feel free to post up to save my life!!
Thanks for all your replies
Liam
No it wont change the enrolment option, just reset the primary admin password.
If you already know the password of an admin (primary or not), you can edit your database and directly change the enrolment method. Connect to your database and execute (assuming you used the default prefix of 'mdl_' during installation):
UPDATE mdl_config SET value='manual' WHERE name='enrol';
This will reset the enrolment system to Manual.
Saludos. Iñaki.
Well, no luck as yet
Inaki - It says that the default prefix of mdl_config does not exist, though we don't think we changed anything like that in the setup which is confusing.
We did a search for mdl_config within the moodle folder and found mdl_config.frm - but the SQL command you wrote above wasn't recognising it.(I assume it's because it has a *.frm extension on the end.
How would we be able to find out what the prefix name is if it isn't mdl_config?
Thanks in advance
Liam
$CFG->prefix = 'mdl_';
This is your database tables' prefix. Then you need to connect to your Moodle database (using mysql, phpMyAdmin, whatever) and execute the SQL sentence I gave you before.
I hope this helps
Saludos. Iñaki.
Good morning Iñaki, thanks for all your help.
The prefix actually is 'mdl_' so I have no idea why it is not working?
Liam
Hi Liam,
Can you be more precise. What do you mean with 'not working'? What did mysql returned when you issued the command to mysql? Were you able to change the value of that field inside the mdl_config table? Do you have phpmyadmin installed? This allows direct access to the database. In that case you can check if the mdl_config table has been changed.
By 'not working' I mean that the mySQL command isn't successful because after we execute the commands Inkai is giving us, it is saying that mdl_config doesn't exist, even though that is what it is within config.php
The network technician is using the command prompt thing, not phpmyadmin to type all the commands out what Inaki is replying with. This is ok isn't it?
Liam
The mysql prompt is fine.
Did you issue the command USE moodle;
(or the name of your moodle database) before starting the UPDATE command?
Maybe you can post a screenshot of the exact commands you type and the errors you receive...
My apologies for the late reply - have been very busy
there has been developments, unfortunately not for the better.
We ran this function as Inaki suggested and it said it was successful:
UPDATE mdl_config SET value='manual' WHERE name='enrol';
We now get another error when trying to log in
Warning: require_once(C:\Inetpub\wwwroot\moodle\moodle/enrol/manual/enrol.php) [function.require-once]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\moodle\moodle\lib\moodlelib.php on line 2494
Could anyone assist futher?
Many thanks
Liam
UPDATE mdl_config SET value='internal' WHERE name='enrol';
Saludos. Iñaki.
THE JOB IS DONE!!!
Thank you all for your help - it has been well worth it and makes Moodle much more enjoyable when you have helpful people like you supporting.
Regards
Liam