Added rudimentary transport support to get_threaded_children
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / eventz / banlist.inc
CommitLineData
51ff3226 1<?php
2
3 function banlist() {
fd15ea3a 4 global $db,$error,$node;
51ff3226 5 $node_id=$node['node_id'];
6
7if ($node['node_permission']!=('owner' || 'master' || 'op')) {
8$error=$error_messages['EVENT_PERMISSION_ERROR'];
9return false;
10}
ac3bdc72 11 $bans=explode(";",$_POST['bans']); // XXX sqli?
51ff3226 12
13 $db->query("update node_access set node_permission='' where node_id=$node_id and node_permission='ban'");
14 foreach ($bans as $ban) {
15 $set=$db->query("select user_id from users where login='$ban'");
16 $set->next();
17 if ($set->getString('user_id')) {
18 $q="update node_access set node_permission='ban' where node_id=$node_id and user_id='".$set->getString('user_id')."'";
19 echo $q;
20 $changed=$db->update($q);
21 if (!$changed) {
22 $q="insert into node_access set node_permission='ban',node_id=$node_id,user_id=".$set->getString('user_id');
23 $db->query($q);
24 }
fd15ea3a 25 logger::log('add ban',$node_id,'ok',$ban);
51ff3226 26 }
27 else { $error .= "$ban does not exist..."; }
28 }
29 }
30?>
This page took 0.578353 seconds and 4 git commands to generate.