do not try to load sessions if session_file config parameter is empty
This commit is contained in:
parent
ba16cf41fe
commit
ebfa5f7405
|
@ -652,6 +652,8 @@ void SessionManager::LoadSessions()
|
||||||
SessionParser sp;
|
SessionParser sp;
|
||||||
SessionContainer::Iterator i;
|
SessionContainer::Iterator i;
|
||||||
|
|
||||||
|
if( !config->session_file.empty() )
|
||||||
|
{
|
||||||
sp.set_dependency(this);
|
sp.set_dependency(this);
|
||||||
|
|
||||||
// sessions will be overwritten (pointers are invalidated)
|
// sessions will be overwritten (pointers are invalidated)
|
||||||
|
@ -673,6 +675,12 @@ SessionContainer::Iterator i;
|
||||||
if( i->puser )
|
if( i->puser )
|
||||||
plugin->Call(&(*i), WINIX_USER_LOGGED);
|
plugin->Call(&(*i), WINIX_USER_LOGGED);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// FIXME this log is not printed, why?
|
||||||
|
main_log << log1 << "SM: session_file config parameter is empty, not loading sessions" << logend;
|
||||||
|
}
|
||||||
|
|
||||||
cur->session = &temporary_session;
|
cur->session = &temporary_session;
|
||||||
}
|
}
|
||||||
|
@ -686,7 +694,10 @@ void SessionManager::SaveSessions()
|
||||||
char file_path[WINIX_OS_PATH_SIZE];
|
char file_path[WINIX_OS_PATH_SIZE];
|
||||||
|
|
||||||
if( config->session_file.empty() )
|
if( config->session_file.empty() )
|
||||||
|
{
|
||||||
|
main_log << log1 << "SM: session_file config parameter is empty, not saving sessions - sessions lost" << logend;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( !wide_to_utf8(config->session_file, file_path, WINIX_OS_PATH_SIZE) )
|
if( !wide_to_utf8(config->session_file, file_path, WINIX_OS_PATH_SIZE) )
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue