Skip to content

Commit

Permalink
Remove remaining loads of sRootPath from session (ChurchCRM#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Feb 14, 2016
1 parent f02d6d9 commit 2bc0a64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
25 changes: 12 additions & 13 deletions churchinfo/Include/Header-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function GetSecuritySettings()

$sSecurityCond = " AND (security_grp = 'bALL'";
for ($i = 0; $i < count($aSecurityList); $i++) {
if (array_key_exists ($aSecurityList[$i], $_SESSION) && $_SESSION[$aSecurityList[$i]]) {
if (array_key_exists ($aSecurityList[$i], $_SESSION) && $_SESSION[$aSecurityList[$i]]) {
$sSecurityCond .= " OR security_grp = '" . $aSecurityList[$i] . "'";
}
}
Expand Down Expand Up @@ -186,9 +186,9 @@ function addMenu($menu) {
}
}

function addMenuItem($aMenu,$mIdx) {
global $security_matrix, $sRootPath;
$sRootPath = $_SESSION['sRootPath'];
function addMenuItem($aMenu,$mIdx)
{
global $security_matrix, $sRootPath;

$link = ($aMenu['uri'] == "") ? "" : $sRootPath."/".$aMenu['uri'];
$text = $aMenu['statustext'];
Expand Down Expand Up @@ -252,21 +252,20 @@ function addMenuItem($aMenu,$mIdx) {
addMenu($aMenu['name']);
echo "</ul>\n</li>\n";
} else {
echo "</li>\n";
}
echo "</li>\n";
}

return true;
} else {
return false;
}
}

function Header_body_menu() {
function Header_body_menu()
{
global $sLanguage, $bExportCSV, $sMetaRefresh, $bToolTipsOn, $bRegistered, $sHeader, $sGlobalMessage;
global $MenuFirst, $sPageTitle, $sPageTitleSub, $sRootPath;

$sRootPath = $_SESSION['sRootPath'];

$loggedInUserPhoto = (new PersonService())->getPhoto($_SESSION['iUserID']);

$MenuFirst = 1;
Expand All @@ -276,7 +275,7 @@ function Header_body_menu() {
// Must first set a table with a background color, or content scrolls across
// the background of the custom code when using a non-defective browser
echo "<table width=\"100%\" bgcolor=white cellpadding=0 cellspacing=0 border=0><tr><td width=\"100%\">";
echo html_entity_decode($sHeader,ENT_QUOTES);
echo html_entity_decode($sHeader, ENT_QUOTES);
echo "</td></tr></table>";
}
?>
Expand Down Expand Up @@ -470,9 +469,9 @@ function addSection($menu) {
}
}

function addEntry($aMenu) {

$sRootPath = $_SESSION['sRootPath'];
function addEntry($aMenu)
{
global $sRootPath;

$link = ($aMenu['uri'] == "") ? "" : $sRootPath."/".$aMenu['uri'];
$text = $aMenu['statustext'];
Expand Down
2 changes: 0 additions & 2 deletions churchinfo/Include/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

// Top level menu index counter
$MenuFirst = 1;

$sRootPath = $_SESSION['sRootPath'];
?>
<!DOCTYPE HTML>
<html>
Expand Down

0 comments on commit 2bc0a64

Please sign in to comment.