diff options
author | tony baldwin <tonybaldwin@gmx.com> | 2012-03-21 01:36:23 -0400 |
---|---|---|
committer | tony baldwin <tonybaldwin@gmx.com> | 2012-03-21 01:36:23 -0400 |
commit | e5c29fcc786cee73c08247824cb87e9ed65a2c36 (patch) | |
tree | 1e5a6fcf5ba20e5effdd60e6d6ffa5fadb11d9d7 /include/auth.php | |
parent | cf17606d0f6200296b1e6d67f9ae3fb797e0df69 (diff) | |
parent | b4a2dae0850ed72b61b008e44efa98f300ccd640 (diff) | |
download | volse-hubzilla-e5c29fcc786cee73c08247824cb87e9ed65a2c36.tar.gz volse-hubzilla-e5c29fcc786cee73c08247824cb87e9ed65a2c36.tar.bz2 volse-hubzilla-e5c29fcc786cee73c08247824cb87e9ed65a2c36.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/auth.php')
-rwxr-xr-x | include/auth.php | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/include/auth.php b/include/auth.php index fc52684e6..835616a82 100755 --- a/include/auth.php +++ b/include/auth.php @@ -24,7 +24,7 @@ if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-p if(((x($_POST,'auth-params')) && ($_POST['auth-params'] === 'logout')) || ($a->module === 'logout')) { // process logout request - + call_hooks("logging_out"); nuke_session(); info( t('Logged out.') . EOL); goaway(z_root()); @@ -77,7 +77,7 @@ else { $noid = get_config('system','no_openid'); - $openid_url = trim( (strlen($_POST['openid_url'])?$_POST['openid_url']:$_POST['username']) ); + $openid_url = trim((strlen($_POST['openid_url'])?$_POST['openid_url']:$_POST['username']) ); // validate_url alters the calling parameter @@ -99,32 +99,12 @@ else { $openid->identity = $openid_url; $_SESSION['openid'] = $openid_url; $a = get_app(); - $openid->returnUrl = $a->get_baseurl() . '/openid'; - - $r = q("SELECT `uid` FROM `user` WHERE `openid` = '%s' LIMIT 1", - dbesc($openid_url) - ); - if(count($r)) { - // existing account - goaway($openid->authUrl()); - // NOTREACHED - } - else { - if($a->config['register_policy'] == REGISTER_CLOSED) { - $a = get_app(); - notice( t('Login failed.') . EOL); - goaway(z_root()); - // NOTREACHED - } - // new account - $_SESSION['register'] = 1; - $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson'); - $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default'); - goaway($openid->authUrl()); - // NOTREACHED - } + $openid->returnUrl = $a->get_baseurl(true) . '/openid'; + goaway($openid->authUrl()); + // NOTREACHED } } + if((x($_POST,'auth-params')) && $_POST['auth-params'] === 'login') { $record = null; @@ -165,7 +145,7 @@ else { } if((! $record) || (! count($record))) { - logger('authenticate: failed login attempt: ' . notags(trim($_POST['username']))); + logger('authenticate: failed login attempt: ' . notags(trim($_POST['username'])) . ' from IP ' . $_SERVER['REMOTE_ADDR']); notice( t('Login failed.') . EOL ); goaway(z_root()); } |