provide plugin hooks for blacklist checking functions.
This commit is contained in:
parent
2d799f2c11
commit
f7f0d2b265
11
doc/hook/check_channelallowed.bb
Normal file
11
doc/hook/check_channelallowed.bb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[h2]check_channelallowed[/h2]
|
||||||
|
|
||||||
|
Called when checking the channel (xchan) black and white lists to see if a channel is blocked.
|
||||||
|
|
||||||
|
Hook data
|
||||||
|
|
||||||
|
array('hash' => xchan_hash of xchan to check);
|
||||||
|
|
||||||
|
create and set array element 'allowed' to true or false to override the system checks
|
||||||
|
|
||||||
|
|
10
doc/hook/check_siteallowed.bb
Normal file
10
doc/hook/check_siteallowed.bb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[h2]check_siteallowed[/h2]
|
||||||
|
|
||||||
|
Called when checking the site black and white lists to see if a site is blocked.
|
||||||
|
|
||||||
|
Hook data
|
||||||
|
|
||||||
|
array('url' => URL of site to check);
|
||||||
|
|
||||||
|
create and set array element 'allowed' to true or false to override the system checks
|
||||||
|
|
@ -82,6 +82,12 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
|
|||||||
[zrl=[baseurl]/help/hook/check_account_password]check_account_password[/zrl]
|
[zrl=[baseurl]/help/hook/check_account_password]check_account_password[/zrl]
|
||||||
Used to provide policy control over account passwords (minimum length, character set inclusion, etc.)
|
Used to provide policy control over account passwords (minimum length, character set inclusion, etc.)
|
||||||
|
|
||||||
|
[zrl=[baseurl]/help/hook/check_channelallowed]check_channelallowed[/zrl]
|
||||||
|
Used to over-ride or bypass the channel black/white block lists
|
||||||
|
|
||||||
|
[zrl=[baseurl]/help/hook/check_siteallowed]check_siteallowed[/zrl]
|
||||||
|
Used to over-ride or bypass the site black/white block lists
|
||||||
|
|
||||||
[zrl=[baseurl]/help/hook/connect_premium]connect_premium[/zrl]
|
[zrl=[baseurl]/help/hook/connect_premium]connect_premium[/zrl]
|
||||||
Called when connecting to a premium channel
|
Called when connecting to a premium channel
|
||||||
|
|
||||||
|
@ -1822,6 +1822,13 @@ function check_siteallowed($url) {
|
|||||||
|
|
||||||
$retvalue = true;
|
$retvalue = true;
|
||||||
|
|
||||||
|
|
||||||
|
$arr = array('url' => $url);
|
||||||
|
call_hooks('check_siteallowed',$arr);
|
||||||
|
|
||||||
|
if(array_key_exists('allowed',$arr))
|
||||||
|
return $arr['allowed'];
|
||||||
|
|
||||||
$bl1 = get_config('system','whitelisted_sites');
|
$bl1 = get_config('system','whitelisted_sites');
|
||||||
if(is_array($bl1) && $bl1) {
|
if(is_array($bl1) && $bl1) {
|
||||||
foreach($bl1 as $bl) {
|
foreach($bl1 as $bl) {
|
||||||
@ -1848,6 +1855,12 @@ function check_channelallowed($hash) {
|
|||||||
|
|
||||||
$retvalue = true;
|
$retvalue = true;
|
||||||
|
|
||||||
|
$arr = array('hash' => $hash);
|
||||||
|
call_hooks('check_channelallowed',$arr);
|
||||||
|
|
||||||
|
if(array_key_exists('allowed',$arr))
|
||||||
|
return $arr['allowed'];
|
||||||
|
|
||||||
$bl1 = get_config('system','whitelisted_channels');
|
$bl1 = get_config('system','whitelisted_channels');
|
||||||
if(is_array($bl1) && $bl1) {
|
if(is_array($bl1) && $bl1) {
|
||||||
foreach($bl1 as $bl) {
|
foreach($bl1 as $bl) {
|
||||||
|
Reference in New Issue
Block a user