diff options
author | Mario <mario@mariovavti.com> | 2019-12-09 10:44:44 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-12-09 10:44:44 +0000 |
commit | c4f4edd743b79ec3f3bebecf786cbb6da8921ce9 (patch) | |
tree | deb91b84cff545a6af46cf9dc44f18273e23ae04 /Zotlabs/Module/Dircensor.php | |
parent | 258a4e5627caf8fd1b3d89596fada2bea1490c7a (diff) | |
download | volse-hubzilla-c4f4edd743b79ec3f3bebecf786cbb6da8921ce9.tar.gz volse-hubzilla-c4f4edd743b79ec3f3bebecf786cbb6da8921ce9.tar.bz2 volse-hubzilla-c4f4edd743b79ec3f3bebecf786cbb6da8921ce9.zip |
directory: port censoring from zap and disable oembed in profile about
Diffstat (limited to 'Zotlabs/Module/Dircensor.php')
-rw-r--r-- | Zotlabs/Module/Dircensor.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Zotlabs/Module/Dircensor.php b/Zotlabs/Module/Dircensor.php new file mode 100644 index 000000000..0fa65e948 --- /dev/null +++ b/Zotlabs/Module/Dircensor.php @@ -0,0 +1,52 @@ +<?php + +namespace Zotlabs\Module; + +use App; +use Zotlabs\Web\Controller; + + +class Dircensor extends Controller { + + function get() { + if(! is_site_admin()) { + return; + } + + $dirmode = intval(get_config('system','directory_mode')); + + if (! ($dirmode == DIRECTORY_MODE_PRIMARY || $dirmode == DIRECTORY_MODE_STANDALONE)) { + return; + } + + $xchan = argv(1); + if(! $xchan) { + return; + } + + $r = q("select * from xchan where xchan_hash = '%s'", + dbesc($xchan) + ); + + if(! $r) { + return; + } + + $val = (($r[0]['xchan_censored']) ? 0 : 1); + + q("update xchan set xchan_censored = $val where xchan_hash = '%s'", + dbesc($xchan) + ); + + if($val) { + info( t('Entry censored') . EOL); + } + else { + info( t('Entry uncensored') . EOL); + } + + goaway(z_root() . '/directory'); + + } + +} |