Skip to content

Commit

Permalink
Merge pull request #183 from timschofield/master
Browse files Browse the repository at this point in the history
Fix typo in variable name
  • Loading branch information
TurboPT authored Sep 17, 2019
2 parents f8cfb45 + b068054 commit c04ffce
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions PageSecurity.php
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
<?php


include('includes/session.php');
include ('includes/session.php');
$Title = _('Page Security Levels');
include('includes/header.php');
include ('includes/header.php');

echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/security.png" title="' . _('Page Security Levels') . '" alt="" />' . ' ' . $Title . '</p><br />';
echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/security.png" title="' . _('Page Security Levels') . '" alt="" />' . ' ' . $Title . '</p><br />';

if($AllowDemoMode) {
if ($AllowDemoMode) {
prnMsg(_('The the system is in demo mode and the security model administration is disabled'), 'warn');
exit;
}

if (isset($_POST['Update']) AND $AlloDemoMode!= true) {
if (isset($_POST['Update']) and $AllowDemoMode != true) {
foreach ($_POST as $ScriptName => $PageSecurityValue) {
if ($ScriptName!='Update' and $ScriptName!='FormID') {
$ScriptName = mb_substr($ScriptName, 0, mb_strlen($ScriptName)-4).'.php';
$sql="UPDATE scripts SET pagesecurity='". $PageSecurityValue . "' WHERE script='" . $ScriptName . "'";
$UpdateResult=DB_query($sql,_('Could not update the page security value for the script because'));
if ($ScriptName != 'Update' and $ScriptName != 'FormID') {
$ScriptName = mb_substr($ScriptName, 0, mb_strlen($ScriptName) - 4) . '.php';
$SQL = "UPDATE scripts SET pagesecurity='" . $PageSecurityValue . "' WHERE script='" . $ScriptName . "'";
$UpdateResult = DB_query($SQL, _('Could not update the page security value for the script because'));
}
}
}

$sql="SELECT script,
$SQL = "SELECT script,
pagesecurity,
description
FROM scripts";

$result=DB_query($sql);
$Result = DB_query($SQL);

echo '<br /><form method="post" id="PageSecurity" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">';
echo '<br /><form method="post" id="PageSecurity" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';

echo '<table class="selection">';

$TokenSql="SELECT tokenid,
$TokenSql = "SELECT tokenid,
tokenname
FROM securitytokens
ORDER BY tokenname";
$TokenResult=DB_query($TokenSql);
$TokenResult = DB_query($TokenSql);

while ($myrow=DB_fetch_array($result)) {
while ($MyRow = DB_fetch_array($Result)) {
echo '<tr>
<td>' . $myrow['script'] . '</td>
<td><select name="' . $myrow['script'] . '">';
<td>' . $MyRow['script'] . '</td>
<td><select name="' . $MyRow['script'] . '">';

while ($myTokenRow=DB_fetch_array($TokenResult)) {
if ($myTokenRow['tokenid']==$myrow['pagesecurity']) {
while ($myTokenRow = DB_fetch_array($TokenResult)) {
if ($myTokenRow['tokenid'] == $MyRow['pagesecurity']) {
echo '<option selected="selected" value="' . $myTokenRow['tokenid'] . '">' . $myTokenRow['tokenname'] . '</option>';
} else {
echo '<option value="'.$myTokenRow['tokenid'].'">' . $myTokenRow['tokenname'] . '</option>';
echo '<option value="' . $myTokenRow['tokenid'] . '">' . $myTokenRow['tokenname'] . '</option>';
}
}
echo '</select></td>
Expand All @@ -61,11 +60,11 @@
echo '</table><br />';

echo '<div class="centre">
<input type="submit" name="Update" value="'._('Update Security Levels').'" />
<input type="submit" name="Update" value="' . _('Update Security Levels') . '" />
</div>
<br />
</div>
</form>';

include('includes/footer.php');
include ('includes/footer.php');
?>

0 comments on commit c04ffce

Please sign in to comment.