Added signin button.

This commit is contained in:
Markus Birth 2016-05-20 15:13:56 +02:00
parent 92f2408deb
commit 877a736e15
5 changed files with 24 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
/_devel_/
/auth.json
/client_secret.json
/composer.phar
/vendor/

3
.htaccess Normal file
View File

@ -0,0 +1,3 @@
<Files ~ "\.json$">
Require all denied
</Files>

View File

@ -59,3 +59,8 @@
.mdl-mini-footer--link-list li:hover {
color: white;
}
#signin-button:hover {
display: block;
background: url(../img/btn_google_signin_dark_focus_web.png);
}

View File

@ -9,5 +9,14 @@ $m = new Mustache_Engine(array(
'logger' => new Mustache_Logger_StreamLogger('php://stderr'),
));
$data = array();
$client = new Google_Client();
$client->setAuthConfigFile('client_secret.json');
$client->setRedirectUri('https://raspi.mbirth.de/dev/FRS/');
$client->addScope(Google_Service_Oauth2::USERINFO_EMAIL);
$data['auth_url'] = $client->createAuthUrl();
$tpl = $m->loadTemplate('index_html');
echo $tpl->render();
echo $tpl->render($data);

View File

@ -8,6 +8,10 @@
<h3>What is this?</h3>
<p>
<a href="{{auth_url}}"><img id="signin-button" src="img/btn_google_signin_dark_normal_web.png"/></a>
</p>
<p>
Hello, world!
</p>