Changeset 983


Ignore:
Timestamp:
Apr 22, 2026, 10:11:45 PM (4 hours ago)
Author:
chronos
Message:
  • Fixed: IS form unknown items error handling.
  • Modified: Ping redirection to Inext local network.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r981 r983  
    11<?php
    22
    3 $Revision = 981; // Subversion revision
     3$Revision = 983; // Subversion revision
    44$DatabaseRevision = 970; // SQL structure revision
    5 $ReleaseTime = strtotime('2026-12-01');
     5$ReleaseTime = strtotime('2026-04-22');
  • trunk/Common/Form/Form.php

    r948 r983  
    210210      else $SourceTable = '`'.$this->Definition['Table'].'` AS `TX`';
    211211    $DbResult = $this->Database->query('SELECT '.$Columns.' FROM '.$SourceTable.' WHERE `TX`.`Id`='.$Id);
    212     $DbRow = $DbResult->fetch_array();
    213     foreach ($this->Definition['Items'] as $Index => $Item)
    214     {
    215       if (!array_key_exists($Item['Type'], $this->FormManager->FormTypes) or
    216       (array_key_exists($Item['Type'], $this->FormManager->FormTypes) and
    217       ($this->FormManager->FormTypes[$Item['Type']]['Type'] != 'ManyToOne')))
    218       {
    219         $UseType = $this->GetItemType($Item);
    220         $this->Values[$Index] = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'OnLoadDb',
    221           array('Value' => $DbRow[$Index], 'Name' => $Index,
    222           'Type' => $Item['Type'], 'Values' => $this->Values));
    223         $this->ValuesFilter[$Index] = $DbRow[$Index.'_Filter'];
    224       }
    225     }
     212    if ($DbResult->num_rows == 1)
     213    {
     214      $DbRow = $DbResult->fetch_array();
     215     foreach ($this->Definition['Items'] as $Index => $Item)
     216      {
     217        if (!array_key_exists($Item['Type'], $this->FormManager->FormTypes) or
     218        (array_key_exists($Item['Type'], $this->FormManager->FormTypes) and
     219        ($this->FormManager->FormTypes[$Item['Type']]['Type'] != 'ManyToOne')))
     220        {
     221          $UseType = $this->GetItemType($Item);
     222          $this->Values[$Index] = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'OnLoadDb',
     223            array('Value' => $DbRow[$Index], 'Name' => $Index,
     224            'Type' => $Item['Type'], 'Values' => $this->Values));
     225          $this->ValuesFilter[$Index] = $DbRow[$Index.'_Filter'];
     226        }
     227      }
     228    } else throw new Exception('Item '.$Id.' not found');
    226229  }
    227230
  • trunk/Modules/IS/IS.php

    r980 r983  
    464464    $Form->SetClass($Table);
    465465    $this->Title .= ' - '.$Form->Definition['Title'].' položka';
    466     $Form->LoadValuesFromDatabase($Id);
     466    try
     467    {
     468      $Form->LoadValuesFromDatabase($Id);
     469    } catch (Exception $E)
     470    {
     471      return $this->SystemMessage('Chyba', 'Položka '.$Id.' nenalezena.');
     472    }
    467473    $Form->OnSubmit = '?a=view';
    468474    $Output = $Form->ShowViewForm();
  • trunk/Modules/NetworkConfigRouterOS/Generators/FirewallNAT.php

    r929 r983  
    3535    //$Items[] = array('chain' => 'inet-out', 'dst-address' => '172.16.1.1/30', 'action' => 'accept', 'comment' => 'Local_subnet');
    3636    //$Items[] = array('chain' => 'inet-in', 'dst-address' => '172.16.1.1/30', 'action' => 'accept', 'comment' => 'Local_subnet');
     37
     38    // Redirect ping from warp to inext test network
     39    $Items[] = array('chain' => 'inet-out', 'src-address' => '10.145.64.23', 'dst-address' => '172.20.195.192/29', 'protocol' => 'icmp',
     40      'action' => 'src-nat', 'to-addresses' => '172.20.195.197', 'comment' => 'warp_ping_inext');
    3741
    3842    $DbResult = $this->Database->query('SELECT `Member`.*, `Subject`.`Name` FROM `Member` '.
Note: See TracChangeset for help on using the changeset viewer.