|
|
@@ -81,7 +81,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
<br />
|
|
|
<?php if($protect != 2): ?>
|
|
|
|
|
|
-<form method="post" action="/submit.php" oninput='password2.setCustomValidity(password2.value != password.value ? "Les mots de passe ne sont pas identiques" : "")'>
|
|
|
+<form id="form-user" method="post" action="/submit.php" oninput='password2.setCustomValidity(password2.value != password.value ? "Les mots de passe ne sont pas identiques" : "")' onsubmit="return(false);">
|
|
|
|
|
|
<input type="hidden" name="from" value="user">
|
|
|
|
|
|
@@ -105,12 +105,12 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
?>
|
|
|
<?php if($protect == 0): ?>
|
|
|
<?php
|
|
|
- html::printSelect('name="id_type" class="form-select"', $id_type, $user["id_type"]);
|
|
|
+ html::printSelect('name="id_type" class="form-select"', $id_type, @$user["id_type"]);
|
|
|
?>
|
|
|
<?php endif; ?>
|
|
|
<?php if($protect == 1 OR $protect == 2): ?>
|
|
|
<?php
|
|
|
- html::printSelect('class="form-control" disabled', $id_type, $user["id_type"]);
|
|
|
+ html::printSelect('class="form-control" disabled', $id_type, @$user["id_type"]);
|
|
|
html::printInput('type="hidden" name="id_type"', $user["id_type"]);
|
|
|
?>
|
|
|
<?php endif; ?>
|
|
|
@@ -121,14 +121,14 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
if(access::ifAccesss("add-user") AND core::ifGet("id")) { ?>
|
|
|
<div class="form-group">
|
|
|
<label>Rôles aditionnels</label>
|
|
|
- <?= html::printInput('type="text" name="tags" id="tags"', $user["tags"]) ?>
|
|
|
+ <?= html::printInput('type="text" name="tags" id="tags"', @$user["tags"]) ?>
|
|
|
</div>
|
|
|
<br />
|
|
|
<?php
|
|
|
} elseif(isset($user["tags"])) { ?>
|
|
|
<div class="form-group">
|
|
|
<label>Rôles aditionnels</label>
|
|
|
- <?= html::printInput('type="text" class="form-control" name="tags" readonly="readonly"', $user["tags"]) ?>
|
|
|
+ <?= html::printInput('type="text" class="form-control" name="tags" readonly="readonly"', @$user["tags"]) ?>
|
|
|
</div>
|
|
|
<br />
|
|
|
<?php
|
|
|
@@ -142,7 +142,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
<?php
|
|
|
$confPrenom = 'type="text" name="prenom" class="form-control" ';
|
|
|
$confPrenom .= $protect == 2 ? 'readonly="readonly"' : 'required';
|
|
|
- html::printInput($confPrenom, $user["prenom"]);
|
|
|
+ html::printInput($confPrenom, @$user["prenom"]);
|
|
|
?>
|
|
|
</div>
|
|
|
<br />
|
|
|
@@ -152,7 +152,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
<?php
|
|
|
$confNom = 'type="text" name="nom" class="form-control" ';
|
|
|
$confNom .= $protect == 2 ? 'readonly="readonly"' : 'required';
|
|
|
- html::printInput($confNom, $user["nom"]);
|
|
|
+ html::printInput($confNom, @$user["nom"]);
|
|
|
?>
|
|
|
</div>
|
|
|
<br />
|
|
|
@@ -162,7 +162,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
<?php
|
|
|
$confEmail = 'type="text" name="email" class="form-control" ';
|
|
|
$confEmail .= $protect == 2 ? 'readonly="readonly"' : 'required';
|
|
|
- html::printInput($confEmail, $user["email"]);
|
|
|
+ html::printInput($confEmail, @$user["email"]);
|
|
|
?>
|
|
|
</div>
|
|
|
<br />
|
|
|
@@ -172,7 +172,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
<div class="form-group">
|
|
|
<label>Mot de passe</label>
|
|
|
<?php
|
|
|
- $confPassword = 'type="password" class="form-control" minlength="8" maxlength="25" name="password" ';
|
|
|
+ $confPassword = 'type="password" class="form-control" minlength="8" maxlength="25" name="password" required ';
|
|
|
$confPassword .= core::ifGet("add") ? 'required"' : NULL;
|
|
|
html::printInput($confPassword);
|
|
|
?>
|
|
|
@@ -182,7 +182,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
<div class="form-group">
|
|
|
<label>Confirmation du mot de passe</label>
|
|
|
<?php
|
|
|
- $confPassword2 = 'type="password" class="form-control" minlength="8" maxlength="25" name="password2" ';
|
|
|
+ $confPassword2 = 'type="password" class="form-control" minlength="8" maxlength="25" name="password2" required ';
|
|
|
$confPassword2 .= core::ifGet("add") ? 'required"' : NULL;
|
|
|
html::printInput($confPassword2);
|
|
|
?>
|
|
|
@@ -196,7 +196,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
0 => "Désactivé",
|
|
|
1 => "Activé",
|
|
|
];
|
|
|
- html::printSelect('name="googleAuthenticator" class="form-select"', $googleAuthenticator, $user["googleAuthenticator"]);
|
|
|
+ html::printSelect('name="googleAuthenticator" class="form-select"', $googleAuthenticator, @$user["googleAuthenticator"]);
|
|
|
?>
|
|
|
</div>
|
|
|
<br />
|
|
|
@@ -225,7 +225,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
0 => "Compte désactivé",
|
|
|
1 => "Compte activé",
|
|
|
];
|
|
|
- html::printSelect('name="actif" class="form-select"', $actif, $user["actif"]);
|
|
|
+ html::printSelect('name="actif" class="form-select"', $actif, @$user["actif"]);
|
|
|
?>
|
|
|
</div>
|
|
|
<br />
|
|
|
@@ -235,7 +235,7 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
<?= html::printInput('type="hidden" name="actif"', $user["actif"]); ?>
|
|
|
<?php endif; ?>
|
|
|
|
|
|
- <input class="btn btn-primary btn-lg" style="width: 100%; margin-bottom:20px;" type="submit" value="<?php echo $submit ?>">
|
|
|
+ <input class="btn btn-primary btn-lg" style="width: 100%; margin-bottom:20px;" type="button" value="<?php echo $submit ?>" onclick="validateAndSubmit()">
|
|
|
|
|
|
</form>
|
|
|
|
|
|
@@ -249,4 +249,8 @@ if(core::ifGet("add") AND access::ifAccesss("add-user")) {
|
|
|
max: 3
|
|
|
});
|
|
|
});
|
|
|
-</script>
|
|
|
+</script>
|
|
|
+
|
|
|
+<?php
|
|
|
+ get::javascript("user");
|
|
|
+?>
|