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