summaryrefslogtreecommitdiffstats
path: root/includes/header.php
diff options
context:
space:
mode:
authorSnap <snapwilliam@gmail.com>2015-04-16 14:51:26 -0700
committerSnap <snapwilliam@gmail.com>2015-04-16 14:51:26 -0700
commit5c7f2f17f9c471d306955df457c7cab4e5c6ed3b (patch)
tree0fe6d049f1af552af6a74d264a3f571cfdb1ee7c /includes/header.php
parentd0b9b771a876922afdf00b2c55d5e1388a4ea2a3 (diff)
downloadpathery-5c7f2f17f9c471d306955df457c7cab4e5c6ed3b.tar.xz
Google's OpenID Connect method
$google_client_id & $google_client_secret must be added to db.inc.php!
Diffstat (limited to 'includes/header.php')
-rw-r--r--includes/header.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/includes/header.php b/includes/header.php
index d3256c3..cb34fac 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -180,11 +180,19 @@ function topbar($links) {
//Empty first-div contains sound manager stuff
echo '<div></div>';
+ //Create Google login link! So simple... </sarcasm>
+ global $google_client_id, $mydomain;
+ $googleLoginAuth = "https://accounts.google.com/o/oauth2/auth?response_type=code";
+ $googleLoginAuth .= "&redirect_uri=" . urlencode($mydomain . 'login?op=google');
+ $googleLoginAuth .= "&client_id=" . urlencode($google_client_id);
+ $googleLoginAuth .= "&scope=email&access_type=online&approval_prompt=auto";
+ $googleLoginAuth .= "&openid.realm" . urlencode($mydomain);
+
echo ' <div class="wrapper" id="oid_hidden" >
<h2>Sign in</h2>
<div id="oid_box">
<h2 style="color:#333;">Please sign in using one of the following</h2>
- <a rel="nofollow" href="login?op=google"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
+ <a rel="nofollow" href="'.$googleLoginAuth.'"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
<a rel="nofollow" href="login?op=facebook"><img id="oid_btn" src="images/btns/signin_Facebook.png" alt="Sign in with Facebook" /></a>
<a rel="nofollow" href="login?op=twitter"><img id="oid_btn" src="images/btns/signin_Twitter.png" alt="Sign in with Twitter" /></a>
<a rel="nofollow" href="login?op=yahoo"><img id="oid_btn" src="images/btns/signin_Yahoo.png" alt="Sign in with Yahoo" /></a>