r4267 genericAssertion(): add "enum/dqcode" and "rackcode/expr" cases
authorDenis Ovsienko <infrastation@yandex.ru>
Tue, 1 Mar 2011 16:59:40 +0000 (16:59 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Tue, 1 Mar 2011 16:59:40 +0000 (16:59 +0000)
renderDeployQueue(): update to use getBypassValue()

wwwroot/inc/functions.php
wwwroot/inc/interface.php
wwwroot/inc/navigation.php

index b44f810183791e09ab6d8643e4b789b587aaaaf1..bf2ebcd1699968a269862d4803fe33caee99e59b 100644 (file)
@@ -379,6 +379,12 @@ function genericAssertion ($argname, $argtype)
                if (!in_array ($sic[$argname], array ('regular', 'shared', 'virtual', 'router')))
                        throw new InvalidRequestArgException ($argname, $sic[$argname], 'Unknown value');
                break;
+       case 'enum/dqcode':
+               assertStringArg ($argname);
+               global $dqtitle;
+               if (! array_key_exists ($sic[$argname], $dqtitle))
+                       throw new InvalidRequestArgException ($argname, $sic[$argname], 'Unknown value');
+               break;
        case 'iif':
                if (!array_key_exists ($sic[$argname], getPortIIFOptions()))
                        throw new InvalidRequestArgException ($argname, $sic[$argname], 'Unknown value');
@@ -391,6 +397,14 @@ function genericAssertion ($argname, $argtype)
                if ($sic[$argname] > VLAN_MAX_ID or $sic[$argname] < VLAN_MIN_ID)
                        throw new InvalidRequestArgException ($argname, $sic[$argname], 'out of valid range');
                break;
+       case 'rackcode/expr':
+               genericAssertion ($argname, 'string0');
+               if ($sic[$argname] == '')
+                       return;
+               $parse = spotPayload ($sic[$argname], 'SYNT_EXPR');
+               if ($parse['result'] != 'ACK')
+                       throw new InvalidRequestArgException ($argname, $sic[$argname], 'RackCode parsing error');
+               break;
        default:
                throw new InvalidArgException ('argtype', $argtype); // comes not from user's input
        }
index f46089be23a420e21cc618d21ec1060410754e61..16760c9fda9b0d479911f7f964b49e2008484c80 100644 (file)
@@ -9010,10 +9010,11 @@ function renderVSTRulesEditor ($vst_id)
                finishPortlet();
 }
 
-function renderDeployQueue ($dqcode)
+function renderDeployQueue()
 {
        global $nextorder;
        $order = 'odd';
+       $dqcode = getBypassValue();
        $allq = get8021QDeployQueues();
        echo '<table cellspacing=0 cellpadding=5 align=center class=widetable>';
        echo '<tr><th>switch</th><th>age</th><th>';
index d417a59be15c60e7d20e4134bfe2c2d6b3a553af..72a484386169424e176e18c78438349fefca6de0 100644 (file)
@@ -631,7 +631,7 @@ $ophandler['vst']['8021qorder']['del'] = 'del8021QOrder';
 
 $page['dqueue']['parent'] = '8021q';
 $page['dqueue']['bypass'] = 'dqcode';
-$page['dqueue']['bypass_type'] = 'string';
+$page['dqueue']['bypass_type'] = 'enum/dqcode';
 $tab['dqueue']['default'] = 'View';
 $tabhandler['dqueue']['default'] = 'renderDeployQueue';