CMXX - Bugfixes

This commit is contained in:
“VeLiTi”
2024-10-03 16:01:14 +02:00
parent c42de76fb8
commit 7737be560c
3 changed files with 12 additions and 14 deletions

View File

@@ -608,7 +608,7 @@ function getProfile($profile, $permission){
else {
switch ($permission) {
case '4': //Admin++
$profile = admin_profile;
$profile = adminplus_profile;
break;
case '3': //Admin
$profile = admin_profile;

View File

@@ -1,18 +1,16 @@
<?php
defined(page_security_key) or exit;
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
// Configuration file
$file = './settings/settingsprofiles.php';
$page = 'profiles';
/*Check if allowed
//Check if allowed
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
header('location: index.php');
exit;
}
*/
// Open the configuration file for reading
$contents = file_get_contents($file);
@@ -67,7 +65,7 @@ function format_tabs($contents) {
// Format form
function format_form($contents) {
$rows = explode("\n", $contents);
$form = '<div class="tab-content active">';
$form = '<div class="tab-content active">Each tab represents a profile. Each element in a profile represents a view and or API access.';
for ($i = 0; $i < count($rows); $i++) {
preg_match('/\/\*(.*?)\*\//', $rows[$i], $match);
if ($match) {
@@ -93,7 +91,7 @@ if (isset($_POST['submit']) && !empty($_POST)) {
foreach($profile_views as $profile_view){
$view_input .= $profile_view.',';
}
$view_input = substr($view_input,0,-1);
$view_input = "'".substr($view_input,0,-1)."'";
// Update the configuration file with the new keys and values
$contents = preg_replace('/define\(\'' . $profile_name . '\'\, ?(.*?)\)/s', 'define(\'' . $profile_name . '\',' . $view_input . ')', $contents);

View File

@@ -1,16 +1,16 @@
<?php
/*Standard*/
define('standard_profile','dashboard,profile,equipments,equipment,histories,history,servicereports,servicereport,firmwaretool,application');
define('standard_profile','dashboard,profile,equipments,equipment,histories,history,firmwaretool,servicereports,servicereport,application');
/*Superuser*/
define('superuser_profile','dashboard,profile,assets,equipments,equipment,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,products,product,products_versions,product_manage,servicereports,servicereport,application,sales,contracts,contract,contract_manage,admin,partners,partner,users,user,user_manage,marketing');
define('superuser_profile','dashboard,profile,sales,contracts,contract,contract_manage,assets,equipments,equipment,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,products,products_versions,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,marketing,application');
/*Service*/
define('service','dashboard,profile,assets,equipments,equipment,equipment_manage,histories,history,history_manage,firmwaretool,servicereports,servicereport,application,admin,partners,partner,marketing');
define('service','dashboard,profile,assets,equipments,equipment,equipment_manage,histories,history,history_manage,firmwaretool,servicereports,servicereport,admin,partners,partner,marketing,application');
/*Admin*/
define('admin_profile','dashboard,profile,buildtool,assets,equipments,equipment,equipment_healthindex,equipment_data,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,buildtool,products,products_versions,product,product_manage,servicereports,servicereport,config,settings,language,application,admin,partners,partner,users,user,user_manage,logfile,account,communications,communication,communication_send,sales,accounts,account,contracts,contract,contract_manage,marketing,cartests,cartest,cartest_manage,changelog,reporting,report_build,report_healthindex,report_usage,maintenance');
define('admin_profile','dashboard,profile,buildtool,sales,accounts,account,contracts,contract,contract_manage,cartests,cartest,cartest_manage,assets,equipments,equipment,equipment_healthindex,equipment_data,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,buildtool,products,products_versions,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,communications,communication,communication_send,marketing,reporting,report_build,report_healthindex,report_usage,application');
/*AdminPlus*/
define('adminplus_profile','dashboard,profile,buildtool,assets,equipments,equipment,equipment_healthindex,equipment_data,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,buildtool,products,products_versions,product,product_manage,servicereports,servicereport,config,settings,language,application,admin,partners,partner,users,user,user_manage,logfile,account,communications,communication,communication_send,sales,accounts,account,contracts,contract,contract_manage,marketing,cartests,cartest,cartest_manage,changelog,reporting,report_build,report_healthindex,report_usage,maintenance');
define('adminplus_profile','dashboard,profile,buildtool,sales,accounts,account,contracts,contract,contract_manage,cartests,cartest,cartest_manage,assets,equipments,equipment,equipment_healthindex,equipment_data,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,buildtool,products,products_versions,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,communications,communication,communication_send,marketing,reporting,report_build,report_healthindex,report_usage,config,settings,logfile,changelog,language,application,maintenance,profiles');
/*Build*/
define('build','buildtool,application');
define('build','buildtool,buildtool,application');
/*Distribution*/
define('distribution','');
/*Firmware*/