From d9bf22a0e29c2a70049443a0ae8521a2c0492c8b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 11 Dec 2011 06:38:23 -0500 Subject: initial commit for git repository --- views/default/openid_client/forms/sync.php | 86 ++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 views/default/openid_client/forms/sync.php (limited to 'views/default/openid_client/forms/sync.php') diff --git a/views/default/openid_client/forms/sync.php b/views/default/openid_client/forms/sync.php new file mode 100644 index 000000000..6d921b278 --- /dev/null +++ b/views/default/openid_client/forms/sync.php @@ -0,0 +1,86 @@ + + * @copyright Curverider Ltd 2008-2009 + * @link http://elgg.com/ + * + * @uses the following values in $vars: + * + * 'userid' the user's GUID + * 'new_email' the user's new email + * 'new_name' the user's new full name + * 'email_confirmation' whether the email address needs to be confirmed + */ + +$emailLabel = elgg_echo('openid_client:email_label'); +$nameLabel = elgg_echo('openid_client:name_label'); +$submitLabel = elgg_echo('openid_client:submit_label'); +$cancelLabel = elgg_echo('openid_client:cancel_label'); +$noSyncLabel = elgg_echo('openid_client:nosync_label'); +$instructions = elgg_echo('openid_client:sync_instructions'); + +$new_email = $vars['new_email']; +$new_name = $vars['new_name']; +$email_confirmation = $vars['email_confirmation']; + +$user = get_user($vars['userid']); + +$old_email = $user->email; +$old_name = $user->name; +$openid_url = $user->alias; + +if ($new_email && $new_email != $old_email) { + $change_fields .= '
$old_email => $new_email
\n"; + if (!$email_confirmation) { + // the email address is from a green server, so we can change the email without a confirmation message + // add an invitation code however to prevent this form from being forged + // the user ident and new email address can then securely be stored in the database invitation table + // rather than the form + $details = openid_client_create_invitation('c',$openid_url,$vars['userid'],$new_email,$new_name); + $form_stuff = ''; + } else { + // the email will be confirmed anyway so it is safe to put it in the form + $form_stuff .= <<< END + +END; + } + +} +if ($new_name && $new_name != $old_name) { + $change_fields .= '
$old_name => $new_name
\n"; +} + +$action = $CONFIG->wwwroot.'action/openid_client/sync'; +$security_token = elgg_view('input/securitytoken'); + +$body .= <<< END + $instructions +
+ $security_token +

+ $change_fields +

+

+ +

+ $form_stuff + + + +

+
+ +END; + +echo elgg_view('page_elements/contentwrapper',array('body'=>$body)); + +?> \ No newline at end of file -- cgit v1.2.3