Refactor user session handling and permissions management
- Updated session variables to use 'authorization' array instead of 'username' for user identification across multiple files. - Introduced a new function `getUserPermissions` to consolidate user permissions retrieval based on assigned roles. - Modified API calls to use the new authorization structure and updated endpoints to v2. - Enhanced language support by adding 'PL' to the list of supported languages. - Cleaned up redundant code and improved session management during user login and registration processes. - Added a new API endpoint for fetching user permissions based on user ID.
This commit is contained in:
@@ -8,7 +8,7 @@ $domain = getDomainName($_SERVER['SERVER_NAME']);
|
||||
$file = ((file_exists(dirname(__FILE__).'/custom/'.$domain.'/settings/'.$domain.'_config.php')) ? dirname(__FILE__).'/custom/'.$domain.'/settings/'.$domain.'_config.php' : dirname(__FILE__).'/settings/config.php');
|
||||
|
||||
//Check if allowed
|
||||
if (isAllowed('settings',$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||
if (isAllowed('settings',$_SESSION['authorization']['profile'],$_SESSION['authorization']['permission'],'R') === 0){
|
||||
header('location: index.php');
|
||||
exit;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ if (isset($_POST['submit']) && !empty($_POST)) {
|
||||
|
||||
if (isset($_POST['geoupdate'])){
|
||||
//GEOLOCATION UPDATE
|
||||
geolocationUpdate($_SESSION['userkey']);
|
||||
geolocationUpdate($_SESSION['authorization']['userkey']);
|
||||
}
|
||||
|
||||
if (isset($_POST['updatecartest'])){
|
||||
|
||||
Reference in New Issue
Block a user