31 define(
'DO_XHPROF_STATS', FALSE);
32 if (
DO_XHPROF_STATS) require_once(
'/usr/share/alternc/panel/admin/xhprof_header.php');
36 if (file_exists(
'/etc/alternc/alternc_display_php_error')) {
37 ini_set(
'display_errors',
true);
39 session_name(
'AlternC_Panel');
72 if (ini_get(
"safe_mode")) {
73 echo
"SAFE MODE IS ENABLED for the web panel ! It's a bug in your php or apache configuration, please fix it !!";
78 if (
isset($_GET[
'http_auth'])) $http_auth=strval($_GET[
'http_auth']);
79 if (
isset($http_auth) && $http_auth) {
80 if (empty($_SERVER[
'PHP_AUTH_USER']) || empty($_SERVER[
'PHP_AUTH_PW'])) {
81 header(
'WWW-Authenticate: Basic realm="Test Authentication System"');
82 header(
'HTTP/1.0 401 Unauthorized');
86 if (!empty($_SERVER[
'PHP_AUTH_USER']) && !empty($_SERVER[
'PHP_AUTH_PW'])) {
88 $_REQUEST[
"username"]=$_SERVER[
'PHP_AUTH_USER'];
89 $_REQUEST[
"password"]=$_SERVER[
'PHP_AUTH_PW'];
99 require_once(dirname(__FILE__).
"/local.php");
103 define(
'ALTERNC_MAIL',
"$L_ALTERNC_MAIL");
104 define(
'ALTERNC_HTML',
"$L_ALTERNC_HTML");
106 define(
'ALTERNC_LOGS_ARCHIVE',
"$L_ALTERNC_LOGS_ARCHIVE");
107 define(
'ALTERNC_LOGS',
"$L_ALTERNC_LOGS");
108 define(
'ALTERNC_PANEL',
"/usr/share/alternc/panel");
110 define(
'ALTERNC_LOCK_JOBS',
'/var/run/alternc/jobs-lock');
111 define(
'ALTERNC_LOCK_PANEL',
'/var/lib/alternc/panel/nologin.lock');
112 define(
'ALTERNC_APACHE2_GEN_TMPL_DIR',
'/etc/alternc/templates/apache2/');
113 define(
'ALTERNC_VHOST_DIR',
"/var/lib/alternc/apache-vhost/");
121 require_once(
$root.
"/class/db_mysql.php");
122 require_once(
$root.
"/class/functions.php");
125 if (
isset($_SERVER[
"HTTPS"]) && $_SERVER[
"HTTPS"]==
"on" &&
$host!=$L_FQDN) {
126 header(
"Location: https://$L_FQDN/");
145 global $L_MYSQL_HOST,$L_MYSQL_DATABASE,$L_MYSQL_LOGIN,$L_MYSQL_PWD;
146 $this->Host = $L_MYSQL_HOST;
147 $this->Database = $L_MYSQL_DATABASE;
148 $this->User = $L_MYSQL_LOGIN;
149 $this->Password = $L_MYSQL_PWD;
161 foreach ( glob(
$root.
"class/m_*.php") as $di ) {
162 if (preg_match(
"#${root}class/m_(.*)\\.php$#",$di,$match)) {
176 foreach ( glob(
$root.
"class/class_system_*.php") as $fcs ) {
177 if (is_readable($fcs)) require_once($fcs);
181 include_once(
"lang_env.php");
190 if (!defined(
'NOCHECK')) {
191 if (!
$mem->checkid()) {
193 include(
"index.php");
200 if (
isset($$name2))
continue;
202 $$name2=
new $name1();