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:
parent
dd6c64f95a
commit
fa8f26c544
21
mod/post.php
21
mod/post.php
@ -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
|
||||||
|
|
||||||
@ -135,20 +139,15 @@ function post_init(&$a) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME - we really want to save the return_url in the session before we visit rmagic.
|
// FIXME - we really want to save the return_url in the session before we visit rmagic.
|
||||||
// This does however prevent a recursion if you visit rmagic directly, as it would otherwise send you back here again.
|
// This does however prevent a recursion if you visit rmagic directly, as it would otherwise send you back here again.
|
||||||
// But z_root() probably isn't where you really want to go.
|
// But z_root() probably isn't where you really want to go.
|
||||||
|
|
||||||
if(strstr($desturl,z_root() . '/rmagic'))
|
if(strstr($desturl,z_root() . '/rmagic'))
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
|
|
||||||
goaway($desturl);
|
goaway($desturl);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger('mod_zot: invalid args: ' . print_r($a->argv,true));
|
|
||||||
killme();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
2013-11-17.500
|
2013-11-18.501
|
||||||
|
Reference in New Issue
Block a user