Changeset 1257
- Timestamp:
- 07/16/07 22:45:59 (6 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 4 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/include/schema_validate.php (modified) (1 diff)
-
wifidog/node_list.php (modified) (2 diffs)
-
wifidog/templates/node_list.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1256 r1257 2 2 3 3 2007-06-16 Benoit Grégoire <bock@step.polymtl.ca> 4 * Fix display of wifidog uptime in node list 4 5 * Preliminary skinning of the menu 5 6 * Network::getNumOnlineUsers(): Fix #40 by counting active connexion tokens, not distinct user id's. That way users logged in twice (splash-only, or username if allowed in network config) will be counted twice. -
trunk/wifidog-auth/wifidog/include/schema_validate.php
r1253 r1257 1256 1256 $sql .= "INSERT into roles (role_id, stakeholder_type_id) VALUES ('NODE_OWNER', 'Node');\n"; 1257 1257 $db->execSql("SELECT * FROM node_stakeholders WHERE is_owner = true", $results, false); 1258 foreach ($results as $row) { 1259 $sql .= "INSERT into node_stakeholders (user_id, role_id, object_id) VALUES ('{$row['user_id']}', 'NODE_OWNER', '{$row['node_id']}');\n"; 1258 if($results) { 1259 foreach ($results as $row) { 1260 $sql .= "INSERT into node_stakeholders (user_id, role_id, object_id) VALUES ('{$row['user_id']}', 'NODE_OWNER', '{$row['node_id']}');\n"; 1261 } 1260 1262 } 1261 1263 $sql .= "INSERT into roles (role_id, stakeholder_type_id) VALUES ('NODE_TECH_OFFICER', 'Node');\n"; 1262 1264 $db->execSql("SELECT * FROM node_stakeholders WHERE is_tech_officer = true", $results, false); 1263 foreach ($results as $row) { 1264 $sql .= "INSERT into node_stakeholders (user_id, role_id, object_id) VALUES ('{$row['user_id']}', 'NODE_TECH_OFFICER', '{$row['node_id']}');\n"; 1265 if($results) { 1266 foreach ($results as $row) { 1267 $sql .= "INSERT into node_stakeholders (user_id, role_id, object_id) VALUES ('{$row['user_id']}', 'NODE_TECH_OFFICER', '{$row['node_id']}');\n"; 1268 } 1265 1269 } 1266 1270 -
trunk/wifidog-auth/wifidog/node_list.php
r1249 r1257 98 98 $sort_by_param_sql = $sort_by_param; 99 99 } 100 $sql = "SELECT node_id, gw_id, name, last_heartbeat_user_agent, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date, node_deployment_status FROM nodes WHERE node_deployment_status != 'PERMANENTLY_CLOSED' ORDER BY {$sort_by_param_sql}";100 $sql = "SELECT node_id, gw_id, name, last_heartbeat_user_agent, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date, node_deployment_status, last_heartbeat_wifidog_uptime FROM nodes WHERE node_deployment_status != 'PERMANENTLY_CLOSED' ORDER BY {$sort_by_param_sql}"; 101 101 } 102 102 else { 103 $sql = "SELECT node_id, gw_id, name, last_heartbeat_user_agent, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date, node_deployment_status FROM nodes WHERE node_deployment_status != 'PERMANENTLY_CLOSED' ORDER BY " . DEFAULT_SORT_BY_PARAM;103 $sql = "SELECT node_id, gw_id, name, last_heartbeat_user_agent, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date, node_deployment_status, last_heartbeat_wifidog_uptime FROM nodes WHERE node_deployment_status != 'PERMANENTLY_CLOSED' ORDER BY " . DEFAULT_SORT_BY_PARAM; 104 104 } 105 105 $nodes_results = null; … … 117 117 $node = Node :: getObject($node_row['node_id']); 118 118 $node_row['duration'] = $db->GetDurationArrayFromIntervalStr($node_row['since_last_heartbeat']); 119 if($node_row['last_heartbeat_wifidog_uptime']) { 120 $node_row['wifidog_uptime'] = $db->GetDurationArrayFromIntervalStr($node_row['last_heartbeat_wifidog_uptime'].' seconds'); 121 } 119 122 $node_row['num_online_users'] = $node->getNumOnlineUsers(); 120 123 $nodeDeploymentStatus = $node_row['node_deployment_status']; -
trunk/wifidog-auth/wifidog/templates/node_list.html
r1253 r1257 36 36 {if $nodes[node].online == 't'} 37 37 <img src='{$common_images_url}HotspotStatus/up.gif'> 38 {if $nodes[node]. last_heartbeat_wifidog_uptime != ''}39 {$nodes[node]. last_heartbeat_wifidog_uptime.days} {"days"|_} {$nodes[node].last_heartbeat_wifidog_uptime.hours}{"h"|_} {$nodes[node].last_heartbeat_wifidog_uptime.minutes}{"min"|_}<br />38 {if $nodes[node].wifidog_uptime != ''} 39 {$nodes[node].wifidog_uptime.days} {"days"|_} {$nodes[node].wifidog_uptime.hours}{"h"|_} {$nodes[node].wifidog_uptime.minutes}{"min"|_}<br /> 40 40 {/if} 41 41 {else}
