--- /dev/null
+*.php
\ No newline at end of file
-<?php
-$driver = "mysql";
-$host = "localhost";
-$port = 3306;
-$user = "";
-$pass = "";
-$db = "";
+<?php\r
+$driver = "mysql";\r
+$host = "localhost";\r
+$port = 3306;\r
+$user = "";\r
+$pass = "";\r
+$db = "";\r
$tpl = "default";
\ No newline at end of file
INSERT INTO dns_options VALUES (10, 'dns_soa_expire', '604800');
INSERT INTO dns_options VALUES (11, 'dns_soa_minimum_ttl', '60');
INSERT INTO dns_options VALUES (12, 'enable_dnssec', '1');
+INSERT INTO dns_options VALUES (13, 'cache_source_type', 'disk');
INSERT INTO `dns_user` VALUES (1, 'admin', 'example@example.net', '$2a$08$XfcfTGc1LlmOHWUt/2sfNeFLEwqESy6wmrIIJMyQS1j5pwembqiae', '0', '2');
use dns\system\DNS;
session_start();
-
+ini_set('display_errors', 1);
+ini_set('error_reporting', E_ALL);
/**
* @author Jan Altensen (Stricted)
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
}
$.ajax({
- url: 'index.php?page=action',
+ url: 'index.php?Action',
data: {
action: action,
dataID: deleteID
$('#requestApiKey').unbind('click');
$("#requestApiKey").on('click', function(e){
$.ajax({
- url: 'index.php?page=action',
+ url: 'index.php?Action',
data: {
action: 'requestApiKey',
dataID: 1
}
$.ajax({
- url: 'index.php?page=action',
+ url: 'index.php?Action',
data: {
action: action,
dataID: dataID
var t = $(this);
var dataID = t.attr('export-id');
$.ajax({
- url: 'index.php?page=action',
+ url: 'index.php?Action',
data: {
action: 'export',
dataID: dataID
var origin = $('#importModal').find('.modal-body').find('#importOrigin').val();
var zone = $('#importModal').find('.modal-body').find('#importTextarea').val();
$.ajax({
- url: 'index.php?page=action',
+ url: 'index.php?Action',
data: {
action: 'import',
dataID: dataID ? dataID : 0, /* 0 for new zone otherwise soaID for existing zone*/
else {
if (!dataID) {
// redirect to main page on success
- $(location).attr('href','index.php?page=DomainList');
+ $(location).attr('href','index.php?DomainList');
}
else {
// redirect to record list on success
- $(location).attr('href','index.php?page=RecordList&id=' + dataID);
+ $(location).attr('href','index.php?RecordList/' + dataID);
}
}
}
<?php
-namespace dns\page;
+namespace dns\api\page;
use dns\page\AbstractPage;
+use dns\system\cache\builder\DNSApiCacheBuilder;
use dns\system\DNS;
/**
exit;
}
else {
- $data = array();
-
- $sql = "SELECT * FROM dns_soa where active = ?";
- $statement = DNS::getDB()->query($sql, array(1));
-
- while ($zone = DNS::getDB()->fetch_array($statement)) {
- $data[$zone['origin']] = array();
- $data[$zone['origin']]['soa'] = $zone;
- $data[$zone['origin']]['rr'] = array();
- $data[$zone['origin']]['sec'] = array();
-
- /* resource records */
- $sql2 = "SELECT * FROM dns_rr where zone = ? and active = ?";
- $statement2 = DNS::getDB()->query($sql2, array($zone['id'], 1));
- while ($rr = DNS::getDB()->fetch_array($statement2)) {
- $data[$zone['origin']]['rr'][] = $rr;
- }
-
- if (ENABLE_DNSSEC) {
- /* dnssec keys */
- $sql3 = "SELECT * FROM dns_sec where zone = ? and active = ?";
- $statement3 = DNS::getDB()->query($sql3, array($zone['id'], 1));
- while ($sec = DNS::getDB()->fetch_array($statement3)) {
- $data[$zone['origin']]['sec'][] = $sec;
- }
- }
- }
+ $data = DNSApiCacheBuilder::getInstance()->getData();
header('Content-Type: application/json');
echo json_encode($data, JSON_PRETTY_PRINT);
}
User::login(trim($_POST['username']), trim($_POST['password']), $remember);
- header("Location: ?page=index");
+ header("Location: index.php?index");
}
}
}
if (error_reporting() != 0) {
$type = 'error';
switch ($errorNo) {
- case 2: $type = 'warning';
+ case 2:
+ $type = 'warning';
break;
- case 8: $type = 'notice';
+ case 8:
+ $type = 'notice';
break;
}
require_once(DNS_DIR.'/lib/system/api/smarty/libs/Smarty.class.php');
self::$tplObj = new \Smarty;
- self::getTPL()->setTemplateDir(DNS_DIR.(empty(self::$module) ? '' : '/'.self::$module)."/templates/".$tpl);
+ if (!empty(self::$module)) {
+ // try first to load the template from module then from core
+ self::getTPL()->addTemplateDir(DNS_DIR.'/'.self::$module."/templates/".$tpl);
+ }
+
+ self::getTPL()->addTemplateDir(DNS_DIR."/templates/".$tpl);
self::getTPL()->setCompileDir(DNS_DIR.(empty(self::$module) ? '' : '/'.self::$module)."/templates/compiled/".$tpl);
self::getTPL()->setPluginsDir(array(
DNS_DIR."/lib/system/api/smarty/libs/plugins",
<?php
namespace dns\system;
+use dns\system\cache\builder\ControllerCacheBuilder;
/**
* @author Jan Altensen (Stricted)
* @copyright 2013-2015 Jan Altensen (Stricted)
*/
class RequestHandler {
+ protected $pattern = "";
+ protected $routeData = array();
+ protected $controllers = array();
+
/**
* init RequestHandler
*/
public function __construct ($module = '') {
- $className = "";
- $pages = glob(DNS_DIR.'/lib/'.(empty($module) ? '' : $module.'/').'page/*Page.class.php');
- if (isset($_GET["page"]) && !empty($_GET["page"])) {
- if (strtolower($_GET["page"]) != "abstract") {
- foreach ($pages as $page) {
- $page = str_replace('Page.class.php', '', basename($page));
- if (strtolower($_GET["page"]) == strtolower($page)) {
- $class = "\\dns".(empty($module) ? '' : "\\".$module)."\\page\\".$page."Page";
- if (class_exists($class) && is_subclass_of($class, '\\dns\\page\\AbstractPage')) {
- $className = $class;
- }
- break;
- }
- }
- }
+ $this->pattern = '~/?(?:(?P<controller>[A-Za-z0-9\-]+)(?:/(?P<id>\d+)(?:-(?P<title>[^/]+))?)?)?~x';
+ $this->getControllers($module);
+
+ if (DNS::getSession()->username !== null) {
+ DNS::getTPL()->assign(array("username" => DNS::getSession()->username));
}
else {
- $className = '\\dns'.(empty($module) ? '' : '\\'.$module).'\\page\\IndexPage';
+ DNS::getTPL()->assign(array("username" => ''));
}
- if (!User::isLoggedIn() && $className != '\dns\page\LoginPage' && $className != '\dns\page\ApiPage') {
- DNS::getTPL()->display('login.tpl');
- exit;
+ $className = "";
+ if (!empty($_SERVER['QUERY_STRING'])) {
+ $this->matches($_SERVER['QUERY_STRING']);
+ $this->registerRouteData();
+ }
+ else {
+ $className = '\\dns'.(empty($module) ? '' : '\\'.$module).'\\page\\IndexPage';
}
- if (DNS::getSession()->username !== null) {
- DNS::getTPL()->assign(array("username" => DNS::getSession()->username));
+ if (isset($this->routeData['controller']) && !empty($this->routeData['controller'])) {
+ $controller = strtolower($this->routeData['controller']);
+ if (isset($this->controllers[$controller]) && !empty($this->controllers[$controller])) {
+ $className = $this->controllers[$controller];
+ }
+ else {
+ @header('HTTP/1.0 404 Not Found');
+ DNS::getTPL()->assign(array("activeMenuItem" => '', "error" => 'The link you are trying to reach is no longer available or invalid.'));
+ DNS::getTPL()->display('error.tpl');
+ exit;
+ }
}
- if (empty($className)) {
- @header('HTTP/1.0 404 Not Found');
- DNS::getTPL()->assign(array("activeMenuItem" => '', "error" => 'The link you are trying to reach is no longer available or invalid.'));
- DNS::getTPL()->display('error.tpl');
+ if (!User::isLoggedIn() && $className != '\dns\page\LoginPage' && $className != '\dns\page\ApiPage') {
+ DNS::getTPL()->display('login.tpl');
exit;
}
exit;
}
}
+
+ /**
+ * Registers route data within $_GET and $_REQUEST.
+ */
+ protected function registerRouteData() {
+ foreach ($this->routeData as $key => $value) {
+ $_GET[$key] = $value;
+ $_REQUEST[$key] = $value;
+ }
+ }
+
+ public function getControllers ($module) {
+
+ $this->controllers = ControllerCacheBuilder::getInstance()->getData(array('module' => $module));
+ /*
+ $pages = glob(DNS_DIR.'/lib/'.(empty($module) ? '' : $module.'/').'page/*Page.class.php');
+
+ foreach ($pages as $page) {
+ $page = str_replace('Page.class.php', '', basename($page));
+
+ $class = "\\dns".(empty($module) ? '' : "\\".$module)."\\page\\".$page."Page";
+ if (class_exists($class) && is_subclass_of($class, '\\dns\\page\\AbstractPage')) {
+ $this->controllers[strtolower($page)] = $class;
+ }
+ }
+ */
+ }
+
+ public function matches($requestURL) {
+ if (preg_match($this->pattern, $requestURL, $matches)) {
+ foreach ($matches as $key => $value) {
+ if (!is_numeric($key)) {
+ $this->routeData[$key] = $value;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
}
--- /dev/null
+<?php
+namespace dns\system;
+
+/**
+ * Basis class for singleton classes.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system
+ * @category Community Framework
+ */
+abstract class SingletonFactory {
+ /**
+ * list of singletons
+ * @var array<SingletonFactory>
+ */
+ protected static $__singletonObjects = array();
+
+ /**
+ * Singletons do not support a public constructor. Override init() if
+ * your class needs to initialize components on creation.
+ */
+ protected final function __construct() {
+ $this->init();
+ }
+
+ /**
+ * Called within __construct(), override if neccessary.
+ */
+ protected function init() { }
+
+ /**
+ * Object cloning is disallowed.
+ */
+ protected final function __clone() { }
+
+ /**
+ * Object serializing is disallowed.
+ */
+ public final function __sleep() {
+ throw new \Exception('Serializing of Singletons is not allowed');
+ }
+
+ /**
+ * Returns an unique instance of current child class.
+ *
+ * @return \dns\system\SingletonFactory
+ */
+ public static final function getInstance() {
+ $className = get_called_class();
+ if (!array_key_exists($className, self::$__singletonObjects)) {
+ self::$__singletonObjects[$className] = null;
+ self::$__singletonObjects[$className] = new $className();
+ }
+ else if (self::$__singletonObjects[$className] === null) {
+ throw new \Exception("Infinite loop detected while trying to retrieve object for '".$className."'");
+ }
+
+ return self::$__singletonObjects[$className];
+ }
+
+ /**
+ * Returns whether this singleton is already initialized.
+ *
+ * @return boolean
+ */
+ public static final function isInitialized() {
+ $className = get_called_class();
+
+ return isset(self::$__singletonObjects[$className]);
+ }
+}
-<?php\r
-namespace dns\system;\r
-\r
-/**\r
- * A SystemException is thrown when an unexpected error occurs.\r
- * \r
- * @author Marcel Werk\r
- * @copyright 2001-2015 WoltLab GmbH\r
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>\r
- * @package com.woltlab.wcf\r
- * @subpackage system.exception\r
- * @category Community Framework\r
- */\r
-// @codingStandardsIgnoreFile\r
-class SystemException extends \Exception {\r
- /**\r
- * error description\r
- * @var string\r
- */\r
- protected $description = null;\r
- \r
- /**\r
- * additional information\r
- * @var string\r
- */\r
- protected $information = '';\r
- \r
- /**\r
- * additional information\r
- * @var string\r
- */\r
- protected $functions = '';\r
- \r
- /**\r
- * exception id\r
- * @var string\r
- */\r
- protected $exceptionID = '';\r
- \r
- /**\r
- * Creates a new SystemException.\r
- * \r
- * @param string $message error message\r
- * @param integer $code error code\r
- * @param string $description description of the error\r
- * @param \Exception $previous repacked Exception\r
- */\r
- public function __construct($message = '', $code = 0, $description = '', \Exception $previous = null) {\r
- parent::__construct((string) $message, (int) $code, $previous);\r
- $this->description = $description;\r
- }\r
- \r
- /**\r
- * Removes database password from stack trace.\r
- * @see \Exception::getTraceAsString()\r
- */\r
- public function __getTraceAsString() {\r
- $e = ($this->getPrevious() ?: $this);\r
- $string = $e->getTraceAsString();\r
- $string = preg_replace('/PDO->__construct\(.*\)/', 'PDO->__construct(...)', $string);\r
- $string = preg_replace('/DB->__construct\(.*\)/', 'DB->__construct(...)', $string);\r
- return $string;\r
- }\r
- \r
- /**\r
- * @see \Exception::getMessage()\r
- */\r
- public function _getMessage() {\r
- $e = ($this->getPrevious() ?: $this);\r
- return $e->getMessage();\r
- }\r
- \r
- /**\r
- * Returns the description of this exception.\r
- * \r
- * @return string\r
- */\r
- public function getDescription() {\r
- return $this->description;\r
- }\r
- \r
- /**\r
- * Returns exception id\r
- * \r
- * @return string\r
- */\r
- public function getExceptionID() {\r
- if (empty($this->exceptionID)) {\r
- $this->logError();\r
- }\r
- \r
- return $this->exceptionID;\r
- }\r
- \r
- /**\r
- * Writes an error to log file.\r
- */\r
- protected function logError() {\r
- if (!empty($this->exceptionID)) {\r
- return;\r
- }\r
- \r
- $logFile = DNS_DIR . '/log/' . gmdate('Y-m-d', time()) . '.txt';\r
- \r
- // try to create file\r
- @touch($logFile);\r
- \r
- // validate if file exists and is accessible for us\r
- if (!file_exists($logFile) || !is_writable($logFile)) {\r
- /*\r
- We cannot recover if we reached this point, the server admin\r
- is urged to fix his pretty much broken configuration.\r
- \r
- GLaDOS: Look at you, sailing through the air majestically, like an eagle... piloting a blimp.\r
- */\r
- return;\r
- }\r
- \r
- $e = ($this->getPrevious() ?: $this);\r
- \r
- // don't forget to update ExceptionLogViewPage, when changing the log file format\r
- $message = gmdate('r', time())."\n".\r
- 'Message: '.$e->getMessage()."\n".\r
- 'File: '.$e->getFile().' ('.$e->getLine().")\n".\r
- 'PHP version: '.phpversion()."\n".\r
- 'DNS version: '.DNS_VERSION."\n".\r
- 'Request URI: '.(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '')."\n".\r
- 'Referrer: '.(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')."\n".\r
- 'User-Agent: '.(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '')."\n".\r
- 'Information: '.json_encode($this->information)."\n".\r
- "Stacktrace: \n ".implode("\n ", explode("\n", $this->__getTraceAsString()))."\n";\r
- \r
- // calculate Exception-ID\r
- $this->exceptionID = sha1($message);\r
- $message = "<<<<<<<<".$this->exceptionID."<<<<\n".$message."<<<<\n\n";\r
- \r
- // append\r
- @file_put_contents($logFile, $message, FILE_APPEND);\r
- }\r
- \r
- /**\r
- * @see \wcf\system\exception\IPrintableException::show()\r
- */\r
- public function show() {\r
- // send status code\r
- @header('HTTP/1.1 503 Service Unavailable');\r
- \r
- // print report\r
- $e = ($this->getPrevious() ?: $this);\r
- ?><!DOCTYPE html>\r
- <html>\r
- <head>\r
- <title>Fatal error: <?php echo htmlspecialchars($this->_getMessage(), ENT_COMPAT, 'UTF-8'); ?></title>\r
- <meta charset="utf-8" />\r
- <style>\r
- .systemException {\r
- font-family: 'Trebuchet MS', Arial, sans-serif !important;\r
- font-size: 80% !important;\r
- text-align: left !important;\r
- border: 1px solid #036;\r
- border-radius: 7px;\r
- background-color: #eee !important;\r
- overflow: auto !important;\r
- }\r
- .systemException h1 {\r
- font-size: 130% !important;\r
- font-weight: bold !important;\r
- line-height: 1.1 !important;\r
- text-decoration: none !important;\r
- text-shadow: 0 -1px 0 #003 !important;\r
- color: #fff !important;\r
- word-wrap: break-word !important;\r
- border-bottom: 1px solid #036;\r
- border-top-right-radius: 6px;\r
- border-top-left-radius: 6px;\r
- background-color: #369 !important;\r
- margin: 0 !important;\r
- padding: 5px 10px !important;\r
- }\r
- .systemException div {\r
- border-top: 1px solid #fff;\r
- border-bottom-right-radius: 6px;\r
- border-bottom-left-radius: 6px;\r
- padding: 0 10px !important;\r
- }\r
- .systemException h2 {\r
- font-size: 130% !important;\r
- font-weight: bold !important;\r
- color: #369 !important;\r
- text-shadow: 0 1px 0 #fff !important;\r
- margin: 5px 0 !important;\r
- }\r
- .systemException pre, .systemException p {\r
- text-shadow: none !important;\r
- color: #555 !important;\r
- margin: 0 !important;\r
- }\r
- .systemException pre {\r
- font-size: .85em !important;\r
- font-family: "Courier New" !important;\r
- text-overflow: ellipsis;\r
- padding-bottom: 1px;\r
- overflow: hidden !important;\r
- }\r
- .systemException pre:hover{\r
- text-overflow: clip;\r
- overflow: auto !important;\r
- }\r
- </style>\r
- </head>\r
- <body>\r
- <div class="systemException">\r
- <h1>Fatal error: <?php if(!$this->getExceptionID()) { ?>Unable to write log file, please make "<?php echo DNS_DIR; ?>/log/" writable!<?php } else { echo htmlspecialchars($this->_getMessage(), ENT_COMPAT, 'UTF-8'); } ?></h1>\r
- \r
- <?php if (DNS::debugModeIsEnabled()) { ?>\r
- <div>\r
- <?php if ($this->getDescription()) { ?><p><br /><?php echo $this->getDescription(); ?></p><?php } ?>\r
- \r
- <h2>Information:</h2>\r
- <p>\r
- <b>error message:</b> <?php echo htmlspecialchars($this->_getMessage(), ENT_COMPAT, 'UTF-8'); ?><br>\r
- <b>error code:</b> <?php echo intval($e->getCode()); ?><br>\r
- <?php echo $this->information; ?>\r
- <b>file:</b> <?php echo htmlspecialchars($e->getFile(), ENT_COMPAT, 'UTF-8'); ?> (<?php echo $e->getLine(); ?>)<br>\r
- <b>php version:</b> <?php echo htmlspecialchars(phpversion(), ENT_COMPAT, 'UTF-8'); ?><br>\r
- <b>dns version:</b> <?php echo DNS_VERSION; ?><br>\r
- <b>date:</b> <?php echo gmdate('r'); ?><br>\r
- <b>request:</b> <?php if (isset($_SERVER['REQUEST_URI'])) echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_COMPAT, 'UTF-8'); ?><br>\r
- <b>referer:</b> <?php if (isset($_SERVER['HTTP_REFERER'])) echo htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8'); ?><br>\r
- </p>\r
- \r
- <h2>Stacktrace:</h2>\r
- <pre><?php echo htmlspecialchars($this->__getTraceAsString(), ENT_COMPAT, 'UTF-8'); ?></pre>\r
- </div>\r
- <?php } else { ?>\r
- <div>\r
- <h2>Information:</h2>\r
- <p>\r
- <?php if (!$this->getExceptionID()) { ?>\r
- Unable to write log file, please make "<?php echo DNS_DIR; ?>/log/" writable!\r
- <?php } else { ?>\r
- <b>ID:</b> <code><?php echo $this->getExceptionID(); ?></code><br>\r
- Please send the ID above to the site administrator.\r
- <?php } ?>\r
- </p>\r
- </div>\r
- <?php } ?>\r
- <?php echo $this->functions; ?>\r
- </div>\r
- </body>\r
- </html>\r
- \r
- <?php\r
- }\r
-}\r
+<?php
+namespace dns\system;
+
+/**
+ * A SystemException is thrown when an unexpected error occurs.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2015 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.exception
+ * @category Community Framework
+ */
+// @codingStandardsIgnoreFile
+class SystemException extends \Exception {
+ /**
+ * error description
+ * @var string
+ */
+ protected $description = null;
+
+ /**
+ * additional information
+ * @var string
+ */
+ protected $information = '';
+
+ /**
+ * additional information
+ * @var string
+ */
+ protected $functions = '';
+
+ /**
+ * exception id
+ * @var string
+ */
+ protected $exceptionID = '';
+
+ /**
+ * Creates a new SystemException.
+ *
+ * @param string $message error message
+ * @param integer $code error code
+ * @param string $description description of the error
+ * @param \Exception $previous repacked Exception
+ */
+ public function __construct($message = '', $code = 0, $description = '', \Exception $previous = null) {
+ parent::__construct((string) $message, (int) $code, $previous);
+ $this->description = $description;
+ }
+
+ /**
+ * Removes database password from stack trace.
+ * @see \Exception::getTraceAsString()
+ */
+ public function __getTraceAsString() {
+ $e = ($this->getPrevious() ?: $this);
+ $string = $e->getTraceAsString();
+ $string = preg_replace('/PDO->__construct\(.*\)/', 'PDO->__construct(...)', $string);
+ $string = preg_replace('/DB->__construct\(.*\)/', 'DB->__construct(...)', $string);
+ return $string;
+ }
+
+ /**
+ * @see \Exception::getMessage()
+ */
+ public function _getMessage() {
+ $e = ($this->getPrevious() ?: $this);
+ return $e->getMessage();
+ }
+
+ /**
+ * Returns the description of this exception.
+ *
+ * @return string
+ */
+ public function getDescription() {
+ return $this->description;
+ }
+
+ /**
+ * Returns exception id
+ *
+ * @return string
+ */
+ public function getExceptionID() {
+ if (empty($this->exceptionID)) {
+ $this->logError();
+ }
+
+ return $this->exceptionID;
+ }
+
+ /**
+ * Writes an error to log file.
+ */
+ protected function logError() {
+ if (!empty($this->exceptionID)) {
+ return;
+ }
+
+ $logFile = DNS_DIR . '/log/' . gmdate('Y-m-d', time()) . '.txt';
+
+ // try to create file
+ @touch($logFile);
+
+ // validate if file exists and is accessible for us
+ if (!file_exists($logFile) || !is_writable($logFile)) {
+ /*
+ We cannot recover if we reached this point, the server admin
+ is urged to fix his pretty much broken configuration.
+
+ GLaDOS: Look at you, sailing through the air majestically, like an eagle... piloting a blimp.
+ */
+ return;
+ }
+
+ $e = ($this->getPrevious() ?: $this);
+
+ // don't forget to update ExceptionLogViewPage, when changing the log file format
+ $message = gmdate('r', time())."\n".
+ 'Message: '.$e->getMessage()."\n".
+ 'File: '.$e->getFile().' ('.$e->getLine().")\n".
+ 'PHP version: '.phpversion()."\n".
+ 'DNS version: '.DNS_VERSION."\n".
+ 'Request URI: '.(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '')."\n".
+ 'Referrer: '.(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')."\n".
+ 'User-Agent: '.(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '')."\n".
+ 'Information: '.json_encode($this->information)."\n".
+ "Stacktrace: \n ".implode("\n ", explode("\n", $this->__getTraceAsString()))."\n";
+
+ // calculate Exception-ID
+ $this->exceptionID = sha1($message);
+ $message = "<<<<<<<<".$this->exceptionID."<<<<\n".$message."<<<<\n\n";
+
+ // append
+ @file_put_contents($logFile, $message, FILE_APPEND);
+ }
+
+ /**
+ * @see \wcf\system\exception\IPrintableException::show()
+ */
+ public function show() {
+ // send status code
+ @header('HTTP/1.1 503 Service Unavailable');
+
+ // print report
+ $e = ($this->getPrevious() ?: $this);
+ ?><!DOCTYPE html>
+ <html>
+ <head>
+ <title>Fatal error: <?php echo htmlspecialchars($this->_getMessage(), ENT_COMPAT, 'UTF-8'); ?></title>
+ <meta charset="utf-8" />
+ <style>
+ .systemException {
+ font-family: 'Trebuchet MS', Arial, sans-serif !important;
+ font-size: 80% !important;
+ text-align: left !important;
+ border: 1px solid #036;
+ border-radius: 7px;
+ background-color: #eee !important;
+ overflow: auto !important;
+ }
+ .systemException h1 {
+ font-size: 130% !important;
+ font-weight: bold !important;
+ line-height: 1.1 !important;
+ text-decoration: none !important;
+ text-shadow: 0 -1px 0 #003 !important;
+ color: #fff !important;
+ word-wrap: break-word !important;
+ border-bottom: 1px solid #036;
+ border-top-right-radius: 6px;
+ border-top-left-radius: 6px;
+ background-color: #369 !important;
+ margin: 0 !important;
+ padding: 5px 10px !important;
+ }
+ .systemException div {
+ border-top: 1px solid #fff;
+ border-bottom-right-radius: 6px;
+ border-bottom-left-radius: 6px;
+ padding: 0 10px !important;
+ }
+ .systemException h2 {
+ font-size: 130% !important;
+ font-weight: bold !important;
+ color: #369 !important;
+ text-shadow: 0 1px 0 #fff !important;
+ margin: 5px 0 !important;
+ }
+ .systemException pre, .systemException p {
+ text-shadow: none !important;
+ color: #555 !important;
+ margin: 0 !important;
+ }
+ .systemException pre {
+ font-size: .85em !important;
+ font-family: "Courier New" !important;
+ text-overflow: ellipsis;
+ padding-bottom: 1px;
+ overflow: hidden !important;
+ }
+ .systemException pre:hover{
+ text-overflow: clip;
+ overflow: auto !important;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="systemException">
+ <h1>Fatal error: <?php if(!$this->getExceptionID()) { ?>Unable to write log file, please make "<?php echo DNS_DIR; ?>/log/" writable!<?php } else { echo htmlspecialchars($this->_getMessage(), ENT_COMPAT, 'UTF-8'); } ?></h1>
+
+ <?php if (DNS::debugModeIsEnabled()) { ?>
+ <div>
+ <?php if ($this->getDescription()) { ?><p><br /><?php echo $this->getDescription(); ?></p><?php } ?>
+
+ <h2>Information:</h2>
+ <p>
+ <b>error message:</b> <?php echo htmlspecialchars($this->_getMessage(), ENT_COMPAT, 'UTF-8'); ?><br>
+ <b>error code:</b> <?php echo intval($e->getCode()); ?><br>
+ <?php echo $this->information; ?>
+ <b>file:</b> <?php echo htmlspecialchars($e->getFile(), ENT_COMPAT, 'UTF-8'); ?> (<?php echo $e->getLine(); ?>)<br>
+ <b>php version:</b> <?php echo htmlspecialchars(phpversion(), ENT_COMPAT, 'UTF-8'); ?><br>
+ <b>dns version:</b> <?php echo DNS_VERSION; ?><br>
+ <b>date:</b> <?php echo gmdate('r'); ?><br>
+ <b>request:</b> <?php if (isset($_SERVER['REQUEST_URI'])) echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_COMPAT, 'UTF-8'); ?><br>
+ <b>referer:</b> <?php if (isset($_SERVER['HTTP_REFERER'])) echo htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8'); ?><br>
+ </p>
+
+ <h2>Stacktrace:</h2>
+ <pre><?php echo htmlspecialchars($this->__getTraceAsString(), ENT_COMPAT, 'UTF-8'); ?></pre>
+ </div>
+ <?php } else { ?>
+ <div>
+ <h2>Information:</h2>
+ <p>
+ <?php if (!$this->getExceptionID()) { ?>
+ Unable to write log file, please make "<?php echo DNS_DIR; ?>/log/" writable!
+ <?php } else { ?>
+ <b>ID:</b> <code><?php echo $this->getExceptionID(); ?></code><br>
+ Please send the ID above to the site administrator.
+ <?php } ?>
+ </p>
+ </div>
+ <?php } ?>
+ <?php echo $this->functions; ?>
+ </div>
+ </body>
+ </html>
+
+ <?php
+ }
+}
DNS::getSession()->register('username', $row["username"]);
DNS::getSession()->register('userID', $row["userID"]);
DNS::getSession()->register('status', intval($row["status"]));
-
+ DNS::getSession()->register('csrf_token', DNS::generateRandomID());
return true;
}
}
return false;
}
+ public static function getSecurityToken () {
+ return DNS::getSession()->csrf_token;
+ }
+
/**
* login the user
*
DNS::getSession()->register('username', $row["username"]);
DNS::getSession()->register('userID', $row["userID"]);
DNS::getSession()->register('status', intval($row["status"]));
+ DNS::getSession()->register('csrf_token', DNS::generateRandomID());
if ($remember === true) {
$sha1UserID = sha1($row["userID"]);
-Subproject commit 4537d8aae6c4a26f5439bc3a05d3437d25c2c4d2
+Subproject commit 35480f10e7ce9b0fdaf23d3799d7b79463919b1e
--- /dev/null
+<?php
+namespace dns\system\cache;
+use dns\system\cache\builder\ICacheBuilder;
+use dns\system\cache\source\DiskCacheSource;
+use dns\system\SingletonFactory;
+
+define('CACHE_SOURCE_TYPE', 'disk');
+
+/**
+ * Manages transparent cache access.
+ *
+ * @author Alexander Ebert, Marcel Werk
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.cache
+ * @category Community Framework
+ */
+class CacheHandler extends SingletonFactory {
+ /**
+ * cache source object
+ * @var \dns\system\cache\source\ICacheSource
+ */
+ protected $cacheSource = null;
+
+ /**
+ * Creates a new CacheHandler object.
+ */
+ protected function init() {
+ // init cache source object
+ try {
+ $className = 'dns\system\cache\source\\'.ucfirst(CACHE_SOURCE_TYPE).'CacheSource';
+ if (class_exists($className)) {
+ $this->cacheSource = new $className();
+ }
+ else {
+ // fallback to disk cache
+ $this->cacheSource = new DiskCacheSource();
+ }
+ }
+ catch (\Exception $e) {
+ if (CACHE_SOURCE_TYPE != 'disk') {
+ // fallback to disk cache
+ $this->cacheSource = new DiskCacheSource();
+ }
+ else {
+ throw $e;
+ }
+ }
+ }
+
+ /**
+ * Flush cache for given resource.
+ *
+ * @param \dns\system\cache\builder\ICacheBuilder $cacheBuilder
+ * @param array $parameters
+ */
+ public function flush(ICacheBuilder $cacheBuilder, array $parameters) {
+ $this->getCacheSource()->flush($this->getCacheName($cacheBuilder, $parameters), empty($parameters));
+ }
+
+ /**
+ * Flushes the entire cache.
+ */
+ public function flushAll() {
+ $this->getCacheSource()->flushAll();
+ }
+
+ /**
+ * Returns cached value for given resource, false if no cache exists.
+ *
+ * @param \dns\system\cache\builder\ICacheBuilder $cacheBuilder
+ * @param array $parameters
+ * @return mixed
+ */
+ public function get(ICacheBuilder $cacheBuilder, array $parameters) {
+ return $this->getCacheSource()->get($this->getCacheName($cacheBuilder, $parameters), $cacheBuilder->getMaxLifetime());
+ }
+
+ /**
+ * Caches a value for given resource,
+ *
+ * @param \dns\system\cache\builder\ICacheBuilder $cacheBuilder
+ * @param array $parameters
+ * @param array $data
+ */
+ public function set(ICacheBuilder $cacheBuilder, array $parameters, array $data) {
+ $this->getCacheSource()->set($this->getCacheName($cacheBuilder, $parameters), $data, $cacheBuilder->getMaxLifetime());
+ }
+
+ /**
+ * Returns cache index hash.
+ *
+ * @param array $parameters
+ * @return string
+ */
+ public function getCacheIndex(array $parameters) {
+ return sha1(serialize($this->orderParameters($parameters)));
+ }
+
+ /**
+ * Builds cache name.
+ *
+ * @param \dns\system\cache\builder\ICacheBuilder $cacheBuilder
+ * @param array $parameters
+ * @return string
+ */
+ protected function getCacheName(ICacheBuilder $cacheBuilder, array $parameters = array()) {
+ $className = explode('\\', get_class($cacheBuilder));
+ $cacheName = str_replace('CacheBuilder', '', array_pop($className));
+ if (!empty($parameters)) {
+ $cacheName .= '-' . $this->getCacheIndex($parameters);
+ }
+
+ return ucfirst($cacheName);
+ }
+
+ /**
+ * Returns the cache source object.
+ *
+ * @return \dns\system\cache\source\ICacheSource
+ */
+ public function getCacheSource() {
+ return $this->cacheSource;
+ }
+
+ /**
+ * Unifys parameter order, numeric indizes will be discarded.
+ *
+ * @param array $parameters
+ * @return array
+ */
+ protected function orderParameters($parameters) {
+ if (!empty($parameters)) {
+ array_multisort($parameters);
+ }
+
+ return $parameters;
+ }
+}
--- /dev/null
+<?php
+namespace dns\system\cache\builder;
+use dns\system\cache\CacheHandler;
+use dns\system\SingletonFactory;
+
+/**
+ * Default implementation for cache builders.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.cache.builder
+ * @category Community Framework
+ */
+abstract class AbstractCacheBuilder extends SingletonFactory implements ICacheBuilder {
+ /**
+ * list of cache resources by index
+ * @var array<array>
+ */
+ protected $cache = array();
+
+ /**
+ * maximum cache lifetime in seconds, '0' equals infinite
+ * @var integer
+ */
+ protected $maxLifetime = 0;
+
+ /**
+ * @see \dns\system\cache\builder\ICacheBuilder::getData()
+ */
+ public function getData(array $parameters = array(), $arrayIndex = '') {
+ $index = CacheHandler::getInstance()->getCacheIndex($parameters);
+
+ if (!isset($this->cache[$index])) {
+ // fetch cache or rebuild if missing
+ $this->cache[$index] = CacheHandler::getInstance()->get($this, $parameters);
+ if ($this->cache[$index] === null) {
+ $this->cache[$index] = $this->rebuild($parameters);
+
+ // update cache
+ CacheHandler::getInstance()->set($this, $parameters, $this->cache[$index]);
+ }
+ }
+
+ if (!empty($arrayIndex)) {
+ if (!isset($this->cache[$index][$arrayIndex])) {
+ throw new \Exception("array index '".$arrayIndex."' does not exist in cache resource");
+ }
+
+ return $this->cache[$index][$arrayIndex];
+ }
+
+ return $this->cache[$index];
+ }
+
+ /**
+ * @see \dns\system\cache\builder\ICacheBuilder::getMaxLifetime()
+ */
+ public function getMaxLifetime() {
+ return $this->maxLifetime;
+ }
+
+ /**
+ * @see \dns\system\cache\builder\ICacheBuilder::reset()
+ */
+ public function reset(array $parameters = array()) {
+ CacheHandler::getInstance()->flush($this, $parameters);
+ }
+
+ /**
+ * Rebuilds cache for current resource.
+ *
+ * @param array $parameters
+ */
+ abstract protected function rebuild(array $parameters);
+}
--- /dev/null
+<?php
+namespace dns\system\cache\builder;
+use dns\system\DNS;
+
+/**
+ * @author Jan Altensen (Stricted)
+ * @copyright 2013-2015 Jan Altensen (Stricted)
+ */
+class ControllerCacheBuilder extends AbstractCacheBuilder {
+ /**
+ * @see \dns\system\cache\builder\AbstractCacheBuilder::$maxLifetime
+ */
+ protected $maxLifetime = 3600;
+
+ /**
+ * @see \dns\system\cache\builder\AbstractCacheBuilder::rebuild()
+ */
+ public function rebuild(array $parameters) {
+ $data = array();
+
+ $pages = glob(DNS_DIR.'/lib/'.(empty($parameters['module']) ? '' : $parameters['module'].'/').'page/*Page.class.php');
+
+ foreach ($pages as $page) {
+ $page = str_replace('Page.class.php', '', basename($page));
+
+ $class = "\\dns".(empty($parameters['module']) ? '' : "\\".$parameters['module'])."\\page\\".$page."Page";
+ if (class_exists($class) && is_subclass_of($class, '\\dns\\page\\AbstractPage')) {
+ $data[strtolower($page)] = $class;
+ }
+ }
+
+ return $data;
+ }
+}
--- /dev/null
+<?php
+namespace dns\system\cache\builder;
+use dns\system\DNS;
+
+/**
+ * @author Jan Altensen (Stricted)
+ * @copyright 2013-2015 Jan Altensen (Stricted)
+ */
+class DNSApiCacheBuilder extends AbstractCacheBuilder {
+ /**
+ * @see \dns\system\cache\builder\AbstractCacheBuilder::$maxLifetime
+ */
+ protected $maxLifetime = 30;
+
+ /**
+ * @see \dns\system\cache\builder\AbstractCacheBuilder::rebuild()
+ */
+ public function rebuild(array $parameters) {
+ $data = array();
+
+ $sql = "SELECT * FROM dns_soa where active = ?";
+ $statement = DNS::getDB()->query($sql, array(1));
+
+ while ($zone = DNS::getDB()->fetch_array($statement)) {
+ $data[$zone['origin']] = array();
+ $data[$zone['origin']]['soa'] = $zone;
+ $data[$zone['origin']]['rr'] = array();
+ $data[$zone['origin']]['sec'] = array();
+
+ /* resource records */
+ $sql2 = "SELECT * FROM dns_rr where zone = ? and active = ?";
+ $statement2 = DNS::getDB()->query($sql2, array($zone['id'], 1));
+ while ($rr = DNS::getDB()->fetch_array($statement2)) {
+ $data[$zone['origin']]['rr'][] = $rr;
+ }
+
+ if (ENABLE_DNSSEC) {
+ /* dnssec keys */
+ $sql3 = "SELECT * FROM dns_sec where zone = ? and active = ?";
+ $statement3 = DNS::getDB()->query($sql3, array($zone['id'], 1));
+ while ($sec = DNS::getDB()->fetch_array($statement3)) {
+ $data[$zone['origin']]['sec'][] = $sec;
+ }
+ }
+ }
+
+ return $data;
+ }
+}
--- /dev/null
+<?php
+namespace dns\system\cache\builder;
+
+/**
+ * A cache builder provides data for the cache handler that ought to be cached.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.cache.builder
+ * @category Community Framework
+ */
+interface ICacheBuilder {
+ /**
+ * Returns the data that ought to be cached.
+ *
+ * @param array $parameters
+ * @param string $arrayIndex
+ * @return array
+ */
+ public function getData(array $parameters = array(), $arrayIndex = '');
+
+ /**
+ * Returns maximum lifetime for cache resource.
+ *
+ * @return integer
+ */
+ public function getMaxLifetime();
+
+ /**
+ * Flushes cache. If no parameters are given, all caches starting with
+ * the same cache name will be flushed too.
+ *
+ * @param array $parameters
+ */
+ public function reset(array $parameters = array());
+}
--- /dev/null
+<?php
+namespace dns\system\cache\source;
+
+/**
+ * DiskCacheSource is an implementation of CacheSource that stores the cache as simple files in the file system.
+ *
+ * @author Alexander Ebert, Marcel Werk
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.cache.source
+ * @category Community Framework
+ */
+class DiskCacheSource implements ICacheSource {
+ /**
+ * @see \dns\system\cache\source\ICacheSource::flush()
+ */
+ public function flush($cacheName, $useWildcard) {
+ if ($useWildcard) {
+ $this->removeFiles('cache.'.$cacheName.'*.php');
+ }
+ else {
+ $this->removeFiles('cache.'.$cacheName.'.php');
+ }
+ }
+
+ /**
+ * @see \dns\system\cache\source\ICacheSource::flushAll()
+ */
+ public function flushAll() {
+ $this->removeFiles('cache.*.php');
+ }
+
+ /**
+ * @see \dns\system\cache\source\ICacheSource::get()
+ */
+ public function get($cacheName, $maxLifetime) {
+ $filename = $this->getFilename($cacheName);
+ if ($this->needRebuild($filename, $maxLifetime)) {
+ return null;
+ }
+
+ // load cache
+ try {
+ return $this->readCache($cacheName, $filename);
+ }
+ catch (\Exception $e) {
+ return null;
+ }
+ }
+
+ /**
+ * @see \dns\system\cache\source\ICacheSource::set()
+ */
+ public function set($cacheName, $value, $maxLifetime) {
+ $filename = $this->getFilename($cacheName);
+ $content = "<?php exit; /* cache: ".$cacheName." (generated at ".gmdate('r').") DO NOT EDIT THIS FILE */ ?>\n";
+ $content .= serialize($value);
+
+ if (!file_exists($filename)) {
+ @touch($filename);
+ }
+
+ $handler = fOpen($filename, "a+");
+ fWrite($handler, $content);
+ fClose($handler);
+ }
+
+ /**
+ * Returns cache filename.
+ *
+ * @param string $cacheName
+ * @return string
+ */
+ protected function getFilename($cacheName) {
+ return DNS_DIR.'/cache/cache.'.$cacheName.'.php';
+ }
+
+ /**
+ * Removes files matching given pattern.
+ *
+ * @param string $pattern
+ */
+ protected function removeFiles($pattern) {
+ $directory = DNS_DIR.'cache/';
+
+ foreach (glob($directory.$pattern) as $filename) {
+ @unlink($filename);
+ }
+ }
+
+ /**
+ * Determines wheater the cache needs to be rebuild or not.
+ *
+ * @param string $filename
+ * @param integer $maxLifetime
+ * @return boolean
+ */
+ protected function needRebuild($filename, $maxLifetime) {
+ // cache does not exist
+ if (!file_exists($filename)) {
+ return true;
+ }
+
+ // cache is empty
+ if (!@filesize($filename)) {
+ return true;
+ }
+
+ // cache resource was marked as obsolete
+ if (($mtime = filemtime($filename)) <= 1) {
+ return true;
+ }
+
+ // maxlifetime expired
+ if ($maxLifetime > 0 && (time() - $mtime) > $maxLifetime) {
+ return true;
+ }
+
+ // do not rebuild cache
+ return false;
+ }
+
+ /**
+ * Loads the file of a cached resource.
+ *
+ * @param string $cacheName
+ * @param string $filename
+ * @return mixed
+ */
+ protected function readCache($cacheName, $filename) {
+ // get file contents
+ $contents = file_get_contents($filename);
+
+ // find first newline
+ $position = strpos($contents, "\n");
+ if ($position === false) {
+ throw new \Exception("Unable to load cache resource '".$cacheName."'");
+ }
+
+ // cut contents
+ $contents = substr($contents, $position + 1);
+
+ // unserialize
+ $value = @unserialize($contents);
+ if ($value === false) {
+ throw new \Exception("Unable to load cache resource '".$cacheName."'");
+ }
+
+ return $value;
+ }
+}
--- /dev/null
+<?php
+namespace dns\system\cache\source;
+
+/**
+ * Any cache sources should implement this interface.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.cache.source
+ * @category Community Framework
+ */
+interface ICacheSource {
+ /**
+ * Flushes a specific cache, optionally removing caches which share the same name.
+ *
+ * @param string $cacheName
+ * @param boolean $useWildcard
+ */
+ public function flush($cacheName, $useWildcard);
+
+ /**
+ * Clears the cache completely.
+ */
+ public function flushAll();
+
+ /**
+ * Returns a cached variable.
+ *
+ * @param string $cacheName
+ * @param integer $maxLifetime
+ * @return mixed
+ */
+ public function get($cacheName, $maxLifetime);
+
+ /**
+ * Stores a variable in the cache.
+ *
+ * @param string $cacheName
+ * @param mixed $value
+ * @param integer $maxLifetime
+ */
+ public function set($cacheName, $value, $maxLifetime);
+}
--- /dev/null
+<?php
+
+function smarty_block_link($params, $content, $template, &$repeat) {
+ if ($repeat) {
+ return;
+ }
+
+ if (!array_key_exists('controller', $params)) {
+ $params['controller'] = null;
+ }
+
+ if (!array_key_exists('id', $params)) {
+ $params['id'] = null;
+ }
+
+ if (!array_key_exists('title', $params)) {
+ $params['title'] = null;
+ }
+
+ $url = 'index.php?'.$params['controller'];
+
+ if (!empty($params['id'])) {
+ if (!empty($params['title'])) {
+ $url .= '/'.$params['id'].'-'.$params['title'];
+ }
+ else {
+ $url .= '/'.$params['id'];
+ }
+ }
+
+ if (!empty($content)) {
+ if (strpos($content, '&') !== 0) {
+ $url .= '&';
+ }
+
+ $url .= $content;
+ }
+
+ return @htmlspecialchars($url, ENT_COMPAT, 'UTF-8');;
+}
\ No newline at end of file
$html = '';
if ($tagArgs['pages'] > 1) {
- $link = "index.php?page=".$tagArgs['controller'].(isset($tagArgs['id']) ? "&id=".$tagArgs['id'] : "");
+ $link = "index.php?".$tagArgs['controller'].(isset($tagArgs['id']) ? "/".$tagArgs['id'] : "");
if (!isset($tagArgs['pageNo'])) {
if (($tagArgs['pageNo'] = $tplObj->smarty->getTemplateVars('pageNo')) === null) {
* @category Community Framework
*/
-function smarty_prefilter_hascontent($source, &$smarty) {
+function smarty_prefilter_hascontent($source, $smarty) {
$ldq = preg_quote($smarty->left_delimiter, '~');
$rdq = preg_quote($smarty->right_delimiter, '~');
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
- <li><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
- <li class="active"><a href="index.php?page=ApiManagement">API</a></li>
+ <li><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='ApiManagement'}{/link}">API</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
- <li><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
- <li class="active"><a href="index.php?page=DomainAdd">Domain hinzufügen</a></li>
+ <li><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='DomainAdd'}{/link}">Domain hinzufügen</a></li>
</ol>
</div>
</div>
Domain erfolgreich hinzugefügt.
</div>
{/if}
-<form method="post" action="index.php?page=DomainAdd">
+<form method="post" action="{link controller='DomainAdd'}{/link}">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
- <li class="active"><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
</ol>
</div>
</div>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="index.html"><i class="fa fa-wrench"></i> Domain Control Panel</a>
+ <a class="navbar-brand" href="{link controller='Index'}{/link}"><i class="fa fa-wrench"></i> Domain Control Panel</a>
</div>
<ul class="nav navbar-top-links navbar-right">
<i class="fa fa-user fa-fw"></i> {$username} <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
- <li><a href="index.php?page=logout"><i class="fa fa-sign-out fa-fw"></i> Logout</a></li>
+ <li><a href="{link controller='logout'}{/link}"><i class="fa fa-sign-out fa-fw"></i> Logout</a></li>
</ul>
</li>
</ul>
<li{if $activeMenuItem == 'index' || $activeMenuItem == 'add' || $activeMenuItem == 'update'} class="active"{/if}>
<a href="#"><i class="fa fa-home"></i> Domains<span class="fa arrow"></span></a>
<ul class="{if $activeMenuItem == 'index' || $activeMenuItem == 'add' || $activeMenuItem == 'update'}nav nav-second-level collapse in{else}nav nav-second-level{/if}">
- <li><a {if $activeMenuItem == 'index'}class="active" {/if}href="index.php?page=DomainList"><i class="fa fa-list"></i> Auflisten</a></li>
- {if $isReseller === true}<li><a {if $activeMenuItem == 'add'}class="active" {/if}href="index.php?page=DomainAdd"><i class="fa fa-plus"></i> Hinzufügen</a></li>{/if}
+ <li><a {if $activeMenuItem == 'index'}class="active" {/if}href="{link controller='DomainList'}{/link}"><i class="fa fa-list"></i> Auflisten</a></li>
+ {if $isReseller === true}<li><a {if $activeMenuItem == 'add'}class="active" {/if}href="{link controller='DomainAdd'}{/link}"><i class="fa fa-plus"></i> Hinzufügen</a></li>{/if}
</ul>
</li>
<li{if $activeMenuItem == 'settings' || $activeMenuItem == 'api'} class="active"{/if}>
<a href="#"><i class="fa fa-cogs"></i> Settings<span class="fa arrow"></span></a>
<ul class="{if $activeMenuItem == 'settings' || $activeMenuItem == 'api'}nav nav-second-level collapse in{else}nav nav-second-level{/if}">
- <li><a {if $activeMenuItem == 'index'}class="api" {/if}href="index.php?page=ApiManagement"><i class="fa fa-key"></i> API</a></li>
+ <li><a {if $activeMenuItem == 'index'}class="api" {/if}href="{link controller='ApiManagement'}{/link}"><i class="fa fa-key"></i> API</a></li>
</ul>
</li>
</ul>
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
- <li class="active"><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="page-header pull-right">
- <a href="#" class="btn btn-gr-gray"><i class="fa fa-plus"></i> Domain hinzufügen</a>
+ <a href="{link controller='DomainAdd'}{/link}" class="btn btn-gr-gray"><i class="fa fa-plus"></i> Domain hinzufügen</a>
</div>
</div>
</div>
<table class="table table-bordered table-hover radius table-striped">
<thead>
<tr>
- <th><a class="sorting{if $sortField == 'id'}_{$sortOrder|strtolower}{/if}" href="index.php?page=DomainList&pageNo={$pageNo}&sortField=id&sortOrder={if $sortField == 'id' && $sortOrder == 'ASC'}DESC{else}ASC{/if}">ID</a></th>
- <th><a class="sorting{if $sortField == 'origin'}_{$sortOrder|strtolower}{/if}" href="index.php?page=DomainList&pageNo={$pageNo}&sortField=origin&sortOrder={if $sortField == 'origin' && $sortOrder == 'ASC'}DESC{else}ASC{/if}">Name</a></th>
- <th><a class="sorting{if $sortField == 'serial'}_{$sortOrder|strtolower}{/if}" href="index.php?page=DomainList&pageNo={$pageNo}&sortField=serial&sortOrder={if $sortField == 'serial' && $sortOrder == 'ASC'}DESC{else}ASC{/if}">Serial</a></th>
+ <th><a class="sorting{if $sortField == 'id'}_{$sortOrder|strtolower}{/if}" href="{link controller='DomainList'}&pageNo={$pageNo}&sortField=id&sortOrder={if $sortField == 'id' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">ID</a></th>
+ <th><a class="sorting{if $sortField == 'origin'}_{$sortOrder|strtolower}{/if}" href="{link controller='DomainList'}&pageNo={$pageNo}&sortField=origin&sortOrder={if $sortField == 'origin' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">Name</a></th>
+ <th><a class="sorting{if $sortField == 'serial'}_{$sortOrder|strtolower}{/if}" href="{link controller='DomainList'}&pageNo={$pageNo}&sortField=serial&sortOrder={if $sortField == 'serial' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">Serial</a></th>
<th>Records</th>
{if $isReseller === true || $smarty.const.ENABLE_DNSSEC}<th>Manage</th>{/if}
</tr>
{foreach from=$domains item=domain}
<tr>
<td>{$domain['id']}</td>
- <td>{if $domain['active'] != 1}<span class="badge badge-red">{lang}domain.disabled{/lang}</span> {/if}<a href="index.php?page=RecordList&id={$domain['id']}">{$domain['origin']}</a></td>
+ <td>{if $domain['active'] != 1}<span class="badge badge-red">{lang}domain.disabled{/lang}</span> {/if}<a href="{link controller='RecordList' id=$domain['id'] title=$domain['origin']}{/link}">{$domain['origin']}</a></td>
<td>{$domain['serial']}</td>
<td>{$domain['rrc']}</td>
<td>
{if $isReseller === true}<span class="fa fa{if $domain['active']}-check{/if}-square-o ttips pointer toggleDomain" toggle-id="{$domain['id']}" title="{if $domain['active']}{lang}button.disable{/lang}{else}{lang}button.enable{/lang}{/if}" data-disable-message="{lang}button.disable{/lang}" data-enable-message="{lang}button.enable{/lang}"></span> {/if}
- {if $smarty.const.ENABLE_DNSSEC}<a href="index.php?page=SecList&id={$domain['id']}" class="ttips" title="Edit DNSSEC"><span class="fa fa-key"></span></a> {/if}
+ {if $smarty.const.ENABLE_DNSSEC}<a href="{link controller='SecList' id=$domain['id'] title=$domain['origin']}{/link}" class="ttips" title="Edit DNSSEC"><span class="fa fa-key"></span></a> {/if}
{if $isReseller === true}<span class="fa fa-remove ttips pointer deleteDomain" delete-id="{$domain['id']}" delete-confirm="{lang}domain.delete.message{/lang}" title="{lang}button.delete{/lang}"></span>{/if}
</td>
</tr>
<h3 class="panel-title">Please Sign In</h3>
</div>
<div class="panel-body">
- <form method="post" action="index.php?page=login">
+ <form method="post" action="index.php?login">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="Username" name="username" type="username" autofocus>
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
- <li><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
- <li class="active"><a href="index.php?page=RecordList&id={$soa['id']}">{$soa['origin']}</a></li>
+ <li><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='RecordList' id=$soa['id'] title=$soa['origin']}{/link}">{$soa['origin']}</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="page-header pull-right">
- <a href="index.php?page=RecordList&id={$soa['id']}" class="btn btn-gr-gray"><i class="fa fa-list"></i> Einträge auflisten</a>
+ <a href="{link controller='RecordList' id=$soa['id'] title=$soa['origin']}{/link}" class="btn btn-gr-gray"><i class="fa fa-list"></i> Einträge auflisten</a>
</div>
</div>
</div>
Record erfolgreich hinzugefügt.
</div>
{/if}
-<form method="post" action="index.php?page=RecordAdd&id={$soa['id']}">
+<form method="post" action="{link controller='RecordAdd' id=$soa['id']}{/link}">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
- <li><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
- <li class="active"><a href="index.php?page=RecordList&id={$soa['id']}">{$soa['origin']}</a></li>
+ <li><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='RecordList' id=$soa['id'] title=$soa['origin']}{/link}">{$soa['origin']}</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="page-header pull-right">
- <a href="index.php?page=RecordList&id={$soa['id']}" class="btn btn-gr-gray"><i class="fa fa-list"></i> Einträge auflisten</a>
+ <a href="{link controller='RecordList' id=$soa['id'] title=$soa['origin']}{/link}" class="btn btn-gr-gray"><i class="fa fa-list"></i> Einträge auflisten</a>
</div>
</div>
</div>
Record erfolgreich bearbeitet.
</div>
{/if}
-<form method="post" action="index.php?page=RecordEdit&id={$rr['id']}">
+<form method="post" action="{link controller='RecordEdit' id=$soa['id']}{/link}">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
- <li><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
- <li class="active"><a href="index.php?page=RecordList&id={$soa['id']}">{$soa['origin']}</a></li>
+ <li><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='RecordList' id=$soa['id'] title=$soa['origin']}{/link}">{$soa['origin']}</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="page-header pull-right">
- <a href="index.php?page=DomainList" class="btn btn-gr-gray"><i class="fa fa-list"></i> Domains auflisten</a>
- <a href="index.php?page=RecordAdd&id={$soa['id']}" class="btn btn-gr-gray"><i class="fa fa-plus"></i> Eintrag hinzufügen</a>
+ <a href="{link controller='DomainList'}{/link}" class="btn btn-gr-gray"><i class="fa fa-list"></i> Domains auflisten</a>
+ <a href="{link controller='RecordAdd' id=$soa['id']}{/link}" class="btn btn-gr-gray"><i class="fa fa-plus"></i> Eintrag hinzufügen</a>
<a href="#" id="export" export-id="{$soa['id']}" class="btn btn-gr-gray"><i class="fa fa-download"></i> Exportieren</a>
</div>
</div>
<table class="table table-bordered table-hover radius table-striped">
<thead>
<tr>
- <th><a class="sorting{if $sortField == 'id'}_{$sortOrder|strtolower}{/if}" href="index.php?page=RecordList&id={$soa['id']}&pageNo={$pageNo}&sortField=id&sortOrder={if $sortField == 'id' && $sortOrder == 'ASC'}DESC{else}ASC{/if}">ID</th>
- <th><a class="sorting{if $sortField == 'name'}_{$sortOrder|strtolower}{/if}" href="index.php?page=RecordList&id={$soa['id']}&pageNo={$pageNo}&sortField=name&sortOrder={if $sortField == 'name' && $sortOrder == 'ASC'}DESC{else}ASC{/if}">Host</th>
- <th><a class="sorting{if $sortField == 'ttl'}_{$sortOrder|strtolower}{/if}" href="index.php?page=RecordList&id={$soa['id']}&pageNo={$pageNo}&sortField=ttl&sortOrder={if $sortField == 'ttl' && $sortOrder == 'ASC'}DESC{else}ASC{/if}">TTL</th>
- <th><a class="sorting{if $sortField == 'type'}_{$sortOrder|strtolower}{/if}" href="index.php?page=RecordList&id={$soa['id']}&pageNo={$pageNo}&sortField=type&sortOrder={if $sortField == 'type' && $sortOrder == 'ASC'}DESC{else}ASC{/if}">Type</th>
+ <th><a class="sorting{if $sortField == 'id'}_{$sortOrder|strtolower}{/if}" href="{link controller='RecordList' id=$soa['id']}&pageNo={$pageNo}&sortField=id&sortOrder={if $sortField == 'id' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">ID</th>
+ <th><a class="sorting{if $sortField == 'name'}_{$sortOrder|strtolower}{/if}" href="{link controller='RecordList' id=$soa['id']}&pageNo={$pageNo}&sortField=name&sortOrder={if $sortField == 'name' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">Host</th>
+ <th><a class="sorting{if $sortField == 'ttl'}_{$sortOrder|strtolower}{/if}" href="{link controller='RecordList' id=$soa['id']}&pageNo={$pageNo}&sortField=ttl&sortOrder={if $sortField == 'ttl' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">TTL</th>
+ <th><a class="sorting{if $sortField == 'type'}_{$sortOrder|strtolower}{/if}" href="{link controller='RecordList' id=$soa['id']}&pageNo={$pageNo}&sortField=type&sortOrder={if $sortField == 'type' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">Type</th>
<th>Prio</th>
- <th><a class="sorting{if $sortField == 'data'}_{$sortOrder|strtolower}{/if}" href="index.php?page=RecordList&id={$soa['id']}&pageNo={$pageNo}&sortField=data&sortOrder={if $sortField == 'data' && $sortOrder == 'ASC'}DESC{else}ASC{/if}">Data</th>
+ <th><a class="sorting{if $sortField == 'data'}_{$sortOrder|strtolower}{/if}" href="{link controller='RecordList' id=$soa['id']}&pageNo={$pageNo}&sortField=data&sortOrder={if $sortField == 'data' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">Data</th>
<th>Manage</th>
</tr>
</thead>
<td>{$record['aux']}</td>
<td>{if $record['data']|strlen > 40}{$record['data']|substr:0:40}…{else}{$record['data']}{/if}</td>
<td>
- <a href="index.php?page=RecordEdit&id={$record['id']}"><span class="fa fa-pencil ttips pointer" title="Edit"></span></a>
+ <a href="{link controller='RecordEdit' id=$soa['id']}{/link}"><span class="fa fa-pencil ttips pointer" title="Edit"></span></a>
<span class="fa fa{if $record['active']}-check{/if}-square-o ttips pointer toggleRecord" toggle-id="{$record['id']}" title="{if $record['active']}{lang}button.disable{/lang}{else}{lang}button.enable{/lang}{/if}" data-disable-message="{lang}button.disable{/lang}" data-enable-message="{lang}button.enable{/lang}"></span>
<span class="fa fa-remove ttips pointer deleteRecord" delete-id="{$record['id']}" delete-confirm="{lang}record.delete.message{/lang}" title="{lang}button.delete{/lang}"></span>
</td>
{include file="header.tpl"}
<div class="c-block" id="breadcrumbs">
<ol class="breadcrumb">
- <li><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
- <li class="active"><a href="index.php?page=SecList&id={$soa['id']}">{$soa['origin']}</a></li>
+ <li><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='SecList' id=$soa['id'] title=$soa['origin']}{/link}">{$soa['origin']}</a></li>
</ol>
</div>
<div class="row">
<div class="col-lg-12">
<div class="page-header pull-right">
- <a href="index.php?page=SecList&id={$soa['id']}" class="btn btn-gr-gray"><i class="fa fa-list"></i> DESSEC auflisten</a>
+ <a href="{link controller='SecList' id=$soa['id'] title=$soa['origin']}{/link}" class="btn btn-gr-gray"><i class="fa fa-list"></i> DESSEC auflisten</a>
</div>
</div>
</div>
Record erfolgreich hinzugefügt.
</div>
{/if}
-<form method="post" action="index.php?page=SecAdd&id={$soa['id']}">
+<form method="post" action="{link controller='SecAdd' id=$soa['id'] title=$soa['origin']}{/link}">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
{include file="header.tpl"}
<div class="c-block" id="breadcrumbs">
<ol class="breadcrumb">
- <li><a href="index.php?page=DomainList"><i class="fa fa-home"></i> Domain Control Panel</a></li>
- <li class="active"><a href="index.php?page=SecList&id={$soa['id']}">{$soa['origin']}</a></li>
+ <li><a href="{link controller='DomainList'}{/link}"><i class="fa fa-home"></i> Domain Control Panel</a></li>
+ <li class="active"><a href="{link controller='SecList' id=$soa['id'] title=$soa['origin']}{/link}">{$soa['origin']}</a></li>
</ol>
</div>
{if !empty($ds)}