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 --- pages/admin.php | 27 +++++++++++++++++++++++++++ pages/confirm.php | 46 ++++++++++++++++++++++++++++++++++++++++++++++ pages/reset.php | 12 ++++++++++++ pages/sso.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+) create mode 100644 pages/admin.php create mode 100644 pages/confirm.php create mode 100644 pages/reset.php create mode 100644 pages/sso.php (limited to 'pages') diff --git a/pages/admin.php b/pages/admin.php new file mode 100644 index 000000000..9390e5b00 --- /dev/null +++ b/pages/admin.php @@ -0,0 +1,27 @@ + get_plugin_setting('default_server','openid_client'), + 'always_sync' => get_plugin_setting('always_sync','openid_client'), + 'sso' => get_plugin_setting('sso','openid_client'), + 'greenlist' => get_plugin_setting('greenlist','openid_client'), + 'yellowlist' => get_plugin_setting('yellowlist','openid_client'), + 'redlist' => get_plugin_setting('redlist','openid_client'), + )); + + +$body = elgg_view_layout("two_column_left_sidebar", '', $content); + +page_draw($title, $body); diff --git a/pages/confirm.php b/pages/confirm.php new file mode 100644 index 000000000..1f2668620 --- /dev/null +++ b/pages/confirm.php @@ -0,0 +1,46 @@ +new_owner); + $user->email = $details->email; + $user->name = $details->name; + $user->active = 'yes'; + $user->save(); + system_message(sprintf(elgg_echo("openid_client:account_created"), $details->username)); + openid_client_remove_invitation($code); + } + +} elseif ($code{0} == 'c') { + // request to change an email address + if (!$details = openid_client_get_invitation($code)) { + register_error(elgg_echo("openid_client:invalid_code_error")); + } else { + // OK, everything seems to be in order, so change the email address + $user = get_user($details->new_owner); + $user->email = $details->email; + $user->save(); + system_message(sprintf(elgg_echo('openid_client:email_changed'),$details->email)); + openid_client_remove_invitation($code); + } +} + +if(isset($body) && $body) { + page_draw(elgg_echo('openid_client:confirmation_title'),$body); +} else { + forward(); +} diff --git a/pages/reset.php b/pages/reset.php new file mode 100644 index 000000000..aa85f3386 --- /dev/null +++ b/pages/reset.php @@ -0,0 +1,12 @@ +resetAssociations(); +$store->resetNonces(); + +print "OpenID store reset"; diff --git a/pages/sso.php b/pages/sso.php new file mode 100644 index 000000000..a0098ce72 --- /dev/null +++ b/pages/sso.php @@ -0,0 +1,52 @@ +wwwroot.'action/openid_client/login'; +// $ts = time(); +// $token = generate_action_token($ts); +// $fields = array( +// '__elgg_token'=>$token, +// '__elgg_ts'=>$ts, +// 'passthru_url'=>'', +// 'externalservice'=>'', +// 'username'=>urlencode($openid_url), +// ); +// +// //url-ify the data for the POST +// foreach($fields as $key=>$value) { +// $fields_string .= $key.'='.$value.'&'; +// } +// rtrim($fields_string,'&'); +// +// //open connection +// $ch = curl_init(); +// +// //set the url, number of POST vars, POST data +// curl_setopt($ch,CURLOPT_URL,$url); +// //curl_setopt($ch,CURLOPT_POST,count($fields)); +// curl_setopt($ch,CURLOPT_POST,true); +// curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); +// curl_setopt($ch,CURLOPT_RETURNTRANSFER,false); +// curl_setopt($ch,CURLOPT_FAILONERROR,true); +// //curl_setopt($ch,CURLOPT_HEADER, true); +// curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true); +// +// //execute post +// curl_exec($ch); +// +// //print_r (curl_getinfo($ch)); +// +// //print $result; +// +// //close connection +// curl_close($ch); + +?> \ No newline at end of file -- cgit v1.2.3