Show
Ignore:
Timestamp:
01/27/05 11:00:52 (8 years ago)
Author:
aprilp
Message:

*** empty log message ***

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/Node.php

    r402 r405  
    3434   * @return a Node object, or null if there was an error 
    3535   */ 
    36   static function getObject($id) { 
     36  static function getNode($id) { 
    3737      $object = null; 
    3838      $object = new self($id); 
     
    4444   * @return the newly created Node object, or null if there was an error 
    4545   */ 
    46   static function createObject($id) { 
     46  static function createNode($id) { 
    4747      global $db; 
    4848 
     
    6262    $db->ExecSqlUniqueRes($sql, $row, false); 
    6363    if ($row == null) { 
    64             throw new Exception(_("The id $node_id_str could not be found in the database"), "EXCEPTION_CREATE_OBJECT_FAILED"); 
     64            throw new Exception(_("The id $node_id_str could not be found in the database")); 
    6565    } 
    6666    $this->mRow = $row;   
     
    9696 
    9797    $db->ExecSql("SELECT * FROM nodes", $nodes, false); 
     98 
    9899    if ($nodes == null) { 
    99         throw new Exception(_("No nodes could not be found in the database"), "EXCEPTION_NO_NODES"); 
     100        throw new Exception(_("No nodes could not be found in the database")); 
     101    } 
     102    return $nodes; 
     103  } 
     104 
     105  static function getAllNodesOrdered($order_by) { 
     106    global $db; 
     107 
     108    $db->ExecSql("SELECT * FROM nodes ORDER BY $order_by", $nodes, false); 
     109 
     110    if ($nodes == null) { 
     111        throw new Exception(_("No nodes could not be found in the database")); 
     112    } 
     113    return $nodes; 
     114  } 
     115 
     116  static function getAllNodesWithStatus() { 
     117    global $db; 
     118    $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 online, creation_date FROM nodes ORDER BY node_id", $nodes, false); 
     119    if ($nodes == null) { 
     120        throw new Exception(_("No nodes could not be found in the database")); 
    100121    } 
    101122    return $nodes; 
     
    107128    $db->ExecSql("SELECT * FROM node_deployment_status", $statuses, false); 
    108129    if ($statuses == null) { 
    109         throw new Exception(_("No deployment statues  could be found in the database"), "EXCEPTION_NO_STATUSES"); 
     130        throw new Exception(_("No deployment statues  could be found in the database")); 
    110131    } 
    111132    $statuses_array = array();