aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Polak <polak@gnu.org>2010-05-14 23:17:06 +0200
committerWojciech Polak <polak@gnu.org>2010-05-14 23:17:06 +0200
commitac61ac8cd76e9588bf8f4879716d9bbbfe718e76 (patch)
treeadef21b82d3262d8476d3217b60b7b3dfbd945ac
parente577933281b5c423445b510aa272cd4f9acf06e2 (diff)
downloadcheetah-ac61ac8cd76e9588bf8f4879716d9bbbfe718e76.tar.gz
cheetah-ac61ac8cd76e9588bf8f4879716d9bbbfe718e76.tar.bz2
Add OpenID providers selection.
Merge openid_manage and fb_connect into linked-accounts.
-rw-r--r--css/v2/cswindow.css63
-rw-r--r--css/v2/login.css43
-rw-r--r--frontend/fb_connect.php138
-rw-r--r--frontend/images/master-auth.pngbin0 -> 7549 bytes
-rw-r--r--frontend/lib/d-files.php3
-rw-r--r--frontend/lib/session.class.php53
-rw-r--r--frontend/linked-accounts.php282
-rw-r--r--frontend/login.php97
-rw-r--r--frontend/openid_manage.php183
-rw-r--r--frontend/rd.php11
-rw-r--r--frontend/reader.php3
-rw-r--r--frontend/xrds.php6
-rw-r--r--js/v2/gui.js34
-rw-r--r--js/v2/login.js418
-rw-r--r--po/POTFILES.in2
15 files changed, 699 insertions, 637 deletions
diff --git a/css/v2/cswindow.css b/css/v2/cswindow.css
index 21643f4..ff00b10 100644
--- a/css/v2/cswindow.css
+++ b/css/v2/cswindow.css
@@ -5,44 +5,34 @@ a:active { color: yellow; }
5body { 5body {
6 background-color: black; 6 background-color: black;
7 color: white; 7 color: white;
8 text-align: center; 8 text-align: left;
9 border: 2px solid red;
10 border-radius: 8px;
11 padding: 1em;
12 -moz-border-radius: 8px;
13 -webkit-border-radius: 8px;
14}
15h2 {
16 font-size: 100%;
9} 17}
10ul, p { 18ul, p {
11 margin-top: 1em; 19 margin-top: 1em;
12 margin-bottom: 1em; 20 margin-bottom: 1em;
13} 21}
14 22
15.smaller { 23.hidden { display: none; }
16 font-size: smaller; 24.left { text-align: left; }
17} 25.smaller { font-size: smaller; }
18.warning { 26.warning {
19 color: red; 27 color: red;
20 font-weight: bold; 28 font-weight: bold;
21} 29}
22 30
23#box { 31#accounts {
24 position: relative; 32 font-size: 85%;
25 width: 80%;
26 max-width: 600px;
27 top: 50px;
28 border: 2px solid red;
29 margin-left: auto;
30 margin-right: auto;
31 padding: 1em;
32 border-radius: 8px;
33 -moz-border-radius: 8px;
34 -webkit-border-radius: 8px;
35}
36#box a {
37 color: #eae3d7;
38 font-size: smaller;
39}
40#box table {
41 margin-left: auto;
42 margin-right: auto;
43} 33}
44 34
45#add_openid { 35.openid {
46 background: url(images/openid.png) no-repeat; 36 background: url(images/openid.png) no-repeat;
47 background-color: #fff; 37 background-color: #fff;
48 background-position: 0 50%; 38 background-position: 0 50%;
@@ -50,3 +40,26 @@ ul, p {
50 padding-left: 18px; 40 padding-left: 18px;
51} 41}
52.img-16-delete {background: transparent url(images/master-icons.png?v=0) no-repeat -64px 0px;} 42.img-16-delete {background: transparent url(images/master-icons.png?v=0) no-repeat -64px 0px;}
43
44#providers {
45 height: 40px;
46}
47#providers a {
48 float: left;
49 width: 32px;
50 height: 32px;
51 margin-right: 4px;
52 border: 1px solid black;
53}
54#providers a:hover {
55 border: 1px dashed #fffcc9;
56}
57#providers a.selected {
58 border: 4px solid #fffcc9;
59 -moz-border-radius: 10px;
60 -webkit-border-radius: 10px;
61}
62#auth-facebook { background: transparent url(images/master-auth.png?v=0) no-repeat 0px 0px; }
63#auth-google { background: transparent url(images/master-auth.png?v=0) no-repeat -32px 0px; }
64#auth-openid { background: transparent url(images/master-auth.png?v=0) no-repeat -64px 0px; }
65#auth-yahoo { background: transparent url(images/master-auth.png?v=0) no-repeat -96px 0px; }
diff --git a/css/v2/login.css b/css/v2/login.css
index 54d7d51..1804f41 100644
--- a/css/v2/login.css
+++ b/css/v2/login.css
@@ -8,13 +8,9 @@ ul, p {
8 margin-bottom: 1em; 8 margin-bottom: 1em;
9} 9}
10 10
11.hidden { 11.hidden { display: none; }
12 display: none; 12.left { text-align: left; }
13} 13.smaller { font-size: 90%; }
14
15.smaller {
16 font-size: 90%;
17}
18 14
19.link { 15.link {
20 color: #eae3d7; 16 color: #eae3d7;
@@ -68,7 +64,7 @@ ul, p {
68 margin-right: auto; 64 margin-right: auto;
69} 65}
70 66
71input.openid_identifier { 67#openid_identifier {
72 background: url(images/openid.png) no-repeat; 68 background: url(images/openid.png) no-repeat;
73 background-color: #fff; 69 background-color: #fff;
74 background-position: 0 50%; 70 background-position: 0 50%;
@@ -162,3 +158,34 @@ input.openid_identifier {
162 color: white; 158 color: white;
163 text-decoration: none; 159 text-decoration: none;
164} 160}
161
162#trExtAuth p {
163 margin: 0.5em 0 0.5em 0;
164}
165#trOpenID {
166 margin: 0.5em 0 0.5em 0;
167}
168
169#providers {
170 height: 40px;
171 padding-left: 8px;
172}
173#providers a {
174 float: left;
175 width: 32px;
176 height: 32px;
177 margin-right: 4px;
178 border: 1px solid black;
179}
180#providers a:hover {
181 border: 1px dashed #fffcc9;
182}
183#providers a.selected {
184 border: 4px solid #fffcc9;
185 -moz-border-radius: 10px;
186 -webkit-border-radius: 10px;
187}
188#auth-facebook { background: transparent url(images/master-auth.png?v=0) no-repeat 0px 0px; }
189#auth-google { background: transparent url(images/master-auth.png?v=0) no-repeat -32px 0px; }
190#auth-openid { background: transparent url(images/master-auth.png?v=0) no-repeat -64px 0px; }
191#auth-yahoo { background: transparent url(images/master-auth.png?v=0) no-repeat -96px 0px; }
diff --git a/frontend/fb_connect.php b/frontend/fb_connect.php
deleted file mode 100644
index ee91c23..0000000
--- a/frontend/fb_connect.php
+++ /dev/null
@@ -1,138 +0,0 @@
1<?php
2
3/*
4 Cheetah News fb_connect.php
5 Copyright (C) 2010 Wojciech Polak.
6
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21require_once 'lib/include.php';
22require_once 'lib/d-sigs.php';
23require_once 'lib/facebook.php';
24
25start_session (null, true);
26$session->auth ('iflogged');
27$message = '';
28$auth = true;
29
30getvars ('link');
31
32if ($session->status['afterlogged'] != 'yes' ||
33 $session->email == 'guest')
34{
35 $message = _('You are using a guest account. You must register in order to do this.');
36 $auth = false;
37}
38else if ($link == '1')
39{
40 try {
41 $fb = new Facebook (array ('appId' => $CONF['fb.app_id'],
42 'secret' => $CONF['fb.secret_key'],
43 'cookie' => true));
44 $fb_session = $fb->getSession ();
45 if ($fb_session) {
46 $fb_uid = $fb->getUser ();
47 if ($fb_uid) {
48 $db = new Database ();
49 $db->query ("UPDATE user SET fbUID=".$fb_uid." WHERE id='".
50 $session->id."'");
51 }
52 }
53 }
54 catch (FacebookApiException $e) {
55 error_log ($e);
56 }