Browse Source

Added impressum and privacy policity links

master
Givou 1 year ago
parent
commit
133be6c98d
  1. 20
      admin.php
  2. 10
      css/style.css
  3. 5
      index.php
  4. 2
      install/index.php
  5. 44
      worker.php

20
admin.php

@ -511,6 +511,26 @@ if(isset($_GET["manageservice"])) {
</select>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<div class="placeholder"></div>
<div class="content">Impressum & Privacy Policity</div>';
if($_GET['impressumset']) {
echo '<p class="upassword">Impressum link set to: '.$_GET['impressumset'].'!</p>';
} else if($_GET['privacyset']) {
echo '<p class="upassword">Privacy policity link set to: '.$_GET['privacyset'].'!</p>';
}
echo '
<form action="admin.php?upimpressum" method="post">
<input type="text" class="username-field" value="'.$impressum.'" readonly>
<input type="text" class="username-field" placeholder="Impressum link" name="impressum">
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<form action="admin.php?upprivacy" method="post">
<input type="text" class="username-field" value="'.$privacy.'" readonly>
<input type="text" class="username-field" placeholder="Privacy policity link" name="privacy">
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
</div>
</div>';
}

10
css/style.css

@ -452,6 +452,12 @@ label::after {
}
.footer a {
text-decoration: none;
color: #868c96;
}
.footer a:hover {
text-decoration: underline;
color: #868c96;
}
@ -641,6 +647,6 @@ label::after {
}
.underline {
text-decoration: underline;
text-decoration-color: #a6a6a6;
text-decoration: underline;
text-decoration-color: #a6a6a6;
}

5
index.php

@ -17,6 +17,8 @@
$instancename = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='instancename'"))["value"];
$autoreload_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='autoreload'"))["value"];
$modular_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='modularwindow'"))["value"];
$privacy = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='privacy'"))["value"];
$impressum = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='impressum'"))["value"];
$groups = mysqli_query($con, "SELECT priority, name, id FROM groups ORDER BY priority DESC");
$services = mysqli_query($con, "SELECT priority, groupid, name, id, status FROM services ORDER BY priority DESC");
@ -257,7 +259,8 @@ echo '</div>';
<!-- FOOTER -->
<footer class="footer">
<p class="footer">Powered by <a class="underline" href="http://git.thiemoo.at/Givou/WebStatus.git" target="_blank">WebStatus</a></p>
<p class="footer-subtext">Made with <span class="footer-heart"><i class="fa fa-heart"></i></span> by Givou</p>
<p class="footer-subtext"><a href="<?php echo $impressum; ?>">Impressum</a> | <a href="<?php echo $privacy; ?>">Privacy policity</a></p>
<p class="footer-subtext">Made with <span class="footer-heart"><i class="fa fa-heart"></i></span> by <a target"_blank" href="thiemoo.at">Givou</a></p>
</footer>
<div class="legend">

2
install/index.php

@ -87,6 +87,8 @@ if(isset($_POST['dbhost']) && isset($_POST['dbname']) && isset($_POST['dbpwd'])
//Infliating Settings
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('instancename', '".mysqli_real_escape_string($con,$instancename)."')");
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('autoreload', 'enabled')");
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('impressum', '#')");
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('privacy', '#')");
//Creating Administrative User
mysqli_query($con, "INSERT INTO accounts (username, password, role) VALUES ('".mysqli_real_escape_string($con,$admin_username)."',

44
worker.php

@ -23,6 +23,8 @@ if ( mysqli_connect_errno() ) {
$role = mysqli_fetch_assoc(mysqli_query($con, "SELECT role FROM accounts WHERE id='".mysqli_real_escape_string($con, $_SESSION['id'])."'"))["role"];
$instancename = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='instancename'"))["value"];
$privacy = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='privacy'"))["value"];
$impressum = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='impressum'"))["value"];
if($role == "administrator") {
$autoreload_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='autoreload'"))["value"];
@ -306,6 +308,48 @@ if($role == "administrator") {
}
?>
<?php
//Set Impressum link
if($role == "administrator") {
if(isset($_GET["upimpressum"]) && isset($_POST['impressum'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con,"UPDATE settings SET value='".mysqli_real_escape_string($con, $_POST['impressum'])."'
WHERE type='impressum'");
if($statement) {
header("Location: admin.php?impressumset=".$_POST['impressum']."#settings");
}
}
}
?>
<?php
//Set Privacy policity link
if($role == "administrator") {
if(isset($_GET["upprivacy"]) && isset($_POST['privacy'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con,"UPDATE settings SET value='".mysqli_real_escape_string($con, $_POST['privacy'])."'
WHERE type='privacy'");
if($statement) {
header("Location: admin.php?privacyset=".$_POST['privacy']."#settings");
}
}
}
?>
<?php
//Create new service
if(isset($_GET["createservice"]) && isset($_POST['priority']) && isset($_POST['group']) && isset($_POST['name'])) {

Loading…
Cancel
Save