Show
Ignore:
Timestamp:
02/11/10 17:34:27 (2 years ago)
Author:
gbastien
Message:

* Merged recent changes in the trunk into this branch
* New token architecture not yet fully functional, nor tested, but ...

  • can now edit token templates for different context of tokens (from the edit netork interface at the bottom of page)
  • Users connected through a wifidog gateway can view their connection token information
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newtoken/wifidog/classes/Network.php

    r1436 r1446  
    5656require_once('classes/Security.php'); 
    5757require_once('classes/HotspotGraphElement.php'); 
     58require_once('classes/TokenTemplate.php'); 
     59 
    5860 
    5961/** 
     
    688690            } 
    689691        } 
     692        $params = array_map('trim',$params); 
    690693        return call_user_func_array(array (new ReflectionClass($this->_row['network_authenticator_class']), 'newInstance'), $params); 
    691694 
     
    16941697         * Content management 
    16951698         */ 
    1696        /* $title = _("Network content"); 
    1697         $name = "network_".$this->_id."_content"; 
    1698         $data = Content::getLinkedContentUI($name, "network_has_content", "network_id", $this->_id, $display_page = "portal"); 
    1699         $html .= InterfaceElements::generateAdminSectionContainer("network_content", $title, $data);*/ 
    17001699         
    17011700        $html .= parent::getContentAdminUI(); 
     
    19281927        $html .= InterfaceElements::generateAdminSectionContainer("network_profile_templates", $title, $data); 
    19291928         
     1929        // Token templates 
     1930        $title = _("Network token templates"); 
     1931        $name = "network_".$this->_id."_token_templates"; 
     1932        $data = TokenTemplate::getTemplatesForNetworkUI($name, $this); 
     1933        $html .= InterfaceElements::generateAdminSectionContainer("network_token_templates", $title, $data); 
     1934         
    19301935        // objects hierarchy 
    19311936        $html .= parent::getGraphAdminUI($this); 
     
    19501955        // Content management 
    19511956        parent::processContentAdminUI(); 
    1952         /* $name = "network_".$this->_id."_content"; 
    1953         Content :: processLinkedContentUI($name, 'network_has_content', 'network_id', $this->_id);*/ 
    19541957 
    19551958        // name 
     
    20692072        ProfileTemplate :: processLinkedProfileTemplateUI($name, 'network_has_profile_templates', 'network_id', $this->_id); 
    20702073         
     2074        // Token templates 
     2075        $name = "network_".$this->_id."_token_templates"; 
     2076        TokenTemplate :: processTemplatesForNetworkUI($name, $this); 
     2077         
    20712078        parent::processGraphAdminUI($errMsg, $this); 
    20722079        if(!empty($errMsg)) { 
     
    20822089        } 
    20832090    } 
    2084  
    2085     /** 
    2086      * Add network-wide content to this network 
    2087      * 
    2088      * @param object Content object 
    2089      * 
    2090      * @return void 
    2091      * 
    2092      * @access public 
    2093      */ 
    2094  /*   public function addContent(Content $content) 
    2095     { 
    2096         $db = AbstractDb::getObject(); 
    2097  
    2098         $content_id = $db->escapeString($content->getId()); 
    2099         $sql = "INSERT INTO network_has_content (network_id, content_id) VALUES ('$this->_id','$content_id')"; 
    2100         $db->execSqlUpdate($sql, false); 
    2101     }*/ 
    2102  
    2103     /** 
    2104      * Remove network-wide content from this network 
    2105      * 
    2106      * @param object Content object 
    2107      * 
    2108      * @return void 
    2109      * 
    2110      * @access public 
    2111      */ 
    2112  /*   public function removeContent(Content $content) 
    2113     { 
    2114         $db = AbstractDb::getObject(); 
    2115  
    2116         $content_id = $db->escapeString($content->getId()); 
    2117         $sql = "DELETE FROM network_has_content WHERE network_id='$this->_id' AND content_id='$content_id'"; 
    2118         $db->execSqlUpdate($sql, false); 
    2119     }*/ 
    2120  
    21212091 
    21222092    /**