Show
Ignore:
Timestamp:
12/09/09 17:08:25 (3 years ago)
Author:
gbastien
Message:

Merged branch 'gbastien' for node group with the trunk:
* Added the concept of node group and hierarchy (in a not too clean way to start with, I will refactor the code before adding new functionalities to nodes and groups) (#246)
* Login and signup and logout script now receive the mac address as parameter (#675)
* Initial abuse control verification now made with the mac address (#676)

Files:
1 modified

Legend:

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

    r1428 r1435  
    5555require_once('classes/ThemePack.php'); 
    5656require_once('classes/Security.php'); 
     57require_once('classes/HotspotGraphElement.php'); 
    5758 
    5859/** 
     
    7172    /** Object cache for the object factory (getObject())*/ 
    7273    private static $instanceArray = array(); 
     74    protected $_hotspotGraphElement; 
    7375 
    7476    /** 
     
    201203            throw new Exception(_('Unable to insert the new network in the database!')); 
    202204        } 
     205         
     206        HotspotGraphElement::createNewObject($network_id, 'Network'); 
     207         
    203208        $object = self::getObject($network_id); 
    204209        require_once('classes/Stakeholder.php'); 
     
    378383    { 
    379384        $db = AbstractDb::getObject(); 
     385        if ($p_network_id == "") 
     386            $p_network_id = self::getDefaultNetwork()->getId(); 
    380387        $network_id_str = $db->escapeString($p_network_id); 
    381         if ($network_id_str == "") 
    382         $network_id_str = $db->escapeString(self::getDefaultNetwork()->getId()); 
    383388 
    384389        $sql = "SELECT *, EXTRACT(EPOCH FROM validation_grace_time) as validation_grace_time_seconds FROM networks WHERE network_id='$network_id_str'"; 
     
    390395        $this->_row = $row; 
    391396        $this->_id = $p_network_id; 
     397        $this->_hotspotGraphElement = HotspotGraphElement::getObject($this->_id,'Network'); 
    392398    } 
    393399 
     
    16961702         * Content management 
    16971703         */ 
    1698         $title = _("Network content"); 
     1704       /* $title = _("Network content"); 
    16991705        $name = "network_".$this->_id."_content"; 
    17001706        $data = Content::getLinkedContentUI($name, "network_has_content", "network_id", $this->_id, $display_page = "portal"); 
    1701         $html .= InterfaceElements::generateAdminSectionContainer("network_content", $title, $data); 
     1707        $html .= InterfaceElements::generateAdminSectionContainer("network_content", $title, $data);*/ 
     1708        if (!is_null($this->_hotspotGraphElement)) 
     1709            $html .= $this->_hotspotGraphElement->getContentAdminUI(); 
    17021710 
    17031711        /* 
     
    19271935        $data = ProfileTemplate::getLinkedProfileTemplateUI($name, "network_has_profile_templates", "network_id", $this->_id); 
    19281936        $html .= InterfaceElements::generateAdminSectionContainer("network_profile_templates", $title, $data); 
     1937         
     1938        // objects hierarchy 
     1939        if (!is_null($this->_hotspotGraphElement)) 
     1940            $html .= $this->_hotspotGraphElement->getGraphAdminUI($this); 
    19291941 
    19301942        $html .= "</ul>\n"; 
     
    19461958 
    19471959        // Content management 
    1948         $name = "network_".$this->_id."_content"; 
    1949         Content :: processLinkedContentUI($name, 'network_has_content', 'network_id', $this->_id); 
     1960        if (!is_null($this->_hotspotGraphElement)) 
     1961            $this->_hotspotGraphElement->processContentAdminUI(); 
     1962        /* $name = "network_".$this->_id."_content"; 
     1963        Content :: processLinkedContentUI($name, 'network_has_content', 'network_id', $this->_id);*/ 
    19501964 
    19511965        // name 
     
    20642078        $name = "network_".$this->_id."_profile_templates"; 
    20652079        ProfileTemplate :: processLinkedProfileTemplateUI($name, 'network_has_profile_templates', 'network_id', $this->_id); 
     2080         
     2081        if (!is_null($this->_hotspotGraphElement)) 
     2082            $this->_hotspotGraphElement->processGraphAdminUI($errMsg, $this); 
     2083        if(!empty($errMsg)) { 
     2084            echo $errMsg; 
     2085            $errMsg = null; 
     2086        } 
    20662087 
    20672088        // Node creation