Skip to content

Commit

Permalink
Updates for 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xtophe38 committed Jan 4, 2022
1 parent 125c651 commit 5d0d751
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions teemip-zone-mgmt/src/Model/_Zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Dict;
use DisplayBlock;
use DNSObject;
use iTopWebPage;
use MetaModel;
use TeemIp\TeemIp\Extension\Framework\Helper\IPUtils;
use utils;
Expand Down Expand Up @@ -61,16 +62,14 @@ public function DoCheckToWrite() {
$sMapping = $this->Get('mapping');
if ($sMapping == 'ipv4reverse') {
$sPattern = '/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){1,3}in-addr\.arpa\.$/';
$aMatches = array();
if (!preg_match($sPattern, $sName, $aMatches)) {
if (!preg_match($sPattern, $sName)) {
$this->m_aCheckIssues[] = Dict::Format('UI:ZoneManagement:Action:New:Zone:V4:WrongFormat');

return;
}
} elseif ($sMapping == 'ipv6reverse') {
$sPattern = '/^((\d|[a-f]|[A-F])\.){1,31}ip6\.arpa\.$/';
$aMatches = array();
if (!preg_match($sPattern, $sName, $aMatches)) {
if (!preg_match($sPattern, $sName)) {
$this->m_aCheckIssues[] = Dict::Format('UI:ZoneManagement:Action:New:Zone:V6:WrongFormat');

return;
Expand All @@ -81,16 +80,19 @@ public function DoCheckToWrite() {
/**
* Displays data file
*
* @param \WebPage $oP
* @param \iTopWebPage $oP
* @param $aParams
*
* @return void
* @throws \ApplicationException
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \DictExceptionMissingString
* @throws \MySQLException
* @throws \OQLException
*/
public function DisplayDataFile(WebPage $oP, $aParams = array()) {
public function DisplayDataFile(iTopWebPage $oP, $aParams = array()) {
$this->DisplayBareTab($oP, 'UI:ZoneManagement:Action:DataFileDisplay:');

if ($this->Get('mapping') == 'direct') {
Expand Down Expand Up @@ -130,9 +132,11 @@ public function DisplayDataFile(WebPage $oP, $aParams = array()) {
// Adjust the size of the block
$oP->add_ready_script(" $('#zonedatafile>textarea').height($('#zonedatafile').parent().height() - 220).width( $('#zonedatafile').parent().width() - 30);");
} else {
$sUITitle = Dict::Format('UI:ZoneManagement:Action:DataFileDisplay:Zone:PageTitle_Object_Class', 'Zone', $this->GetName());
$oP->SetBreadCrumbEntry($sUITitle, $sUITitle, '', '', 'fa fa-file', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES);
$oP->add(<<<HTML
<div id="zonedatafile" class="ibo-is-code">
<pre>{$sHtml}</pre>
<pre>$sHtml</pre>
</div>
HTML
);
Expand Down

0 comments on commit 5d0d751

Please sign in to comment.