Commit 00dfbafa authored by redray's avatar redray

charset corrections

parent 141f4cfa
......@@ -5,7 +5,7 @@
//* Main
$conf['language'] = 'en';
$conf['distname'] = 'centos52';
$conf['hostname'] = 'server1.example.com'; // Full hostname
$conf['hostname'] = 'server1.domain.tld'; // Full hostname
$conf['ispconfig_install_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_config_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_log_priority'] = 2; // 0 = Debug, 1 = Warning, 2 = Error
......@@ -24,6 +24,7 @@ $conf['mysql']['port'] = '3306';
$conf['mysql']['database'] = 'dbispconfig';
$conf['mysql']['admin_user'] = 'root';
$conf['mysql']['admin_password'] = '';
$conf['mysql']['charset'] = 'utf8';
$conf['mysql']['ispconfig_user'] = 'ispconfig';
$conf['mysql']['ispconfig_password'] = md5 (uniqid (rand()));
......
......@@ -5,7 +5,7 @@
//* Main
$conf['language'] = 'en';
$conf['distname'] = 'debian40';
$conf['hostname'] = 'server1.example.com'; // Full hostname
$conf['hostname'] = 'server1.domain.tld'; // Full hostname
$conf['ispconfig_install_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_config_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_log_priority'] = 2; // 0 = Debug, 1 = Warning, 2 = Error
......@@ -24,6 +24,7 @@ $conf['mysql']['port'] = '3306';
$conf['mysql']['database'] = 'dbispconfig';
$conf['mysql']['admin_user'] = 'root';
$conf['mysql']['admin_password'] = '';
$conf['mysql']['charset'] = 'utf8';
$conf['mysql']['ispconfig_user'] = 'ispconfig';
$conf['mysql']['ispconfig_password'] = md5 (uniqid (rand()));
......
......@@ -5,7 +5,7 @@
//* Main
$conf['language'] = 'en';
$conf['distname'] = 'fedora9';
$conf['hostname'] = 'server1.example.com'; // Full hostname
$conf['hostname'] = 'server1.domain.tld'; // Full hostname
$conf['ispconfig_install_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_config_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_log_priority'] = 2; // 0 = Debug, 1 = Warning, 2 = Error
......@@ -24,6 +24,7 @@ $conf['mysql']['port'] = '3306';
$conf['mysql']['database'] = 'dbispconfig';
$conf['mysql']['admin_user'] = 'root';
$conf['mysql']['admin_password'] = '';
$conf['mysql']['charset'] = 'utf8';
$conf['mysql']['ispconfig_user'] = 'ispconfig';
$conf['mysql']['ispconfig_password'] = md5 (uniqid (rand()));
......
......@@ -5,7 +5,7 @@
//* Main
$conf['language'] = 'en';
$conf['distname'] = 'opensuse110';
$conf['hostname'] = 'server1.example.com'; // Full hostname
$conf['hostname'] = 'server1.domain.tld'; // Full hostname
$conf['ispconfig_install_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_config_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_log_priority'] = 2; // 0 = Debug, 1 = Warning, 2 = Error
......@@ -24,6 +24,7 @@ $conf['mysql']['port'] = '3306';
$conf['mysql']['database'] = 'dbispconfig';
$conf['mysql']['admin_user'] = 'root';
$conf['mysql']['admin_password'] = '';
$conf['mysql']['charset'] = 'utf8';
$conf['mysql']['ispconfig_user'] = 'ispconfig';
$conf['mysql']['ispconfig_password'] = md5 (uniqid (rand()));
......
......@@ -32,9 +32,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ISPConfig 3 installer.
*/
//** Check for existing installation
//if(is_dir("/usr/local/ispconfig")) die('We will stop here. There is already a ISPConfig installation, use the update script to update this installation.');
error_reporting(E_ALL|E_STRICT);
//** The banner on the command line
......@@ -56,20 +53,25 @@ require_once('lib/install.lib.php');
//** Include the base class of the installer class
require_once('lib/installer_base.lib.php');
//** Install logfile
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');
define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../'));
//** Check for existing installation
/*if(is_dir("/usr/local/ispconfig")) {
die('We will stop here. There is already a ISPConfig installation, use the update script to update this installation.');
}*/
//** Get distribution identifier
$dist = get_distname();
if($dist['id'] == '') die('Linux Dustribution or Version not recognized.');
if($dist['id'] == '') die('Linux Distribution or Version not recognized.');
//** Include the distribution specific installer class library and configuration
if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php');
include_once('dist/lib/'.$dist['id'].'.lib.php');
include_once('dist/conf/'.$dist['id'].'.conf.php');
//** Install logfile
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');
define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../'));
//****************************************************************************************************
//** Installer Interface
//****************************************************************************************************
......@@ -97,7 +99,7 @@ $install_mode = $inst->simple_query('Installation mode', array('Standard','Exper
//** Get the hostname
$tmp_out = array();
exec('hostname -f', $tmp_out);
$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg foo.example.com ', $tmp_out[0]);
$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', $tmp_out[0]);
unset($tmp_out);
//** Get MySQL root credentials
......@@ -107,6 +109,7 @@ do {
$tmp_mysql_server_admin_user = $inst->free_query('MySQL root username', $conf['mysql']['admin_user']);
$tmp_mysql_server_admin_password = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']);
$tmp_mysql_server_database = $inst->free_query('MySQL database to create', $conf['mysql']['database']);
$tmp_mysql_server_charset = $inst->free_query('MySQL charset', $conf['mysql']['charset']);
//* Initialize the MySQL server connection
if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) {
......@@ -114,6 +117,7 @@ do {
$conf['mysql']['admin_user'] = $tmp_mysql_server_admin_user;
$conf['mysql']['admin_password'] = $tmp_mysql_server_admin_password;
$conf['mysql']['database'] = $tmp_mysql_server_database;
$conf['mysql']['charset'] = $tmp_mysql_server_charset;
$finished = true;
} else {
swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error());
......
......@@ -119,7 +119,7 @@ class installer_base {
$cf = $conf['mysql']; // make $conf['mysql'] more accessible
//** Create the database
if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$cf['database'])) {
if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$cf['database'].' DEFAULT CHARACTER SET '.$cf['charset'])) {
$this->error('Unable to create MySQL database: '.$cf['database'].'.');
}
......@@ -132,10 +132,10 @@ class installer_base {
$this->error('Stopped: Database already contains some tables.');
} else {
if($cf['admin_password'] == '') {
caselog("mysql -h '".$cf['host']."' -u '".$cf['admin_user']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
caselog("mysql --default-character-set=".$cf['charset']." -h '".$cf['host']."' -u '".$cf['admin_user']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
__FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
} else {
caselog("mysql -h '".$cf['host']."' -u '".$cf['admin_user']."' -p'".$cf['admin_password']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
caselog("mysql --default-character-set=".$cf['charset']." -h '".$cf['host']."' -u '".$cf['admin_user']."' -p'".$cf['admin_password']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
__FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
}
$db_tables = $this->db->getTables();
......
......@@ -29,18 +29,19 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
class db
{
var $dbHost = ""; // hostname of the MySQL server
var $dbName = ""; // logical database name on that server
var $dbUser = ""; // database authorized user
var $dbPass = ""; // user's password
var $linkId = 0; // last result of mysql_connect()
var $queryId = 0; // last result of mysql_query()
var $record = array(); // last record fetched
var $autoCommit = 1; // Autocommit Transactions
var $currentRow; // current row number
var $errorNumber = 0; // last error number
var $errorMessage = ""; // last error message
var $errorLocation = "";// last error location
var $dbHost = ""; // hostname of the MySQL server
var $dbName = ""; // logical database name on that server
var $dbUser = ""; // database authorized user
var $dbPass = ""; // user's password
var $dbCharset = ""; // what charset comes and goes to mysql: utf8 / latin1
var $linkId = 0; // last result of mysql_connect()
var $queryId = 0; // last result of mysql_query()
var $record = array(); // last record fetched
var $autoCommit = 1; // Autocommit Transactions
var $currentRow; // current row number
var $errorNumber = 0; // last error number
var $errorMessage = ""; // last error message
var $errorLocation = ""; // last error location
var $show_error_messages = false;
// constructor
......@@ -52,6 +53,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//$this->dbName = $conf["mysql"]["database"];
$this->dbUser = $conf["mysql"]["admin_user"];
$this->dbPass = $conf["mysql"]["admin_password"];
$this->dbCharset = $conf["mysql"]["charset"];
//$this->connect();
}
......@@ -79,6 +81,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
$this->updateError('DB::connect()<br />mysql_connect');
return false;
}
$this->queryId = @mysql_query('SET NAMES '.$this->dbCharset, $this->linkId);
}
return true;
}
......
......@@ -6,7 +6,7 @@
$conf['language'] = 'en';
$conf['distname'] = 'debian40';
$conf['hostname'] = 'server1.example.com'; // Full hostname
$conf['hostname'] = 'server1.domain.tld'; // Full hostname
$conf['ispconfig_install_dir'] = '/usr/local/ispconfig';
$conf['ispconfig_config_dir'] = '/usr/local/ispconfig';
$conf['server_id'] = 1;
......@@ -18,6 +18,7 @@ $conf['mysql']['port'] = '3306';
$conf['mysql']['database'] = 'dbispconfig';
$conf['mysql']['admin_user'] = 'root';
$conf['mysql']['admin_password'] = '';
$conf['mysql']['charset'] = 'utf8';
$conf['mysql']['ispconfig_user'] = 'ispconfig';
$conf['mysql']['ispconfig_password'] = '5sDrewBhk';
......
This diff is collapsed.
......@@ -32,122 +32,95 @@ if( !empty($_SERVER['DOCUMENT_ROOT']) ) {
Header("Pragma: no-cache");
Header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
Header("Content-Type: text/html");
Header("Content-Type: text/html; charset=utf-8");
ini_set('register_globals',0);
}
$conf["app_title"] = "ISPConfig";
$conf["app_version"] = "3.0.0";
$conf["modules_available"] = "admin,mail,sites,monitor,client,dns";
$conf["interface_logout_url"] = "";
//** Key paramaters
//** Application
define('ISPC_APP_TITLE', 'ISPConfig');
$conf['app_title'] = 'ISPConfig';
define('ISPC_APP_VERSION', '3.0.0');
$conf['app_version'] = '3.0.0';
$conf['modules_available'] = 'admin,mail,sites,monitor,client,dns,help';
//** The main ROOT is the parent directory to this file, ie Interface/. NO trailing slashes.
define('ISPC_ROOT_PATH', realpath(dirname(__FILE__).'/../'));
define('ISPC_LIB_PATH', ISPC_ROOT_PATH.'/lib');
define('ISPC_CLASS_PATH', ISPC_ROOT_PATH.'/lib/classes');
define('ISPC_WEB_PATH', ISPC_ROOT_PATH.'/web');
define('ISPC_THEMES_PATH', ISPC_ROOT_PATH.'/web/themes');
define('ISPC_WEB_TEMP_PATH', ISPC_WEB_PATH.'/temp'); // Path for downloads, accessible via browser
define('ISPC_CACHE_PATH', ISPC_ROOT_PATH.'/cache');
//** Interface settings
define('ISPC_INTERFACE_MODULES_ENABLED', 'mail,sites,dns,tools');
define('ISPC_APP_VERSION', '3.0.8 beta');
define('ISPC_APP_LINK', 'http://www.howtoforge.com/forums/showthread.php?t=26988');
/*
Server variables
*/
$conf["server_id"] = "{server_id}";
//** Database
$conf["db_type"] = 'mysql';
$conf["db_host"] = '{mysql_server_host}';
$conf["db_database"] = '{mysql_server_database}';
$conf["db_user"] = '{mysql_server_ispconfig_user}';
$conf["db_password"] = '{mysql_server_ispconfig_password}';
$conf["db_charset"] = 'utf8'; // same charset as html-charset - (HTML --> MYSQL: "utf-8" --> "utf8", "iso-8859-1" --> "latin1")
define("DB_TYPE",$conf["db_type"]);
define("DB_HOST",$conf["db_host"]);
define("DB_DATABASE",$conf["db_database"]);
define("DB_USER",$conf["db_user"]);
define("DB_PASSWORD",$conf["db_password"]);
define("DB_CHARSET",$conf["db_charset"]);
/*
Database Settings
*/
$conf["db_type"] = 'mysql';
$conf["db_host"] = '{mysql_server_host}';
$conf["db_database"] = '{mysql_server_database}';
$conf["db_user"] = '{mysql_server_ispconfig_user}';
$conf["db_password"] = '{mysql_server_ispconfig_password}';
//** Paths
define('ISPC_ROOT_PATH', realpath(dirname(__FILE__).'/../')); // The main ROOT is the parent directory to this file, ie Interface/. NO trailing slashes.
define('ISPC_LIB_PATH', ISPC_ROOT_PATH.'/lib');
define('ISPC_CLASS_PATH', ISPC_ROOT_PATH.'/lib/classes');
define('ISPC_WEB_PATH', ISPC_ROOT_PATH.'/web');
define('ISPC_THEMES_PATH', ISPC_ROOT_PATH.'/web/themes');
define('ISPC_WEB_TEMP_PATH', ISPC_WEB_PATH.'/temp'); // Path for downloads, accessible via browser
define('ISPC_CACHE_PATH', ISPC_ROOT_PATH.'/cache');
//** Paths (Do not change!)
$conf["rootpath"] = substr(dirname(__FILE__),0,-4);
$conf["fs_div"] = "/"; // File system divider, "\\" on windows and "/"" on linux and unix
$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes";
$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp";
/*
Path Settings (Do not change!)
*/
define("FS_DIV",$conf["fs_div"]);
define("SERVER_ROOT",$conf["rootpath"]);
define("INCLUDE_ROOT",SERVER_ROOT.FS_DIV."lib");
define("CLASSES_ROOT",INCLUDE_ROOT.FS_DIV."classes");
$conf["rootpath"] = substr(dirname(__FILE__),0,-4);
$conf["fs_div"] = "/"; // File system divider, \\ on windows and / on linux and unix
$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes";
$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp";
//** Server
$conf['app_title'] = ISPC_APP_TITLE;
$conf['app_version'] = ISPC_APP_VERSION;
$conf['modules_available'] = 'admin,mail,sites,monitor,client,dns,help';
$conf["server_id"] = "{server_id}";
define("DIR_TRENNER",$conf["fs_div"]);
define("SERVER_ROOT",$conf["rootpath"]);
define("INCLUDE_ROOT",SERVER_ROOT.DIR_TRENNER."lib");
define("CLASSES_ROOT",INCLUDE_ROOT.DIR_TRENNER."classes");
define("DB_TYPE",$conf["db_type"]);
define("DB_HOST",$conf["db_host"]);
define("DB_DATABASE",$conf["db_database"]);
define("DB_USER",$conf["db_user"]);
define("DB_PASSWORD",$conf["db_password"]);
//** Interface
define('ISPC_INTERFACE_MODULES_ENABLED', 'mail,sites,dns,tools');
/*
Logging
*/
$conf["log_file"] = '/var/log/ispconfig/ispconfig.log';
$conf["log_priority"] = {ispconfig_log_priority}; // 0 = Debug, 1 = Warning, 2 = Error
//** Logging
$conf["log_file"] = '/var/log/ispconfig/ispconfig.log';
$conf["log_priority"] = {ispconfig_log_priority}; // 0 = Debug, 1 = Warning, 2 = Error
/*
Allow software package installations
*/
//** Allow software package installations
$conf['software_updates_enabled'] = false;
/*
Themes
*/
$conf["theme"] = 'default';
$conf["html_content_encoding"] = 'text/html; charset=iso-8859-1';
$conf["logo"] = 'themes/default/images/mydnsconfig_logo.gif';
/*
Default Language
*/
//** Themes
$conf["theme"] = 'default';
$conf["html_content_encoding"] = 'utf-8'; // example: utf-8, iso-8859-1, ...
$conf["logo"] = 'themes/default/images/ispc_logo.png';
$conf["language"] = 'en';
/*
Misc.
*/
//** Default Language
$conf["language"] = 'en';
$conf["interface_logout_url"] = ""; // example: http://www.domain.tld/
//** Misc.
$conf["interface_logout_url"] = ""; // example: http://www.domain.tld/
/*
Auto Load Modules
*/
$conf["start_db"] = true;
$conf["start_session"] = true;
//** Auto Load Modules
$conf["start_db"] = true;
$conf["start_session"] = true;
/*
Constants
*/
//** Constants
define("LOGLEVEL_DEBUG",0);
define("LOGLEVEL_WARN",1);
define("LOGLEVEL_ERROR",2);
......
......@@ -8,8 +8,8 @@ auto_network_configuration=n
ip_address=192.168.0.105
netmask=255.255.255.0
gateway=192.168.0.1
hostname=server1.example.com
nameservers=193.174.32.18,145.253.2.75
hostname=server1.domain.tld
nameservers=192.168.0.1,192.168.0.2
[mail]
module=postfix_mysql
......
<?php
/*
Copyright (c) 2008, Till Brehm, projektfarm Gmbh
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
......@@ -28,6 +28,25 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
ISPConfig 3 uninstaller.
*/
error_reporting(E_ALL|E_STRICT);
//** The banner on the command line
echo "\n\n".str_repeat('-',80)."\n";
echo " _____ ___________ _____ __ _
|_ _/ ___| ___ \ / __ \ / _(_)
| | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _
| | `--. \ __/ | | / _ \| '_ \| _| |/ _` |
_| |_/\__/ / | | \__/\ (_) | | | | | | | (_| |
\___/\____/\_| \____/\___/|_| |_|_| |_|\__, |
__/ |
|___/ ";
echo "\n".str_repeat('-',80)."\n";
echo "\n\n>> Uninstall \n\n";
require("/usr/local/ispconfig/server/lib/config.inc.php");
require("/usr/local/ispconfig/server/lib/app.inc.php");
......
......@@ -28,8 +28,12 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
ISPConfig 3 updater.
*/
error_reporting(E_ALL|E_STRICT);
//** ISPConfig 3 installer.
//** The banner on the command line
echo "\n\n".str_repeat('-',80)."\n";
echo " _____ ___________ _____ __ _
......@@ -43,14 +47,13 @@ echo " _____ ___________ _____ __ _
echo "\n".str_repeat('-',80)."\n";
echo "\n\n>> Update \n\n";
//** Include the library with the basic installer functions
require_once('lib/install.lib.php');
//** Include the base class of the installer class
require_once('lib/installer_base.lib.php');
//** Installer/updater logfile
//** Install logfile
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');
define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../'));
......@@ -82,6 +85,7 @@ unset($tmp_out);
//** Set the mysql login information
$conf["mysql"]["host"] = $conf_old["db_host"];
$conf["mysql"]["database"] = $conf_old["db_database"];
$conf['mysql']['charset'] = 'utf8';
$conf["mysql"]["ispconfig_user"] = $conf_old["db_user"];
$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"];
......@@ -138,10 +142,10 @@ foreach($db_tables as $table) {
//** load old data back into database
if( !empty($conf["mysql"]["admin_password"]) ) {
system("mysql -h ".$conf['mysql']['host']." -u ".$conf['mysql']['admin_user']." -p".$conf['mysql']['admin_password']." ".$conf['mysql']['database']." < existing_db.sql");
system("mysql --default-character-set=".$conf['mysql']['charset']." -h ".$conf['mysql']['host']." -u ".$conf['mysql']['admin_user']." -p".$conf['mysql']['admin_password']." ".$conf['mysql']['database']." < existing_db.sql");
} else {
system("mysql -h ".$conf['mysql']['host']." -u ".$conf['mysql']['admin_user']." ".$conf['mysql']['database']." < existing_db.sql");
system("mysql --default-character-set=".$conf['mysql']['charset']." -h ".$conf['mysql']['host']." -u ".$conf['mysql']['admin_user']." ".$conf['mysql']['database']." < existing_db.sql");
}
// create a backup copy of the ispconfig database in the root folder
......
......@@ -100,14 +100,14 @@ class app {
if($priority >= $this->_conf['log_priority']) {
if (is_writable($this->_conf['log_file'])) {
if (!$fp = fopen ($this->_conf['log_file'], 'a')) {
$this->error('Logfile konnte nicht ge�ffnet werden.');
$this->error('Unable to open logfile.');
}
if (!fwrite($fp, date('d.m.Y-H:i').' - '. $msg."\r\n")) {
$this->error('Schreiben in Logfile nicht m�glich.');
$this->error('Unable to write to logfile.');
}
fclose($fp);
} else {
$this->error('Logfile ist nicht beschreibbar.');
$this->error('Unable to write to logfile.');
}
}
}
......@@ -121,7 +121,7 @@ class app {
$msg = '<html>
<head>
<title>Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../themes/default/style.css" rel="stylesheet" type="text/css">
</head>
<body>
......@@ -161,15 +161,20 @@ class app {
public function tpl_defaults()
{
$this->tpl->setVar('theme', $_SESSION['s']['theme']);
$this->tpl->setVar('app_title', $this->_conf['app_title']);
$this->tpl->setVar('app_version', $this->_conf['app_version']);
$this->tpl->setVar('app_link', $this->_conf['app_link']);
$this->tpl->setVar('phpsessid', session_id());
$this->tpl->setVar('theme', $_SESSION['s']['theme']);
$this->tpl->setVar('html_content_encoding', $this->_conf['html_content_encoding']);
if(isset($this->_conf['logo']) && $this->_conf['logo'] != '' && @is_file($this->_conf['logo'])){
$this->tpl->setVar('logo', '<img src="'.$this->_conf['logo'].'" border="0" alt="">');
} else {
$this->tpl->setVar('logo', '&nbsp;');
}
$this->tpl->setVar('app_title', $this->_conf['app_title']);
$this->tpl->setVar('delete_confirmation', $this->lng('delete_confirmation'));
//print_r($_SESSION);
if(isset($_SESSION['s']['module']['name'])) {
......@@ -181,7 +186,6 @@ class app {
if(isset($_SESSION['s']['user']) && $this->auth->has_clients($_SESSION['s']['user']['userid'])) {
$this->tpl->setVar('is_reseller', 1);
}
$this->tpl->setVar('ISPC_APP_VERSION', ISPC_APP_VERSION);
}
} // end class
......
......@@ -37,18 +37,19 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
class db
{
private $dbHost = ''; // hostname of the MySQL server
private $dbName = ''; // logical database name on that server
private $dbUser = ''; // database authorized user
private $dbPass = ''; // user's password
private $linkId = 0; // last result of mysql_connect()
private $queryId = 0; // last result of mysql_query()
private $record = array(); // last record fetched
private $autoCommit = 1; // Autocommit Transactions
private $currentRow; // current row number
private $errorNumber = 0; // last error number
public $errorMessage = ''; // last error message
private $errorLocation = '';// last error location
private $dbHost = ''; // hostname of the MySQL server
private $dbName = ''; // logical database name on that server
private $dbUser = ''; // database authorized user
private $dbPass = ''; // user's password
private $dbCharset = ""; // what charset comes and goes to mysql: utf8 / latin1
private $linkId = 0; // last result of mysql_connect()
private $queryId = 0; // last result of mysql_query()
private $record = array(); // last record fetched
private $autoCommit = 1; // Autocommit Transactions
private $currentRow; // current row number
private $errorNumber = 0; // last error number
public $errorMessage = ''; // last error message
private $errorLocation = ''; // last error location
public $show_error_messages = false;
public function __construct()
......@@ -58,6 +59,7 @@ class db
$this->dbName = $conf['db_database'];
$this->dbUser = $conf['db_user'];
$this->dbPass = $conf['db_password'];
$this->dbCharset = $conf['db_charset'];
//$this->connect();
}
......@@ -81,6 +83,7 @@ class db
$this->updateError('DB::connect()<br />mysql_connect');
return false;
}
$this->queryId = @mysql_query('SET NAMES '.$this->dbCharset, $this->linkId);
}
return true;
}
......
<?php
/*
Copyright (c) 2008, Till Brehm, Falko Timme, 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.
*/
//** Web-only
if( !empty($_SERVER['DOCUMENT_ROOT']) ) {
Header("Pragma: no-cache");
Header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
Header("Content-Type: text/html");
ini_set('register_globals',0);
}
$conf["app_title"] = "ISPConfig";
$conf["app_version"] = "3.0.0";
$conf["modules_available"] = "admin,mail,sites,monitor,client,dns";
$conf["interface_logout_url"] = "";
//** Key paramaters
define('ISPC_APP_TITLE', 'ISPConfig');
$conf['app_title'] = 'ISPConfig';
define('ISPC_APP_VERSION', '3.0.0');
$conf['app_version'] = '3.0.0';
$conf['modules_available'] = 'admin,mail,sites,monitor,client,dns,help';
//** The main ROOT is the parent directory to this file, ie Interface/. NO trailing slashes.
define('ISPC_ROOT_PATH', realpath(dirname(__FILE__).'/../'));
define('ISPC_LIB_PATH', ISPC_ROOT_PATH.'/lib');
define('ISPC_CLASS_PATH', ISPC_ROOT_PATH.'/lib/classes');
define('ISPC_WEB_PATH', ISPC_ROOT_PATH.'/web');
define('ISPC_THEMES_PATH', ISPC_ROOT_PATH.'/web/themes');
define('ISPC_WEB_TEMP_PATH', ISPC_WEB_PATH.'/temp'); // Path for downloads, accessible via browser
define('ISPC_CACHE_PATH', ISPC_ROOT_PATH.'/cache');
//** Interface settings
define('ISPC_INTERFACE_MODULES_ENABLED', 'mail,sites,dns,tools');
/*
Server variables
*/
$conf["server_id"] = "{server_id}";
/*
Database Settings
*/
$conf["db_type"] = 'mysql';
$conf["db_host"] = 'localhost';
$conf["db_database"] = 'dbispconfig';
$conf["db_user"] = 'ispconfig';
$conf["db_password"] = '56409c08def09f8ee9c42416f4bcfc51';
/*
Path Settings (Do not change!)
*/
$conf["rootpath"] = substr(dirname(__FILE__),0,-4);
$conf["fs_div"] = "/"; // File system divider, \\ on windows and / on linux and unix
$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes";
$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp";
define("DIR_TRENNER",$conf["fs_div"]);
define("SERVER_ROOT",$conf["rootpath"]);
define("INCLUDE_ROOT",SERVER_ROOT.DIR_TRENNER."lib");
define("CLASSES_ROOT",INCLUDE_ROOT.DIR_TRENNER."classes");
define("DB_TYPE",$conf["db_type"]);
define("DB_HOST",$conf["db_host"]);
define("DB_DATABASE",$conf["db_database"]);
define("DB_USER",$conf["db_user"]);
define("DB_PASSWORD",$conf["db_password"]);
/*
Logging
*/
$conf["log_file"] = '/var/log/ispconfig/ispconfig.log';
$conf["log_priority"] = 2; // 0 = Debug, 1 = Warning, 2 = Error