aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot.php4
-rw-r--r--mod/magic.php2
-rw-r--r--version.inc2
3 files changed, 7 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index 9d80eedb4..d6c02ecc0 100755
--- a/boot.php
+++ b/boot.php
@@ -1553,6 +1553,10 @@ function goaway($s) {
* @return int|bool account_id or false
*/
function get_account_id() {
+
+ if(intval($_SESSION['account_id']))
+ return intval($_SESSION['account_id']);
+
if(get_app()->account)
return intval(get_app()->account['account_id']);
diff --git a/mod/magic.php b/mod/magic.php
index 2fee87241..12679773b 100644
--- a/mod/magic.php
+++ b/mod/magic.php
@@ -105,6 +105,7 @@ function magic_init(&$a) {
$r = q("select * from channel left join hubloc on channel_hash = hubloc_hash where hubloc_addr = '%s' limit 1",
dbesc($delegate)
);
+
if($r && intval($r[0]['channel_id'])) {
$allowed = perm_is_allowed($r[0]['channel_id'],get_observer_hash(),'delegate');
if($allowed) {
@@ -112,6 +113,7 @@ function magic_init(&$a) {
$_SESSION['delegate'] = get_observer_hash();
$_SESSION['account_id'] = intval($r[0]['channel_account_id']);
change_channel($r[0]['channel_id']);
+
$delegation_success = true;
}
}
diff --git a/version.inc b/version.inc
index d884e64a2..7b8a8ab83 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2016-01-23.1287H
+2016-01-24.1288H