Commit | Line | Data |
---|---|---|
b42b2bf9 H |
1 | <? |
2 | require('config/config.inc'); | |
3 | require('node_types.php'); | |
4 | require(SYSTEM_ROOT.'inc/log.inc'); | |
5 | require(SYSTEM_ROOT.'inc/nodes.inc'); | |
6 | require(SYSTEM_ROOT.'inc/database.inc'); | |
7 | ||
8 | $db=new CLASS_DATABASE(); | |
9 | ||
10 | $q = "select distinct parent.node_id as parent_node_id from nodes left join nodes as parent on parent.node_id = nodes.node_parent where nodes.node_system_access = 'public' and parent.node_system_access = 'private' order by parent_node_id"; | |
11 | ||
12 | $set = $db->query($q); | |
13 | echo "Updating security access for ".$set->getNumRows()." nodes ...<br>"; | |
14 | while($set->next()) | |
15 | { | |
16 | $parents[] = $set->getString('parent_node_id'); | |
17 | } | |
18 | ||
19 | foreach($parents as $parent) | |
20 | { | |
21 | echo "Updating node $parent ... "; | |
22 | $query = "update nodes set node_system_access = 'private' where node_system_access = 'public' and node_parent = '$parent'"; | |
23 | $set = $db->query($query); | |
24 | // echo $query; | |
25 | echo "done<br>"; | |
26 | } | |
27 | ||
28 | //print_r($parents); | |
29 | ||
30 | ?> |