"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mrbs-1.9.4/web/init.inc" between
mrbs-1.9.4.tar.gz and mrbs-1.10.0.tar.gz

About: MRBS is a web application for booking meeting rooms or other resources (using PHP and MySQL/pgsql).

init.inc  (mrbs-1.9.4):init.inc  (mrbs-1.10.0)
<?php <?php
namespace MRBS; namespace MRBS;
use MRBS\Form\Form; use MRBS\Form\Form;
use SessionHandler;
function init_errors() function init_errors() : void
{ {
global $debug; global $debug;
// If the error log file is a relative path then turn it into an absolute one in // If the error log file is a relative path then turn it into an absolute one in
// order to avoid problems in shutdown when the working directory can change. // order to avoid problems in shutdown when the working directory can change.
// (See the notes in https://www.php.net/manual/en/function.register-shutdown- function.php). // (See the notes in https://www.php.net/manual/en/function.register-shutdown- function.php).
// Check for both Windows and Unix style separators because Unix separators ca n be used // Check for both Windows and Unix style separators because Unix separators ca n be used
// on Windows. // on Windows.
$error_log = ini_get('error_log'); $error_log = ini_get('error_log');
if (isset($error_log) && if (isset($error_log) &&
skipping to change at line 58 skipping to change at line 59
assert_options(ASSERT_ACTIVE, false); assert_options(ASSERT_ACTIVE, false);
} }
error_reporting ($error_level); error_reporting ($error_level);
set_error_handler(__NAMESPACE__ . "\\error_handler", $error_level); set_error_handler(__NAMESPACE__ . "\\error_handler", $error_level);
set_exception_handler(__NAMESPACE__ . "\\exception_handler"); set_exception_handler(__NAMESPACE__ . "\\exception_handler");
register_shutdown_function(__NAMESPACE__ . "\\shutdown_function"); register_shutdown_function(__NAMESPACE__ . "\\shutdown_function");
} }
function init_joomla() function init_joomla() : void
{ {
$mainframe = JFactory::getApplication('site'); $mainframe = JFactory::getApplication('site');
$mainframe->initialise(); $mainframe->initialise();
} }
function init_sessions() function init_sessions() : void
{ {
global $auth; global $auth;
// The cookie session scheme doesn't use PHP sessions // The cookie session scheme doesn't use PHP sessions
if ($auth['session'] == 'cookie') if ($auth['session'] == 'cookie')
{ {
return; return;
} }
// Joomla has its own session management // Joomla has its own session management
if ($auth['session'] == 'joomla') if ($auth['session'] == 'joomla')
{ {
init_joomla(); init_joomla();
return; return;
} }
// If we're using SAML then initialising sessions here can interfere with
// session handling in some SAML libraries
if (($auth['session'] == 'saml') && $auth['saml']['disable_mrbs_session_init']
)
{
return;
}
// Set some session settings, as a defence against session fixation. // Set some session settings, as a defence against session fixation.
ini_set('session.use_only_cookies', '1'); ini_set('session.use_only_cookies', '1');
ini_set('session.use_strict_mode', '1'); // Only available since PHP 5.5.2, b ut does no harm before then ini_set('session.use_strict_mode', '1'); // Only available since PHP 5.5.2, b ut does no harm before then
ini_set('session.use_trans_sid', '0'); ini_set('session.use_trans_sid', '0');
$cookie_path = get_cookie_path(); $cookie_path = get_cookie_path();
if (!isset($auth['session_php']['session_expire_time'])) if (!isset($auth['session_php']['session_expire_time']))
{ {
// Default to the behaviour of previous versions of MRBS, use only // Default to the behaviour of previous versions of MRBS, use only
skipping to change at line 132 skipping to change at line 140
} }
if ($session_started === false) if ($session_started === false)
{ {
if ($session_table_should_exist) if ($session_table_should_exist)
{ {
$message = "Could not start DB sessions, trying ordinary PHP sessions."; $message = "Could not start DB sessions, trying ordinary PHP sessions.";
trigger_error($message, E_USER_WARNING); trigger_error($message, E_USER_WARNING);
} }
$handler = new \SessionHandler(); $handler = new SessionHandler();
session_set_save_handler($handler, true); session_set_save_handler($handler, true);
if (false === session_start()) if (false === session_start())
{ {
// Check that the session started OK. If we're using the 'php' session s cheme then // Check that the session started OK. If we're using the 'php' session s cheme then
// they are essential. Otherwise they are desirable for storing CSRF tok ens, but if // they are essential. Otherwise they are desirable for storing CSRF tok ens, but if
// they are not working we will fall back to using cookies. // they are not working we will fall back to using cookies.
$message = "MRBS: could not start sessions"; $message = "MRBS: could not start sessions";
if ($auth['session'] == 'php') if ($auth['session'] == 'php')
 End of changes. 6 change blocks. 
4 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)