mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-06-16 12:45:36 +02:00
Create a new session if permission denied on current one (#331)
In a multi-user configuration, the current session file can be unreadable by the current user. This tries to create a new session in this case.
This commit is contained in:
parent
5903849388
commit
8fb1816877
|
@ -203,7 +203,17 @@ if (defined('FM_EMBED')) {
|
||||||
|
|
||||||
session_cache_limiter('');
|
session_cache_limiter('');
|
||||||
session_name(FM_SESSION_ID );
|
session_name(FM_SESSION_ID );
|
||||||
@session_start();
|
function session_error_handling_function($code, $msg, $file, $line) {
|
||||||
|
// Permission denied for default session, try to create a new one
|
||||||
|
if ($code == 2) {
|
||||||
|
session_abort();
|
||||||
|
session_id(session_create_id());
|
||||||
|
@session_start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set_error_handler('session_error_handling_function');
|
||||||
|
session_start();
|
||||||
|
restore_error_handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($auth_users)) {
|
if (empty($auth_users)) {
|
||||||
|
|
Loading…
Reference in a new issue