update auf neuen codeigniter
benutzerverwaltung hinzugefügt sync scheduled implementiert
This commit is contained in:
64
app/Views/auth/change_password.php
Normal file
64
app/Views/auth/change_password.php
Normal 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(); ?>
|
||||
27
app/Views/auth/email_invition.php
Normal file
27
app/Views/auth/email_invition.php
Normal 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>
|
||||
24
app/Views/auth/email_register_notify.php
Normal file
24
app/Views/auth/email_register_notify.php
Normal 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
73
app/Views/auth/login.php
Normal 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(); ?>
|
||||
65
app/Views/auth/register.php
Normal file
65
app/Views/auth/register.php
Normal 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() ?>
|
||||
92
app/Views/auth/table_users.php
Normal file
92
app/Views/auth/table_users.php
Normal 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(); ?>
|
||||
Reference in New Issue
Block a user