Implement RBAC migration and role management enhancements
- Added AJAX functionality to fetch role permissions for copying. - Introduced system role management with permission checks for updates. - Implemented role deletion with confirmation modal and backend handling. - Enhanced user role assignment migration scripts to transition from legacy profiles to RBAC. - Created SQL migration scripts for user roles and permissions mapping. - Updated user interface to support new role management features including copy permissions and system role indicators.
This commit is contained in:
19
login.php
19
login.php
@@ -78,13 +78,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
//Decode Payload
|
||||
if (!empty($responses)){$responses = json_decode($responses,true);}else{$responses = '400';}
|
||||
|
||||
if ($responses === 'NOK'){
|
||||
|
||||
if ($responses === 'NOK' || $responses === 'NULL' || $responses === 'NULL '){
|
||||
$retry++;
|
||||
$password_err = $password_err_1 ?? 'Not authorized, please retry';
|
||||
} elseif ($responses == '1'){
|
||||
$password_err = $password_err_2 ?? 'Too many login attempts. User blocked, please contact your administrator';
|
||||
} else {
|
||||
} elseif (!empty($responses['userkey']) && ctype_xdigit($responses['userkey'])) {
|
||||
// Start a new session
|
||||
session_start();
|
||||
|
||||
@@ -93,14 +93,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$_SESSION['authorization'] = $responses;
|
||||
|
||||
$language_user = trim($_SESSION['authorization']['language']) ?? 'US';
|
||||
if($responses->profile == 'firmwaretool,products_software,application'){
|
||||
header('location: index.php?page=firmwaretool');
|
||||
exit();
|
||||
|
||||
} else {
|
||||
header('location: index.php?language='.$language_user.'');
|
||||
exit();
|
||||
}
|
||||
header('location: index.php?language='.$language_user.'');
|
||||
exit();
|
||||
|
||||
} else {
|
||||
$retry++;
|
||||
$password_err = $password_err_1 ?? 'Not authorized, please retry';
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user