fix installation
This commit is contained in:
parent
df2e548a2a
commit
d5d03875f0
7
init.php
7
init.php
@ -67,9 +67,13 @@ require_once $root_path . File::pathFixer('system/orm.php');
|
|||||||
require_once $root_path . File::pathFixer('system/autoload/PEAR2/Autoload.php');
|
require_once $root_path . File::pathFixer('system/autoload/PEAR2/Autoload.php');
|
||||||
include $root_path . File::pathFixer('system/autoload/Hookers.php');
|
include $root_path . File::pathFixer('system/autoload/Hookers.php');
|
||||||
|
|
||||||
|
if(!empty($db_password)){
|
||||||
|
// compability for old version
|
||||||
|
$db_pass = $db_password;
|
||||||
|
}
|
||||||
ORM::configure("mysql:host=$db_host;dbname=$db_name");
|
ORM::configure("mysql:host=$db_host;dbname=$db_name");
|
||||||
ORM::configure('username', $db_user);
|
ORM::configure('username', $db_user);
|
||||||
ORM::configure('password', $db_password);
|
ORM::configure('password', $db_pass);
|
||||||
ORM::configure('return_result_sets', true);
|
ORM::configure('return_result_sets', true);
|
||||||
if ($_app_stage != 'Live') {
|
if ($_app_stage != 'Live') {
|
||||||
ORM::configure('logging', true);
|
ORM::configure('logging', true);
|
||||||
@ -112,6 +116,7 @@ date_default_timezone_set($config['timezone']);
|
|||||||
|
|
||||||
if ((!empty($radius_user) && $config['radius_enable']) || _post('radius_enable')) {
|
if ((!empty($radius_user) && $config['radius_enable']) || _post('radius_enable')) {
|
||||||
if(!empty($radius_password)){
|
if(!empty($radius_password)){
|
||||||
|
// compability for old version
|
||||||
$radius_pass = $radius_password;
|
$radius_pass = $radius_password;
|
||||||
}
|
}
|
||||||
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
|
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
|
||||||
|
@ -28,61 +28,60 @@ if ($cn == '1') {
|
|||||||
if (isset($_POST['radius']) && $_POST['radius'] == 'yes') {
|
if (isset($_POST['radius']) && $_POST['radius'] == 'yes') {
|
||||||
$input = '<?php
|
$input = '<?php
|
||||||
|
|
||||||
$protocol = (!empty($_SERVER[\'HTTPS\']) && $_SERVER[\'HTTPS\'] !== \'off\' || $_SERVER[\'SERVER_PORT\'] == 443) ? "https://" : "http://";
|
$protocol = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
|
||||||
$host = $_SERVER[\'HTTP_HOST\'];
|
$host = $_SERVER["HTTP_HOST"];
|
||||||
$baseDir = rtrim(dirname($_SERVER[\'SCRIPT_NAME\']), \'/\\\');
|
$baseDir = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\");
|
||||||
define(\'APP_URL\', $protocol . $host . $baseDir);
|
define("APP_URL", $protocol . $host . $baseDir);
|
||||||
|
|
||||||
$_app_stage = \'Live\';
|
// Live, Dev, Demo
|
||||||
|
$_app_stage = "Live";
|
||||||
|
|
||||||
// Database PHPNuxBill
|
// Database PHPNuxBill
|
||||||
$db_host = \'' . $db_host . '\';
|
$db_host = "' . $db_host . '";
|
||||||
$db_user = \'' . $db_user . '\';
|
$db_user = "' . $db_user . '";
|
||||||
$db_password = \'' . $db_password . '\';
|
$db_pass = "' . $db_password . '";
|
||||||
$db_name = \'' . $db_name . '\';
|
$db_name = "' . $db_name . '";
|
||||||
|
|
||||||
// Database Radius
|
// Database Radius
|
||||||
$radius_host = \'' . $db_host . '\';
|
$radius_host = "' . $db_host . '";
|
||||||
$radius_user = \'' . $db_user . '\';
|
$radius_user = "' . $db_user . '";
|
||||||
$radius_pass = \'' . $db_password . '\';
|
$radius_pass = "' . $db_password . '";
|
||||||
$radius_name = \'' . $db_name . '\';
|
$radius_name = "' . $db_name . '";
|
||||||
|
|
||||||
if($_app_stage!=\'Live\'){
|
if($_app_stage!="Live"){
|
||||||
error_reporting(E_ERROR);
|
error_reporting(E_ERROR);
|
||||||
ini_set(\'display_errors\', 1);
|
ini_set("display_errors", 1);
|
||||||
ini_set(\'display_startup_errors\', 1);
|
ini_set("display_startup_errors", 1);
|
||||||
}else{
|
}else{
|
||||||
error_reporting(E_ERROR);
|
error_reporting(E_ERROR);
|
||||||
ini_set(\'display_errors\', 0);
|
ini_set("display_errors", 0);
|
||||||
ini_set(\'display_startup_errors\', 0);
|
ini_set("display_startup_errors", 0);
|
||||||
}
|
}';
|
||||||
';
|
|
||||||
} else {
|
} else {
|
||||||
$input = '<?php
|
$input = '<?php
|
||||||
|
$protocol = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
|
||||||
|
$host = $_SERVER["HTTP_HOST"];
|
||||||
|
$baseDir = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\");
|
||||||
|
define("APP_URL", $protocol . $host . $baseDir);
|
||||||
|
|
||||||
$protocol = (!empty($_SERVER[\'HTTPS\']) && $_SERVER[\'HTTPS\'] !== \'off\' || $_SERVER[\'SERVER_PORT\'] == 443) ? "https://" : "http://";
|
// Live, Dev, Demo
|
||||||
$host = $_SERVER[\'HTTP_HOST\'];
|
$_app_stage = "Live";
|
||||||
$baseDir = rtrim(dirname($_SERVER[\'SCRIPT_NAME\']), \'/\\\');
|
|
||||||
define(\'APP_URL\', $protocol . $host . $baseDir);
|
|
||||||
|
|
||||||
$_app_stage = \'Live\';
|
// Database PHPNuxBill
|
||||||
|
$db_host = "' . $db_host . '";
|
||||||
|
$db_user = "' . $db_user . '";
|
||||||
|
$db_pass = "' . $db_password . '";
|
||||||
|
$db_name = "' . $db_name . '";
|
||||||
|
|
||||||
// Database PHPNuxBill
|
if($_app_stage!="Live"){
|
||||||
$db_host = \'' . $db_host . '\';
|
|
||||||
$db_user = \'' . $db_user . '\';
|
|
||||||
$db_password = \'' . $db_password . '\';
|
|
||||||
$db_name = \'' . $db_name . '\';
|
|
||||||
|
|
||||||
if($_app_stage!=\'Live\'){
|
|
||||||
error_reporting(E_ERROR);
|
error_reporting(E_ERROR);
|
||||||
ini_set(\'display_errors\', 1);
|
ini_set("display_errors", 1);
|
||||||
ini_set(\'display_startup_errors\', 1);
|
ini_set("display_startup_errors", 1);
|
||||||
}else{
|
}else{
|
||||||
error_reporting(E_ERROR);
|
error_reporting(E_ERROR);
|
||||||
ini_set(\'display_errors\', 0);
|
ini_set("display_errors", 0);
|
||||||
ini_set(\'display_startup_errors\', 0);
|
ini_set("display_startup_errors", 0);
|
||||||
}
|
}';
|
||||||
';
|
|
||||||
}
|
}
|
||||||
$wConfig = "../config.php";
|
$wConfig = "../config.php";
|
||||||
$fh = fopen($wConfig, 'w') or die("Can't create config file, your server does not support 'fopen' function,
|
$fh = fopen($wConfig, 'w') or die("Can't create config file, your server does not support 'fopen' function,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user