diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-25 19:21:21 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-25 19:21:21 +0000 |
commit | 401fd957b30219a610014d4236de35b6220fd310 (patch) | |
tree | 072d7ef4b88000ff20df90724e4f798bf5448b74 /engine | |
parent | fb24a60da5ea1627c8336e387217bd6ca2b45f74 (diff) | |
download | elgg-401fd957b30219a610014d4236de35b6220fd310.tar.gz elgg-401fd957b30219a610014d4236de35b6220fd310.tar.bz2 |
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
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/notification.php | 7 | ||||
-rw-r--r-- | engine/lib/sites.php | 6 | ||||
-rw-r--r-- | engine/lib/users.php | 8 |
3 files changed, 13 insertions, 8 deletions
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 *************************************************************
|