Skip to content

Commit

Permalink
update account system.
Browse files Browse the repository at this point in the history
  • Loading branch information
lewmilburn committed Apr 29, 2024
1 parent 39edb27 commit b12a4d3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 4 deletions.
59 changes: 59 additions & 0 deletions Plugins/ControlPanel/Views/Account.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
use Saturn\DatabaseManager\DBMS;
use Saturn\HookManager\Actions;
require_once __DIR__ . '/Include/Security.php';
$UUID = $_SESSION['UUID'];
$DBMS = new DBMS();
$User = $DBMS->Select('*','user',"`uuid` = '".$DBMS->Escape($UUID)."'",'first:object');
$Permissions = $DBMS->Select('*','user_permissions',"`uuid` = '".$DBMS->Escape($UUID)."'",'first:object');
?><!DOCTYPE html>
<html lang="<?= WEBSITE_LANGUAGE; ?>">
<head>
<title><?= $User->username ?> - <?= WEBSITE_NAME ?> <?= __CP('ControlPanel'); ?></title>
<?php require_once __DIR__ . '/Include/Header.php'; ?>
</head>
<body class="body">
<?php require_once __DIR__ . '/Include/Navigation.php'; ?>
<main class="main">
<h1 class="text-header-nopt"><?= $User->username ?></h1>
<?php $Actions = new Actions(); $Actions->Run('ControlPanel.UsersPageStart'); ?>
<div class="grid lg:grid-cols-3 gap-4">
<div class="lg:col-span-2 grid gap-4">
<div class="grid-item grid-padding">
No details for <?= $User->username; ?>.
</div>
</div>

<div class="grid-item grid-padding">
<h2 class="text-subheader-nopt"><?= __CP('User_Permissions'); ?></h2>
<?php if ($Permissions->administrator) { ?>
<i class="fa-solid fa-check text-green-500" aria-hidden="true"></i>
<?php } else { ?>
<i class="fa-solid fa-times text-red-500" aria-hidden="true"></i>
<?php } ?> <?= __CP('User_Permissions_Administrator'); ?><br>

<?php if ($Permissions->panel_access || $Permissions->administrator) { ?>
<i class="fa-solid fa-check text-green-500" aria-hidden="true"></i>
<?php } else { ?>
<i class="fa-solid fa-times text-red-500" aria-hidden="true"></i>
<?php } ?> <?= __CP('User_Permissions_Panel_Access'); ?><br>

<?php if ($Permissions->panel_pages_edit || $Permissions->administrator) { ?>
<i class="fa-solid fa-check text-green-500" aria-hidden="true"></i>
<?php } else { ?>
<i class="fa-solid fa-times text-red-500" aria-hidden="true"></i>
<?php } ?> <?= __CP('User_Permissions_Panel_Pages_Edit'); ?><br>

<?php if ($Permissions->panel_settings || $Permissions->administrator) { ?>
<i class="fa-solid fa-check text-green-500" aria-hidden="true"></i>
<?php } else { ?>
<i class="fa-solid fa-times text-red-500" aria-hidden="true"></i>
<?php } ?> <?= __CP('User_Permissions_Panel_Settings'); ?><br>
</div>
</div>
<?php $Actions = new Actions(); $Actions->Run('ControlPanel.UsersPageEnd'); ?>
</main>

<script src="<?= SATURN_ROOT; ?>/Plugins/ControlPanel/Assets/JS/Console.js"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions Plugins/ControlPanel/Views/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="grid lg:grid-cols-3 gap-4">
<div class="lg:col-span-2 grid gap-4">
<div class="grid-item grid-padding">

Up No details for <?= $User->username; ?>.
</div>
</div>

Expand All @@ -32,19 +32,19 @@
<i class="fa-solid fa-times text-red-500" aria-hidden="true"></i>
<?php } ?> <?= __CP('User_Permissions_Administrator'); ?><br>

<?php if ($Permissions->panel_access) { ?>
<?php if ($Permissions->panel_access || $Permissions->administrator) { ?>
<i class="fa-solid fa-check text-green-500" aria-hidden="true"></i>
<?php } else { ?>
<i class="fa-solid fa-times text-red-500" aria-hidden="true"></i>
<?php } ?> <?= __CP('User_Permissions_Panel_Access'); ?><br>

<?php if ($Permissions->panel_pages_edit) { ?>
<?php if ($Permissions->panel_pages_edit || $Permissions->administrator) { ?>
<i class="fa-solid fa-check text-green-500" aria-hidden="true"></i>
<?php } else { ?>
<i class="fa-solid fa-times text-red-500" aria-hidden="true"></i>
<?php } ?> <?= __CP('User_Permissions_Panel_Pages_Edit'); ?><br>

<?php if ($Permissions->panel_settings) { ?>
<?php if ($Permissions->panel_settings || $Permissions->administrator) { ?>
<i class="fa-solid fa-check text-green-500" aria-hidden="true"></i>
<?php } else { ?>
<i class="fa-solid fa-times text-red-500" aria-hidden="true"></i>
Expand Down

0 comments on commit b12a4d3

Please sign in to comment.