diff --git a/churchinfo/Default.php b/churchinfo/Default.php index cf68e6dde0..f1e7c9669b 100644 --- a/churchinfo/Default.php +++ b/churchinfo/Default.php @@ -45,7 +45,7 @@ // Initialize the variables // Is the user requesting to logoff or timed out? -if (isset($_GET["Logoff"]) || isset($_GET['timeout'])) { +if (isset($_GET["Logoff"]) || isset($_GET['Timeout'])) { if (!isset($_SESSION['sshowPledges']) || ($_SESSION['sshowPledges'] == '')) $_SESSION['sshowPledges'] = 0; if (!isset($_SESSION['sshowPayments']) || ($_SESSION['sshowPayments'] == '')) @@ -331,7 +331,7 @@

$sSessionTimeout) { - Redirect("Default.php?timeout"); + Redirect("Default.php?Timeout"); exit; } else { @@ -269,12 +269,6 @@ function RedirectURL($sRelativeURL) global $sRootPath; global $sDocumentRoot; - if (!isset($_SESSION['sRootPath'])) - { - header('Location: Default.php?timeout'); - exit; - } - // Test if file exists before redirecting. May need to remove // query string first. $iQueryString = strpos($sRelativeURL, '?'); @@ -285,21 +279,23 @@ function RedirectURL($sRelativeURL) } // The idea here is to get the file path into this form: - // $sFullPath = $sDocumentRoot.$sRootPath.$sPathExtension + // $sFullPath = $sDocumentRoot . $sRootPath . $sPathExtension // The Redirect URL is then in this form: - // $sRedirectURL = $_SESSION['sRootPath'].$sPathExtension - + // $sRedirectURL = $sRootPath . $sPathExtension $sFullPath = str_replace('\\', '/', $sDocumentRoot . '/' . $sPathExtension); // With the query string removed we can test if file exists - if (file_exists($sFullPath) && is_readable($sFullPath)) { - return ($_SESSION['sRootPath'] . '/' . $sRelativeURL); - } else { - $sErrorMessage = 'Fatal Error: Cannot access file: '.$sFullPath."
\n"; - $sErrorMessage .= "\$sPathExtension = $sPathExtension
\n"; - $sErrorMessage .= "\$sDocumentRoot = $sDocumentRoot
\n"; - $sErrorMessage .= "\$_SESSION['sRootPath'] = "; - $sErrorMessage .= $_SESSION['sRootPath'] . "
\n"; + if (file_exists($sFullPath) && is_readable($sFullPath)) + { + return ($sRootPath . '/' . $sRelativeURL); + } + else + { + $sErrorMessage = 'Fatal Error: Cannot access file: '.$sFullPath."
\n" + . "\$sPathExtension = $sPathExtension
\n" + . "\$sDocumentRoot = $sDocumentRoot
\n" + . "\$_SESSION['sRootPath'] = " + . $sRootPath . "
\n"; die ($sErrorMessage); } diff --git a/churchinfo/Include/Initialize.php b/churchinfo/Include/Initialize.php index 01642977bf..c5175314be 100644 --- a/churchinfo/Include/Initialize.php +++ b/churchinfo/Include/Initialize.php @@ -47,7 +47,7 @@ if ($sSessionTimeout > 0) { if ((time() - $_SESSION['tLastOperation']) > $sSessionTimeout) { - Redirect("Default.php?timeout"); + Redirect("Default.php?Timeout"); exit; } else { $_SESSION['tLastOperation'] = time();