Changeset 2952


Ignore:
Timestamp:
05/31/10 07:46:28 (21 months ago)
Author:
nuxwin
Message:
  • [GUI] Small fix (it's my fault)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/admin/settings_ports.php

    r2951 r2952  
    145145 * @param int $show 
    146146 * @param boolean $on_updt True: validates for update 
    147  * @return TRUE if valids, FALSE otherwise 
     147 * @return TRUE if valid, FALSE otherwise 
    148148 */ 
    149149function validates_service($name, $ip, $port, $proto, $show, $on_updt = false) { 
     
    160160        } elseif(!is_number($port) || $port <= 0) { 
    161161                $e = tr('ERROR: Only positive numbers are allowed!'); 
    162         } elseif(isset($db_cfg->$db_sname) && !$on_updt) { 
     162        } elseif(!$on_updt && isset($db_cfg->$db_sname)) { 
    163163                $e = tr('ERROR: Service port already exists!'); 
    164164        } elseif($proto != 'tcp' && $proto != 'udp') { 
     
    218218                        $port = $_POST['port'][$index]; 
    219219                        $proto = $_POST['port_type'][$index]; 
     220                        $name = strtoupper($name); 
    220221                        $show = $_POST['show_val'][$index]; 
    221222                        $custom = $_POST['custom'][$index]; 
     
    223224 
    224225                        if(validates_service($name, $ip, $port, $proto, $show, true)) { 
    225                                 $db_sname = "PORT_$name"; 
     226                                $db_sname = $_POST['var_name'][$index]; 
    226227 
    227228                                // Update the service port in the database 
Note: See TracChangeset for help on using the changeset viewer.