- 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.
15 lines
261 B
PHP
15 lines
261 B
PHP
<?php
|
|
// Start sessions
|
|
session_start();
|
|
|
|
$_SESSION = array();
|
|
|
|
// Destroy all session related to user
|
|
$_SESSION['authorization']['profile'] = '';
|
|
session_unset();
|
|
session_destroy();
|
|
|
|
// Redirect to login page
|
|
header('location: login.php');
|
|
exit;
|
|
?>
|