|
|
@@ -14,7 +14,13 @@ if(core::ifGet("add")) {
|
|
|
$user = user::getUserById(core::getGet("id"));
|
|
|
$submit = "Modifier ce profil";
|
|
|
$titre = "Fiche de " . $user["prenom"] . " " . $user["nom"];
|
|
|
- $protect = 0;
|
|
|
+ if($user["deleted"] == 1){
|
|
|
+ $titre .= " (Supprimée)";
|
|
|
+ $protect = 2;
|
|
|
+ } else {
|
|
|
+ $protect = 0;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
$id_form = '<input type="hidden" name="id" value="' . $user["id"] . '">';
|
|
|
@@ -27,23 +33,29 @@ if(core::ifGet("add")) {
|
|
|
<h2 class="bd-title" id="content">
|
|
|
<span><?php echo $titre ?></span>
|
|
|
</h2>
|
|
|
- <?php if(isset($user["id"]) AND session::getId() != $user["id"]){ ?>
|
|
|
+ <?php if(isset($user["id"]) AND session::getId() != $user["id"] AND $protect != 2){ ?>
|
|
|
<div style="float:right; margin: -30px;">
|
|
|
<a href="/submit.php?from=user-delete&id=<?php echo $user["id"] ?>" onclick="return confirm('Voulez-vous supprimer le compte de <?php echo $user["prenom"] . " " . $user["nom"]; ?> ?')" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-danger btn-sm"><span data-feather="trash-2"></span> Supprimer</button></a>
|
|
|
</div>
|
|
|
+ <?php } elseif($protect == 2){ ?>
|
|
|
+ <div style="float:right; margin: -30px;">
|
|
|
+ <a href="/submit.php?from=user-restore&id=<?php echo $user["id"] ?>" onclick="return confirm('Voulez-vous restaurer le compte de <?php echo $user["prenom"] . " " . $user["nom"]; ?> ?')" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-danger btn-sm"><span data-feather="package"></span> Restaurer</button></a>
|
|
|
+ </div>
|
|
|
<?php } ?>
|
|
|
<?php if(isset($user["last_connect"])){ echo '<h6>Dernière connexion : ' . $user["last_connect"] .'</h6>'; } ?>
|
|
|
</div>
|
|
|
</header>
|
|
|
|
|
|
<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" : "")'>
|
|
|
|
|
|
<input type="hidden" name="from" value="user">
|
|
|
|
|
|
<?php
|
|
|
echo $id_form;
|
|
|
+ endif;
|
|
|
?>
|
|
|
|
|
|
<div class="form-group">
|
|
|
@@ -55,7 +67,7 @@ if(core::ifGet("add")) {
|
|
|
<option value="1"<?php if(isset($user["id_type"]) AND $user["id_type"] == 1){ echo " selected"; } ?>>Administrateur</option>
|
|
|
</select>
|
|
|
<?php endif; ?>
|
|
|
- <?php if($protect == 1): ?>
|
|
|
+ <?php if($protect == 1 OR $protect == 2): ?>
|
|
|
<input type="text" class="form-control" value="<?php
|
|
|
if($user["id_type"] == 1){ echo "Administrateur"; }
|
|
|
elseif($user["id_type"] == 2){ echo "Contrôleur QRCode (émargement)"; }
|
|
|
@@ -72,7 +84,7 @@ if(core::ifGet("add")) {
|
|
|
if (isset($user["prenom"])) {
|
|
|
echo $user["prenom"];
|
|
|
}
|
|
|
- ?>" name="prenom" placeholder="" required>
|
|
|
+ ?>" name="prenom" placeholder="" <?php if($protect == 2){ echo 'readonly="readonly"'; } else { echo 'required'; } ?>>
|
|
|
</div>
|
|
|
<br />
|
|
|
|
|
|
@@ -82,7 +94,7 @@ if(core::ifGet("add")) {
|
|
|
if (isset($user["nom"])) {
|
|
|
echo $user["nom"];
|
|
|
}
|
|
|
- ?>" name="nom" placeholder="" required>
|
|
|
+ ?>" name="nom" placeholder="" <?php if($protect == 2){ echo 'readonly="readonly"'; } else { echo 'required'; } ?>>
|
|
|
</div>
|
|
|
<br />
|
|
|
|
|
|
@@ -92,10 +104,12 @@ if(core::ifGet("add")) {
|
|
|
if (isset($user["email"])) {
|
|
|
echo $user["email"];
|
|
|
}
|
|
|
- ?>" name="email" placeholder="" required>
|
|
|
+ ?>" name="email" placeholder="" <?php if($protect == 2){ echo 'readonly="readonly"'; } else { echo 'required'; } ?>>
|
|
|
</div>
|
|
|
<br />
|
|
|
|
|
|
+ <?php if($protect != 2): ?>
|
|
|
+
|
|
|
<div class="form-group">
|
|
|
<label>Mot de passe</label>
|
|
|
<input type="password" class="form-control" minlength="8" maxlength="25" value="" name="password" placeholder="" <?php if(core::ifGet("add")){ echo "required"; } ?>>
|
|
|
@@ -117,6 +131,8 @@ if(core::ifGet("add")) {
|
|
|
</div>
|
|
|
<br />
|
|
|
|
|
|
+ <?php endif; ?>
|
|
|
+
|
|
|
<?php if(isset($user["googleAuthenticator"]) AND $user["googleAuthenticator"] == 1 AND $protect == 1) { ?>
|
|
|
<div class="card text-center" style="width: 18rem;">
|
|
|
<?php
|
|
|
@@ -140,13 +156,13 @@ if(core::ifGet("add")) {
|
|
|
</select>
|
|
|
</div>
|
|
|
<br />
|
|
|
- <?php endif; ?>
|
|
|
+
|
|
|
<?php if($protect == 1): ?>
|
|
|
<input type="hidden" name="actif" value="<?php echo $user["actif"] ?>">
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<input class="btn btn-primary btn-lg" style="width: 100%" type="submit" value="<?php echo $submit ?>">
|
|
|
-
|
|
|
+ <?php endif; ?>
|
|
|
<br />
|
|
|
<br />
|
|
|
|