diff options
author | Wojciech Polak <polak@gnu.org> | 2010-05-14 23:17:06 +0200 |
---|---|---|
committer | Wojciech Polak <polak@gnu.org> | 2010-05-14 23:17:06 +0200 |
commit | ac61ac8cd76e9588bf8f4879716d9bbbfe718e76 (patch) | |
tree | adef21b82d3262d8476d3217b60b7b3dfbd945ac | |
parent | e577933281b5c423445b510aa272cd4f9acf06e2 (diff) | |
download | cheetah-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.css | 63 | ||||
-rw-r--r-- | css/v2/login.css | 43 | ||||
-rw-r--r-- | frontend/fb_connect.php | 138 | ||||
-rw-r--r-- | frontend/images/master-auth.png | bin | 0 -> 7549 bytes | |||
-rw-r--r-- | frontend/lib/d-files.php | 3 | ||||
-rw-r--r-- | frontend/lib/session.class.php | 53 | ||||
-rw-r--r-- | frontend/linked-accounts.php | 282 | ||||
-rw-r--r-- | frontend/login.php | 97 | ||||
-rw-r--r-- | frontend/openid_manage.php | 183 | ||||
-rw-r--r-- | frontend/rd.php | 11 | ||||
-rw-r--r-- | frontend/reader.php | 3 | ||||
-rw-r--r-- | frontend/xrds.php | 6 | ||||
-rw-r--r-- | js/v2/gui.js | 34 | ||||
-rw-r--r-- | js/v2/login.js | 418 | ||||
-rw-r--r-- | po/POTFILES.in | 2 |
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; } | |||
5 | body { | 5 | body { |
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 | } | ||
15 | h2 { | ||
16 | font-size: 100%; | ||
9 | } | 17 | } |
10 | ul, p { | 18 | ul, 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 | ||
71 | input.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 | |||
21 | require_once 'lib/include.php'; | ||
22 | require_once 'lib/d-sigs.php'; | ||
23 | require_once 'lib/facebook.php'; | ||
24 | |||
25 | start_session (null, true); | ||
26 | $session->auth ('iflogged'); | ||
27 | $message = ''; | ||
28 | $auth = true; | ||
29 | |||
30 | getvars ('link'); | ||
31 | |||
32 | if ($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 | } | ||
38 | else 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 | } |