Added rudimentary transport support to get_threaded_children
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / eventz / accesslist.inc
1 <?php
2
3 function accesslist() {
4 global $db,$error,$node,$error_messages;
5 $node_id=$node['node_id'];
6 $access=explode(";",$_POST['access']);
7
8 if ($node['node_permission']!=('owner' || 'master' || 'op')) {
9 $error=$error_messages['EVENT_PERMISSION_ERROR'];
10 return false;
11 }
12
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'");
16 $set->next();
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')."'";
19 echo $q;
20 $changed=$db->update($q);
21 if (!$changed) {
22 $q="insert into node_access set node_permission='access',node_id=$node_id,user_id=".$set->getString('user_id');
23 $db->query($q);
24 }
25 logger::log('add access',$node_id,'ok',$acc);
26 }
27 else { $error .= "$acc does not exist..."; }
28 }
29 }
30 ?>
31
32
33
34
This page took 1.046904 seconds and 4 git commands to generate.