change the way magic-auth works - we rarely need a destination channel and if that channel has problems

it shouldn't mess up authentication to the hub.
This commit is contained in:
friendica 2013-11-18 00:55:41 -08:00
parent dd6c64f95a
commit fa8f26c544
2 changed files with 117 additions and 118 deletions

View File

@ -15,8 +15,8 @@ function post_init(&$a) {
// as a get request, and the only communications to arrive this way. // as a get request, and the only communications to arrive this way.
if(argc() > 1) { if(argc() > 1) {
$webbie = argv(1); $webbie = argv(1);
}
if(array_key_exists('auth',$_REQUEST)) { if(array_key_exists('auth',$_REQUEST)) {
logger('mod_zot: auth request received.'); logger('mod_zot: auth request received.');
@ -39,13 +39,17 @@ function post_init(&$a) {
$desturl = $dest; $desturl = $dest;
break; break;
} }
if($webbie) {
$c = q("select * from channel where channel_address = '%s' limit 1", $c = q("select * from channel where channel_address = '%s' limit 1",
dbesc($webbie) dbesc($webbie)
); );
if(! $c) { if(! $c) {
logger('mod_zot: auth: unable to find channel ' . $webbie); logger('mod_zot: auth: unable to find channel ' . $webbie);
// They'll get a notice when they hit the page, we don't need two of them. // They'll get a notice when they hit the page, we don't need two of them.
goaway($desturl); // In fact we only need the name to map the destination, auth can proceed
// without it.
// goaway($desturl);
}
} }
// Try and find a hubloc for the person attempting to auth // Try and find a hubloc for the person attempting to auth
@ -70,7 +74,7 @@ function post_init(&$a) {
goaway($desturl); goaway($desturl);
} }
logger('mod_zot: auth request received from ' . $x[0]['xchan_addr'] . ' for ' . $webbie); logger('mod_zot: auth request received from ' . $x[0]['xchan_addr'] . ' for ' . (($webbie) ? $webbie : 'undefined'));
// check credentials and access // check credentials and access
@ -144,11 +148,6 @@ function post_init(&$a) {
goaway($desturl); goaway($desturl);
} }
logger('mod_zot: invalid args: ' . print_r($a->argv,true));
killme();
}
return; return;
} }

View File

@ -1 +1 @@
2013-11-17.500 2013-11-18.501