X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fopenid.php;h=68d7c3fd2a482645ea7e81bd11d49433b21cfdc3;hb=ee11a74d0b7cff5061a4d498f8ecd15e55b91b07;hp=84d4bf4bf0b783e6f4f8769559ccb2e41a455fbd;hpb=62bb471ba0bf8d996e4548b835cd23fa3da92696;p=friendica.git diff --git a/mod/openid.php b/mod/openid.php index 84d4bf4bf0..68d7c3fd2a 100644 --- a/mod/openid.php +++ b/mod/openid.php @@ -70,19 +70,35 @@ function openid_content(&$a) { $_SESSION['page_flags'] = $r[0]['page-flags']; $_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $r[0]['nickname']; - notice( t("Welcome back ") . $r[0]['username'] . EOL); + notice( sprintf( t("Welcome back "), $r[0]['username']) . EOL); $a->user = $r[0]; - if(strlen($a->user['timezone'])) + + if(strlen($a->user['timezone'])) { date_default_timezone_set($a->user['timezone']); + $a->timezone = $a->user['timezone']; + } + + $r = q("SELECT `uid`,`username` FROM `user` WHERE `password` = '%s' AND `email` = '%s'", + dbesc($a->user['password']), + dbesc($a->user['email']) + ); + if(count($r)) + $a->identities = $r; - $r = q("SELECT * FROM `contact` WHERE `uid` = %s AND `self` = 1 LIMIT 1", - intval($_SESSION['uid'])); + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", + intval($_SESSION['uid']) + ); if(count($r)) { $a->contact = $r[0]; $a->cid = $r[0]['id']; $_SESSION['cid'] = $a->cid; } + q("UPDATE `user` SET `login_date` = '%s' WHERE `uid` = %d LIMIT 1", + dbesc(datetime_convert()), + intval($_SESSION['uid']) + ); + header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] .'"'); if(($a->module !== 'home') && isset($_SESSION['return_url'])) goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);