return $userlist;
}
+// getNodeCommanders
+
+// Get logins of all node commanders (used in configure)
+// Secure.
+// Returns list of (node_permission, login)
-}
+public static function getNodeCommanders($node_id) {
+ global $db;
+ $set=$db->query("select node_permission,users.login from node_access
+ left join users on node_access.user_id=users.user_id where
+ node_id='$node_id' and node_permission!='' order by node_permission");
+
+ while ($set->next()) {
+ $commanders[$set->getString('node_permission')].=$set->getString('login').";";
+ }
+
+ return $commanders;
+}
+
+}
?>
<?php
function smarty_function_get_node_commanders($brawco,&$smarty) {
- global $db,$node;
+ global $node;
$node_id=$node['node_id'];
- $set=$db->query("select node_permission,users.login from node_access left join users on node_access.user_id=users.user_id where node_id='$node_id' and node_permission!='' order by node_permission");
-
- while ($set->next()) {
- $commanders[$set->getString('node_permission')].=$set->getString('login').";";
- }
+
+ $commanders=nodes::getNodeCommanders($node_id);
$smarty->assign('get_node_commanders',empty($commanders) ? "" : $commanders);
$smarty->assign('masters',empty($commanders['master']) ? "" : $commanders['master']);
<?php
+
+//XXX duplicate to get_node_commanders,
+//only one can survive;)
+
function smarty_function_get_node_commanders2($brawco,&$smarty) {
global $db,$node;
$node_id=$node['node_id'];