PageRenderTime 29ms CodeModel.GetById 18ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/config.inc.php

http://freshdns.googlecode.com/
PHP | 103 lines | 80 code | 16 blank | 7 comment | 6 complexity | 5a8460ec03a7757d40366efab1caeebd MD5 | raw file
  1<?
  2if (session_id() == "") session_start();
  3
  4/*****************************************************/
  5
  6define('PATH', 			'./');
  7define('CLASSES',		PATH.'class/');
  8define('VERSION',		'1.0.3');
  9
 10/*****************************************************/
 11
 12$config['mysql']['use']							= true;
 13$config['mysql']['username']					= 'pdns';
 14$config['mysql']['password']					= 'RWTifOD';	
 15$config['mysql']['database']					= 'pdns';
 16$config['mysql']['master_host']					= 'localhost';
 17$config['mysql']['slave_hosts']					= array('localhost','localhost'); // DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING!
 18$config['mysql']['use_replication']				= '0';	// DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING!
 19
 20/*****************************************************/
 21
 22$config['postgresql']['use']					= false;
 23$config['postgresql']['username']				= 'username';
 24$config['postgresql']['password']				= 'password';	
 25$config['postgresql']['database']				= 'pdns';
 26$config['postgresql']['master_host']			= 'localhost';
 27$config['postgresql']['slave_hosts']			= array('localhost','localhost'); // DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING!
 28$config['postgresql']['use_replication']		= 0;	// DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING!
 29
 30/*****************************************************/
 31
 32$config['DNS']['ns0']							= 'ns0.example.com';
 33$config['DNS']['ns1']							= 'ns1.example.com';
 34$config['DNS']['ns2']							= 'ns2.example.com';
 35$config['DNS']['hostmaster']					= 'hostmaster@example.com';
 36
 37/*****************************************************/
 38
 39$config['DNS']['templates']['standardRecords'] = array( # DO NOT CHANGE, UNLESS YOU KNOW WHAT YOU ARE DOING!
 40array("name" => "{#DOMAIN#}",			"type" => "SOA",		"content" => "{#NS0#} {#HOSTMASTER#} {#SOACODE#}",	"prio" => "0",	"ttl" => "3600"),
 41array("name" => "{#DOMAIN#}",			"type" => "NS",			"content" => "{#NS0#}",								"prio" => "0",	"ttl" => "3600"),
 42array("name" => "{#DOMAIN#}",			"type" => "NS",			"content" => "{#NS1#}",								"prio" => "0",	"ttl" => "3600"),
 43array("name" => "{#DOMAIN#}",			"type" => "NS",			"content" => "{#NS2#}",								"prio" => "0",	"ttl" => "3600"),
 44array("name" => "{#DOMAIN#}",			"type" => "A",			"content" => "{#WEBIP#}",							"prio" => "0",	"ttl" => "3600"),
 45array("name" => "localhost.{#DOMAIN#}", "type" => "A",          "content" => "127.0.0.1",                           "prio" => "0",  "ttl" => "3600"),
 46array("name" => "*.{#DOMAIN#}",			"type" => "A",			"content" => "{#WEBIP#}",							"prio" => "0",	"ttl" => "3600"),
 47array("name" => "www.{#DOMAIN#}",		"type" => "A",			"content" => "{#WEBIP#}",							"prio" => "0",	"ttl" => "3600"),
 48array("name" => "mail.{#DOMAIN#}",		"type" => "A",			"content" => "{#MAILIP#}",							"prio" => "0",	"ttl" => "3600"),
 49array("name" => "{#DOMAIN#}",			"type" => "MX",			"content" => "mail.{#DOMAIN#}",						"prio" => "10", "ttl" => "3600"));
 50
 51$config['DNS']['templates']['minimal'] = array( # DO NOT CHANGE, UNLESS YOU KNOW WHAT YOU ARE DOING!
 52array("name" => "{#DOMAIN#}",			"type" => "SOA",		"content" => "{#NS0#} {#HOSTMASTER#} {#SOACODE#}",	"prio" => "0",	"ttl" => "3600"),
 53array("name" => "{#DOMAIN#}",			"type" => "NS",			"content" => "{#NS0#}",								"prio" => "0",	"ttl" => "3600"),
 54array("name" => "{#DOMAIN#}",			"type" => "NS",			"content" => "{#NS1#}",								"prio" => "0",	"ttl" => "3600"),
 55array("name" => "{#DOMAIN#}",			"type" => "NS",			"content" => "{#NS2#}",								"prio" => "0",	"ttl" => "3600"),
 56array("name" => "*.{#DOMAIN#}",			"type" => "A",			"content" => "{#WEBIP#}",							"prio" => "0",	"ttl" => "3600"),
 57array("name" => "{#DOMAIN#}",			"type" => "MX",			"content" => "mail.{#DOMAIN#}",						"prio" => "10", "ttl" => "3600"));
 58
 59$config['DNS']['templates']['googleapps'] = array( # DO NOT CHANGE, UNLESS YOU KNOW WHAT YOU ARE DOING!
 60array("name" => "{#DOMAIN#}",			"type" => "SOA",        "content" => "{#NS0#} {#HOSTMASTER#} {#SOACODE#}",  "prio" => "0",  "ttl" => "3600"),
 61array("name" => "{#DOMAIN#}",           "type" => "NS",         "content" => "{#NS0#}",                             "prio" => "0",  "ttl" => "3600"),
 62array("name" => "{#DOMAIN#}",           "type" => "NS",         "content" => "{#NS1#}",                             "prio" => "0",  "ttl" => "3600"),
 63array("name" => "{#DOMAIN#}",           "type" => "NS",         "content" => "{#NS2#}",                             "prio" => "0",  "ttl" => "3600"),
 64array("name" => "{#DOMAIN#}",           "type" => "A",          "content" => "{#WEBIP#}",                           "prio" => "0",  "ttl" => "3600"),
 65array("name" => "*.{#DOMAIN#}",         "type" => "A",          "content" => "{#WEBIP#}",                           "prio" => "0",  "ttl" => "3600"),
 66array("name" => "www.{#DOMAIN#}",       "type" => "A",          "content" => "{#WEBIP#}",                           "prio" => "0",  "ttl" => "3600"),
 67array("name" => "localhost.{#DOMAIN#}", "type" => "A",          "content" => "127.0.0.1",                           "prio" => "0",  "ttl" => "3600"),
 68array("name" => "{#DOMAIN#}",           "type" => "MX",         "content" => "ASPMX.L.GOOGLE.COM",                  "prio" => "1", "ttl" => "3600"),
 69array("name" => "{#DOMAIN#}",           "type" => "MX",         "content" => "ALT1.ASPMX.L.GOOGLE.COM",             "prio" => "5", "ttl" => "3600"),
 70array("name" => "{#DOMAIN#}",           "type" => "MX",         "content" => "ALT2.ASPMX.L.GOOGLE.COM",             "prio" => "5", "ttl" => "3600"),
 71array("name" => "{#DOMAIN#}",           "type" => "MX",         "content" => "ASPMX2.GOOGLEMAIL.COM",               "prio" => "10", "ttl" => "3600"),
 72array("name" => "{#DOMAIN#}",           "type" => "MX",         "content" => "ASPMX3.GOOGLEMAIL.COM",               "prio" => "10", "ttl" => "3600"),
 73array("name" => "{#DOMAIN#}",           "type" => "MX",         "content" => "ASPMX4.GOOGLEMAIL.COM",               "prio" => "10", "ttl" => "3600"),
 74array("name" => "{#DOMAIN#}",           "type" => "MX",         "content" => "ASPMX5.GOOGLEMAIL.COM",               "prio" => "10", "ttl" => "3600"));
 75
 76/*****************************************************/
 77
 78include_once(CLASSES.'class.database.php');
 79include_once(CLASSES.'class.mysql.php');
 80include_once(CLASSES.'class.postgresql.php');
 81include_once(CLASSES.'class.manager.php');
 82include_once(CLASSES.'class.login.php');
 83include_once(CLASSES.'class.xmlcreator.php');
 84include_once(CLASSES.'class.JSON.php');
 85
 86/*****************************************************/
 87		
 88if ($config['postgresql']['use']==false && $config['mysql']['use']==true)
 89{
 90	$config['database'] = new mysql();
 91	$config['database']->setVars($config['mysql']['username'], $config['mysql']['password'], $config['mysql']['database'], $config['mysql']['master_host'], $config['mysql']['slave_hosts'], $config['mysql']['use_replication']);
 92	$config['database']->initiate();
 93}else if ($config['postgresql']['use']==true && $config['mysql']['use']==false)
 94{
 95	$config['database'] = new postgresql();
 96	$config['database']->setVars($config['postgresql']['username'], $config['postgresql']['password'], $config['postgresql']['database'], $config['postgresql']['master_host'], $config['postgresql']['slave_hosts'], $config['postgresql']['use_replication']);
 97	$config['database']->initiate();
 98}else
 99{
100	echo 'You have encountered an error: You did not select the right database in config.inc.php';
101	exit;
102}
103?>