From 130cad8cd8ad76efae0ef9d061ed546b160eaceb Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 20 Feb 2013 15:07:13 -0800 Subject: 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. --- mod/magic.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mod') 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) { -- cgit v1.2.3