andom-tec changes

This commit is contained in:
Frank Schubert
2024-12-24 12:38:29 +01:00
parent aff469924e
commit ee0037835c
24 changed files with 5518 additions and 298 deletions

View File

@@ -62,18 +62,18 @@
</select>
</div>
<div class="form-group">
<label for="employee"><span class="text-warning font-weight-bold font-16">X</span><span class="text-primary font-weight-bold">inon</span> Mitarbeiter:</label>
<label for="employee"><?=TT_SYSOWNER_NAME_HTML?> Mitarbeiter:</label>
<select name="employee" id="employee" class="form-control">
<option value="false" <?=(isset($user) && !$user->is("employee")) ? "selected='selected'" : ""?>>No</option>
<option value="true" <?=(isset($user) && $user->is("employee")) ? "selected='selected'" : ""?>>Yes</option>
</select>
</div>
<div class="form-group <?=(!isset($user) || !$user->is("employee")) ? "hidden" : ""?>" id="employee-number-container">
<label for="employee_number"><span class="text-warning font-weight-bold font-16">X</span><span class="text-primary font-weight-bold">inon</span> Mitarbeiternummer:</label>
<label for="employee_number"><?=TT_SYSOWNER_NAME_HTML?> Mitarbeiternummer:</label>
<input type="text" id="employee_number" name="employee_number" class="form-control" value="<?=(isset($user)) ? (new WorkerFlag($user->id, "employee_number"))->value() : ""?>" />
</div>
<div class="form-group <?=(!isset($user) || !$user->is("employee")) ? "hidden" : ""?>" id="project-api-key-container">
<label for="project_api_key">Project API Key:</label>
<label for="project_api_key">OpenProject API Key:</label>
<input type="text" id="project_api_key" name="project_api_key" class="form-control" value="<?=(isset($user)) ? (new WorkerFlag($user->id, "project_api_key"))->value() : ""?>" />
</div>
<div class="form-group">

View File

@@ -127,60 +127,64 @@ if ($userprofile->twofactor == 0) {
</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): ?>
<?php if(!$userprofile->twofactor): ?>
<div class="alert alert-danger"><i class="fas fa-exclamation-circle"></i> Derzeit ist keine Methode für die Zwei-Faktor-Authentifizerung aktiviert. Bitte aktivieren Sie eine Zwei-Faktor-Authentifizerungsmethode!</div>
<?php if(defined("TT_WORKER_FORCE_2FA") && TT_WORKER_FORCE_2FA): ?>
<div class="w-100 border-bottom"></div>
<h4 class="form-group mb-2 mt-3">2FA</h4>
<?php if (!$verification || $verification == 0): ?>
<?php if(!$userprofile->twofactor): ?>
<div class="alert alert-danger"><i class="fas fa-exclamation-circle"></i> Derzeit ist keine Methode für die Zwei-Faktor-Authentifizerung aktiviert. Bitte aktivieren Sie eine Zwei-Faktor-Authentifizerungsmethode!</div>
<?php endif; ?>
<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>
</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; ?>
<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>
</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>

View File

@@ -51,7 +51,12 @@ function pascalToSnakeCase(string $str): string {
$vueTagName = pascalToSnakeCase($vueViewName);
include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/vueHeader.php"); ?>
$vueHeaderPath = realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/vueHeader.php";
if(!file_exists($vueHeaderPath)) {
$vueHeaderPath = realpath(dirname(__FILE__) . "/../../default") . "/vueHeader.php";
}
include($vueHeaderPath); ?>
<div id="app">