aboutsummaryrefslogtreecommitdiff
path: root/mod/uservalidationbyemail
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-30 02:12:20 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-30 02:12:20 +0000
commit6f59a0482ed182ed3f544ebde84bbcfdcd9b4680 (patch)
treecd5e07ce01084ade525dae1b168225638e28ac59 /mod/uservalidationbyemail
parent68f09537fcdb4222947a6c8938e4416bcc47e4ec (diff)
downloadelgg-6f59a0482ed182ed3f544ebde84bbcfdcd9b4680.tar.gz
elgg-6f59a0482ed182ed3f544ebde84bbcfdcd9b4680.tar.bz2
Refs #2428 removed some global CONFIG usage in plugins
git-svn-id: http://code.elgg.org/elgg/trunk@7479 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/uservalidationbyemail')
-rw-r--r--mod/uservalidationbyemail/lib/functions.php9
-rw-r--r--mod/uservalidationbyemail/start.php2
2 files changed, 6 insertions, 5 deletions
diff --git a/mod/uservalidationbyemail/lib/functions.php b/mod/uservalidationbyemail/lib/functions.php
index aadabc927..ab382c059 100644
--- a/mod/uservalidationbyemail/lib/functions.php
+++ b/mod/uservalidationbyemail/lib/functions.php
@@ -14,10 +14,11 @@
* @return string
*/
function uservalidationbyemail_generate_code($user_guid, $email_address) {
- global $CONFIG;
+
+ $site_url = elgg_get_site_url();
// Note I bind to site URL, this is important on multisite!
- return md5($user_guid . $email_address . $CONFIG->site->url . get_site_secret());
+ return md5($user_guid . $email_address . $site_url . get_site_secret());
}
/**
@@ -30,13 +31,15 @@ function uservalidationbyemail_generate_code($user_guid, $email_address) {
function uservalidationbyemail_request_validation($user_guid) {
global $CONFIG;
+ $site_url = elgg_get_site_url();
+
$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 = "{$CONFIG->site->url}pg/uservalidationbyemail/confirm?u=$user_guid&c=$code";
+ $link = "{$site_url}pg/uservalidationbyemail/confirm?u=$user_guid&c=$code";
$site = $CONFIG->site;
// Send validation email
diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php
index 0f8dd2091..1214df11b 100644
--- a/mod/uservalidationbyemail/start.php
+++ b/mod/uservalidationbyemail/start.php
@@ -10,7 +10,6 @@
elgg_register_event_handler('init', 'system', 'uservalidationbyemail_init');
function uservalidationbyemail_init() {
- global $CONFIG;
require_once dirname(__FILE__) . '/lib/functions.php';
@@ -147,7 +146,6 @@ function uservalidationbyemail_check_auth_attempt($credentials) {
* @param array $page
*/
function uservalidationbyemail_page_handler($page) {
- global $CONFIG;
if (isset($page[0]) && $page[0] == 'confirm') {
$code = sanitise_string(get_input('c', FALSE));