From 877a736e154f14058431685440a7800114a7ab4f Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Fri, 20 May 2016 15:13:56 +0200 Subject: [PATCH] Added signin button. --- .gitignore | 2 ++ .htaccess | 3 +++ css/frs.css | 5 +++++ index.php | 11 ++++++++++- templates/index_html.mustache | 4 ++++ 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .htaccess diff --git a/.gitignore b/.gitignore index d8a4973..df021ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /_devel_/ +/auth.json +/client_secret.json /composer.phar /vendor/ diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..ba24195 --- /dev/null +++ b/.htaccess @@ -0,0 +1,3 @@ + + Require all denied + diff --git a/css/frs.css b/css/frs.css index 5a84ba6..19c6b8c 100644 --- a/css/frs.css +++ b/css/frs.css @@ -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); +} diff --git a/index.php b/index.php index 5f263f2..0d7760e 100644 --- a/index.php +++ b/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); diff --git a/templates/index_html.mustache b/templates/index_html.mustache index c133ea7..f44a943 100644 --- a/templates/index_html.mustache +++ b/templates/index_html.mustache @@ -8,6 +8,10 @@

What is this?

+

+ +

+

Hello, world!