Added rudimentary transport support to get_threaded_children
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / eventz / banlist.inc
1 <?php
2
3 function banlist() {
4 global $db,$error,$node;
5 $node_id=$node['node_id'];
6
7 if ($node['node_permission']!=('owner' || 'master' || 'op')) {
8 $error=$error_messages['EVENT_PERMISSION_ERROR'];
9 return false;
10 }
11 $bans=explode(";",$_POST['bans']); // XXX sqli?
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 }
25 logger::log('add ban',$node_id,'ok',$ban);
26 }
27 else { $error .= "$ban does not exist..."; }
28 }
29 }
30 ?>
This page took 0.395626 seconds and 4 git commands to generate.