1
0
Fork 0

add admin menu

master
Christopher 2020-08-04 11:44:59 +02:00
parent 122c07c515
commit f1912e4ea2
14 changed files with 186 additions and 54 deletions

View File

@ -32,6 +32,19 @@ if(isset($_REQUEST['api']))
die(); die();
} }
if ($handle = opendir('./plugins/'))
{
while (false !== ($entry = readdir($handle)))
{
if ($entry != "." && $entry != "..")
{
include_once "./plugins/".$entry;
}
}
closedir($handle);
}
if(isset($_REQUEST['logout'])) if(isset($_REQUEST['logout']))
if($_REQUEST['logout'] == '1') if($_REQUEST['logout'] == '1')
$_SESSION = array(); $_SESSION = array();

View File

@ -1,8 +1,5 @@
<?php <?php
$HTML = new HTML();
$HTML->setHTMLTitle("Dashboard"); $HTML->setHTMLTitle("Dashboard");
$HTML->importHTML("style/default/dashboard.html");
$HTML->importSeitenInhalt("pages/HTML/dashboard.html"); $HTML->importSeitenInhalt("pages/HTML/dashboard.html");
$HTML->ReplaceSeitenInhalt("%%GLOBAL-USER-COUNT%%", $RUNTIME['OPENSIM']->getUserCount()); $HTML->ReplaceSeitenInhalt("%%GLOBAL-USER-COUNT%%", $RUNTIME['OPENSIM']->getUserCount());

View File

@ -1,9 +1,5 @@
<?php <?php
$HTML = new HTML();
$HTML->setHTMLTitle("Seite nicht gefunden"); $HTML->setHTMLTitle("Seite nicht gefunden");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->build(); $HTML->build();
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");

View File

@ -1,9 +1,5 @@
<?php <?php
$HTML = new HTML();
$HTML->setHTMLTitle("Gruppen"); $HTML->setHTMLTitle("Gruppen");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->importSeitenInhalt("pages/HTML/deine-regionen.html"); $HTML->importSeitenInhalt("pages/HTML/deine-regionen.html");
$table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Gründer</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; $table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Gründer</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>';

View File

@ -1,9 +1,5 @@
<?php <?php
$HTML = new HTML();
$HTML->setHTMLTitle("Invite erstellen"); $HTML->setHTMLTitle("Invite erstellen");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->importSeitenInhalt("pages/HTML/invite.html"); $HTML->importSeitenInhalt("pages/HTML/invite.html");
$statement = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `InviteCodes` (`InviteCode` VARCHAR(64) NOT NULL, PRIMARY KEY (`InviteCode`))"); $statement = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `InviteCodes` (`InviteCode` VARCHAR(64) NOT NULL, PRIMARY KEY (`InviteCode`))");

View File

@ -35,7 +35,8 @@
$_SESSION['LEVEL'] = $rowUser['UserLevel']; $_SESSION['LEVEL'] = $rowUser['UserLevel'];
$_SESSION['DISPLAYNAME'] = strtoupper(trim($_POST['username'])); $_SESSION['DISPLAYNAME'] = strtoupper(trim($_POST['username']));
$_SESSION['LOGIN'] = 'true'; $_SESSION['LOGIN'] = 'true';
include "./pages/".@$_REQUEST['page'].".php";
header("Location: index.php?page=".$_REQUEST['page']);
die(); die();
} }
} }

View File

@ -1,10 +1,6 @@
<?php <?php
$HTML = new HTML();
$HTML->setHTMLTitle("Passwort ändern"); $HTML->setHTMLTitle("Passwort ändern");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->importSeitenInhalt("pages/HTML/passwort.html"); $HTML->importSeitenInhalt("pages/HTML/passwort.html");
if(isset($_REQUEST['oldPassword']) || @$_REQUEST['oldPassword'] != "") if(isset($_REQUEST['oldPassword']) || @$_REQUEST['oldPassword'] != "")

View File

@ -1,4 +1,6 @@
<?php <?php
$HTML->setHTMLTitle("Dein Profile");
$HTML->importSeitenInhalt("pages/HTML/profile.html");
if(isset($_REQUEST['formInputFeldVorname']) || @$_REQUEST['formInputFeldVorname'] != "") if(isset($_REQUEST['formInputFeldVorname']) || @$_REQUEST['formInputFeldVorname'] != "")
{ {
@ -95,12 +97,6 @@
} }
} }
$HTML = new HTML();
$HTML->setHTMLTitle("Dein Profile");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->importSeitenInhalt("pages/HTML/profile.html");
$statementLocalUsers = $RUNTIME['PDO']->prepare("SELECT * FROM UserAccounts ORDER BY PrincipalID ASC"); $statementLocalUsers = $RUNTIME['PDO']->prepare("SELECT * FROM UserAccounts ORDER BY PrincipalID ASC");
$statementLocalUsers->execute(); $statementLocalUsers->execute();

View File

@ -1,9 +1,5 @@
<?php <?php
$HTML = new HTML();
$HTML->setHTMLTitle("Deine Regionen"); $HTML->setHTMLTitle("Deine Regionen");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->importSeitenInhalt("pages/HTML/deine-regionen.html"); $HTML->importSeitenInhalt("pages/HTML/deine-regionen.html");
$table = '<table class="table"><thead><tr><th scope="col">Region Name</th><th scope="col">Eigentümer</th><th scope="col">Position</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; $table = '<table class="table"><thead><tr><th scope="col">Region Name</th><th scope="col">Eigentümer</th><th scope="col">Position</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>';

View File

@ -1,9 +1,5 @@
<?php <?php
$HTML = new HTML();
$HTML->setHTMLTitle("Online Anzeige"); $HTML->setHTMLTitle("Online Anzeige");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->importSeitenInhalt("pages/HTML/online-anzeige.html"); $HTML->importSeitenInhalt("pages/HTML/online-anzeige.html");
$table = '<table class="table"><thead><tr><th scope="col">Benutzername</th><th scope="col">Region</th></thead><tbody>%%ENTRY%%</tbody></table>'; $table = '<table class="table"><thead><tr><th scope="col">Benutzername</th><th scope="col">Region</th></thead><tbody>%%ENTRY%%</tbody></table>';

View File

@ -1,21 +1,13 @@
<?php <?php
if(@$_SESSION['LEVEL'] < 100) if(@$_SESSION['LEVEL'] < 100)
{ {
$HTML = new HTML();
$HTML->setHTMLTitle("Kein Zugriff"); $HTML->setHTMLTitle("Kein Zugriff");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->SetSeitenInhalt("Dazu hast du keine Rechte!"); $HTML->SetSeitenInhalt("Dazu hast du keine Rechte!");
$HTML->build(); $HTML->build();
echo $HTML->ausgabe(); echo $HTML->ausgabe();
die(); die();
}else{ }else{
$HTML = new HTML();
$HTML->setHTMLTitle("Benutzer"); $HTML->setHTMLTitle("Benutzer");
$HTML->importHTML("style/default/dashboard.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", $_SESSION['DISPLAYNAME']);
$HTML->importSeitenInhalt("pages/HTML/deine-regionen.html"); $HTML->importSeitenInhalt("pages/HTML/deine-regionen.html");
$table = '<table class="table"><thead><tr><th scope="col">Vorname</th><th scope="col">Nachname</th><th scope="col">Status</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; $table = '<table class="table"><thead><tr><th scope="col">Vorname</th><th scope="col">Nachname</th><th scope="col">Status</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>';

12
plugins/default-html.php Normal file
View File

@ -0,0 +1,12 @@
<?php
$HTML = new HTML();
if(@$_SESSION['LOGIN'] == 'true')
{
$HTML->importHTML("style/default/dashboard.html");
if(@$_SESSION['LEVEL'] > 100)
$HTML->importHTML("style/default/dashboard-admin.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", @$_SESSION['DISPLAYNAME']);
}
?>

View File

@ -0,0 +1,157 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>OpenSim - Kontrollzentrum - %%USERNAME%% - %%EchoTitle%%</title>
<link href="./style/4Creative.ico" rel="icon">
<link href="./style/4Creative.ico" rel="apple-touch-icon">
<link href="./style/default/css/autocomplete.css" rel="stylesheet" type="text/css">
<link href="./style/default/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="./style/default/vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
<link href="./style/default/css/sb-admin.css" rel="stylesheet"> %%echoHeader%%
</head>
<body id="page-top">
<nav class="navbar navbar-expand navbar-dark bg-dark static-top">
<button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
<i class="fas fa-bars"></i>
</button>
<div class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0"></div>
<ul class="navbar-nav ml-auto ml-md-0">
<li class="nav-item dropdown no-arrow">
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">%%USERNAME%% <i class="fas fa-user-circle fa-fw"></i></a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
<a class="dropdown-item" href="?page=profile">Profil</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="?page=password">Passwort ändern</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="?page=invite">Grid Invite</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>
</div>
</li>
</ul>
</nav>
<div id="wrapper">
<ul class="sidebar navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="index.php">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>Übrsicht</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=profile">
<i class="far fa-address-card"></i>
<span>Profil</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=user-online-state">
<i class="fas fa-link"></i>
<span>Online Anzeige</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=regions">
<i class="fas fa-globe-europe"></i>
<span>Deine Regionen</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=groups">
<i class="fas fa-users"></i>
<span>Deine Gruppen</span></a>
</li>
<div class="nav-link" style="padding: 1.75rem 1rem 0.75rem; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; color: rgba(255, 255, 255, 0.25)">
Administration
</div>
<li class="nav-item active">
<a class="nav-link" href="index.php?page=loginPage">
<i class="fas fa-fw fa-key"></i>
<span>Anmeldung</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=users">
<i class="fas fa-user-plus"></i>
<span>Benutzer verwalten</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=groups">
<i class="fas fa-users"></i>
<span>Gruppen verwalten</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=regions">
<i class="fas fa-globe-europe"></i>
<span>Regionen verwalten</span></a>
</li>
</ul>
<div id="content-wrapper">
<div class="container-fluid">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.php">Gridverwaltung</a>
</li>
<li class="breadcrumb-item active">%%EchoTitle%%</li>
</ol>
<hr><br>
%%EchoInhalt%%
</div>
</div>
</div>
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Bist du sicher?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Wähle 'Logout' wenn du dich wirklich abmelden möchtest.</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Abbrechen</button>
<a class="btn btn-primary" href="index.php?logout=1">Logout</a>
</div>
</div>
</div>
</div>
<script src="./style/default/vendor/jquery/jquery.min.js"></script>
<script src="./style/default/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="./style/default/vendor/jquery-easing/jquery.easing.min.js"></script>
<script src="./style/default/vendor/chart.js/Chart.min.js"></script>
<script src="./style/default/vendor/datatables/jquery.dataTables.js"></script>
<script src="./style/default/vendor/datatables/dataTables.bootstrap4.js"></script>
<script src="./style/default/js/sb-admin.min.js"></script>
<script src="./style/default/js/demo/datatables-demo.js"></script>
<script src="./style/default/js/demo/chart-area-demo.js"></script>
</body>
</html>

View File

@ -49,12 +49,6 @@
</a> </a>
</li> </li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=downloads">
<i class="fas fa-link"></i>
<span>Downloads</span></a>
</li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="index.php?page=profile"> <a class="nav-link" href="index.php?page=profile">
<i class="far fa-address-card"></i> <i class="far fa-address-card"></i>
@ -73,12 +67,6 @@
<span>Deine Regionen</span></a> <span>Deine Regionen</span></a>
</li> </li>
<li class="nav-item">
<a class="nav-link" href="index.php?page=users">
<i class="fas fa-user-plus"></i>
<span>Benutzer verwalten</span></a>
</li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="index.php?page=groups"> <a class="nav-link" href="index.php?page=groups">
<i class="fas fa-users"></i> <i class="fas fa-users"></i>