aboutsummaryrefslogtreecommitdiffstats
path: root/mod/rmagic.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-02-08 18:28:39 -0800
committerfriendica <info@friendica.com>2013-02-08 18:28:39 -0800
commit28b11f3567deff72dff943af67ab963b98262eda (patch)
tree932d378a5789a206dac89004b3756ba765e64b4b /mod/rmagic.php
parentf6af431612d758276287b464ec3454df167823c8 (diff)
downloadvolse-hubzilla-28b11f3567deff72dff943af67ab963b98262eda.tar.gz
volse-hubzilla-28b11f3567deff72dff943af67ab963b98262eda.tar.bz2
volse-hubzilla-28b11f3567deff72dff943af67ab963b98262eda.zip
debug rmagic
Diffstat (limited to 'mod/rmagic.php')
-rw-r--r--mod/rmagic.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/mod/rmagic.php b/mod/rmagic.php
index 445c8c917..910ccd40f 100644
--- a/mod/rmagic.php
+++ b/mod/rmagic.php
@@ -3,17 +3,21 @@
function rmagic_init(&$a) {
+ if(local_user())
+ goaway(z_root());
+
$me = get_my_address();
if($me) {
$r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
dbesc($me)
);
if($r) {
- $dest = z_root() . str_replace('zid=','zid_=',$get_app()->query_string);
- goaway($r[0]['hubloc_url'] . '/magic' . '?f=&dest=' . z_root() . $dest);
+ if($r[0]['hubloc_url'] === z_root())
+ goaway(z_root() . '/login');
+ $dest = z_root() . '/' . str_replace('zid=','zid_=',$get_app()->query_string);
+ goaway($r[0]['hubloc_url'] . '/magic' . '?f=&dest=' . $dest);
}
}
-
}
function rmagic_post(&$a) {
@@ -38,8 +42,8 @@ function rmagic_post(&$a) {
}
if($url) {
- $dest = z_root() . str_replace('zid=','zid_=',$a->query_string);
- goaway($url . '/magic' . '?f=&dest=' . z_root() . $dest);
+ $dest = z_root() . '/' . str_replace('zid=','zid_=',$a->query_string);
+ goaway($url . '/magic' . '?f=&dest=' . $dest);
}