aboutsummaryrefslogtreecommitdiffstats
path: root/mod/magic.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-02-20 15:07:13 -0800
committerfriendica <info@friendica.com>2013-02-20 15:07:13 -0800
commit130cad8cd8ad76efae0ef9d061ed546b160eaceb (patch)
tree2ccae3ed496e50fd3f92735b11153b02149aec55 /mod/magic.php
parent92f94a0fdc87088a8ce40b652f396bbac4801a42 (diff)
downloadvolse-hubzilla-130cad8cd8ad76efae0ef9d061ed546b160eaceb.tar.gz
volse-hubzilla-130cad8cd8ad76efae0ef9d061ed546b160eaceb.tar.bz2
volse-hubzilla-130cad8cd8ad76efae0ef9d061ed546b160eaceb.zip
give plugins control over magic auth so one could create plugins with policy controls (like friends only, etc.) or block lists to prevent automatic authentication.
Diffstat (limited to 'mod/magic.php')
-rw-r--r--mod/magic.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/mod/magic.php b/mod/magic.php
index ba9e69a49..0f9a66c5b 100644
--- a/mod/magic.php
+++ b/mod/magic.php
@@ -60,6 +60,18 @@ function magic_init(&$a) {
return;
}
+ $arr = array(
+ 'channel_id' => local_user(),
+ 'xchan' => $x[0],
+ 'destination' => $dest,
+ 'proceed' => true
+ );
+
+ call_hooks('magic_auth',$arr);
+ $dest = $arr['destination'];
+ if(! $arr['proceed'])
+ goaway($dest);
+
if($x[0]['hubloc_url'] === z_root()) {
$webbie = substr($x[0]['hubloc_addr'],0,strpos('@',$x[0]['hubloc_addr']));
switch($dest) {