Added impressum and privacy policity links

This commit is contained in:
Givou 2021-03-16 20:57:22 +01:00
parent 8abcc0bf94
commit 133be6c98d
5 changed files with 78 additions and 3 deletions

View File

@ -511,6 +511,26 @@ if(isset($_GET["manageservice"])) {
</select> </select>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input> <input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form> </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>
</div>'; </div>';
} }

View File

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

View File

@ -17,6 +17,8 @@
$instancename = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='instancename'"))["value"]; $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"]; $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"]; $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"); $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"); $services = mysqli_query($con, "SELECT priority, groupid, name, id, status FROM services ORDER BY priority DESC");
@ -257,7 +259,8 @@ echo '</div>';
<!-- FOOTER --> <!-- FOOTER -->
<footer class="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">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> </footer>
<div class="legend"> <div class="legend">

View File

@ -87,6 +87,8 @@ if(isset($_POST['dbhost']) && isset($_POST['dbname']) && isset($_POST['dbpwd'])
//Infliating Settings //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 ('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 ('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 //Creating Administrative User
mysqli_query($con, "INSERT INTO accounts (username, password, role) VALUES ('".mysqli_real_escape_string($con,$admin_username)."', mysqli_query($con, "INSERT INTO accounts (username, password, role) VALUES ('".mysqli_real_escape_string($con,$admin_username)."',

View File

@ -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"]; $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"]; $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") { if($role == "administrator") {
$autoreload_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='autoreload'"))["value"]; $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 <?php
//Create new service //Create new service
if(isset($_GET["createservice"]) && isset($_POST['priority']) && isset($_POST['group']) && isset($_POST['name'])) { if(isset($_GET["createservice"]) && isset($_POST['priority']) && isset($_POST['group']) && isset($_POST['name'])) {