aboutsummaryrefslogtreecommitdiffstats
path: root/include/api_auth.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-07-21 21:14:54 -0400
committerAndrew Manning <tamanning@zoho.com>2016-07-21 21:14:54 -0400
commit5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6 (patch)
tree84b9b847f384c42a462a0035142b4b5757906922 /include/api_auth.php
parentd504197a786eb46a780278fccb529daa13bfa443 (diff)
parent8566f9130395ecdbe19f9fce85a26dac39d9fe24 (diff)
downloadvolse-hubzilla-5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6.tar.gz
volse-hubzilla-5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6.tar.bz2
volse-hubzilla-5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6.zip
Merge remote-tracking branch 'upstream/dev' into website-import
Diffstat (limited to 'include/api_auth.php')
-rw-r--r--include/api_auth.php14
1 files changed, 3 insertions, 11 deletions
diff --git a/include/api_auth.php b/include/api_auth.php
index dc8492b20..7a71bad73 100644
--- a/include/api_auth.php
+++ b/include/api_auth.php
@@ -59,20 +59,12 @@ function api_login(&$a){
if(isset($_SERVER['PHP_AUTH_USER'])) {
$channel_login = 0;
$record = account_verify_password($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
- if(! $record) {
- $r = q("select * from channel left join account on account.account_id = channel.channel_account_id
- where channel.channel_address = '%s' limit 1",
- dbesc($_SERVER['PHP_AUTH_USER'])
- );
- if ($r) {
- $record = account_verify_password($r[0]['account_email'],$_SERVER['PHP_AUTH_PW']);
- if($record)
- $channel_login = $r[0]['channel_id'];
- }
+ if($record && $record['channel']) {
+ $channel_login = $record['channel']['channel_id'];
}
}
- if($record) {
+ if($record['account']) {
authenticate_success($record);
if($channel_login)