aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-03 13:00:41 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-03 13:00:41 +0000
commit920d8c409b6bac1b8def6d05d7a90860b249ecd7 (patch)
tree08806a9a5da25716bf4f2386497cf4a15251d390
parentf3ee4d82d0afd844c522a0f941d1fdfb1eb7e58e (diff)
downloadelgg-920d8c409b6bac1b8def6d05d7a90860b249ecd7.tar.gz
elgg-920d8c409b6bac1b8def6d05d7a90860b249ecd7.tar.bz2
Refs #311
git-svn-id: https://code.elgg.org/elgg/trunk@2169 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/users.php33
1 files changed, 28 insertions, 5 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 3bb1d0da8..48a05c12a 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -901,7 +901,7 @@
* @param int $user_guid The user id
* @param string $email_address The email address
*/
- function generate_email_validation_code($user_guid, $email_address)
+ /*function generate_email_validation_code($user_guid, $email_address)
{
global $CONFIG;
@@ -914,7 +914,7 @@
* @param int $user_guid The user
* @param bool $status The status
*/
- function set_email_validation_status($user_guid, $status)
+ /*function set_email_validation_status($user_guid, $status)
{
$user_guid = (int)$user_guid;
@@ -926,7 +926,7 @@
*
* @param int $user_guid
*/
- function get_email_validation_status($user_guid)
+ /*function get_email_validation_status($user_guid)
{
$user = get_entity($user_guid);
@@ -944,7 +944,7 @@
* @param int $user_guid The user.
* @return bool
*/
- function request_email_validation($user_guid)
+ /*function request_email_validation($user_guid)
{
global $CONFIG;
@@ -973,7 +973,7 @@
* @param int $user_guid User GUID
* @param string $code The code provided on validation.
*/
- function validate_email($user_guid, $code)
+ /*function validate_email($user_guid, $code)
{
$user = get_entity($user_guid);
@@ -985,6 +985,29 @@
}
/**
+ * Trigger an event requesting that a user guid be validated somehow - either by email address or some other way.
+ *
+ * This event invalidates any existing values and returns
+ *
+ * @param unknown_type $user_guid
+ */
+ function request_email_validation($user_guid)
+ {
+ $user = get_entity($user_guid);
+
+ if (($user) && ($user instanceof ElggUser))
+ {
+ // invalidate any existing validations
+ create_metadata($user_guid, 'validated', false,'', 0, 2);
+ create_metadata($user_guid, 'validated_method', '','', 0, 2);
+
+ // request validation
+ trigger_elgg_event('user', 'validate', $user);
+
+ }
+ }
+
+ /**
* Validates an email address.
*
* @param string $address Email address.