2FA/Remember Me Implementierung
Userprofile Implementierung Datatables Padding Anpassungen Usercontroller und User um Mobile erweitert
This commit is contained in:
@@ -1,99 +1,159 @@
|
||||
<?php
|
||||
$siteTitle = "Benutzer";
|
||||
$siteTitle = "Benutzer";
|
||||
|
||||
$pagination_baseurl = $this->getUrl($Mod,"Index");
|
||||
$pagination_baseurl_params = ["filter" => $filter];
|
||||
$pagination_entity_name = "Benutzer";
|
||||
$pagination_baseurl = $this->getUrl($Mod, "Index");
|
||||
$pagination_baseurl_params = ["filter" => $filter];
|
||||
$pagination_entity_name = "Benutzer";
|
||||
?>
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<style>
|
||||
.fa-exclamation-triangle, .fa-envelope, .fa-mobile-retro {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.fa-exclamation-triangle {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
|
||||
<li class="breadcrumb-item active">Benutzer</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Benutzer</h4>
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Benutzer</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Benutzer</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">Benutzerliste</h4>
|
||||
<p class="sub-header">
|
||||
<?php if(is_array($filter) && count($filter)): ?>
|
||||
<?php if($filter['address_id']): ?>
|
||||
Zugehörig zu <?=(AddressModel::getOne($filter["address_id"])->getCompanyOrName())?><br />
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
Zeige alle Benutzer
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="overflow-auto">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">Benutzerliste</h4>
|
||||
<p class="sub-header">
|
||||
<?php if (is_array($filter) && count($filter)): ?>
|
||||
<?php if ($filter['address_id']): ?>
|
||||
Zugehörig zu <?= (AddressModel::getOne($filter["address_id"])->getCompanyOrName()) ?>
|
||||
<br/>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="float-right">
|
||||
<?php if (is_array($filter) && count($filter) && is_numeric($filter['address_id'])): ?>
|
||||
<a class="btn btn-primary"
|
||||
href="<?= self::getUrl("User", "add", ['address_id' => $filter['address_id']]) ?>"><i
|
||||
class="fas fa-plus"></i> Neuen Benutzer anlegen</a>
|
||||
<?php else: ?>
|
||||
<a class="btn btn-primary" href="<?= self::getUrl("User", "add") ?>"><i
|
||||
class="fas fa-plus"></i> Neuen Benutzer anlegen</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
||||
<div style="clear: both;" class="mt-2">
|
||||
<table id="datatable" class="table table-striped table-hover font-13 table-sm ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<th>Name</th>
|
||||
<th>Firma / Person</th>
|
||||
<th>Email</th>
|
||||
<th>Handy Nr.</th>
|
||||
<th>2FA</th>
|
||||
<th>Admin</th>
|
||||
<th>Techniker</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($users as $user):
|
||||
if ($user->twofactor == 0) {
|
||||
$twoFactortype = '<i class="fa fa-exclamation-triangle"><span style="display: none">N/A</span></i>';
|
||||
} else if ($user->twofactor == 1) {
|
||||
$twoFactortype = '<i class="fa-light fa-envelope"><span style="display: none">Mail</span></i>';
|
||||
} else if ($user->twofactor == 2) {
|
||||
$twoFactortype = '<i class="fa-light fa-mobile-retro"><span style="display: none">SMS</span></i>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $user->username ?></td>
|
||||
<td><?= $user->name ?></td>
|
||||
<td><?= ($user->address->company) ? $user->address->company : $user->address->getFullName() ?></td>
|
||||
<td><?= $user->email ?></td>
|
||||
<td><?= $user->mobile ?></td>
|
||||
<td class="text-center"><?= $twoFactortype ?></td>
|
||||
<td><?= ($user->isAdmin()) ? "Ja" : "Nein" ?></td>
|
||||
<td><?= ($user->is("Technician")) ? "Ja" : "Nein" ?></td>
|
||||
<td class="edit-width"
|
||||
style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?= self::getUrl("User", "edit", ['id' => $user->id]) ?>"
|
||||
title="User bearbeiten"><i class="far fa-edit"></i></a>
|
||||
<?php if ($user->id > 1): ?>
|
||||
<a href="<?= self::getUrl("User", "delete", ['id' => $user->id]) ?>"
|
||||
class="text-danger" title="User löschen"
|
||||
onclick="if(!confirm('Benutzer wirklich löschen?')) return false;"><i
|
||||
class="far fa-trash-alt"></i></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<?php if(is_array($filter) && count($filter) && is_numeric($filter['address_id'])): ?>
|
||||
<a class="btn btn-primary" href="<?=self::getUrl("User", "add", ['address_id' => $filter['address_id']])?>"><i class="fas fa-plus"></i> Neuen Benutzer anlegen</a>
|
||||
<?php else: ?>
|
||||
<a class="btn btn-primary" href="<?=self::getUrl("User", "add")?>"><i class="fas fa-plus"></i> Neuen Benutzer anlegen</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<th>Name</th>
|
||||
<th>Firma / Person</th>
|
||||
<th>Email</th>
|
||||
<th>Admin</th>
|
||||
<th>Techniker</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($users as $user): ?>
|
||||
<tr>
|
||||
<td><?=$user->username?></td>
|
||||
<td><?=$user->name?></td>
|
||||
<td><?=($user->address->company) ? $user->address->company : $user->address->getFullName()?></td>
|
||||
<td><?=$user->email?></td>
|
||||
<td><?=($user->isAdmin()) ? "Ja" : "Nein"?></td>
|
||||
<td><?=($user->is("Technician")) ? "Ja" : "Nein"?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?=self::getUrl("User","edit", ['id' => $user->id])?>" title="User bearbeiten"><i class="far fa-edit"></i></a>
|
||||
<?php if($user->id > 1): ?>
|
||||
<a href="<?=self::getUrl("User","delete", ['id' => $user->id])?>" class="text-danger" title="User löschen" onclick="if(!confirm('Benutzer wirklich löschen?')) return false;"><i class="far fa-trash-alt"></i></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Control Sidebar -->
|
||||
<aside class="control-sidebar control-sidebar-dark">
|
||||
<!-- Control sidebar content goes here -->
|
||||
</aside>
|
||||
<!-- /.control-sidebar -->
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
<!-- Control Sidebar -->
|
||||
<aside class="control-sidebar control-sidebar-dark">
|
||||
<!-- Control sidebar content goes here -->
|
||||
</aside>
|
||||
<!-- /.control-sidebar -->
|
||||
|
||||
<script type="text/javascript">
|
||||
var hidesearch = [8];
|
||||
var columndefs = {type: 'ip-address', targets: 4};
|
||||
|
||||
var columnfilter = [5];
|
||||
var columnoptions = '<option value=""></option><option value="SMS">SMS</option><option value="Mail">Mail</option><option value="N/A">N/A</option>';
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
Reference in New Issue
Block a user