Commit | Line | Data |
---|---|---|
e586807d H |
1 | <?php |
2 | /* This program is free software. It comes without any warranty, to | |
3 | * the extent permitted by applicable law. You can redistribute it | |
4 | * and/or modify it under the terms of the Do What The Fuck You Want | |
5 | * To Public License, Version 2, as published by Sam Hocevar. See | |
6 | * http://sam.zoy.org/wtfpl/COPYING for more details. */ | |
7 | ||
8 | function configure_system_access() { | |
9 | global $db,$error,$node; | |
10 | $node_id=$node['node_id']; | |
11 | $user_id=$_SESSION['user_id']; | |
12 | ||
13 | if ($node['node_permission']=='owner') { | |
14 | $node_system_access=$_POST['node_system_access']; | |
15 | ||
16 | if ($_POST['apply_on_vector']) { | |
17 | $vector=$node['node_vector']; | |
18 | if (empty($vector)) { | |
19 | $error=$error_messages['INCORRECT_VECTOR']; | |
20 | return false; | |
21 | } | |
22 | $q="update nodes set node_system_access='$node_system_access' where node_vector like '$vector%' and node_creator='$user_id'"; | |
23 | $db->query($q); | |
24 | } | |
25 | ||
26 | else { | |
27 | $q="update nodes set node_system_access='$node_system_access' where node_id='$node_id'"; | |
28 | $db->query($q); | |
29 | } | |
30 | } | |
31 | return true; | |
32 | } | |
33 | ?> |