Added signin button.
This commit is contained in:
parent
92f2408deb
commit
877a736e15
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
/_devel_/
|
||||
/auth.json
|
||||
/client_secret.json
|
||||
/composer.phar
|
||||
/vendor/
|
||||
|
@ -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);
|
||||
}
|
||||
|
11
index.php
11
index.php
@ -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);
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user