Changeset 312
- Timestamp:
- 01/11/05 00:13:19 (8 years ago)
- Location:
- trunk/wifidog-auth/wifidog
- Files:
-
- 6 added
- 3 modified
-
hotspot_status.php (modified) (1 diff)
-
index.php (modified) (1 diff)
-
node_list.php (modified) (1 diff)
-
templates (added)
-
templates/header.html (added)
-
templates/hotspot_status.html (added)
-
templates/main.html (added)
-
templates/node_list.html (added)
-
templates/user_management_menu.html (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/wifidog/hotspot_status.php
r296 r312 27 27 require_once BASEPATH.'include/common.php'; 28 28 require_once BASEPATH.'classes/Style.php'; 29 require_once (BASEPATH.'include/user_management_menu.php');30 29 require_once BASEPATH.'classes/Statistics.php'; 30 require_once BASEPATH.'classes/SmartyWifidog.php'; 31 32 $smarty = new SmartyWifidog; 33 $smarty->SetTemplateDir('templates/'); 31 34 32 35 $style = new Style(); 33 $stats=new Statistics(); 36 $stats = new Statistics(); 37 38 $db->ExecSql("SELECT *, (NOW()-last_heartbeat_timestamp) AS since_last_heartbeat, CASE WHEN ((NOW()-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS is_up FROM nodes WHERE node_deployment_status = 'DEPLOYED' OR node_deployment_status = 'NON_WIFIDOG_NODE' OR node_deployment_status = 'IN_TESTING' ORDER BY creation_date", $node_results, false); 39 40 foreach($node_results as $node_row) { 41 $node_row['num_online_users'] = $stats->getNumOnlineUsers($node_row['node_id']); 42 $smarty->append("nodes", $node_row); 43 } 34 44 35 45 echo $style->GetHeader(HOTSPOT_NETWORK_NAME.' hotspot status'); 36 echo "<div id='head'><h1>". HOTSPOT_NETWORK_NAME ." node list</h1></div>\n"; 37 echo "<div id='navLeft'>\n"; 38 echo get_user_management_menu(); 39 echo "</div>\n"; 40 echo "<div id='content'>\n"; 41 42 $db->ExecSql("SELECT *, (NOW()-last_heartbeat_timestamp) AS since_last_heartbeat, 43 CASE WHEN ((NOW()-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS is_up FROM nodes WHERE node_deployment_status = 'DEPLOYED' OR node_deployment_status = 'NON_WIFIDOG_NODE' OR node_deployment_status = 'IN_TESTING' ORDER BY creation_date",$node_results, false); 44 echo "<table class='spreadsheet'>\n"; 45 echo "<thead><tr class='spreadsheet'><th class='spreadsheet' colspan=6>"._('Status of the ').count($node_results) .' '._("open").' '.HOTSPOT_NETWORK_NAME.' '._("HotSpots")."</th></tr>\n"; 46 echo "<tr class='spreadsheet'><th class='spreadsheet'>"._('HotSpot / Status')."</th>\n"; 47 echo "<th class='spreadsheet'>"._('Description')."</th>\n"; 48 echo "<th class='spreadsheet'>"._('Location')."</th>\n"; 49 echo "</tr></thead>\n"; 50 foreach($node_results as $node_row) 51 { 52 echo "<tr class='spreadsheet'>\n"; 53 echo "<td class='spreadsheet'>\n"; 54 if($node_row['node_deployment_status']=='NON_WIFIDOG_NODE') 55 { 56 echo "? "; 57 } 58 else 59 { 60 if($node_row['is_up']=='t') 61 { 62 echo "<img src='".BASE_URL_PATH . "images/hotspot_status_up.png'> "; 63 } 64 else 65 { 66 echo "<img src='".BASE_URL_PATH . "images/hotspot_status_down.png'> "; 67 } 68 } 69 70 if(empty($node_row['home_page_url'])) 71 { 72 echo "$node_row[name]\n"; 73 } 74 else 75 { 76 echo "<a href='$node_row[home_page_url]' target='_new'>$node_row[name]</a>\n"; 77 } 78 79 if($node_row['node_deployment_status']=='IN_TESTING') 80 { 81 echo _("<br />HotSpot in testing phase"); 82 } 83 if($node_row['node_deployment_status']!='NON_WIFIDOG_NODE' && $node_row['is_up']!='t') 84 { 85 $duration = $db->GetDurationArrayFromIntervalStr($node_row['since_last_heartbeat']); 86 echo '<br />' . $duration['days'].'days '.$duration['hours'].'h '.$duration['minutes'].'min<br />'; 87 } 88 89 echo "</td>\n"; 90 echo "<td class='spreadsheet'>\n"; 91 if(!empty($node_row['description'])) 92 { 93 echo "$node_row[description]\n"; 94 } 95 echo '<br />'; 96 echo _("Opened on "); 97 echo "$node_row[creation_date]\n"; 98 $num_online_users = $stats->getNumOnlineUsers($node_row['node_id']); 99 if($num_online_users!=0) 100 { 101 echo ", $num_online_users "; 102 echo _("user(s) online"); 103 } 104 105 106 echo "</td>\n"; 107 echo "<td class='spreadsheet'>\n"; 108 if(!empty($node_row['street_address'])) 109 { 110 echo "<br />$node_row[street_address]\n"; 111 } 112 if(!empty($node_row['map_url'])) 113 { 114 echo " - <a href='$node_row[map_url]' target='_new'>Map</a>\n"; 115 } 116 if(!empty($node_row['mass_transit_info'])) 117 { 118 echo "<br />$node_row[mass_transit_info]\n"; 119 } 120 if(!empty($node_row['public_phone_number'])) 121 { 122 echo "<br />$node_row[public_phone_number]\n"; 123 } 124 if(!empty($node_row['public_email'])) 125 { 126 echo "<br />$node_row[public_email]\n"; 127 } 128 129 130 echo "</td>\n"; 131 } 132 echo "</table>\n"; 133 134 echo "</div>\n"; 135 46 $smarty->display("hotspot_status.html"); 136 47 echo $style->GetFooter(); 137 48 ?> -
trunk/wifidog-auth/wifidog/index.php
r305 r312 23 23 */ 24 24 25 define('BASEPATH', './');25 define('BASEPATH', './'); 26 26 require_once BASEPATH.'include/common.php'; 27 27 require_once BASEPATH.'classes/Style.php'; 28 28 require_once BASEPATH.'classes/Statistics.php'; 29 require_once (BASEPATH.'include/user_management_menu.php'); 29 require_once BASEPATH.'classes/SmartyWifidog.php'; 30 31 $smarty = new SmartyWifidog; 32 $smarty->SetTemplateDir('templates/'); 30 33 31 34 $style = new Style(); 32 35 echo $style->GetHeader(HOTSPOT_NETWORK_NAME.' authentication server'); 33 echo "<div id='head'><h1>Wifidog authentication server for ". HOTSPOT_NETWORK_NAME ."</h1></div>\n";34 echo "<div id='navLeft'>\n";35 echo get_user_management_menu();36 echo "</div>\n";37 echo "<div id='content'>\n";38 36 39 $stats=new Statistics(); 40 $num_valid_users=$stats->getNumValidUsers(); 37 $stats = new Statistics(); 38 $smarty->assign("num_valid_users", $stats->getNumValidUsers()); 39 $smarty->assign("num_online_users", $stats->getNumOnlineUsers($node_id = null)); 41 40 42 $num_online_users=$stats->getNumOnlineUsers($node_id=null); 43 44 echo "<p>"._("The network currently has ").$num_valid_users._(" valid users.")." ".$num_online_users._(" user(s) are currently online")."</p>\n"; 45 echo "<ul>\n"; 46 echo "<li><a href='hotspot_status.php'>"._("Deployed HotSpots status with coordinates")."</a></li>\n"; 47 echo "<li><a href='node_list.php'>"._("Full node technical status (includes non-deployed nodes)")."</a></li>\n"; 48 echo "<li><a href='./user_management/index.php'>"._("Personal user management")."</a></li>\n"; 49 echo "<li><a href='".BASE_SSL_PATH."admin/index.php'>"._("Administration")."</a></li>\n"; 50 echo "</ul>\n"; 51 echo "</div>\n"; 41 $smarty->display("main.html"); 52 42 53 43 echo $style->GetFooter(); -
trunk/wifidog-auth/wifidog/node_list.php
r267 r312 27 27 require_once BASEPATH.'include/common.php'; 28 28 require_once BASEPATH.'classes/Style.php'; 29 require_once (BASEPATH.'include/user_management_menu.php');30 29 require_once BASEPATH.'classes/Statistics.php'; 30 require_once BASEPATH.'classes/SmartyWifidog.php'; 31 32 $smarty = new SmartyWifidog; 33 $smarty->SetTemplateDir('templates/'); 31 34 32 35 $style = new Style(); 33 $stats=new Statistics(); 36 $stats = new Statistics(); 37 38 $db->ExecSql("SELECT node_id, name, last_heartbeat_user_agent, (NOW()-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((NOW()-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS is_up, creation_date FROM nodes ORDER BY node_id", $node_results, false); 39 40 foreach($node_results as $node_row) { 41 $node_row['duration'] = $db->GetDurationArrayFromIntervalStr($node_row['since_last_heartbeat']); 42 $node_row['num_online_users'] = $stats->getNumOnlineUsers($node_row['node_id']); 43 $smarty->append("nodes", $node_row); 44 } 34 45 35 46 echo $style->GetHeader(HOTSPOT_NETWORK_NAME.' node list'); 36 echo "<div id='head'><h1>". HOTSPOT_NETWORK_NAME ." node list</h1></div>\n"; 37 echo "<div id='navLeft'>\n"; 38 echo get_user_management_menu(); 39 echo "</div>\n"; 40 41 echo "<div id='content'>\n"; 42 43 $db->ExecSql("SELECT node_id, name, last_heartbeat_user_agent, (NOW()-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, 44 CASE WHEN ((NOW()-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS is_up, creation_date FROM nodes ORDER BY node_id",$node_results, false); 45 echo "<table class='spreadsheet'>\n"; 46 echo "<thead><tr class='spreadsheet'><th class='spreadsheet' colspan=6>Status of all nodes of the ".HOTSPOT_NETWORK_NAME." network</th></tr>\n"; 47 echo "<tr class='spreadsheet'><th class='spreadsheet'>Status</th>\n"; 48 echo "<th class='spreadsheet'>Id</th>\n"; 49 echo "<th class='spreadsheet'>Name</th>\n"; 50 echo "<th class='spreadsheet'>Local content demo</th>\n"; 51 echo "<th class='spreadsheet'>Opened on</th>\n"; 52 echo "<th class='spreadsheet'>Online users</th>\n"; 53 echo "</tr></thead>\n"; 54 foreach($node_results as $node_row) 55 { 56 echo "<tr class='spreadsheet'>\n"; 57 echo "<td class='spreadsheet'>\n"; 58 if($node_row['is_up']=='t') 59 { 60 echo "<img src='".BASE_URL_PATH . "images/hotspot_status_up.png'> "; 61 } 62 else 63 { 64 echo "<img src='".BASE_URL_PATH . "images/hotspot_status_down.png'> "; 65 $duration = $db->GetDurationArrayFromIntervalStr($node_row['since_last_heartbeat']); 66 echo $duration['days'].'days '.$duration['hours'].'h '.$duration['minutes'].'min<br />'; 67 } 68 echo "$node_row[last_heartbeat_user_agent]"; 69 echo "</td>\n"; 70 echo "<td class='spreadsheet'>$node_row[node_id]</td>\n"; 71 echo "<td class='spreadsheet'>$node_row[name]</td>\n"; 72 echo "<td class='spreadsheet'>\n"; 73 echo "<a href='".BASE_SSL_PATH."login/index.php?gw_id=$node_row[node_id]&gw_address=127.0.0.1&gw_port=80'>Login page</a><br />\n"; 74 echo "<a href='".BASE_URL_PATH."portal/index.php?gw_id=$node_row[node_id]'>Portal page</a>\n"; 75 echo "</td>\n"; 76 echo "<td class='spreadsheet'>$node_row[creation_date]</td>\n"; 77 $num_online_users = $stats->getNumOnlineUsers($node_row['node_id']); 78 if($num_online_users==0) 79 { 80 $num_online_users=null; 81 } 82 echo "<td class='spreadsheet'>$num_online_users</td>\n"; 83 echo "</tr>\n"; 84 } 85 echo "</table>\n"; 86 87 echo "</div>\n"; 88 47 $smarty->display("node_list.html"); 89 48 echo $style->GetFooter(); 90 49 ?>
