This commit is contained in:
Walter Hupfeld
2024-03-15 19:46:25 +01:00
parent e325b14ee7
commit 0d5fb5e5da
13 changed files with 77 additions and 44 deletions

View File

@@ -23,7 +23,7 @@
<link href="../css/font-awesome.min.css" rel="stylesheet">
<script src="../js/jquery.min.js"></script>
<title>Konfigruation</title>
<title>Konfiguration</title>
<style>
.leftlabel { width: 10em;}
input[type="text"] { width: 18em;}
@@ -91,9 +91,11 @@
<input type="checkbox" id="districtSelection" name="districtSelection" <?= ($boolDistrictSelection) ? "checked=\"checked\"" :"" ?> >
<label for="districtSelection">Auswahl Kreise in Navigation</label><br>
<input type="checkbox" id="approve" name="approve" <?= ($boolApprove) ? "checked=\"checked\"" :"" ?> >
<label for="approve">Eingaben genehmigen</label>
<label for="approve">Eingaben genehmigen</label><br>
<input type="checkbox" id="sidebar" name="sidebar" <?= ($boolSidebar) ? "checked=\"checked\"" :"" ?> >
<label for="sidebar">Sidebar anzeigen</label>
<br>
<label class="leftlabel">Uplaod-Pfad:</label>
<label class="leftlabel">Upload-Pfad:</label>
<input type="text" class="wide" name="uploaddir" id="uploaddir" value="<?=$uploaddir?>">
</div>
</div>

View File

@@ -17,7 +17,7 @@
$boolDefect = (isset($_POST['defect'])) ? "1" : "0";
$boolDistrictSelection = (isset($_POST['districtSelection'])) ? "1" : "0";
$boolApprove = (isset($_POST['approve'])) ? "1" : "0";
$boolSidebar = (isset($_POST['sidebar'])) ? "1" : "0";
$strUploaddir = $_POST['uploaddir'];
$strTitle = $_POST['title'];
@@ -45,6 +45,7 @@
$db->query("UPDATE `config` SET `value`= '$boolDefect' WHERE `key`='boolDefect'");
$db->query("UPDATE `config` SET `value`= '$boolUpload' WHERE `key`='boolUpload'");
$db->query("UPDATE `config` SET `value`= '$boolApprove' WHERE `key`='boolApprove'");
$db->query("UPDATE `config` SET `value`= '$boolSidebar' WHERE `key`='boolSidebar'");
$db->query("UPDATE `config` SET `value`= '$boolDistrictSelection' WHERE `key`='boolDistrictSelection'");
header("Location: configuration.php");

View File

@@ -32,7 +32,7 @@
<link href="../css/font-awesome.min.css" rel="stylesheet">
<script src="../js/jquery.min.js"></script>
<title>Konfigruation</title>
<title>Konfiguration</title>
<style>
.leftlabel { width: 10em;}
input[type="text"] { width: 18em;}

View File

@@ -36,7 +36,7 @@
<link href="../css/font-awesome.min.css" rel="stylesheet">
<script src="../js/jquery.min.js"></script>
<title>Konfigruation</title>
<title>Konfiguration</title>
<style>
.leftlabel { width: 10em;}
input[type="text"] { width: 18em;}

View File

@@ -144,7 +144,6 @@
<script src="../js/leaflet.awesome-markers.js"></script>
<script src="../js/jquery.fancybox.min.js"></script>
<title>Eintragsliste</title>
<style>
.tdmap { height:350px; width:300px;}
</style>
@@ -237,7 +236,8 @@
$strDatum = date("d.m.Y",$numDatum);
echo $strDatum."</em><br>";
echo nl2br(stripslashes($comment['comment']));
echo "<a class='left' href='".$_SERVER['PHP_SELF']."?delcid=".$comment['id']."&csrf=".$_SESSION['csrf_token']."'><i class='fa fa-trash'></i></a>";
echo "<a class='left' href='".$_SERVER['PHP_SELF']."?delcid=".$comment['id']."&csrf=".$_SESSION['csrf_token']."'>".
"<span data-toggle='tooltip' title='Freischalten/Sperren'><i class='fa fa-trash'></i></span></a>";
echo "</div>";
}
echo "</td>";
@@ -256,7 +256,8 @@
if ($file=$files->fetch(PDO::FETCH_ASSOC)) {
echo "<a href='../images/".$file['filename']."' data-fancybox data-caption='".$strDefect."'>";
echo "<img src='../images/".$file['filename']."' style='width:150px'></a>";
echo "<a href='".$_SERVER['PHP_SELF']."?delfid=".$file['id']."&csrf=".$_SESSION['csrf_token']."'><i class='fa fa-trash'></i></a>";
echo "<a href='".$_SERVER['PHP_SELF']."?delfid=".$file['id']."&csrf=".$_SESSION['csrf_token']."'>".
"<span data-toggle='tooltip' title='Bild löschen'><i class='fa fa-trash'></i></span></a>";
}
echo "</td>\n";
@@ -270,13 +271,15 @@
echo "<td>".$row['created_at']."</td>";
if ($boolApprove) {
$strApproved = ($row['approval']) ? "<i class='fa fa-check' style='color:green'></i>"
: "<i class='fa fa-circle' style='color:red'></i>" ;
$strApproved .= " <i class='fa fa-recycle'></i>";
$strApproved = ($row['approval']) ? "<span data-toggle='data-toggle' title='Eintrag sperren'><i class='fa fa-check' style='color:green'></i>"
: "<span data-toggle='tooltip' title='Eintrag freischalten'><i class='fa fa-circle' style='color:red'></i>" ;
$strApproved .= " <i class='fa fa-recycle'></i></span>";
echo "<td><a href='".$_SERVER['PHP_SELF']."?approvalId=".$id."&csrf=".$_SESSION['csrf_token']."'>".$strApproved."</a></td>";
}
echo "<td><a class='del' href='".$_SERVER['PHP_SELF']."?delid=".$id."&csrf=".$_SESSION['csrf_token']."'><i class='fa fa-trash'></i></a>&nbsp;";
echo "<a class='edit_defect' href='#' id='edit_".$id."' value='".$id."'><i class='fa fa-pencil'></i></a>";
echo "<td><a class='del' href='".$_SERVER['PHP_SELF']."?delid=".$id."&csrf=".$_SESSION['csrf_token']."'>".
"<span data-toggle='tooltip' title='Eintrag löschen'><i class='fa fa-trash'></i></span></a>&nbsp;";
echo "<a class='edit_defect' href='#' id='edit_".$id."' value='".$id."'>".
"<span data-toggle='tooltip' title='Eintrag editieren'><i class='fa fa-pencil'></span></i></a>";
echo "</td>";
echo "</tr>\n";
@@ -327,7 +330,6 @@ $( document ).ready(function() {
return result===true;
})
$("#editobjectform").submit(function(event){
event.preventDefault();
@@ -369,7 +371,7 @@ $( document ).ready(function() {
$('#close').click(function(e){
$('#dialog_defect').hide();
});
<?= $strScript ?>
});
</script>

View File

@@ -26,9 +26,9 @@ $boolLogin=true;
$strPassword = trim($_POST['password']);
$strSQL = "SELECT username,passwordhash,district,role FROM user WHERE username=:user";
$stmt = $db->prepare($strSQL);
$stmt->bindValue(':user',$strUser);
$result=$stmt->execute();
if ($row=$result->fetch(PDO::FETCH_ASSOC)) {
$stmt->bindValue(":user",$strUser, PDO::PARAM_STR);
$stmt->execute();
if ($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
$boolOk = $strDistrict==$row['district'] || $row['role']=="admin";
if (password_verify($strPassword,$row['passwordhash']) && $boolOk) {
$_SESSION['user']=$strUser;
@@ -62,6 +62,9 @@ $boolLogin=true;
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<?php if (!$boolSidebar): ?>
<a href="start.php"><img class="logo_navbar" src="../<?=$strLogo?>" alt="Logo"></a>
<?php endif; ?>
<a class="navbar-brand" href="#"><?=$strTitle?> <?=$strDistrictTitle?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@@ -76,6 +79,17 @@ $boolLogin=true;
</li>
</ul>
</div>
<ul class="navbar-nav mr-auto right">
<li class="nav-item">
<a class="nav-link" href="../impressum.php">Impressum</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../datenschutz.php">Datenschutzerklärung</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="login.php">Login <span class="sr-only">(current)</span></a>
</li>
</ul>
</nav>
<!-- Ende Navbar -->