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