From 401fd957b30219a610014d4236de35b6220fd310 Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 25 Jun 2008 19:21:21 +0000 Subject: Closes #79: Email confirmation on registration & email change http://trac.elgg.org/elgg/ticket/79 git-svn-id: https://code.elgg.org/elgg/trunk@1137 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/notification.php | 7 +++++-- engine/lib/sites.php | 6 ++++-- engine/lib/users.php | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'engine') diff --git a/engine/lib/notification.php b/engine/lib/notification.php index 145f9a4a0..aa2ecbfdd 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -110,7 +110,7 @@ throw new NotificationException(sprintf(elgg_echo('NotificationException:NoHandlerFound'), $method)); if ($CONFIG->debug) - error_log("Sending message to $guid using $method"); + error_log("Sending message to $guid using $method"); // Trigger handler and retrieve result. $result[$guid][$method] = $handler( @@ -226,7 +226,10 @@ if ($from->email) $from = $from->email; // Handle users else if ($from->url) - $from = 'noreply@' . parse_url($from->url, 'host'); // Handle anything with a url + { + $breakdown = parse_url($from->url); + $from = 'noreply@' . $breakdown['host']; // Handle anything with a url + } else { $from = 'noreply@' . get_site_domain($CONFIG->site_guid); // Handle a fallback } diff --git a/engine/lib/sites.php b/engine/lib/sites.php index 441a649ad..40ff02f6c 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -554,8 +554,10 @@ $guid = (int)$guid; $site = get_entity($site); - if ($site instanceof ElggSite) - return parse_url($site->url, 'host'); + if ($site instanceof ElggSite) { + $breakdown = parse_url($site->url); + return $breakdown['host']; + } return false; } diff --git a/engine/lib/users.php b/engine/lib/users.php index 5dc382670..c090f3267 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -784,10 +784,10 @@ $user->validated_email = false; // Work out validate link - $link = $CONFIG->site->url . "action/email/confirm/?u=$user_guid&c=" . generate_email_validation_code($user_guid, $user->email); - + $link = $CONFIG->site->url . "action/email/confirm?u=$user_guid&c=" . generate_email_validation_code($user_guid, $user->email); + // Send validation email - return notify_user($user->guid, $CONFIG->site_guid, elgg_echo('email:validate:subject'), sprintf(elgg_echo('email:validate:body'), $user->username, $link), NULL, 'email'); + return notify_user($user->guid, $CONFIG->site->guid, elgg_echo('email:validate:subject'), sprintf(elgg_echo('email:validate:body'), $user->username, $link), NULL, 'email'); } @@ -899,7 +899,7 @@ register_action("register",true); register_action("friends/add"); register_action("friends/remove"); - + register_action("email/confirm"); } //register actions ************************************************************* -- cgit v1.2.3