Show
Ignore:
Timestamp:
01/26/05 15:43:34 (8 years ago)
Author:
aprilp
Message:

Some kind of virtual login (we need to talk about this).
New User and Node classes
Modified all files to work with the classes.
Remove mgmt_helpers (all done in User class now)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/portal/index.php

    r368 r402  
    2626define('BASEPATH','../'); 
    2727require_once BASEPATH.'include/common.php'; 
    28 require_once BASEPATH.'classes/SmartyWifidog.php'; 
    29 require_once BASEPATH.'classes/Session.php'; 
     28require_once BASEPATH.'include/common_interface.php'; 
     29require_once BASEPATH.'classes/Node.php'; 
    3030 
    3131if (CONF_USE_CRON_FOR_DB_CLEANUP == false) { 
     
    3333} 
    3434 
    35 $smarty = new SmartyWifidog; 
    36 $session = new Session; 
    37  
    38 include BASEPATH.'include/language.php'; 
     35if (!isset($_REQUEST['gw_id'])) { 
     36    $smarty->display("templates/message_unknown_hotspot.html"); 
     37    exit; 
     38} 
    3939 
    4040$portal_template = $_REQUEST['gw_id'] . ".html"; 
    4141$node_id = $db->EscapeString($_REQUEST['gw_id']); 
    42 $db->ExecSqlUniqueRes("SELECT * FROM nodes WHERE node_id='$node_id'", $node_info); 
    43 if ($node_info == null) { 
    44     $smarty->assign('hotspot_name', UNKNOWN_HOSTPOT_NAME); 
    45     $hotspot_rss_url = UNKNOWN_HOTSPOT_RSS_URL; 
    46 } else { 
    47     $smarty->assign('hotspot_name', $node_info['name']); 
    48     $hotspot_rss_url =  $node_info['rss_url']; 
     42 
     43$node = Node::getObject($node_id); 
     44if ($node == null) { 
     45    $smarty->assign("gw_id", $_REQUEST['gw_id']); 
     46    $smarty->display("templates/message_unknown_hotspot.html"); 
     47    exit; 
    4948} 
    5049 
     50$smarty->assign('hotspot_name', $node->getName()); 
     51$hotspot_rss_url = $node->getRSSURL(); 
     52 
    5153/* Find out who is online */ 
    52 $db->ExecSql("SELECT users.user_id FROM users,connections WHERE connections.token_status='" . TOKEN_INUSE . "' AND users.user_id=connections.user_id AND connections.node_id='$node_id'", $users, false); 
    53 if ($users != null) { 
    54     $smarty->assign("online_users", $users); 
    55 } 
     54$smarty->assign("online_users", $node->getOnlineUsers()); 
    5655 
    5756if (RSS_SUPPORT) {