| 1 | <?php |
| 2 | function configure_system_access() { |
| 3 | global $db,$error,$node; |
| 4 | $node_id=$node['node_id']; |
| 5 | $user_id=$_SESSION['user_id']; |
| 6 | |
| 7 | if (($node['node_permission']=='owner') || ($node['node_permission']=='master')) { |
| 8 | $node_system_access=$_POST['node_system_access']; |
| 9 | |
| 10 | if ($_POST['apply_on_vector']) { |
| 11 | $vector=$node['node_vector']; |
| 12 | if (empty($vector)) { |
| 13 | $error=$error_messages['INCORRECT_VECTOR']; |
| 14 | return false; |
| 15 | } |
| 16 | $q="update nodes set node_system_access='$node_system_access' where node_vector like '$vector%' and node_creator='$user_id'"; |
| 17 | $db->query($q); |
| 18 | } |
| 19 | |
| 20 | else { |
| 21 | $q="update nodes set node_system_access='$node_system_access' where node_id='$node_id'"; |
| 22 | $db->query($q); |
| 23 | } |
| 24 | } |
| 25 | return true; |
| 26 | } |
| 27 | ?> |