[geeklog-hg] geeklog: Oauth - Cleaned up code. Tested resynch of remote accou...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Aug 25 01:05:00 EDT 2013
changeset 9263:9d7622a07421
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/9d7622a07421
user: Tom <websitemaster at cogeco.net>
date: Sun Aug 25 00:56:28 2013 -0400
description:
Oauth - Cleaned up code. Tested resynch of remote accounts. Added icons for Google, Microsoft and Yahoo
diffstat:
public_html/images/google-login-icon.png | Bin
public_html/images/microsoft-login-icon.png | Bin
public_html/images/yahoo-login-icon.png | Bin
public_html/users.php | 55 ----------------------------
public_html/usersettings.php | 41 --------------------
5 files changed, 0 insertions(+), 96 deletions(-)
diffs (122 lines):
diff -r 6aa61575c4d2 -r 9d7622a07421 public_html/images/google-login-icon.png
Binary file public_html/images/google-login-icon.png has changed
diff -r 6aa61575c4d2 -r 9d7622a07421 public_html/images/microsoft-login-icon.png
Binary file public_html/images/microsoft-login-icon.png has changed
diff -r 6aa61575c4d2 -r 9d7622a07421 public_html/images/yahoo-login-icon.png
Binary file public_html/images/yahoo-login-icon.png has changed
diff -r 6aa61575c4d2 -r 9d7622a07421 public_html/users.php
--- a/public_html/users.php Sat Aug 24 22:19:12 2013 -0400
+++ b/public_html/users.php Sun Aug 25 00:56:28 2013 -0400
@@ -922,61 +922,6 @@
$consumer->doAction($oauth_userinfo);
}
-
- /*
- $active_service = false;
- $modules = SEC_collectRemoteOAuthModules();
- $active_service = (count($modules) == 0) ? false : in_array($_GET['oauth_login'], $modules);
- if (!$active_service) {
- $status = -1;
- } else {
- $query = array_merge($_GET, $_POST);
- $service = $query['oauth_login'];
- $callback_url = $_CONF['site_url'] . '/users.php?oauth_login=' . $service;
-
- COM_clearSpeedlimit($_CONF['login_speedlimit'], $service);
- if (COM_checkSpeedlimit($service, $_CONF['login_attempts']) > 0) {
- displayLoginErrorAndAbort(82, $LANG12[26], $LANG04[112]);
- }
-
- require_once $_CONF['path_system'] . 'classes/oauthhelper.class.php';
-
- $consumer = new OAuthConsumer($service);
- $callback_query_string = $consumer->getCallback_query_string();
- $cancel_query_string = $consumer->getCancel_query_string();
-
- if (!isset($query[$callback_query_string]) && (empty($cancel_query_string) || !isset($query[$cancel_query_string]))) {
- $url = $consumer->find_identity_info($callback_url, $query);
- if (empty($url)) {
- COM_updateSpeedlimit('login');
- COM_updateSpeedlimit($service);
- echo COM_refresh($_CONF['site_url'] . '/users.php?msg=110');
- exit;
- } else {
- header('Location: ' . $url);
- exit;
- }
- } elseif (isset($query[$callback_query_string])) {
- $oauth_userinfo = $consumer->sreq_userinfo_response($query);
- if (empty($oauth_userinfo)) {
- COM_updateSpeedlimit('login');
- echo COM_refresh($_CONF['site_url'] . '/users.php?msg=111');
- exit;
- } else {
- $consumer->doAction($oauth_userinfo);
- }
- } elseif (!empty($cancel_query_string) && isset($query[$cancel_query_string])) {
- COM_updateSpeedlimit('login');
- echo COM_refresh($_CONF['site_url'] . '/users.php?msg=112');
- exit;
- } else {
- COM_updateSpeedlimit('login');
- echo COM_refresh($_CONF['site_url'] . '/users.php?msg=91');
- exit;
- }
- }
- */
-
} else {
$status = -1;
}
diff -r 6aa61575c4d2 -r 9d7622a07421 public_html/usersettings.php
--- a/public_html/usersettings.php Sat Aug 24 22:19:12 2013 -0400
+++ b/public_html/usersettings.php Sun Aug 25 00:56:28 2013 -0400
@@ -1136,47 +1136,6 @@
}
}
-/*
- $msg = 5;
- // Re Sync data if needed
- if (isset($A['resynch'])) {
- if ($_CONF['user_login_method']['oauth'] && (strpos($_USER['remoteservice'], 'oauth.') === 0)) {
- $modules = SEC_collectRemoteOAuthModules();
-
- $active_service = (count($modules) == 0) ? false : in_array(substr($_USER['remoteservice'], 6), $modules);
- if (!$active_service) {
- $status = -1;
- $msg = 115; // Remote service has been disabled.
- } else {
- $query[] = '';
- $callback_url = $_CONF['site_url'] . '/usersettings.php?mode=synch&oauth_login=' . $service;
-
- if ($service == 'oauth.facebook') {
- // facebook does resynch during refresh
- return COM_refresh($callback_url);
- } else {
- // all other services use reauth/callback method
- // send request to OAuth Service for user information
- require_once $_CONF['path_system'] . 'classes/oauthhelper.class.php';
-
- $consumer = new OAuthConsumer($service);
-
- $url = $consumer->find_identity_info($callback_url, $query);
- if (empty($url)) {
- $msg = 110; // Can not get URL for authentication.'
- } else {
- header('Location: ' . $url);
- exit;
- }
- }
- }
- }
-
- if ($msg != 5) {
- $msg = 114; // Account saved but re-synch failed.
- }
- }
-*/
if ($_US_VERBOSE) {
COM_errorLog('**** Leaving saveuser in usersettings.php ****', 1);
}
More information about the geeklog-cvs
mailing list