aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-02-06 17:04:34 -0800
committerfriendica <info@friendica.com>2013-02-06 17:04:34 -0800
commitaf1b3c6c9ac3e3d3ed60a01f5cabeca8fe0f76dc (patch)
tree91d0bc7f2e5473d4be7a2c957896d95ea8be642b /boot.php
parent6a23ac9217ab5b743cbb14243651ee40cfcc3c5a (diff)
downloadvolse-hubzilla-af1b3c6c9ac3e3d3ed60a01f5cabeca8fe0f76dc.tar.gz
volse-hubzilla-af1b3c6c9ac3e3d3ed60a01f5cabeca8fe0f76dc.tar.bz2
volse-hubzilla-af1b3c6c9ac3e3d3ed60a01f5cabeca8fe0f76dc.zip
this might make zot-id work as originally conceived complete with reverse magic auth. If it doesn't it will probably crash and burn every site involved in horrible ways. To test or not to test.... decisions. (Maybe tomorrow.)
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index 6e98f829c..9e7485285 100644
--- a/boot.php
+++ b/boot.php
@@ -1975,6 +1975,15 @@ function zid_init(&$a) {
proc_run('php','include/gprobe.php',bin2hex($tmp_str));
$arr = array('zid' => $tmp_str, 'url' => $a->cmd);
call_hooks('zid_init',$arr);
+ if((! local_user()) && (! remote_user())) {
+ $r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
+ dbesc($tmp_str)
+ );
+ // try to avoid recursion - but send them home to do a proper magic auth
+ if($r && ($r[0]['hubloc_url'] != z_root()) && (! strstr(get_app()->query_string,'/magic'))) {
+ goaway($r[0]['hubloc_url'] . '/magic' . '?f=&dest=' . z_root() . get_app()->query_string);
+ }
+ }
}
}