[geeklog-hg] geeklog: Updated OAuth Class. Includes updates for LinkedIn and ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jul 20 20:46:39 EDT 2013


changeset 9218:7c077e952889
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/7c077e952889
user: Tom <websitemaster at cogeco.net>
date: Sat Jul 20 20:45:44 2013 -0400
description:
Updated OAuth Class. Includes updates for LinkedIn and services for Google, Microsoft (Live) and Yahoo (needs more work). Does not fully work yet there is a redirection issue after user successfully logs into service and returns to Geeklog.
Resynch of User Account also has not been tested.

diffstat:

 language/english.php                                      |    16 +-
 language/english_utf-8.php                                |    14 +-
 public_html/admin/install/config-install.php              |     9 +
 public_html/docs/english/config.html                      |    10 +-
 public_html/docs/japanese/config.html                     |     5 +
 public_html/images/facebook-login-icon.png                |   Bin 
 public_html/images/linkedin-login-icon.png                |   Bin 
 public_html/images/oauth-login-with-sprite.png            |   Bin 
 public_html/images/twitter-login-icon.png                 |   Bin 
 public_html/layout/denim/css_ltr/style.css                |    25 +
 public_html/layout/denim/css_rtl/style.css                |    25 +
 public_html/layout/denim/loginform_oauth.thtml            |    12 +-
 public_html/layout/modern_curve/css/form.css              |    25 +
 public_html/layout/modern_curve/loginform_oauth.thtml     |     7 +-
 public_html/layout/professional/loginform_oauth.thtml     |    12 +-
 public_html/layout/professional/style.css                 |    25 +
 public_html/layout/professional_css/css/form.css          |    25 +
 public_html/layout/professional_css/loginform_oauth.thtml |    12 +-
 public_html/lib-common.php                                |     4 +-
 public_html/users.php                                     |    34 +
 sql/updates/mssql_2.0.0_to_2.0.1.php                      |     8 +
 sql/updates/mysql_2.0.0_to_2.0.1.php                      |    10 +-
 sql/updates/pgsql_2.0.0_to_2.0.1.php                      |    10 +-
 system/classes/http/LICENSE.txt                           |    36 +
 system/classes/http/http.php                              |  2092 +++++++++++++
 system/classes/oauth/facebook.auth.class.php              |   245 -
 system/classes/oauth/linkedin.auth.class.php              |    76 -
 system/classes/oauth/oauth_client.php                     |  1994 ++++++++++++
 system/classes/oauth/twitter.auth.class.php               |   100 -
 system/classes/oauthhelper.class.php                      |   521 +-
 system/lib-security.php                                   |    56 +-
 31 files changed, 4665 insertions(+), 743 deletions(-)

diffs (truncated from 5796 to 300 lines):

diff -r 7d74d79b126e -r 7c077e952889 language/english.php
--- a/language/english.php	Sat Jul 20 14:34:13 2013 -0400
+++ b/language/english.php	Sat Jul 20 20:45:44 2013 -0400
@@ -183,7 +183,10 @@
     139 => "Click <a href=\"{$_CONF['site_url']}/\" rel=\"nofollow\">here</a> to return to the homepage",
     'facebook' => 'Login with Facebook',
     'twitter' => 'Login with Twitter',
-    'linkedin' => 'Login with LinkedIn', 
+    'linkedin' => 'Login with LinkedIn',
+    'google' => 'Login with Google',
+    'microsoft' => 'Login with Microsoft',
+    'yahoo' => 'Login with Yahoo',    
     'ctl' => 'Clear Cache'
 );
 
@@ -1935,7 +1938,16 @@
     'linkedin_consumer_secret' => "LinkedIn OAuth Secret Key",    
     'twitter_login' => "Enable OAuth Login Method Twitter",
     'twitter_consumer_key' => "Twitter OAuth Consumer Key",    
-    'twitter_consumer_secret' => "Twitter OAuth Consumer Secret",  
+    'twitter_consumer_secret' => "Twitter OAuth Consumer Secret",
+    'google_login' => "Enable OAuth Login Method Google",
+    'google_consumer_key' => "Google OAuth Consumer Key",
+    'google_consumer_secret' => "Google OAuth Consumer Secret",
+    'microsoft_login' => "Enable OAuth Login Method Microsoft",
+    'microsoft_consumer_key' => "Microsoft OAuth Consumer Key",
+    'microsoft_consumer_secret' => "Microsoft OAuth Consumer Secret",   
+    'yahoo_login' => "Enable OAuth Login Method Yahoo",
+    'yahoo_consumer_key' => "Yahoo OAuth Consumer Key",
+    'yahoo_consumer_secret' => "Yahoo OAuth Consumer Secret", 
     'spamx' => "Spam-X Actions",
     'sort_admin' => "Sort Links",
     'language' => "Default Language",
diff -r 7d74d79b126e -r 7c077e952889 language/english_utf-8.php
--- a/language/english_utf-8.php	Sat Jul 20 14:34:13 2013 -0400
+++ b/language/english_utf-8.php	Sat Jul 20 20:45:44 2013 -0400
@@ -183,7 +183,10 @@
     139 => "Click <a href=\"{$_CONF['site_url']}/\" rel=\"nofollow\">here</a> to return to the homepage",
     'facebook' => 'Login with Facebook',
     'twitter' => 'Login with Twitter',
-    'linkedin' => 'Login with LinkedIn', 
+    'linkedin' => 'Login with LinkedIn',
+    'google' => 'Login with Google',
+    'microsoft' => 'Login with Microsoft',
+    'yahoo' => 'Login with Yahoo',
     'ctl' => 'Clear Cache'
 );
 
@@ -1936,6 +1939,15 @@
     'twitter_login' => "Enable OAuth Login Method Twitter",
     'twitter_consumer_key' => "Twitter OAuth Consumer Key",    
     'twitter_consumer_secret' => "Twitter OAuth Consumer Secret",  
+    'google_login' => "Enable OAuth Login Method Google",
+    'google_consumer_key' => "Google OAuth Consumer Key",
+    'google_consumer_secret' => "Google OAuth Consumer Secret",
+    'microsoft_login' => "Enable OAuth Login Method Microsoft",
+    'microsoft_consumer_key' => "Microsoft OAuth Consumer Key",
+    'microsoft_consumer_secret' => "Microsoft OAuth Consumer Secret",   
+    'yahoo_login' => "Enable OAuth Login Method Yahoo",
+    'yahoo_consumer_key' => "Yahoo OAuth Consumer Key",
+    'yahoo_consumer_secret' => "Yahoo OAuth Consumer Secret",   
     'spamx' => "Spam-X Actions",
     'sort_admin' => "Sort Links",
     'language' => "Default Language",
diff -r 7d74d79b126e -r 7c077e952889 public_html/admin/install/config-install.php
--- a/public_html/admin/install/config-install.php	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/admin/install/config-install.php	Sat Jul 20 20:45:44 2013 -0400
@@ -240,6 +240,15 @@
     $c->add('twitter_login',0,'select',4,16,1,356,TRUE, $me, 16);
     $c->add('twitter_consumer_key','','text',4,16,NULL,357,TRUE, $me, 16);
     $c->add('twitter_consumer_secret','','text',4,16,NULL,358,TRUE, $me, 16);
+    $c->add('google_login',0,'select',4,16,1,359,TRUE, $me, 16);
+    $c->add('google_consumer_key','','text',4,16,NULL,360,TRUE, $me, 16);
+    $c->add('google_consumer_secret','','text',4,16,NULL,361,TRUE, $me, 16);    
+    $c->add('microsoft_login',0,'select',4,16,1,362,TRUE, $me, 16);
+    $c->add('microsoft_consumer_key','','text',4,16,NULL,363,TRUE, $me, 16);
+    $c->add('microsoft_consumer_secret','','text',4,16,NULL,364,TRUE, $me, 16);    
+    // $c->add('yahoo_login',0,'select',4,16,1,365,TRUE, $me, 16);
+    // $c->add('yahoo_consumer_key','','text',4,16,NULL,366,TRUE, $me, 16);
+    // $c->add('yahoo_consumer_secret','','text',4,16,NULL,367,TRUE, $me, 16);    
     $c->add('aftersave_user','item','select',4,16,9,1340,TRUE, $me, 16);
     
     $c->add('tab_spamx', NULL, 'tab', 4, 17, NULL, 0, TRUE, $me, 17);
diff -r 7d74d79b126e -r 7c077e952889 public_html/docs/english/config.html
--- a/public_html/docs/english/config.html	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/docs/english/config.html	Sat Jul 20 20:45:44 2013 -0400
@@ -833,7 +833,7 @@
   <td valign="top"><a name="desc_user_login_method_oauth">oauth</a></td>
   <td valign="top"><code>false</code></td>
   <td valign="top">Whether to allow logins using <a href="http://oauth.net/">OAuth</a>. This will display a special OAuth login below the normal login field.<br>
-    <strong>Note:</strong> Currently only OAuth 1.0 is supported. Current login methods supported: Facebook, Twitter and LinkedIn.<br>Please note that to enable login for a 
+    <strong>Note:</strong> Currently only OAuth 1.0 is supported. Current login methods supported: Facebook, Twitter, LinkedIn, Google and Microsoft.<br>Please note that to enable login for a 
     specific method, you need an authorization class in <tt>system/classes/oauth</tt>. If you only want to allow Facebook but not Twitter users (or vice versa), simply
     remove the class file for the unwanted service(s) or use the config options below. You must also update the config options below with the correct key and secret string 
     ($consumer_secret) values. The PHP extension OpenSSL is required to be loaded.<br>
@@ -889,6 +889,14 @@
   <td valign="top">Required to use Twitter OAuth login method. Visit this <a href="https://twitter.com/apps">Twitter Application page</a> 
   to create an application to receive your consumer key and secret.<br>
   See our <a href="http://wiki.geeklog.net/index.php/OAuth">Wiki OAuth page</a> for more information.</td></tr>
+  
+  
+  
+  
+  
+  
+  
+  
 <tr>
   <td valign="top"><a name="desc_aftersave_user">aftersave_user</a></td>
   <td valign="top"><code>'item'</code></td>
diff -r 7d74d79b126e -r 7c077e952889 public_html/docs/japanese/config.html
--- a/public_html/docs/japanese/config.html	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/docs/japanese/config.html	Sat Jul 20 20:45:44 2013 -0400
@@ -784,6 +784,11 @@
   <td valign="top"><code>''</code></td>
   <td valign="top">Twitter OAuth ログイン利用時にはå
¥åŠ›ã—てください。アプリケーションを作成してconsumer keyと secretを取得するには、この<a href="https://twitter.com/apps">Twitter Application page</a>を参ç
§ã—てください。<br>
   さらに詳しいæƒ
報は、<a href="http://wiki.geeklog.net/index.php/OAuth">Wiki OAuth page</a>を参ç
§ã—てください。</td></tr>
+  
+  
+  
+  
+  
 <tr>
   <td valign="top"><a name="desc_aftersave_user">ユーザー保存後の画面遷移(aftersave_user)</a></td>
   <td valign="top"><code>作成したé 
目を表示する(item)</code></td>
diff -r 7d74d79b126e -r 7c077e952889 public_html/images/facebook-login-icon.png
Binary file public_html/images/facebook-login-icon.png has changed
diff -r 7d74d79b126e -r 7c077e952889 public_html/images/linkedin-login-icon.png
Binary file public_html/images/linkedin-login-icon.png has changed
diff -r 7d74d79b126e -r 7c077e952889 public_html/images/oauth-login-with-sprite.png
Binary file public_html/images/oauth-login-with-sprite.png has changed
diff -r 7d74d79b126e -r 7c077e952889 public_html/images/twitter-login-icon.png
Binary file public_html/images/twitter-login-icon.png has changed
diff -r 7d74d79b126e -r 7c077e952889 public_html/layout/denim/css_ltr/style.css
--- a/public_html/layout/denim/css_ltr/style.css	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/layout/denim/css_ltr/style.css	Sat Jul 20 20:45:44 2013 -0400
@@ -1584,6 +1584,31 @@
   Login Form
 --------------------------------------*/
 
+/* authentication buttons */
+#login_facebook{left:0px;width:141px;}
+#login_facebook{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position:0 0;}
+
+#login_twitter{left:0px;width:141px;}
+#login_twitter{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -23px;}
+
+#login_linkedin{left:0px;width:141px;}
+#login_linkedin{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -44px;}
+
+#login_google{left:0px;width:141px;}
+#login_google{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -66px;}
+
+#login_yahoo{left:0px;width:141px;}
+#login_yahoo{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -88px;}
+
+#login_microsoft{left:0px;width:141px;}
+#login_microsoft{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -110px;}
+
+#login_github{left:0px;width:141px;}
+#login_github{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -132px;}
+
+#login_openid{left:0px;width:141px;}
+#login_openid{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -154px;}
+
 #loginform fieldset {
   margin-top: 15px;
   padding: 0px;
diff -r 7d74d79b126e -r 7c077e952889 public_html/layout/denim/css_rtl/style.css
--- a/public_html/layout/denim/css_rtl/style.css	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/layout/denim/css_rtl/style.css	Sat Jul 20 20:45:44 2013 -0400
@@ -1627,6 +1627,31 @@
   Login Form
 --------------------------------------*/
 
+/* authentication buttons */
+#login_facebook{left:0px;width:141px;}
+#login_facebook{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position:0 0;}
+
+#login_twitter{left:0px;width:141px;}
+#login_twitter{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -23px;}
+
+#login_linkedin{left:0px;width:141px;}
+#login_linkedin{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -44px;}
+
+#login_google{left:0px;width:141px;}
+#login_google{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -66px;}
+
+#login_yahoo{left:0px;width:141px;}
+#login_yahoo{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -88px;}
+
+#login_microsoft{left:0px;width:141px;}
+#login_microsoft{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -110px;}
+
+#login_github{left:0px;width:141px;}
+#login_github{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -132px;}
+
+#login_openid{left:0px;width:141px;}
+#login_openid{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -154px;}
+
 #loginform fieldset {
   margin-top: 15px;
   padding: 0px;
diff -r 7d74d79b126e -r 7c077e952889 public_html/layout/denim/loginform_oauth.thtml
--- a/public_html/layout/denim/loginform_oauth.thtml	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/layout/denim/loginform_oauth.thtml	Sat Jul 20 20:45:44 2013 -0400
@@ -1,11 +1,9 @@
-<!-- loginform_oauth.thtml { -->
+{# begin {templatelocation} #}
 
 <form class="third-party-login" action="{site_url}/users.php?oauth_login={oauth_service}" method="post">
-  <div>
-    <img alt="" src="{oauth_sign_in_image}"{xhtml}>
-    <input value="{lang_oauth_service}" type="submit" class="submit"{xhtml}>
-  </div>
+    <div>
+        <input style="border:0;height:22px;width:141px;padding:0;margin:0;" type="submit" value="" id="login_{oauth_service}"{xhtml}>
+    </div>
 </form>
 
-<!-- } loginform_oauth.thtml -->
-
+{# end {templatelocation} #}
diff -r 7d74d79b126e -r 7c077e952889 public_html/layout/modern_curve/css/form.css
--- a/public_html/layout/modern_curve/css/form.css	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/layout/modern_curve/css/form.css	Sat Jul 20 20:45:44 2013 -0400
@@ -69,6 +69,31 @@
   Login Form
 --------------------------------------*/
 
+/* authentication buttons */
+#login_facebook{left:0px;width:141px;}
+#login_facebook{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position:0 0;}
+
+#login_twitter{left:0px;width:141px;}
+#login_twitter{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -23px;}
+
+#login_linkedin{left:0px;width:141px;}
+#login_linkedin{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -44px;}
+
+#login_google{left:0px;width:141px;}
+#login_google{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -66px;}
+
+#login_yahoo{left:0px;width:141px;}
+#login_yahoo{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -88px;}
+
+#login_microsoft{left:0px;width:141px;}
+#login_microsoft{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -110px;}
+
+#login_github{left:0px;width:141px;}
+#login_github{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -132px;}
+
+#login_openid{left:0px;width:141px;}
+#login_openid{background:url('/images/oauth-login-with-sprite.png') no-repeat; background-position: 0 -154px;}
+
 /* Input sizing */
 form#loginform input,
 form#loginform select,
diff -r 7d74d79b126e -r 7c077e952889 public_html/layout/modern_curve/loginform_oauth.thtml
--- a/public_html/layout/modern_curve/loginform_oauth.thtml	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/layout/modern_curve/loginform_oauth.thtml	Sat Jul 20 20:45:44 2013 -0400
@@ -1,10 +1,9 @@
 {# begin {templatelocation} #}
 
 <form class="third-party-login" action="{site_url}/users.php?oauth_login={oauth_service}" method="post">
-  <div>
-    <img alt="" src="{oauth_sign_in_image}"{xhtml}>
-    <input value="{lang_oauth_service}" type="submit" class="submit"{xhtml}>
-  </div>
+    <div>
+        <input style="border:0;height:22px;width:141px;padding:0;margin:0;" type="submit" value="" id="login_{oauth_service}"{xhtml}>
+    </div>
 </form>
 
 {# end {templatelocation} #}
diff -r 7d74d79b126e -r 7c077e952889 public_html/layout/professional/loginform_oauth.thtml
--- a/public_html/layout/professional/loginform_oauth.thtml	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/layout/professional/loginform_oauth.thtml	Sat Jul 20 20:45:44 2013 -0400
@@ -1,6 +1,10 @@
+{# begin {templatelocation} #}
+
 <form class="third-party-login" action="{site_url}/users.php?oauth_login={oauth_service}" method="post">
-  <div>
-    <img alt="" src="{oauth_sign_in_image}"{xhtml}>
-    <input value="{lang_oauth_service}" type="submit" class="submit"{xhtml}>
-  </div>
+    <div>
+        <input style="border:0;height:22px;width:141px;padding:0;margin:0;" type="submit" value="" id="login_{oauth_service}"{xhtml}>
+    </div>
 </form>
+
+{# end {templatelocation} #}
+
diff -r 7d74d79b126e -r 7c077e952889 public_html/layout/professional/style.css
--- a/public_html/layout/professional/style.css	Sat Jul 20 14:34:13 2013 -0400
+++ b/public_html/layout/professional/style.css	Sat Jul 20 20:45:44 2013 -0400
@@ -1232,6 +1232,31 @@
   width: 164px;
 }
 



More information about the geeklog-cvs mailing list