Hello!
I'm trying to figure how to get a variable from URL bar. Let's say an invitation directs the user here /elgg/register?friend_guid=35&invitecode=123 . Say I want to use the variables in a mod
the register.php has it like his
$friend_guid = (int) get_input('friend_guid', 0);
$invitecode = get_input('invitecode');
I'm using user validion by admin (very similar than user validion by email). How can I use those two variables in a mod?
It sends email like this (views/function.php):
function uservalidationbyemail_request_validation($user_guid, $admin_requested = FALSE) {
$site = elgg_get_site_entity();
$user_guid = (int)$user_guid;
$user = get_entity($user_guid);
if (($user) && ($user instanceof ElggUser)) {
// Work out validate link
$code = uservalidationbyemail_generate_code($user_guid, $user->email);
$link = "{$site->url}uservalidationbyemail/confirm?u=$user_guid&c=$code";
// Send validation email
$subject = elgg_echo('email:validate:subject', array($user->name, $site->name));
$body = elgg_echo('email:validate:body', array($user->name, $site->name, $link, $site->name, $site->url));
$result = notify_user($user->guid, $site->guid, $subject, $body, NULL, 'email');
if ($result && !$admin_requested) {
system_message(elgg_echo('uservalidationbyemail:registerok'));
}
return $result;
}
return FALSE;
}
How can I get the $friend_guid and $invitecode sent with the same email?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.