aboutsummaryrefslogtreecommitdiffstats
path: root/mod/openid.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-17 20:35:50 -0800
committerFriendika <info@friendika.com>2010-11-17 20:35:50 -0800
commit90b601c3dd037c698621a030c57e4e42162b085f (patch)
tree79dcc0a1b8bdca1a676e6bb57b5adb05fc788e15 /mod/openid.php
parent38eff190ea1ad6270015a6eaf424af8d12ffde58 (diff)
downloadvolse-hubzilla-90b601c3dd037c698621a030c57e4e42162b085f.tar.gz
volse-hubzilla-90b601c3dd037c698621a030c57e4e42162b085f.tar.bz2
volse-hubzilla-90b601c3dd037c698621a030c57e4e42162b085f.zip
openid registration
Diffstat (limited to 'mod/openid.php')
-rw-r--r--mod/openid.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/mod/openid.php b/mod/openid.php
index 6c1edd72e..443d839fa 100644
--- a/mod/openid.php
+++ b/mod/openid.php
@@ -11,6 +11,37 @@ function openid_content(&$a) {
if($openid->validate()) {
+ if(x($_SESSION,'register')) {
+ unset($_SESSION['register']);
+ $args = '';
+ $attr = $openid->getAttributes();
+ if(is_array($attr) && count($attr)) {
+ foreach($attr as $k => $v) {
+ if($k === 'namePerson/friendly')
+ $nick = notags(trim($v));
+ if($k === 'namePerson/first')
+ $first = notags(trim($v));
+ if($k === 'namePerson')
+ $args .= '&username=' . notags(trim($v));
+ if($k === 'contact/email')
+ $args .= '&email=' . notags(trim($v));
+ }
+ }
+ if($nick)
+ $args .= '&nickname=' . $nick;
+ elseif($first)
+ $args .= '&nickname=' . $first;
+
+ $args .= '&openid_url=' . notags(trim($_SESSION['openid']));
+ if($a->config['register_policy'] != REGISTER_CLOSED)
+ goaway($a->get_baseurl() . '/register' . $args);
+ else
+ goaway($a->get_baseurl());
+
+ // NOTREACHED
+ }
+
+
$r = q("SELECT * FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1",
dbesc($_SESSION['openid'])
);