****URGENT! PLZ PLZ PLZ HELP! ****

****URGENT! PLZ PLZ PLZ HELP! ****

by Liam Clayton -
Number of replies: 18

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 sad sad sad sad sad sad

Average of ratings: -
In reply to Liam Clayton

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Norbert Berger -
Hi Liam

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
In reply to Norbert Berger

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Liam Clayton -
Hi Norbert, thanks for your reply

I can't log in as admin, a student, no-one, hence how I can't change it back sad

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
In reply to Liam Clayton

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Are you sure that you are trying to log in as the 'primary' admin - the one that was set up when you installed Moodle. That *always* bypasses the authentication method you have set, and should always be able to log in.
In reply to Howard Miller

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Liam Clayton -
Absolutely positive Howard. It's not having any of it.

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?
In reply to Liam Clayton

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Ken Wilson -

Try to reset the password manually by using these steps (you need to be logged in as root/administrator):

  1. Stop the mysql server.
  2. Restart the server with the --skip-grant-tables option, e.g.
    #mysqld --skip-grant-tables
  3. Start a new shell/command prompt session and connect to the mysql server:
    #mysql -u root mysql
  4. 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)
  5. Close the all the mysql sessions.
  6. You should now be able to connect using the user admin and password "newpass".
  7. Finish off by stopping and starting mysql again.

 

Let us know how you get on.

Ken

In reply to Ken Wilson

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Liam Clayton -
Ken, thanks for that reply.

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
In reply to Liam Clayton

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Ken Wilson -

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

In reply to Ken Wilson

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Liam Clayton -

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

In reply to Liam Clayton

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Before I get the network technician to follow all those steps above, does that change the option back to internal enrollment from LDAP?

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.
In reply to Iñaki Arenaza

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Liam Clayton -
Good morning everyone,

Well, no luck as yet sad

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
In reply to Liam Clayton

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Have a look at your config.php file. There you'll find something similar to this:

     $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 smile

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: ****URGENT! PLZ PLZ PLZ HELP! ****

by Liam Clayton -

Good morning  Iñaki, thanks for all your help.

The prefix actually is 'mdl_' so I have no idea why it is not working?

sad

Liam

sad

In reply to Liam Clayton

Re: changed to ldap enrolment and now I can't login

by Jan Dierckx -

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.

In reply to Jan Dierckx

Re: changed to ldap enrolment and now I can't login

by Liam Clayton -
Hi Jan,

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
In reply to Liam Clayton

Re: changed to ldap enrolment and now I can't login

by Jan Dierckx -

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...

In reply to Jan Dierckx

Re: changed to ldap enrolment and now I can't login

by Liam Clayton -
good morning,

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
In reply to Liam Clayton

Re: changed to ldap enrolment and now I can't login

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hummm, maybe you are using an older version of Moodle where the plugin was called 'internal' instead of 'manual'. See if you have a directory called C:\Inetpub\wwwroot\moodle\moodle/enrol/internal/. If this is so, then execute the following query in your Moodle database:

UPDATE mdl_config SET value='internal' WHERE name='enrol';

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: changed to ldap enrolment and now I can't login

by Liam Clayton -
Iñaki, you are a superstar.
 
THE JOB IS DONE!!! big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin big grin

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