CMXX - Multisite settings
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,8 +7,8 @@ marketing/
|
||||
firmware/
|
||||
log/
|
||||
assets/images/products/
|
||||
settings/config.php
|
||||
settings/settings.php
|
||||
settings/config.php
|
||||
variable_scan.php
|
||||
settings/veliti/settings.php
|
||||
settings/veliti/veliti_config.php
|
||||
settings/veliti/veliti_settings.php
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$_SESSION['prev_origin'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$_SESSION['prev_origin'] = '';
|
||||
|
||||
2
api.php
2
api.php
@@ -13,7 +13,7 @@ $input = stream_get_contents($post_data_curl);
|
||||
// Include functions
|
||||
//------------------------------------------
|
||||
require_once './assets/functions.php';
|
||||
include './settings/settings.php';
|
||||
include './settings/settings_redirector.php';
|
||||
include './settings/config_redirector.php';
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
@@ -216,7 +216,7 @@ case 'firmwareUpdate':
|
||||
|
||||
if (isset($_GET['sn']) && $_GET['sn'] != '' && isset($_GET['hw_version']) && $_GET['hw_version'] != '' && isset($_GET['sw_version']) && $_GET['sw_version'] != '') {
|
||||
|
||||
include './settings/settings.php';
|
||||
include './settings/settings_redirector.php';
|
||||
|
||||
//Clean input data
|
||||
$hw_device_send = strip_tags(trim($_GET['hw_version']));
|
||||
|
||||
@@ -86,7 +86,7 @@ function send_mail($to, $subject, $message, $attachment, $attachment_name){
|
||||
//------------------------------------------
|
||||
function dbConnect($dbcon) {
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
try {
|
||||
// Connect to the MySQL database using the PDO interface
|
||||
@@ -198,7 +198,7 @@ function filterMenuByProfile($menu, $profileString) {
|
||||
}
|
||||
function menu($selected,$selected_child){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
if(isset($_SESSION['country_code'])){
|
||||
$api_file_language = dirname(__FILE__,2).'/settings/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
|
||||
@@ -470,7 +470,7 @@ EOT;
|
||||
//------------------------------------------
|
||||
function generate_payload($payload) {
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
$headers = array('alg'=>'HS256','typ'=>'payload');
|
||||
$payload = array('payload'=>$payload,'exp'=>(time() + 1200));
|
||||
@@ -510,7 +510,7 @@ function encrypt($input, $password) {
|
||||
// Decode Payload
|
||||
//------------------------------------------
|
||||
function decode_payload($payload_input) {
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
// split the jwt
|
||||
$tokenParts = explode('.', $payload_input);
|
||||
$header = base64_decode($tokenParts[0]);
|
||||
@@ -570,7 +570,7 @@ function base64url_encode($data) {
|
||||
//------------------------------------------
|
||||
function generate_jwt($headers, $payload) {
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
$headers_encoded = base64url_encode(json_encode($headers));
|
||||
$payload_encoded = base64url_encode(json_encode($payload));
|
||||
@@ -584,7 +584,7 @@ function generate_jwt($headers, $payload) {
|
||||
}
|
||||
function is_jwt_valid($jwt) {
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
// split the jwt
|
||||
$tokenParts = explode('.', $jwt);
|
||||
$header = base64_decode($tokenParts[0]);
|
||||
@@ -625,7 +625,7 @@ function createCommunicationToken($input){
|
||||
//------------------------------------------
|
||||
function getUserKey($jwt){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
$tokenParts = explode('.', $jwt);
|
||||
$payload = base64_decode($tokenParts[1]);
|
||||
$token = json_decode($payload)->token;
|
||||
@@ -670,7 +670,7 @@ function get_bearer_token() {
|
||||
//------------------------------------------
|
||||
function ioServer($api_call, $data){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
$token = $_SESSION['userkey'] ?? 'authorization_request';
|
||||
$bearertoken = createCommunicationToken($token);
|
||||
@@ -714,7 +714,7 @@ function ioServer($api_call, $data){
|
||||
//------------------------------------------
|
||||
function ioAPI($api_call, $data, $token){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
$bearertoken = createCommunicationToken($token);
|
||||
|
||||
@@ -757,7 +757,7 @@ function ioAPI($api_call, $data, $token){
|
||||
//------------------------------------------
|
||||
function ioAPIv2($api_call, $data, $token){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
$token = (!empty($token) || $token !='')? $token : 'authorization_request';
|
||||
$bearertoken = createCommunicationToken($token);
|
||||
@@ -924,7 +924,7 @@ function getProfile($profile, $permission){
|
||||
function isAllowed($page,$profile,$permission,$action){
|
||||
|
||||
//Include settingsa
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//GET ALLOWED ACTIONS
|
||||
$user_permission = ${'permission_'.$permission};
|
||||
@@ -1045,7 +1045,7 @@ function getPartnerID($str){
|
||||
// overview Indicators
|
||||
//------------------------------------------
|
||||
function overviewIndicators($warranty, $service, $sw_version, $sw_version_latest){
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
include dirname(__FILE__,2).'/settings/systemfirmware.php';
|
||||
$indicator ='';
|
||||
//In warranty
|
||||
@@ -1084,7 +1084,7 @@ function overviewIndicators($warranty, $service, $sw_version, $sw_version_latest
|
||||
|
||||
function warrantyStatus($input){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
//INCLUDE TRANSLATION FILE
|
||||
if(isset($_SESSION['country_code'])){
|
||||
$api_file_language = dirname(__FILE__,2).'/settings/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
|
||||
@@ -1116,7 +1116,7 @@ function warrantyStatus($input){
|
||||
|
||||
function serviceStatus($input){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//INCLUDE TRANSLATION FILE
|
||||
if(isset($_SESSION['country_code'])){
|
||||
@@ -1184,7 +1184,7 @@ function availableFirmware($sw_version,$sw_version_latest){
|
||||
//------------------------------------------
|
||||
function serviceEvents ($messages,$page){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//INCLUDE TRANSLATION FILE
|
||||
if(isset($_SESSION['country_code'])){
|
||||
@@ -1302,7 +1302,7 @@ function serviceReport($history, $request, $country_code)
|
||||
include dirname(__FILE__,2).'/settings/translations/translations_US.php';
|
||||
}
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
include dirname(__FILE__,2).'/settings/systemservicetool.php';
|
||||
|
||||
$json_array = json_decode($history->description);
|
||||
@@ -1948,7 +1948,7 @@ function serviceReport($history, $request, $country_code)
|
||||
//------------------------------------------
|
||||
function listPartner($partnertype, $user_right, $input, $required)
|
||||
{
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//BASED ON USERRIGHT DEFINE SQL AND DATA RETURNED
|
||||
if ($user_right != 3 || $user_right !=4) {
|
||||
@@ -1996,7 +1996,7 @@ return $view;
|
||||
//------------------------------------------
|
||||
function listAccounts($type, $user_right, $input)
|
||||
{
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//BASED ON USERRIGHT DEFINE SQL AND DATA RETURNED
|
||||
if ($user_right != 3 || $user_right !=4) {
|
||||
@@ -2088,7 +2088,7 @@ function uploadrequest($key){
|
||||
//------------------------------------------
|
||||
function displayImages($requestid,$request_type){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
$pdo = dbConnect($dbname);
|
||||
|
||||
@@ -2237,7 +2237,7 @@ function showlog($object,$objectID){
|
||||
else {
|
||||
include dirname(__FILE__,2).'/settings/translations/translations_US.php';
|
||||
}
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
// Connect to DB
|
||||
$pdo = dbConnect($dbname);
|
||||
@@ -2368,7 +2368,7 @@ function createPartner($user_salesid,$user_soldto,$p_name,$p_type, $token){
|
||||
// Update GEOlOCATION
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
function geolocationUpdate($token){
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//GET ALL WARRANTY REGISTRATIONS WHERE NO GEOLOCATION SET
|
||||
$sql = 'SELECT h.equipmentid, h.description FROM equipment e join equipment_history h on e.rowID = h.equipmentid where h.type = "Warranty" AND e.geolocation is Null';
|
||||
@@ -2497,7 +2497,7 @@ function getQuestions($type){
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
function convertCartest(){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//GET CARTEST FROM equipment_history TABLE
|
||||
$pdo = dbConnect($dbname);
|
||||
@@ -2555,7 +2555,7 @@ $messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
function traintotalMeasurement(){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//total measurement internal array
|
||||
$total_measurement = [];
|
||||
@@ -2720,7 +2720,7 @@ function usageBilling($messages){
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
function closeContract(){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
$pdo = dbConnect($dbname);
|
||||
|
||||
@@ -2768,7 +2768,7 @@ foreach ($messages as $message){
|
||||
|
||||
function storeMeasurementProduct($total_results, $token){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
$pdo = dbConnect($dbname);
|
||||
|
||||
@@ -2817,7 +2817,7 @@ function storeMeasurementProduct($total_results, $token){
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
function storeMeasurementEquipment($serialnumber){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//Connect to DB
|
||||
$pdo = dbConnect($dbname);
|
||||
@@ -3004,7 +3004,7 @@ return $healthindex;
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
function blockContracts($token){
|
||||
|
||||
include dirname(__FILE__,2).'/settings/settings.php';
|
||||
include dirname(__FILE__,2).'/settings/settings_redirector.php';
|
||||
|
||||
//CALL TO API
|
||||
$api_url = '/v2/contracts/status=1&type=0';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
$page = 'buildtool';
|
||||
//Check if allowed
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
include_once './settings/systemcartest.php';
|
||||
|
||||
$page = 'cartest';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
include_once './settings/systemcartest.php';
|
||||
|
||||
$page = 'cartest_manage';
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
$page = 'cartests';
|
||||
//Check if allowed
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||
$prev_page = (isset($_SESSION['origin']) && $_SESSION['origin'] == 'equipments') ? $_SESSION['prev_origin_equipment'] : ((isset($_SESSION['origin']) && $_SESSION['origin'] == 'account')? $_SESSION['prev_origin'] :'');
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
|
||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
define('secure_34563$52', true);
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
include_once './settings/config_redirector.php';
|
||||
|
||||
if (debug && debug_id == $_SESSION['id']){
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//Check if allowed
|
||||
if (isAllowed('dashboard',$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$_SESSION['prev_origin_equipment'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
$page = 'equipments_mass_update';
|
||||
//Check if allowed
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$_SESSION['prev_origin'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//Check if allowed
|
||||
$page = 'history';
|
||||
|
||||
@@ -17,7 +17,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
|
||||
//INCLUDE FUNCTIONS AND SETTINGS
|
||||
include dirname(__FILE__).'/assets/functions.php';
|
||||
include dirname(__FILE__).'/settings/settings.php';
|
||||
include dirname(__FILE__).'/settings/settings_redirector.php';
|
||||
|
||||
//=====================================
|
||||
//TRANSLATION FILE LOCATION
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
error_reporting(E_ALL);
|
||||
|
||||
include './assets/functions.php';
|
||||
include './settings/settings.php';
|
||||
include './settings/settings_redirector.php';
|
||||
include './settings/config_redirector.php';
|
||||
include_once './settings/translations/translations_US.php';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//Check if allowed
|
||||
if (isAllowed('marketing',$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
$page = 'media';
|
||||
//Check if allowed
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
$page = 'partners';
|
||||
//Check if allowed
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
include './assets/functions.php';
|
||||
include './settings/settings.php';
|
||||
include './settings/settings_redirector.php';
|
||||
include './settings/config_redirector.php';
|
||||
|
||||
//GET BROWSER LANGUAGE
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//For navigation
|
||||
$_SESSION['prev_origin'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
|
||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||
|
||||
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
$page = 'report_usage';
|
||||
//Check if allowed
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
include './assets/functions.php';
|
||||
include './settings/settings.php';
|
||||
include './settings/settings_redirector.php';
|
||||
include './settings/config_redirector.php';
|
||||
include_once './settings/translations/translations_US.php';
|
||||
|
||||
|
||||
2
rma.php
2
rma.php
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
include_once './settings/systemrma.php';
|
||||
|
||||
$page = 'rma';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
include_once './settings/systemrma.php';
|
||||
|
||||
$page = 'rma_manage';
|
||||
|
||||
2
rmas.php
2
rmas.php
@@ -7,7 +7,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
$page = 'rmas';
|
||||
//Check if allowed
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||
$prev_page = (isset($_SESSION['origin']) && $_SESSION['origin'] == 'equipments') ? $_SESSION['prev_origin_equipment'] : $_SESSION['prev_origin_servicereport'];
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||
$_SESSION['prev_origin_servicereport'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
31
settings/settings_redirector.php
Normal file
31
settings/settings_redirector.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
//=========================================
|
||||
//REDIRECTOR TO CONFIG FILE BASED ON DOMAIN
|
||||
//=========================================
|
||||
function getDomain($hostname) {
|
||||
// Extract the domain parts
|
||||
$parts = explode('.', $hostname);
|
||||
$count = count($parts);
|
||||
|
||||
// For hostnames with enough parts to have a subdomain (at least 3 parts)
|
||||
if ($count >= 3) {
|
||||
// Return the second-to-last and third-to-last parts
|
||||
return $parts[$count - 2];
|
||||
}
|
||||
// For hostnames with just domain and TLD (2 parts)
|
||||
else if ($count == 2) {
|
||||
// Return just the domain part (without the TLD)
|
||||
return $parts[0];
|
||||
}
|
||||
// If it's a single part hostname
|
||||
else {
|
||||
return $hostname;
|
||||
}
|
||||
}
|
||||
|
||||
$domain = getDomain($_SERVER['SERVER_NAME']);
|
||||
$settings_location = ((file_exists(dirname(__FILE__).'/'.$domain.'/'.$domain.'_settings.php')) ? dirname(__FILE__).'/'.$domain.'/'.$domain.'_settings.php' : dirname(__FILE__).'/settings.php');
|
||||
|
||||
include $settings_location;
|
||||
?>
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET ORIGIN FOR NAVIGATION
|
||||
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
include './assets/functions.php';
|
||||
include './settings/settings.php';
|
||||
include './settings/settings_redirector.php';
|
||||
include './settings/config_redirector.php';
|
||||
include_once './settings/translations/translations_US.php';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ if (debug && debug_id == $_SESSION['id']){
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/settings_redirector.php';
|
||||
|
||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||
$prev_page = (isset($_SESSION['origin']) && $_SESSION['origin'] == 'equipments') ? $_SESSION['prev_origin_equipment'] : ((isset($_SESSION['origin']) && $_SESSION['origin'] == 'account')? $_SESSION['prev_origin'] :'');
|
||||
|
||||
Reference in New Issue
Block a user