aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Zot/Auth.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-12-09 21:03:29 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-12-09 21:03:29 -0800
commit8e1e301764058f3bf444f0e448a184614e729159 (patch)
treeb624caef221f347f7ba23c0a93d50a1e06b6479f /Zotlabs/Zot/Auth.php
parentbd37f59829bbb72b66dd4a9edb16c4506e77eaed (diff)
downloadvolse-hubzilla-8e1e301764058f3bf444f0e448a184614e729159.tar.gz
volse-hubzilla-8e1e301764058f3bf444f0e448a184614e729159.tar.bz2
volse-hubzilla-8e1e301764058f3bf444f0e448a184614e729159.zip
refactor a few more redundant returns
Diffstat (limited to 'Zotlabs/Zot/Auth.php')
-rw-r--r--Zotlabs/Zot/Auth.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/Zotlabs/Zot/Auth.php b/Zotlabs/Zot/Auth.php
index f9a1de8ab..07879fbd9 100644
--- a/Zotlabs/Zot/Auth.php
+++ b/Zotlabs/Zot/Auth.php
@@ -158,22 +158,19 @@ class Auth {
$this->Debug('packet contents: ' . $p);
$result = zot_zot($hubloc['hubloc_callback'],$p);
-
if(! $result['success']) {
logger('auth_check callback failed.');
- if($this->test) {
+ if($this->test)
$this->Debug('auth check request to your site returned .' . print_r($result, true));
- return false;
- }
return false;
}
+
$j = json_decode($result['body'], true);
if(! $j) {
logger('auth_check json data malformed.');
- if($this->test) {
+ if($this->test)
$this->Debug('json malformed: ' . $result['body']);
- return false;
- }
+ return false;
}
$this->Debug('auth check request returned .' . print_r($j, true));
@@ -185,10 +182,8 @@ class Auth {
if (! rsa_verify($this->sec . $hubloc['xchan_hash'],base64url_decode($j['confirm']),$hubloc['xchan_pubkey'])) {
logger('final confirmation failed.');
- if($this->test) {
+ if($this->test)
$this->Debug('final confirmation failed. ' . $sec . print_r($j,true) . print_r($hubloc,true));
- return false;
- }
return false;
}
@@ -211,7 +206,8 @@ class Auth {
$_SESSION['authenticated'] = 1;
- // check for delegation
+ // check for delegation and if all is well, log them in locally with delegation restrictions
+
$this->delegate_success = false;
if($this->delegate) {