Commit | Line | Data |
---|---|---|
b42b2bf9 H |
1 | <?php |
2 | // extracts list of users who have execute permission on K | |
3 | // that means they are cittizens | |
4 | ||
5 | function smarty_function_get_citizen_list($params,&$smarty) { | |
6 | global $db, $error; | |
7 | ||
8 | switch ($params['sort']) { | |
9 | case "user_id": | |
10 | $sort = "users.user_id"; | |
11 | break; | |
12 | case "login": | |
13 | $sort = "login"; | |
14 | break; | |
15 | case "last_action": | |
16 | $sort = "last_action"; | |
17 | break; | |
18 | case "user_action": | |
19 | $sort = "user_action"; | |
20 | break; | |
21 | default: | |
22 | $sort = "login"; | |
23 | break; | |
24 | } | |
25 | ||
26 | $q="select users.user_id, login, last_action, user_action from nodes left join node_access on nodes.node_id=node_access.node_id left join users on node_access.user_id=users.user_id where nodes.node_id=1961061 and node_access.node_permission='execute' order by ".$sort; | |
27 | $set=$db->query($q); | |
28 | ||
29 | $i=0; | |
30 | while ($set->next()) { | |
31 | $i++; | |
32 | $citizens[$i]['user_id']=$set->getString('user_id'); | |
33 | $citizens[$i]['login']=$set->getString('login'); | |
34 | $citizens[$i]['last_action']=$set->getString('last_action'); | |
35 | $citizens[$i]['user_action']=$set->getString('user_action'); | |
36 | } | |
37 | $smarty->assign('get_citizen_list',$citizens); | |
38 | } | |
39 | ||
40 | ?> |