Question

I have been working with Elgg. An open source social networking software created in php. I have been working with the API and so far have been able to register users using the register_user function:

register_user($username, $password, $email);

The problem however is that I don't need users to confirm via emails when registered through the API. I need to know which function I could use to 'auto confirm' the user.

Was it helpful?

Solution

If you're in Elgg 1.8 (might also work in 1.7), and you have the uservalidationbyemail plugin enabled, I think the easiest thing to do would be to disable that plugin. If you still want to have some of the functionality of the plugin, just not that one part, you could use elgg_unregister_plugin_hook_handler to keep uservalidationbyemail_disable_new_user() from being called, like: elgg_unregister_plugin_hook_handler('register', 'user', uservalidationbyemail_disable_new_user');

Alternatively, if you want it to work on some users, but not on ones that register a particular way, then you could add your own plugin hook handler with a lower priority number, and short circuit the default handling: elgg_register_plugin_hook_handler('register', 'user', my_registration_function', 1);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top