update auf neuen codeigniter

benutzerverwaltung hinzugefügt
sync scheduled implementiert
This commit is contained in:
Markus
2024-11-26 11:45:22 +01:00
parent eb028d1783
commit de4bd6e366
61 changed files with 1996 additions and 1130 deletions

View File

@@ -0,0 +1,64 @@
<?= $this->extend('layouts/smarthome'); ?>
<?= $this->section('menu'); ?>
<?= $this->include('menu/dashboard_menu') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="container">
<div class="row">
<div class="col-sm-6 offset-sm-3">
<div class="card bg-secondary">
<div class="card-body bg-dark text-white-50">
<h5 class="card-header">Hallo <?= auth()->user()->username ?>, Passwort ändern</h5>
<?php if (session('error') !== null) : ?>
<div class="alert alert-danger" role="alert"><?= session('error') ?></div>
<?php elseif (session('errors') !== null) : ?>
<div class="alert alert-danger" role="alert">
<?php if (is_array(session('errors'))) : ?>
<?php foreach (session('errors') as $error) : ?>
<?= $error ?>
<br>
<?php endforeach ?>
<?php else : ?>
<?= session('errors') ?>
<?php endif ?>
</div>
<?php endif ?>
<?php if (session('message') !== null) : ?>
<div class="alert alert-success" role="alert"><?= session('message') ?></div>
<?php endif ?>
<form action="changePassword" method="post">
<?= csrf_field() ?>
<!-- Email -->
<div class="mb-2">
<input type="email" class="form-control bg-transparent text-light " name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email',$email) ?>" required />
</div>
<!-- old Password -->
<?php if (session('magicLogin') === null) : ?>
<div class="mb-2">
<input type="password" class="form-control bg-transparent text-light " name="oldpassword" inputmode="text" autocomplete="current-password" placeholder="neues Passwort" required />
</div>
<?php endif ?>
<!-- Password -->
<div class="mb-2">
<input type="password" class="form-control bg-transparent text-light " name="password" inputmode="text" autocomplete="new-password" placeholder="neues Passwort" required />
</div>
<!-- Password (Again) -->
<div class="mb-5">
<input type="password" class="form-control bg-transparent text-light " name="password_confirm" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.passwordConfirm') ?>" required />
</div>
<div class="d-grid col-12 col-md-8 mx-auto m-3">
<button type="submit" class="btn btn-primary btn-block">Ändern</button>
</div>
</form>
</div>
</div>
</div>
<?= $this->endSection(); ?>

View File

@@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<meta name="x-apple-disable-message-reformatting">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Einladung zur Registrierung bei Smarthome</title>
</head>
<body>
Hi,
um Smarthome Dashboard zu benutzen, musst du dich registrieren.
Benutze hierfür den Link:
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important;">
<tbody>
<tr>
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; margin: 0;" align="center" bgcolor="#0d6efd">
<a href="<?= url_to('register') ?>" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: inline-block; font-weight: normal; white-space: nowrap; background-color: #0d6efd; padding: 8px 12px; border: 1px solid #0d6efd;"><?= lang('Auth.register') ?></a>
</td>
</tr>
</tbody>
</table>
<p><?= lang('Auth.emailDate') ?> <?= esc($date) ?></p>
</body>
</html>

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<meta name="x-apple-disable-message-reformatting">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Neue Registrierung bei der Verwaltung der Wörgler Flughunden ist erfolgt</title>
</head>
<body>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important;">
Der Benutzer <b><?= $username?></b> mit der Emailadresse <b><?=$email?></b> hat sich neu registriert.<br>
Die Gruppenzugehörigkeit gehört eingestellt.
<tbody>
<tr>
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; margin: 0;" align="center" bgcolor="#0d6efd">
<a href="<?=base_url().$link ?>" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: inline-block; font-weight: normal; white-space: nowrap; background-color: #0d6efd; padding: 8px 12px; border: 1px solid #0d6efd;">Check</a>
</td>
</tr>
</tbody>
</table>
</body>
</html>

73
app/Views/auth/login.php Normal file
View File

@@ -0,0 +1,73 @@
<?= $this->extend('layout'); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="container">
<div class="row">
<div class="col-sm-6 offset-sm-3">
<div class="card bg-secondary">
<div class="card-header bg-dark text-white-50">
<h5 class="card-title"> <?= lang('Auth.login') ?></h5>
</div>
<div class="card-body bg-dark text-white-50">
<?php if (session('error') !== null) : ?>
<div class="alert alert-danger" role="alert"><?= session('error') ?></div>
<?php elseif (session('errors') !== null) : ?>
<div class="alert alert-danger" role="alert">
<?php if (is_array(session('errors'))) : ?>
<?php foreach (session('errors') as $error) : ?>
<?= $error ?>
<br>
<?php endforeach ?>
<?php else : ?>
<?= session('errors') ?>
<?php endif ?>
</div>
<?php endif ?>
<?php if (session('message') !== null) : ?>
<div class="alert alert-success" role="alert"><?= session('message') ?></div>
<?php endif ?>
<form action="<?= url_to('login') ?>" method="post">
<?= csrf_field() ?>
<!-- Email -->
<div class="mb-2">
<input type="email" class="form-control bg-transparent text-light " name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>" required />
</div>
<!-- Password -->
<div class="mb-2">
<input type="password" class="form-control bg-transparent text-light " name="password" inputmode="text" autocomplete="current-password" placeholder="<?= lang('Auth.password') ?>" required />
</div>
<!-- Remember me -->
<?php if (setting('Auth.sessionConfig')['allowRemembering']): ?>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" name="remember" class="form-check-input bg-transparent text-light" <?php if (old('remember')): ?> checked<?php endif ?>>
<?= lang('Auth.rememberMe') ?>
</label>
</div>
<?php endif; ?>
<div class="d-grid col-12 col-md-8 mx-auto m-3">
<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.login') ?></button>
</div>
<?php if (setting('Auth.allowMagicLinkLogins')) : ?>
<p class="text-center"><?= lang('Auth.forgotPassword') ?> <a href="<?= url_to('magic-link') ?>"><?= lang('Auth.useMagicLink') ?></a></p>
<?php endif ?>
</form>
</div>
</div>
</div>
<?= $this->endSection(); ?>

View File

@@ -0,0 +1,65 @@
<?= $this->extend('layouts/smarthome'); ?>
<?= $this->section('menu'); ?>
<?= $this->include('menu/dashboard_menu') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="container">
<div class="card col-12 col-md-5 shadow-sm">
<div class="card-header">
<h5 class="card-title"> <?= lang('Auth.register') ?></h5>
</div>
<div class="card-body">
<?php if (session('error') !== null) : ?>
<div class="alert alert-danger" role="alert"><?= session('error') ?></div>
<?php elseif (session('errors') !== null) : ?>
<div class="alert alert-danger" role="alert">
<?php if (is_array(session('errors'))) : ?>
<?php foreach (session('errors') as $error) : ?>
<?= $error ?>
<br>
<?php endforeach ?>
<?php else : ?>
<?= session('errors') ?>
<?php endif ?>
</div>
<?php endif ?>
<form action="<?= url_to('register') ?>" method="post">
<?= csrf_field() ?>
<!-- Email -->
<div class="form-floating mb-2">
<input type="email" class="form-control" id="floatingEmailInput" name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>" required>
<label for="floatingEmailInput"><?= lang('Auth.email') ?></label>
</div>
<!-- Username -->
<div class="form-floating mb-4">
<input type="text" class="form-control" id="floatingUsernameInput" name="username" inputmode="text" autocomplete="username" placeholder="<?= lang('Auth.username') ?>" value="<?= old('username') ?>" required>
<label for="floatingUsernameInput"><?= lang('Auth.username') ?></label>
</div>
<!-- Password -->
<div class="form-floating mb-2">
<input type="password" class="form-control" id="floatingPasswordInput" name="password" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.password') ?>" required>
<label for="floatingPasswordInput"><?= lang('Auth.password') ?></label>
</div>
<!-- Password (Again) -->
<div class="form-floating mb-5">
<input type="password" class="form-control" id="floatingPasswordConfirmInput" name="password_confirm" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.passwordConfirm') ?>" required>
<label for="floatingPasswordConfirmInput"><?= lang('Auth.passwordConfirm') ?></label>
</div>
<div class="d-grid col-12 col-md-8 mx-auto m-3">
<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.register') ?></button>
</div>
<p class="text-center"><?= lang('Auth.haveAccount') ?> <a href="<?= url_to('login') ?>"><?= lang('Auth.login') ?></a></p>
</form>
</div>
</div>
</div>
<?= $this->endSection() ?>

View File

@@ -0,0 +1,92 @@
<?= $this->extend('layouts/smarthome'); ?>
<?= $this->section('css'); ?>
<link href="/assets/DataTables/datatables.css" rel="stylesheet"/>
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
<?= $this->include('menu/dashboard_menu') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="modal fade" id="modalInviteUser" tabindex="-1" aria-labelledby="Invite User Dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalTitle">Benutzer Registrierungslink schicken</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="inviteuser" method="post" action="/inviteUser">
<div class="form-floating mb-2">
<input type="email" name="email" id="email" onchange="add(this);" inputmode="email" autocomplete="email" class="form-control" placeholder="Email" value="<?= set_value('email', $email??'') ?>">
<label for="email">Email</label>
</div>
<div class="d-grid col-12 col-md-8 mx-auto m-3">
<button type="submit" class="btn btn-primary btn-block">sende Email</button>
</div>
</form>
</div>
<div class="modal-footer d-none">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Send Email</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modalChangeUser" tabindex="-1" aria-labelledby="Change User Dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalTitle">Benutzer ändern</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="edituser" method="post" action="/editUser">
<input type="hidden" value=0 name="id" class="changed" id="fuserid">
<div class="form-group row my-2">
<label for="username" class="col-sm-3 col-form-label">Name</label>
<div class="col-sm-9">
<input type="text" name="username" id="username" onchange="add(this);" class="form-control" placeholder="Name" value="<?= set_value('username', $username??'') ?>">
</div>
</div>
<div class="form-group row my-2">
<label for="email" class="col-sm-3 col-form-label">Email</label>
<div class="col-sm-9">
<input type="email" name="email" id="email" onchange="add(this);" class="form-control" placeholder="Email" value="<?= set_value('email', $email??'') ?>">
</div>
</div>
<div class="form-group row my-2 mb-3">
<label for="group" class="form-label">Auswahl Gruppen</label>
<?php foreach ($allowedGroups as $val => $item) : ?>
<div class="form-switch">
<input class="form-check-input" type="checkbox" onchange="add(this);" role="switch" value="<?=$val?>" name="group[]" id="group<?= $val; ?>">
<label for="group[<?= $val; ?>]" class="form-check-label"><?= $item ?></label>
</div>
<?php endforeach; ?>
</div>
<button type="submit" name="cmnd" value="change" id="modalsave" data-bs-toggle="modal" data-bs-target="#myModal" class="btn btn-primary">Submit</button>
<button type="submit" name="cmnd" value="resetPWD" id="modal_reset" data-bs-toggle="modal" data-bs-target="#myModal" class="btn btn-warning">Passwort Reset</button>
<button type="submit" name="cmnd" value="banUser" id="modal_ban" data-bs-toggle="modal" data-bs-target="#myModal" class="btn btn-danger">Zugang Sperren</button>
</form>
</div>
<div class="modal-footer d-none">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" id="modal_save" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<div class="container-lg ms-0">
<table class="table table-striped table-sm display no-wrap" id="usersTable" width="100%" cellspacing="0"
data-paging="false"
data-scrollX="false"
data-info="false"
data-responsive="{details: false}"
data-order='[[ 2, "desc" ]]''
data-ajax='{"url":"/viewUsers","dataSrc":""}'>
</table>
</div>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/js/userstab.js"></script>
<script src="/assets/DataTables/datatables.js"></script>
<?= $this->endSection(); ?>

View File

@@ -3,17 +3,26 @@
use CodeIgniter\CLI\CLI;
// The main Exception
CLI::newLine();
CLI::write('[' . get_class($exception) . ']', 'light_gray', 'red');
CLI::newLine();
CLI::write('[' . $exception::class . ']', 'light_gray', 'red');
CLI::write($message);
CLI::newLine();
CLI::write('at ' . CLI::color(clean_path($exception->getFile()) . ':' . $exception->getLine(), 'green'));
CLI::newLine();
$last = $exception;
while ($prevException = $last->getPrevious()) {
$last = $prevException;
CLI::write(' Caused by:');
CLI::write(' [' . $prevException::class . ']', 'red');
CLI::write(' ' . $prevException->getMessage());
CLI::write(' at ' . CLI::color(clean_path($prevException->getFile()) . ':' . $prevException->getLine(), 'green'));
CLI::newLine();
}
// The backtrace
if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
$backtraces = $exception->getTrace();
$backtraces = $last->getTrace();
if ($backtraces) {
CLI::write('Backtrace:', 'green');
@@ -41,20 +50,11 @@ if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
$function .= $padClass . $error['function'];
}
$args = implode(', ', array_map(static function ($value) {
switch (true) {
case is_object($value):
return 'Object(' . get_class($value) . ')';
case is_array($value):
return count($value) ? '[...]' : '[]';
case $value === null:
return 'null'; // return the lowercased version
default:
return var_export($value, true);
}
$args = implode(', ', array_map(static fn ($value) => match (true) {
is_object($value) => 'Object(' . $value::class . ')',
is_array($value) => count($value) ? '[...]' : '[]',
$value === null => 'null', // return the lowercased version
default => var_export($value, true),
}, array_values($error['args'] ?? [])));
$function .= '(' . $args . ')';

View File

@@ -19,7 +19,6 @@ body {
}
h1 {
font-weight: lighter;
letter-spacing: 0.8;
font-size: 3rem;
color: var(--dark-text-color);
margin: 0;
@@ -44,7 +43,7 @@ p.lead {
color: var(--dark-text-color);
}
.header .container {
padding: 1rem 1.75rem 1.75rem 1.75rem;
padding: 1rem;
}
.header h1 {
font-size: 2.5rem;
@@ -65,14 +64,11 @@ p.lead {
display: inline;
}
.footer {
.environment {
background: var(--dark-bg-color);
color: var(--light-text-color);
}
.footer .container {
border-top: 1px solid #e7e7e7;
margin-top: 1rem;
text-align: center;
padding: 0.2rem;
}
.source {
@@ -112,7 +108,7 @@ p.lead {
}
.tabs a:link,
.tabs a:visited {
padding: 0rem 1rem;
padding: 0 1rem;
line-height: 2.7;
text-decoration: none;
color: var(--dark-text-color);
@@ -152,9 +148,6 @@ p.lead {
border-radius: 5px;
color: #31708f;
}
ul, ol {
line-height: 1.8;
}
table {
width: 100%;

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>404 Page Not Found</title>
<title><?= lang('Errors.pageNotFound') ?></title>
<style>
div.logo {
@@ -70,14 +70,14 @@
</head>
<body>
<div class="wrap">
<h1>404 - File Not Found</h1>
<h1>404</h1>
<p>
<?php if (ENVIRONMENT !== 'production') : ?>
<?= nl2br(esc($message)) ?>
<?php else : ?>
Sorry! Cannot seem to find the page you were looking for.
<?php endif ?>
<?= lang('Errors.sorryCannotFind') ?>
<?php endif; ?>
</p>
</div>
</body>

View File

@@ -1,4 +1,10 @@
<?php $error_id = uniqid('error', true); ?>
<?php
use CodeIgniter\HTTP\Header;
use Config\Services;
use CodeIgniter\CodeIgniter;
$errorId = uniqid('error', true);
?>
<!doctype html>
<html>
<head>
@@ -6,11 +12,11 @@
<meta name="robots" content="noindex">
<title><?= esc($title) ?></title>
<style type="text/css">
<style>
<?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?>
</style>
<script type="text/javascript">
<script>
<?= file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.js') ?>
</script>
</head>
@@ -18,6 +24,12 @@
<!-- Header -->
<div class="header">
<div class="environment">
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
Environment: <?= ENVIRONMENT ?>
</div>
<div class="container">
<h1><?= esc($title), esc($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1>
<p>
@@ -39,6 +51,30 @@
<?php endif; ?>
</div>
<div class="container">
<?php
$last = $exception;
while ($prevException = $last->getPrevious()) {
$last = $prevException;
?>
<pre>
Caused by:
<?= esc($prevException::class), esc($prevException->getCode() ? ' #' . $prevException->getCode() : '') ?>
<?= nl2br(esc($prevException->getMessage())) ?>
<a href="https://www.duckduckgo.com/?q=<?= urlencode($prevException::class . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $prevException->getMessage())) ?>"
rel="noreferrer" target="_blank">search &rarr;</a>
<?= esc(clean_path($prevException->getFile()) . ':' . $prevException->getLine()) ?>
</pre>
<?php
}
?>
</div>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) : ?>
<div class="container">
<ul class="tabs" id="tabs">
@@ -61,7 +97,7 @@
<li>
<p>
<!-- Trace info -->
<?php if (isset($row['file']) && is_file($row['file'])) :?>
<?php if (isset($row['file']) && is_file($row['file'])) : ?>
<?php
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) {
echo esc($row['function'] . ' ' . clean_path($row['file']));
@@ -77,16 +113,16 @@
<?php if (isset($row['class'])) : ?>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;<?= esc($row['class'] . $row['type'] . $row['function']) ?>
<?php if (! empty($row['args'])) : ?>
<?php $args_id = $error_id . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($args_id, 'attr') ?>">
<?php $argsId = $errorId . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($argsId, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($argsId, 'attr') ?>">
<table cellspacing="0">
<?php
$params = null;
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
$mirror = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
if (! str_ends_with($row['function'], '}')) {
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}
@@ -189,7 +225,7 @@
<!-- Request -->
<div class="content" id="request">
<?php $request = \Config\Services::request(); ?>
<?php $request = Services::request(); ?>
<table>
<tbody>
@@ -199,7 +235,7 @@
</tr>
<tr>
<td>HTTP Method</td>
<td><?= esc(strtoupper($request->getMethod())) ?></td>
<td><?= esc($request->getMethod()) ?></td>
</tr>
<tr>
<td>IP Address</td>
@@ -270,60 +306,11 @@
<?php endif; ?>
<?php $headers = $request->getHeaders(); ?>
<?php $headers = $request->headers(); ?>
<?php if (! empty($headers)) : ?>
<h3>Headers</h3>
<table>
<thead>
<tr>
<th>Header</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($headers as $value) : ?>
<?php
if (empty($value)) {
continue;
}
if (! is_array($value)) {
$value = [$value];
} ?>
<?php foreach ($value as $h) : ?>
<tr>
<td><?= esc($h->getName(), 'html') ?></td>
<td><?= esc($h->getValueLine(), 'html') ?></td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<!-- Response -->
<?php
$response = \Config\Services::response();
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
<table>
<tr>
<td style="width: 15em">Response Status</td>
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReasonPhrase()) ?></td>
</tr>
</table>
<?php $headers = $response->getHeaders(); ?>
<?php if (! empty($headers)) : ?>
<?php natsort($headers) ?>
<h3>Headers</h3>
<table>
<thead>
<tr>
@@ -335,7 +322,64 @@
<?php foreach ($headers as $name => $value) : ?>
<tr>
<td><?= esc($name, 'html') ?></td>
<td><?= esc($response->getHeaderLine($name), 'html') ?></td>
<td>
<?php
if ($value instanceof Header) {
echo esc($value->getValueLine(), 'html');
} else {
foreach ($value as $i => $header) {
echo ' ('. $i+1 . ') ' . esc($header->getValueLine(), 'html');
}
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<!-- Response -->
<?php
$response = Services::response();
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
<table>
<tr>
<td style="width: 15em">Response Status</td>
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReasonPhrase()) ?></td>
</tr>
</table>
<?php $headers = $response->headers(); ?>
<?php if (! empty($headers)) : ?>
<h3>Headers</h3>
<table>
<thead>
<tr>
<th>Header</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($headers as $name => $value) : ?>
<tr>
<td><?= esc($name, 'html') ?></td>
<td>
<?php
if ($value instanceof Header) {
echo esc($response->getHeaderLine($name), 'html');
} else {
foreach ($value as $i => $header) {
echo ' ('. $i+1 . ') ' . esc($header->getValueLine(), 'html');
}
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
@@ -380,18 +424,7 @@
</div> <!-- /tab-content -->
</div> <!-- /container -->
<div class="footer">
<div class="container">
<p>
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(\CodeIgniter\CodeIgniter::CI_VERSION) ?>
</p>
</div>
</div>
<?php endif; ?>
</body>
</html>

View File

@@ -48,6 +48,22 @@
</div>
</div>
</div>
<div class="modal fade" id="mySnycModal" tabindex="-1" aria-labelledby="Snc Result Window" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalTitle">Modal title</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Please Wait.</p>
</div>
<div class="modal-footer d-none">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <script src="/assets/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>

View File

@@ -8,7 +8,7 @@
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<?php session()->set('redirect_url',base_url(route_to('/show-passwords'))); ?>
<?php session()->set('redirect_url',base_url('show-passwords')); ?>
<div class="page-content">
<div class="row">
<div class="col-xxl-8 col-12">

View File

@@ -2,7 +2,7 @@
<div class="sidebar-header">
<div class="d-flex justify-content-between">
<div class="logo">
<a href="index.php">Mein Geld</a>
<a href="/">Mein Geld</a>
</div>
<div class="toggler">
<a href="#" class="sidebar-hide d-xl-none d-block"><i class="fa-solid fa-xmark"></i></a>
@@ -30,13 +30,13 @@
</a>
</li>
<li class="sidebar-item active">
<a href="/syncScheduled" class='sidebar-link'>
<a href="javascript:syncScheduled()" class='sidebar-link'>
<i class="fa-solid fa-pen-to-square"></i>
<span>Sync Automatische</span>
</a>
</li>
<li class="sidebar-item active">
<a href="viewAccounts" class='sidebar-link'>
<a href="/viewAccounts" class='sidebar-link'>
<i class="fa-solid fa-pen-to-square"></i>
<span>Kategorien</span>
</a>
@@ -61,6 +61,10 @@
</li>
</ul>
<div class="ps-5">
<div class="small">Logged in as:</div>
<?= (auth()->user()?auth()->user()->username:"Gast")?>
</div>
</div>
<button class="sidebar-toggler btn x"><i data-feather="x"></i></button>
</div>