+ function handler_forums_bans(&$page, $action = 'list', $id = null)
+ {
+ $page->assign('xorg_title','Polytechnique.org - Administration - Bannissements des forums');
+ $page->assign('title', 'Gestion des mises au ban');
+ $table_editor = new PLTableEditor('admin/forums','forums.innd','id_innd');
+ $table_editor->describe('ipmin','min plage IP',true);
+ $table_editor->describe('ipmax','max plage IP',true);
+ $table_editor->describe('uid','utilisateur',true);
+ $table_editor->describe('write_perm','perm. poster',true);
+ $table_editor->describe('read_perm','perm. lire',true);
+ $table_editor->describe('priority','priorite',true);
+ $table_editor->describe('comment','commentaire',true);
+ $table_editor->apply($page, $action, $id);
+ }
+
+ function handler_forums_bans_service(&$page, $action = 'list', $id = null)
+ {
+ global $globals;
+
+ $ips = array_flip(explode(' ', $globals->banana->bans_authorized_ips));
+
+ if ($ips && isset($ips[$_SERVER['REMOTE_ADDR']])) {
+
+ $res = XDB::query("SELECT priority, read_perm, write_perm, comment
+ FROM forums.innd AS i
+ INNER JOIN x4dat.aliases AS a ON ( a.id = i.uid AND a.type='a_vie' )
+ INNER JOIN x4dat.aliases AS b ON ( b.id = a.id AND b.type != 'homonyme' )
+ WHERE b.alias = '".addslashes(Env::v('forlife'))."'");
+ $ban = $res->fetchOneAssoc();
+ echo "$res['priority']\n$res['read_perm']\n$res['write_perm']\n$res['comment']\n";
+ }
+ exit();
+ }
+