<commit_before><?php
##
## Copyright 2013-2018 Opera Software AS
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
$active_user = $this->get('active_user');
$zones = $this->get('zones');
$replication_types = $this->get('replication_types');
$soa_templates = $this->get('soa_templates');
$ns_templates = $this->get('ns_templates');
$dnssec_enabled = $this->get('dnssec_enabled');
$zone_types = array('forward' => array(), 'reverse4' => array(), 'reverse6' => array());
$accounts = array();
foreach($zones as $zone) {
	if(substr($zone->name, -14) == '.in-addr.arpa.') {
		$zone_types['reverse4'][] = $zone;
	} elseif(substr($zone->name, -10) == '.ip6.arpa.') {
		$zone_types['reverse6'][] = $zone;
	} else {
		$zone_types['forward'][] = $zone;
	}
	if($account = $zone->account) {
		$accounts[$account] = $account;
	}
}
?>
<h1>Zones</h1>
<ul class="nav nav-tabs" role="tablist">
	<li role="presentation" class="active"><a href="#forward" aria-controls="forward" role="tab" data-toggle="tab">Forward zones <span class="badge"><?= count($zone_types['forward']); ?></span></a></li>
	<li role="presentation"><a href="#reverse4" aria-controls="reverse4" role="tab" data-toggle="tab">Reverse zones IPv4 <span class="badge"><?= count($zone_types['reverse4']); ?></span></a></li>
	<li role="presentation"><a href="#reverse6" aria-controls="reverse6" role="tab" data-toggle="tab">Reverse zones IPv6 <span class="badge"><?= count($zone_types['reverse6']); ?></span></a></li>
	<?php if($active_user->admin) { ?>
	<li role="presentation"><a href="#create" aria-controls="create" role="tab" data-toggle="tab">Create zone</a></li>
	<?php } ?>
</ul>
<div class="tab-content">
	<div role="tabpanel" class="tab-pane active" id="forward">
		<h2 class="sr-only">Forward zones</h2>
		<?php if(count($zone_types['forward']) == 0) { ?>
		<p>There are no forward zones defined.</p>
		<?php } else { ?>
		<table class="table table-bordered table-condensed table-hover zonelist">
			<thead>
				<tr>
					<th>Zone name</th>
					<th>Serial</th>
					<th>Replication type</th>
					<th>Classification</th>
					<?php if($dnssec_enabled) { ?>
					<th>DNSSEC</th>
					<?php } ?>
				</tr>
			</thead>
			<tbody>
				<?php foreach($zone_types['forward'] as $zone) { ?>
				<tr>
					<td class="name"><a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>"><?php out(DNSZoneName::unqualify(punycode_to_utf8($zone->name)))?></a></td>
					<td><?php out($zone->serial)?></td>
					<td><?php out($zone->kind)?></td>
					<td><?php out($zone->account)?></td>
					<?php if($dnssec_enabled) { ?>
					<td<?php if($zone->dnssec) out(' class="success"', ESC_NONE) ?>><?php out($zone->dnssec ? 'Enabled' : 'Disabled')?></td><commit_msg>Forgot to maintain the coding standard with last contribution<commit_after><?php
##
## Copyright 2013-2018 Opera Software AS
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
$active_user = $this->get('active_user');
$zones = $this->get('zones');
$replication_types = $this->get('replication_types');
$soa_templates = $this->get('soa_templates');
$ns_templates = $this->get('ns_templates');
$dnssec_enabled = $this->get('dnssec_enabled');
$zone_types = array('forward' => array(), 'reverse4' => array(), 'reverse6' => array());
$accounts = array();
foreach($zones as $zone) {
	if(substr($zone->name, -14) == '.in-addr.arpa.') {
		$zone_types['reverse4'][] = $zone;
	} elseif(substr($zone->name, -10) == '.ip6.arpa.') {
		$zone_types['reverse6'][] = $zone;
	} else {
		$zone_types['forward'][] = $zone;
	}
	if($account = $zone->account) {
		$accounts[$account] = $account;
	}
}
?>
<h1>Zones</h1>
<ul class="nav nav-tabs" role="tablist">
	<li role="presentation" class="active"><a href="#forward" aria-controls="forward" role="tab" data-toggle="tab">Forward zones <span class="badge"><?php out(count($zone_types['forward'])); ?></span></a></li>
	<li role="presentation"><a href="#reverse4" aria-controls="reverse4" role="tab" data-toggle="tab">Reverse zones IPv4 <span class="badge"><?php out(count($zone_types['reverse4'])); ?></span></a></li>
	<li role="presentation"><a href="#reverse6" aria-controls="reverse6" role="tab" data-toggle="tab">Reverse zones IPv6 <span class="badge"><?php out(count($zone_types['reverse6'])); ?></span></a></li>
	<?php if($active_user->admin) { ?>
	<li role="presentation"><a href="#create" aria-controls="create" role="tab" data-toggle="tab">Create zone</a></li>
	<?php } ?>
</ul>
<div class="tab-content">
	<div role="tabpanel" class="tab-pane active" id="forward">
		<h2 class="sr-only">Forward zones</h2>
		<?php if(count($zone_types['forward']) == 0) { ?>
		<p>There are no forward zones defined.</p>
		<?php } else { ?>
		<table class="table table-bordered table-condensed table-hover zonelist">
			<thead>
				<tr>
					<th>Zone name</th>
					<th>Serial</th>
					<th>Replication type</th>
					<th>Classification</th>
					<?php if($dnssec_enabled) { ?>
					<th>DNSSEC</th>
					<?php } ?>
				</tr>
			</thead>
			<tbody>
				<?php foreach($zone_types['forward'] as $zone) { ?>
				<tr>
					<td class="name"><a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>"><?php out(DNSZoneName::unqualify(punycode_to_utf8($zone->name)))?></a></td>
					<td><?php out($zone->serial)?></td>
					<td><?php out($zone->kind)?></td>
					<td><?php out($zone->account)?></td>
					<?php if($dnssec_enabled) { ?>
					<td<?php if($zone->dnssec) out(' class="success"', ESC_NONE) ?>><?php out($zone->dnssec ? 'Enabled' : 'Disabled')?></td>
{'fraction_non_alphanumeric': 0.2206400244985454, 'fraction_numerical': 0.010718113612004287, 'mean_word_length': 5.274735830931796, 'pattern_counts': {'":': 0, '<': 163, '<?xml version=': 0, '>': 203, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4470184', 'n_tokens_mistral': 2403, 'n_tokens_neox': 2229, 'n_words': 499}