3 function accesslist() {
4 global $db,$error,$node,$error_messages;
5 $node_id=$node['node_id'];
6 $access=explode(";",$_POST['access']);
8 if ($node['node_permission']!=('owner' || 'master' || 'op')) {
9 $error=$error_messages['EVENT_PERMISSION_ERROR'];
13 $db->query("update node_access set last_visit=NOW(),node_permission='' where node_id=$node_id and node_permission='access'");
14 foreach ($access as $acc) {
15 $set=$db->query("select user_id from users where login='$acc'");
17 if ($set->getString('user_id')) {
18 $q="update node_access set last_visit='',node_permission='access' where node_id=$node_id and user_id='".$set->getString('user_id')."'";
20 $changed=$db->update($q);
22 $q="insert into node_access set node_permission='access',node_id=$node_id,user_id=".$set->getString('user_id');
25 logger::log('add access',$node_id,'ok',$acc);
27 else { $error .= "$acc does not exist..."; }