Some fixes

This commit is contained in:
Jonathan Flueren 2023-08-16 17:40:32 +02:00
parent f8743c9487
commit 7a3622e8ef

View file

@ -4,7 +4,7 @@ session_start();
define('IDENTITIES_FILE', 'identities.json');
define('PRESENT_FILE', 'present.json');
define('NAME_PATTERN', "^([ a-zA-Z'\-]){1,30}$");
define('NAME_PATTERN', "^([ a-zA-Z0-9'\-]){1,30}$");
define('MAC_PATTERN', "^([0-9A-Fa-f]{2}[:-s]){5}([0-9A-Fa-f]{2})$");
define('PAGE_TITLE', 'CZI Presence Detector');
@ -164,8 +164,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
<div class="card-body">
<h5 class="card-title">Neues Gerät tracken</h5>
<form method="POST">
<input class="form-control" type="text" name="name" pattern="<?php echo NAME_PATTERN; ?>" placeholder="Name" value="" /><br>
<input class="form-control" type="text" name="mac" pattern="<?php echo MAC_PATTERN; ?>" placeholder="MAC-Adresse" value="" /><br>
<input class="form-control" type="text" name="name" pattern="<?php echo NAME_PATTERN; ?>" placeholder="Name" value="" required /><br>
<input class="form-control" type="text" name="mac" pattern="<?php echo MAC_PATTERN; ?>" placeholder="MAC-Adresse" value="" required /><br>
<button class="btn btn-primary" type="submit">Speichern</button>
</form>
</div>
@ -176,7 +176,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
<div class="card-body">
<h5 class="card-title">Gerät entfernen</h5>
<form method="POST">
<input class="form-control" type="text" name="remove-mac" pattern="<?php echo MAC_PATTERN; ?>" placeholder="MAC-Adresse" value="" /><br>
<input class="form-control" type="text" name="remove-mac" pattern="<?php echo MAC_PATTERN; ?>" placeholder="MAC-Adresse" value="" required /><br>
<button class="btn btn-primary" type="submit">Entfernen</button>
</form>
</div>