LDAP Enrolment - how to notify students before they log in to Moodle

LDAP Enrolment - how to notify students before they log in to Moodle

by Alek Steva -
Number of replies: 9

Dear all,

I have LDAP enrolment properly set in Moodle 3.0 and Microsoft AD.

But,...is there a way how to notify students before they log in to Moodle, because only then I could find them in Participants list and send them mail.

What would be the best Moodlers practice with regards to notifying students that they ought to participate in obligatory Moodle course, having in mind working LDAP enrolment?

Thanks a lot, regards


Average of ratings: -
In reply to Alek Steva

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

There is an LDAP sync function (I believe its a CLI script that can be called from cron, but I haven't used it for a year or two so it may be part of scheduled tasks now).

If you use that to create their Moodle accounts, you can then message them through Moodle, or even use an enrol plugin to automtaically enrol them on that obligatory course

In reply to Richard Oelmann

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Alek Steva -

Thanks a lot for suggestion.

Yes, I've been using LDAP sync cron scheduled job for a while, successfully and all of AD users are synced and imported into Moodle.

But, on the other hand, I'm using AD groups under OU=Moodle, OU=Student and OU=Teacher to enroll users automatically via LDAP enrolment (works fine).

Only problem that I have is, that under LDAP enrolment for a course I could see AD users ONLY when they log in first and only then I could notify them by mail.

Yes, I could send mails to users since they are imported via LDAP sync cron job, but it would be a hassle to find all of them one by one. 

So, the key is to see users under Participants for a course without waiting them to log in to Moodle in order to notify them in advance, if this is possible in the first place, at all.

Thanks again for kind help.

Regards

 

 


In reply to Alek Steva

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The user sync is now part of the scheduled tasks that you can set up our it is found in the LDAP/cli folder.

In reply to Emma Richardson

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Alek Steva -

Thanks also.

Still, the problem persist (would you, please, check reply to Richard).

Kind regards


In reply to Alek Steva

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Alek Steva -

Would you, please have a look at the attached screenshot as illustration.

Thanks again, regards

P.S. Test7 AD users has been added to Course02 AD group but he is not visible under Participants in Course02 course in Moodle, until he logs in. (Alek S is a Teacher of Course02 course).

Illustration

In reply to Alek Steva

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
So after the user sync note you need to run the enrollment sync. It is found in the enrol/ldap/cli folder. You have to run that manually or set up crook to run it automatically.
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Alek Steva -

Great, thanks a lot! smile

My Test7 AD user has been finally added to the Course02, without logging in, in advance. Here's the command output:

$ sudo -u www-data /usr/bin/php /var/www/html/moodle/enrol/ldap/cli/sync.php
== Synching course 'Course02' for role 'editingteacher'
== Synching course 'Course02' for role 'student'
Enrol user 'test7' into course 'SN C02' (id 9)

May I ask you, is it possible to create a cron job which will automatically run above mentioned command? And shouldn't it be actually part of LDAP users sync cron job or at least, I expected it to be?

Thanks, thanks


In reply to Alek Steva

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Authentication and enrolment are two different things so they keep them separately.  I hope that they add it to the scheduled tasks but I see it still is not there in 3.1.  Yes, you can set up a cron job to run it - just copy your moodle one but direct it to the sync.php file and then adjust the time to run when you want it to.  

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: LDAP Enrolment - how to notify students before they log in to Moodle

by Alek Steva -

Thanks a lot, I've been able to add one additional line with sync.php, like:

sudo crontab -u www-data -e

*/15 * * * *   /usr/bin/php  /var/www/html/moodle/enrol/ldap/cli/sync.php

an it seems to work its job smile

I really appreciate your kind support.

Thanks again, kind regards