Changeset 1312

Show
Ignore:
Timestamp:
12/23/07 22:29:58 (1 year ago)
Author:
benoitg
Message:
  • Node.php: Fix bug in setCurrentNode() reported by Vacio
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wifidog-auth/CHANGELOG

    r1310 r1312  
    11# $Id$ 
     22007-12-23 Benoit GrĂ©goire  <bock@step.polymtl.ca> 
     3        * Node.php:  Fix bug in setCurrentNode() reported by Vacio 
     4         
    252007-11-29 Benoit GrĂ©goire  <bock@step.polymtl.ca> 
    36        * signup.tpl, lost_username.tpl, lost_password.tpl, resend_validation.tpl:  Move the error div near the button for coherence with the login page (and for the same reason).  In fact it was worse than the login page used to be:  the error message during signup could appear completely below the page for a user with a low resolution screeen (or big font), giving the form the apereance of doing absolutely nothing (it stumped even me as I was trying to help a user). 
  • trunk/wifidog-auth/wifidog/classes/MainUI.php

    r1300 r1312  
    217217    } 
    218218    /** 
    219      * Contructor 
     219     * Constructor 
    220220     * 
    221221     * @return void 
  • trunk/wifidog-auth/wifidog/classes/Menu.php

    r1307 r1312  
    7878    } 
    7979    /** 
    80      * Contructor 
     80     * Constructor 
    8181     * 
    8282     * @return void 
  • trunk/wifidog-auth/wifidog/classes/Network.php

    r1311 r1312  
    15481548        //  network_authenticator_params 
    15491549        $title = _("Authenticator parameters"); 
    1550         $help = _("The explicit parameters to be passed to the authenticator. You MUST read the contructor documentation of your desired authenticator class (in wifidog/classes/Authenticators/) BEFORE you start playing with this.  Example: 'my_network_id', '192.168.0.11', 1812, 1813, 'secret_key', 'CHAP_MD5'"); 
     1550        $help = _("The explicit parameters to be passed to the authenticator. You MUST read the constructor documentation of your desired authenticator class (in wifidog/classes/Authenticators/) BEFORE you start playing with this.  Example: 'my_network_id', '192.168.0.11', 1812, 1813, 'secret_key', 'CHAP_MD5'"); 
    15511551        $data = InterfaceElements::generateInputText("network_" . $this->getId() . "_network_authenticator_params", $this->getAuthenticatorConstructorParams(), "network_network_authenticator_params_input"); 
    15521552        $html_network_authentication[] = InterfaceElements::generateAdminSectionContainer("network_network_authenticator_params", $title, $data, $help); 
  • trunk/wifidog-auth/wifidog/classes/Node.php

    r1308 r1312  
    6868    private $mdB; /**< An AbstractDb instance */ 
    6969    private $id; 
    70     private static $current_node_id = null; 
     70    private static $currentNode = null; 
    7171 
    7272    /** 
     
    117117    { 
    118118        $object = null; 
    119         if (self :: $current_node_id != null && $real_node_only == false) 
    120         { 
    121             $object = self::getObject(self :: $current_node_id)
     119        if (self :: $currentNode != null && $real_node_only == false) 
     120        { 
     121            $object = self :: $currentNode
    122122        } 
    123123        else 
     
    128128    } 
    129129 
    130     /** Set the current node where the user is to be considered connected to.  (For portal and content display purpuses, among other. 
    131      * @param $node Node.  The new current node. 
     130    /** Set the current node where the user is to be considered connected to.  (For portal and content display purposes, among other. 
     131     * @param $node Node object or null.  The new current node. 
    132132     * @return true      */ 
    133     static function setCurrentNode(Node $node) 
    134     { 
    135         self :: $current_node_id = $node->GetId(); 
     133    static function setCurrentNode($node) 
     134    { 
     135        if(empty($node) || $node instanceof Node) { 
     136            self :: $currentNode = $node; 
     137        } 
     138        else { 
     139            throw new Exception(sprintf("Parameter node must be null or of class Node but is of class %s", get_class($node))); 
     140        } 
    136141        return true; 
    137142    } 
     
    12621267        require_once('classes/Stakeholder.php'); 
    12631268        $user = User::getCurrentUser(); 
    1264                 // Get information about the network 
     1269        // Get information about the network 
    12651270        $network = $this->getNetwork(); 
    12661271        //pretty_print_r($_REQUEST); 
     
    12771282 
    12781283        // Gateway Id 
    1279                 $permArray = null; 
     1284        $permArray = null; 
    12801285        $permArray[]=array(Permission::P('NETWORK_PERM_EDIT_ANY_NODE_CONFIG'), $network); 
    12811286        $permArray[]=array(Permission::P('NODE_PERM_EDIT_GATEWAY_ID'), $this); 
     
    16161621            'title' => _("Edit nodes"), 
    16171622            'url' => BASE_URL_PATH.htmlspecialchars("admin/generic_object_admin.php?object_class=Node&action=list") 
    1618                ); 
     1623            ); 
    16191624        } 
    16201625        else if($nodes = Security::getObjectsWithPermission(Permission::P('NODE_PERM_EDIT_CONFIG'))) {