Self registration with validation

Self registration with validation

by Marion Manton -
Number of replies: 5
Sorry this is a bit simple for here - but it is why i am hoping that there might be an easy answer for this!

We have a situation where we would like students to self register, but before they are sent a confirmation email we would like an administrator to be able to check that they are who they say they are and that they are eligible to access the course, then for the confirmation email to be sent.

I cannot see that Moodle currently does this - or that there is an extension to this effect, does anyone have any suggestions?

Thanks
Marion
Average of ratings: -
In reply to Marion Manton

Re: Self registration with validation

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

I know several people have added a line of code in the past to send a duplicate of the registration email to the administrator of the platform. This way, the admin is always notified of new registrations and can keep an eye on them, and optionally disable/delete those registrations.

I know this doesn't exactly fit your requirements, but this is just one addional line of code, instead of a more invasive change to the way Moodle currently works.

If you are interested in this, just edit .../lib/moodlelib.php and search for function send_confirmation_email (around line 3629 in 1.8.4+, current as of today), and at the end of the function there is a line that reads:

return email_to_user($user, $from, $subject, $message, $messagehtml);

Just before that line, add a line like this:

email_to_user($from, $from, $subject, $message, $messagehtml);

Saludos. Iñaki.

Average of ratings: Useful (2)
In reply to Iñaki Arenaza

Re: Self registration with validation

by Marco Polo -

My idea was to go to the line where the email is sent when the user performs the register and comment it out.

Then, go to the line where the Administrator can confirm a user registration, and insert the send email confirmation code there instead.

However, although I have searched (a lot), I cannot find the point from where the send_confirmation_email method is called...

If anyone knows, could you give me some hint?

Thanks

In reply to Iñaki Arenaza

Re: Self registration with validation

by Chris Collman -
Picture of Documentation writers
Hi Iñaki and others,
I want an email address to get a notice of a self enrollment in a 1.9.9+ Moodle.
I think my line in moodlelib.php is around 4539 which says:
return email_to_user($user, $supportuser, $subject, $message, $messagehtml);

I assume I should add
return email_to_user($supportuser, $supportuser, $subject, $message, $messagehtml);


Is it possible for me to add a language string which will contain the email address of where the notice would also go? How would I modify the code and where would I put the string so that it could be found in the language? Would this present a security issue?

Thanks Chris

In reply to Chris Collman

Re: Self registration with validation

by Chris Collman -
Picture of Documentation writers

And what is the $supportuser email? MoodleDocs is less than helpfulsmile

OK Jo Mathews says Site Admin>Server>Email. I will add this to MoodleDocs.

Thanks!

Chris
In reply to Marion Manton

Re: Self registration with validation

by Deleted user -
I have the same problem as yours and i need solution.

Hope someone would help