aboutsummaryrefslogtreecommitdiffstats
path: root/mod/magic.php
diff options
context:
space:
mode:
authorPaolo Tacconi <p.tacconi@giunti.it>2016-04-15 09:20:58 +0200
committerPaolo Tacconi <p.tacconi@giunti.it>2016-04-15 09:20:58 +0200
commit45a854762b451dafb882bc56efce054b64420627 (patch)
tree958fcd22f04546f40b6ac68bb58cfe1a1b1fb7f6 /mod/magic.php
parent1806da0851dd5cf5978b19d12783ae3101a11257 (diff)
parenta29c0371f1f3cceb9a9af3a62e5ed67886869c40 (diff)
downloadvolse-hubzilla-45a854762b451dafb882bc56efce054b64420627.tar.gz
volse-hubzilla-45a854762b451dafb882bc56efce054b64420627.tar.bz2
volse-hubzilla-45a854762b451dafb882bc56efce054b64420627.zip
Resolved conflict in view/it/hstrings.php
Diffstat (limited to 'mod/magic.php')
-rw-r--r--mod/magic.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/mod/magic.php b/mod/magic.php
index 2fee87241..74adbfd6d 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;
}
}
@@ -126,21 +128,17 @@ function magic_init(&$a) {
}
if(local_channel()) {
- $channel = $a->get_channel();
+ $channel = App::get_channel();
$token = random_string();
$token_sig = base64url_encode(rsa_sign($token,$channel['channel_prvkey']));
$channel['token'] = $token;
$channel['token_sig'] = $token_sig;
- $r = q("insert into verify ( type, channel, token, meta, created) values ('%s','%d','%s','%s','%s')",
- dbesc('auth'),
- intval($channel['channel_id']),
- dbesc($token),
- dbesc($x[0]['hubloc_url']),
- dbesc(datetime_convert())
- );
- $target_url = $x[0]['hubloc_callback'] . '/?f=&auth=' . urlencode($channel['channel_address'] . '@' . $a->get_hostname())
+
+ Zotlabs\Zot\Verify::create('auth',$channel['channel_id'],$token,$x[0]['hubloc_url']);
+
+ $target_url = $x[0]['hubloc_callback'] . '/?f=&auth=' . urlencode($channel['channel_address'] . '@' . App::get_hostname())
. '&sec=' . $token . '&dest=' . urlencode($dest) . '&version=' . ZOT_REVISION;
if($delegate)