Mobile Integration,Pop Multiple Networks,DataTables responsible update,Migrations

Mobile Integration:
* in footer.php js eingefügt damit das mobile Menu funktioniert
* in menu.php bzw. app.css neue Klasse eingefügt mobile-hide um in der mobilen Version Menupünkte zu verstecken

Pop Multiple Networks
* Pops können nun mehrere Netzgebiete haben
* Netzgebiete und Pop ansicht angepasst
* (Script muss ausgeführt werden um die PopNetwork Table vom Bestand zu befüllen)

DataTables responsible update
* Datatables update und responsible addon
* Diverse Anpassungen für Responsible in:
  - Pops, Geräte Hersteller, Geräte Typen, Devices, Benutzer

Migrations
* PopNetwork
* Poprackmodulepatch
This commit is contained in:
Spitzer Daniel
2024-01-01 14:16:31 +01:00
parent 1948e58a7c
commit 02497d8e98
34 changed files with 74059 additions and 45561 deletions

View File

@@ -1,4 +1,6 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<style>
@@ -8,6 +10,11 @@
font-size: 16px;
margin-left: 5px;
}
.alert {
margin-bottom: 0px;
}
</style>
<div class="row">
<div class="col-12">
@@ -67,9 +74,11 @@ if ($twofa == 0) {
value="<?= $userprofile->email ?>" <?php if ($twofa == 1) : ?> disabled="disabled" <?php endif; ?> />
</div>
<?php if ($twofa == 1) : ?>
<div class="col-lg-4 col-form-label">
<div class="col-lg-4 ">
<span class="info-span alert alert-info"> Um die Email Adresse zu ändern bitte 2FA auf SMS umschalten.</span>
<div class="info-span alert alert-info"> Um die Email Adresse zu ändern
bitte 2FA auf SMS umschalten.
</div>
</div>
<?php endif; ?>
@@ -84,7 +93,7 @@ if ($twofa == 0) {
value="<?= $userprofile->mobile ?>" <?php if ($twofa == 2) : ?> disabled="disabled" <?php endif; ?>/>
</div>
<?php if ($twofa == 2) : ?>
<div class="col-lg-4 col-form-label">
<div class="col-lg-4 ">
<span class="info-span alert alert-info"> Um die Mobilnummer zu ändern bitte 2FA auf Email umschalten.</span>
</div>
<?php endif; ?>

View File

@@ -1,29 +1,8 @@
<?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"/>
<?php var_dump($userprofile); ?>
<!-- start page title -->
<style>
.fa-exclamation-triangle {
font-size: 19px;
color: red;
}
.fa-new-code {
cursor: pointer;
color: #007bff;
font-size: 16px;
margin-left: 5px;
}
.fa-envelope, .fa-mobile-retro {
font-size: 25px;
vertical-align: sub;
margin-right: 5px;
}
</style>
<div class="row">
<div class="col-12">
<div class="page-title-box">
@@ -31,151 +10,187 @@
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
</li>
<li class="breadcrumb-item active">Gerätetyp</li>
</ol>
</div>
<h4 class="page-title">Benutzerprofil</h4>
<h4 class="page-title">Gerätetyp</h4>
</div>
</div>
</div>
<!-- end page title -->
<?php
if ($userprofile->twofactor == 0) {
$twoFactorsym = '<i class="fa fa-exclamation-triangle mr-1"></i>';
$twoFactorbtn = '<button class="btn btn-success mb-3 ">Aktivieren</button>';
$twoFactortype = '<div class="col-lg-2">
<select class="select2 form-control" name="twofactor" id="twofactor">
<option value="1">Email</option>
<option value="2">SMS</option>
</select></div>';
$twoFactorFormaction = "code2faaction";
} else if ($userprofile->twofactor == 1) {
$twoFactorsym = '<i class="fa-regular fa-circle-check mr-1"></i>';
$twoFactorbtn = '<button class="btn btn-success mb-3 ">Ändern zu SMS</button>';
$twoFactortype = '<label class="col-lg-2 col-form-label"><input type="hidden" name="twofactor" value="2"/><i class="fa-light fa-envelope"></i> Email</label>';
$twoFactorFormaction = "change2faaction";
} else if ($userprofile->twofactor == 2) {
$twoFactorsym = '<i class="fa-regular fa-circle-check mr-1"></i>';
$twoFactorbtn = '<button class="btn btn-success mb-3 ">Ändern zu Email</button>';
$twoFactortype = '<label class="col-lg-2 col-form-label"><input type="hidden" name="twofactor" value="1"/><i class="fa-light fa-mobile-retro"></i> Mobiltelefon (SMS)</label>';
$twoFactorFormaction = "change2faaction";
}
?>
<i class="bi bi-exclamation-triangle"></i>
<div class="row">
<div class="col-lg">
<div class="card">
<div class="card-body">
<h4 class=" mb-2">Allgemeine Daten</h4>
<div class="form-group row">
<div class="col-lg-2 font-weight-500">Name</div>
<div class="col-lg-10">
<?= $userprofile->name ?>
</div>
<div class="card">
<div class="card-body mb-3">
<div class="row">
<div class="col-12">
<div class="float-left">
<h4 class="header-title">Liste aller Gerätetypen</h4>
</div>
<div class="form-group row">
<div class="col-lg-2 font-weight-500">Email</div>
<div class="col-lg-10">
<?= $userprofile->email ?>
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Devicetype", "add") ?>"><i
class="fas fa-plus"></i> Neuen Gerätetyp anlegen</a>
</div>
<div class="form-group row">
<div class="col-lg-2 font-weight-500">Mobiltelefon</div>
<div class="col-lg-10">
<?= $userprofile->mobile ?>
</div>
</div>
<div class="form-group row">
<div class="col-lg-10">
<a class="btn btn-primary mb-2"
href="<?= self::getUrl("UserProfile", "edit") ?>">Bearbeiten</a>
</div>
</div>
<div class="w-100 border-bottom"></div>
</div>
</div>
<h4 class=" mb-2 mt-3">Passwort ändern</h4>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", "changepwd") ?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="oldpwd">altes Passwort</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="oldpwd" id="oldpwd"
value="">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="newpwd">neues Passwort</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="newpwd" id="newpwd"
value="">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="checkpwd">Passwort bestätigen</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="checkpwd" id="checkpwd"
value="">
</div>
</div>
<div class="form-group row">
<div class="col-lg-10">
<button type="submit" class="btn btn-primary">Speichern</button>
</div>
</div>
</form>
<div class="w-100 border-bottom"></div>
<h4 class="form-group mb-2 mt-3">2FA</h4>
<?php if (!$verification || $verification == 0): ?>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", $twoFactorFormaction) ?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="twofactor"><?= $twoFactorsym ?>
Zwei-Faktor-Authentifizierung</label>
<?= $twoFactortype ?>
<div class="col-lg-7">
<?= $twoFactorbtn ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
<table id="datatable" class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th class="text-center">Hersteller</th>
<th class="text-right">Preis</th>
<th class="text-right">max. Leistung</th>
<th class="text-right">erstellt von</th>
<th class="edit-weight"></th>
</tr>
<tr id="filterrow">
<th>Name</th>
<th>Hersteller</th>
<th>Preis</th>
<th></th>
<th></th>
<th></th>
</tr>
<thead>
<tbody>
<?php foreach ($devicetypes as $devicetype): ?>
<tr>
<td><?= $devicetype->name ?></td>
<td class="text-center"><?= $devicetype->devicemanufactor->name ?></td>
<td class="text-right"><?= $devicetype->price ?> €</td>
<td class="text-right"><?= $devicetype->power ?> Watt</td>
<td class="text-right"><?= $devicetype->creator->name ?>
(<?= date("d.m.Y , H:i", $devicetype->create) ?>)
</td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?= self::getUrl("Devicetype", "edit", ["id" => $devicetype->id]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?= self::getUrl("Devicetype", "delete", ["id" => $devicetype->id]) ?>"
onclick="if(!confirm('Gerätetyp wirklich löschen?')) return false;" class="text-danger"
title="Löschen"><i class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var hidesearch=[5];
$(document).ready(function () {
});
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?> <div class="col-lg-10">
<a class="btn btn-primary mb-2"
href="<?= self::getUrl("UserProfile", "edit") ?>">Bearbeiten</a>
</div>
</div>
</form>
<?php elseif ($verification == 1 || $verification == 2) :
if ($verification == 1) {
$verificationType = "Email";
} elseif ($verification == 2) {
$verificationType = "SMS";
}
?>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", "activate2faaction") ?>">
<div class="row">
<div class="col-lg-2"></div>
<label class="col-lg-3 col-form-label"
style="vertical-align: top;font-size: 15px;color: #000;"> Code wurde
per <?php echo $verificationType; ?> verschickt (5 Minuten gültig)</label>
<div class="w-100 border-bottom"></div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="code">Verifizierungscode: <i
data-codetype="<?= $verification ?>"
class="fa-solid fa-arrows-rotate fa-new-code" id="new-authcode"
title="Neuen Code anfordern."></i></label>
<div class="col-lg-2">
<input type="number" required min="0" max="99999" class="form-control" name="code"
id="code"
value="">
<input type="hidden" name="twofactor" value="<?php echo $verification; ?>"/>
<h4 class=" mb-2 mt-3">Passwort ändern</h4>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", "changepwd") ?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="oldpwd">altes Passwort</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="oldpwd" id="oldpwd"
value="">
</div>
</div>
<div class="col-lg-7">
<?= $twoFactorbtn ?>
<a href="<?= self::getUrl("UserProfile") ?>">
<button type="button" class="btn btn-secondary mb-3">Abbrechen</button>
</a>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="newpwd">neues Passwort</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="newpwd" id="newpwd"
value="">
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="checkpwd">Passwort bestätigen</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="checkpwd" id="checkpwd"
value="">
</div>
</div>
<div class="form-group row">
<div class="col-lg-10">
<button type="submit" class="btn btn-primary">Speichern</button>
</div>
</div>
</form>
<div class="w-100 border-bottom"></div>
<h4 class="form-group mb-2 mt-3">2FA</h4>
<?php if (!$verification || $verification == 0): ?>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", $twoFactorFormaction) ?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="twofactor"><?= $twoFactorsym ?>
Zwei-Faktor-Authentifizierung</label>
<?= $twoFactortype ?>
<div class="col-lg-7">
<?= $twoFactorbtn ?>
</div>
</div>
</form>
<?php elseif ($verification == 1 || $verification == 2) :
if ($verification == 1) {
$verificationType = "Email";
} elseif ($verification == 2) {
$verificationType = "SMS";
}
?>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", "activate2faaction") ?>">
<div class="row">
<div class="col-lg-2"></div>
<label class="col-lg-3 col-form-label"
style="vertical-align: top;font-size: 15px;color: #000;"> Code wurde
per <?php echo $verificationType; ?> verschickt (5 Minuten gültig)</label>
</form>
<?php endif; ?>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="code">Verifizierungscode: <i
data-codetype="<?= $verification ?>"
class="fa-solid fa-arrows-rotate fa-new-code" id="new-authcode"
title="Neuen Code anfordern."></i></label>
<div class="col-lg-2">
<input type="number" required min="0" max="99999" class="form-control"
name="code"
id="code"
value="">
<input type="hidden" name="twofactor" value="<?php echo $verification; ?>"/>
</div>
<div class="col-lg-7 check-button">
<?= $twoFactorbtn ?>
<a href="<?= self::getUrl("UserProfile") ?>">
<button type="button" class="btn btn-secondary mb-3">Abbrechen</button>
</a>
</div>
</div>
</form>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>