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'];
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'");
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);
19 $q="insert into node_access set node_permission='master',node_id=$node_id,user_id=".$set->getString('user_id');
21 logger::log('add master',$node_id,'ok',$master);
25 else { $error .= "$master does not exist..."; }