Changeset 178

Show
Ignore:
Timestamp:
12/29/06 00:45:37 (2 years ago)
Author:
syrus
Message:

rajout de la selection du reseau

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wifidog/wifidog-auth/wifidog/classes/Node.php

    r40 r178  
    500500        } 
    501501 
     502    /** Set Network for a node 
     503      * 
     504      */ 
     505    public function setNetwork($n) 
     506    { 
     507        $n = $this->mDb->escapeString($n); 
     508        $retval = $this->mDb->execSqlUpdate("UPDATE nodes SET network_id = '{$n}' WHERE node_id = '{$this->getId()}'"); 
     509        $this->refresh(); 
     510    } 
     511 
    502512        /** Get a GisPoint object ; altide is not supported yet 
    503513         */ 
     
    816826                $network = $this->getNetwork(); 
    817827 
    818                 // Check if user is a admin 
     828                // Check if user is a admin or an owner 
    819829                $_userIsAdmin = User::getCurrentUser()->isSuperAdmin(); 
     830        $_userIsOwner = User::getCurrentUser()->isOwner(); 
    820831 
    821832                /* 
     
    10031014                } 
    10041015 
     1016        // Network Selection (added by PR) 
     1017        $_title = _("Network"); 
     1018        $_data = Network::getSelectNetworkUI("node_" . $this->getId() . "_network", $this->getNetwork()); 
     1019                $_html_node_config[] = InterfaceElements::generateAdminSectionContainer("node_network", $_title, $_data); 
     1020 
     1021 
    10051022                // Build section 
    10061023                $html .= InterfaceElements::generateAdminSectionContainer("node_config", _("Node configuration"), implode(null, $_html_node_config)); 
     
    10661083 
    10671084 
    1068                 // Check if user is a admin 
     1085                // Check if user is a admin or an owner 
    10691086                $_userIsAdmin = User::getCurrentUser()->isSuperAdmin(); 
     1087        $_userIsOwner = User::getCurrentUser()->isOwner(); 
    10701088 
    10711089                // Information about the node 
     
    10771095        Content::processLinkedContentUI($name, 'node_has_content', 'node_id', $this->id); 
    10781096 
    1079                 // Name 
    1080                 if ($_userIsAdmin) { 
     1097                // Name (to change for node owner) 
     1098                if ($_userIsAdmin || $_userIsOwner) { 
    10811099                $name = "node_".$hashed_node_id."_name"; 
    10821100                $this->setName($_REQUEST[$name]); 
     
    11781196 
    11791197                // Node configuration section 
    1180  
    11811198                $network = $this->getNetwork(); 
     1199 
     1200        $name = "node_{$this->id}_network"; 
     1201        $this->setNetwork($_REQUEST[$name]); 
    11821202 
    11831203                // Deployment status