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/css.php | 46 +++++++++++++ views/default/openid_client/forms/admin.php | 99 +++++++++++++++++++++++++++ views/default/openid_client/forms/login.php | 57 +++++++++++++++ views/default/openid_client/forms/missing.php | 73 ++++++++++++++++++++ views/default/openid_client/forms/sync.php | 86 +++++++++++++++++++++++ 5 files changed, 361 insertions(+) create mode 100644 views/default/openid_client/css.php create mode 100644 views/default/openid_client/forms/admin.php create mode 100644 views/default/openid_client/forms/login.php create mode 100644 views/default/openid_client/forms/missing.php create mode 100644 views/default/openid_client/forms/sync.php (limited to 'views/default') diff --git a/views/default/openid_client/css.php b/views/default/openid_client/css.php new file mode 100644 index 000000000..b61865bf0 --- /dev/null +++ b/views/default/openid_client/css.php @@ -0,0 +1,46 @@ + + + + +.river_user_openid_friend { + background: url(_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px; +} +.river_user_openid_update { + background: url(_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px; +} +.river_user_openid_messageboard { + background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} + +#openid_login #login-box h2 { + margin:0; + padding:5px 0 10px 0; +} +#openid_login #login-box-openid form { + background-color: none; + margin:0; + padding:0; +} +input.openid_login { + background: url(mod/openid_client/graphics/login-bg.gif) no-repeat; + background-color: #fff; + background-position: 0 50%; + color: #000; + width: 160px; +} +#openid_show { + cursor:pointer; +} diff --git a/views/default/openid_client/forms/admin.php b/views/default/openid_client/forms/admin.php new file mode 100644 index 000000000..156a605ff --- /dev/null +++ b/views/default/openid_client/forms/admin.php @@ -0,0 +1,99 @@ + + * @copyright Curverider Ltd 2008-2009 + * @link http://elgg.com/ + * + */ + +if ($vars['always_sync'] == 'yes') { + $sync_checked = 'checked="checked"'; +} else { + $sync_checked = ''; +} + +if ($vars['sso'] == 'yes') { + $sso_checked = 'checked="checked"'; +} else { + $sso_checked = ''; +} + +$default_server = $vars['default_server']; + +$greenlist = $vars['greenlist']; +$yellowlist = $vars['yellowlist']; +$redlist = $vars['redlist']; + +$action = $CONFIG->wwwroot.'action/openid_client/admin'; + +$default_server_title = elgg_echo('openid_client:default_server_title'); +$default_server_instructions1 = elgg_echo('openid_client:default_server_instructions1'); +$default_server_instructions2 = elgg_echo('openid_client:default_server_instructions2'); + +$server_sync_title = elgg_echo('openid_client:server_sync_title'); +$server_sync_instructions = elgg_echo('openid_client:server_sync_instructions'); +$server_sync_label = elgg_echo('openid_client:server_sync_label'); + +$sso_title = elgg_echo('openid_client:sso_title'); +$sso_instructions = elgg_echo('openid_client:sso_instructions'); +$sso_label = elgg_echo('openid_client:sso_label'); + +$lists_title = elgg_echo('openid_client:lists_title'); + +$lists_instruction1 = elgg_echo('openid_client:lists_instruction1'); +$lists_instruction2 = elgg_echo('openid_client:lists_instruction2'); +$lists_instruction3 = elgg_echo('openid_client:lists_instruction3'); +$lists_instruction4 = elgg_echo('openid_client:lists_instruction4'); +$lists_instruction5 = elgg_echo('openid_client:lists_instruction5'); +$lists_instruction6 = elgg_echo('openid_client:lists_instruction6'); + +$green_list_title = elgg_echo('openid_client:green_list_title'); +$yellow_list_title = elgg_echo('openid_client:yellow_list_title'); +$red_list_title = elgg_echo('openid_client:red_list_title'); + +$ok_button_label = elgg_echo('openid_client:ok_button_label'); + +$security_token = elgg_view('input/securitytoken'); + +$body = << +
+$security_token +

$default_server_title

+

$default_server_instructions1

+

$default_server_instructions2

+

+

$server_sync_title

+

$server_sync_instructions

+

+$server_sync_label

+

$sso_title

+

$sso_instructions

+

+$sso_label

+

$lists_title

+

$lists_instruction1

+

$lists_instruction2

+

$lists_instruction3

+

$lists_instruction4

+

$lists_instruction5

+

$lists_instruction6

+

$green_list_title

+

+

$yellow_list_title

+

+

$red_list_title

+

+ +
+ +END; + +print $body; + +?> \ No newline at end of file diff --git a/views/default/openid_client/forms/login.php b/views/default/openid_client/forms/login.php new file mode 100644 index 000000000..bfc881e3c --- /dev/null +++ b/views/default/openid_client/forms/login.php @@ -0,0 +1,57 @@ + + +
+OpenID + +
+
+
+ + + + + + + + +

+

+
+ +
+
+
+
+
+
+
+ +
diff --git a/views/default/openid_client/forms/missing.php b/views/default/openid_client/forms/missing.php new file mode 100644 index 000000000..7810f3c57 --- /dev/null +++ b/views/default/openid_client/forms/missing.php @@ -0,0 +1,73 @@ + + * @copyright Curverider Ltd 2008-2009 + * @link http://elgg.com/ + * + * @uses the following values in $vars: + * + * 'openid_url' the OpenID + * 'email' the user's email (if known) + * 'fullname' the user's full name (if known) + * 'email_confirmation' whether the email address needs to be confirmed + * 'code' a magic code that associates this data with a real user + */ + +$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'); + +$missing_email = elgg_echo('openid_client:missing_email'); +$missing_name = elgg_echo('openid_client:missing_name'); +$and = elgg_echo('openid_client:and'); +$email_form = "
$emailLabel
'; +$name_form = "
$nameLabel
'; +$email_hidden = ''."\n"; +$name_hidden = ''."\n"; + +if (!$vars['email'] && !$$vars['fullname']) { + $missing_fields = $missing_email.' '.$and.' '.$missing_name; + $visible_fields = $email_form.'
'.$name_form; + $hidden_fields = ''; +} elseif (!$vars['email']) { + $missing_fields = $missing_email; + $visible_fields = $email_form; + $hidden_fields = $name_hidden; +} elseif (!$vars['fullname']) { + $missing_fields = $missing_name; + $visible_fields = $name_form; + $hidden_fields = $email_hidden; +} + +$hidden_fields .= ''."\n"; + +$instructions = sprintf(elgg_echo('openid_client:missing_info_instructions'),$missing_fields); + +$action = $CONFIG->wwwroot.'action/openid_client/missing'; +$security_token = elgg_view('input/securitytoken'); + +$body .= <<< END + $instructions +
+ $security_token +

+ $visible_fields +

+

+ $hidden_fields + + +

+
+ +END; + +echo elgg_view('page_elements/contentwrapper',array('body'=>$body)); + +?> \ No newline at end of file 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