Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame^] | 1 | <?php |
| 2 | require_once(__DIR__."/../core.php"); |
| 3 | security::checkType(security::ADMIN, security::METHOD_NOTFOUND); |
| 4 | |
| 5 | if (!isset($_GET["id"])) { |
| 6 | security::notFound(); |
| 7 | } |
| 8 | |
| 9 | $p = people::get($_GET["id"], false); |
| 10 | |
| 11 | if ($p === false) { |
| 12 | security::notFound(); |
| 13 | } |
| 14 | |
| 15 | $companies = companies::getAll(); |
| 16 | $pcompanies = []; |
| 17 | |
| 18 | foreach($p["companies"] as $company) { |
| 19 | $pcompanies[] = $companies[$company]; |
| 20 | } |
| 21 | |
| 22 | $secondFactor = secondFactor::isEnabled($p["id"]); |
| 23 | |
| 24 | if ($secondFactor) { |
| 25 | ?> |
| 26 | <dynscript> |
| 27 | document.querySelector(".disable-second-factor").addEventListener("click", e => { |
| 28 | dynDialog.load("dynamic/disablesecondfactor.php?id=<?=(int)$p["id"]?>"); |
| 29 | }); |
| 30 | </dynscript> |
| 31 | <?php |
| 32 | } |
| 33 | ?> |
| 34 | |
| 35 | <style> |
| 36 | #dynDialog { |
| 37 | max-width: 380px; |
| 38 | width: auto; |
| 39 | } |
| 40 | </style> |
| 41 | |
| 42 | <h4 class="mdl-dialog__title"><?=security::htmlsafe($p["name"])?></h4> |
| 43 | <ul> |
| 44 | <li><b>Nombre de usuario:</b> <?=security::htmlsafe($p["username"])?></li> |
| 45 | <li><b>DNI:</b> <?=(!empty($p["dni"]) ? security::htmlsafe($p["dni"]) : "-")?></li> |
| 46 | <li><b>Correo electrónico:</b> <?=(!empty($p["email"]) ? "<a href=\"mailto:".security::htmlsafe(rawurlencode($p["email"]))."\" target=\"_blank\">".security::htmlsafe($p["email"])."</a>" : "-")?> |
| 47 | <li><b>Categoría:</b> <?=($p["categoryid"] == -1 ? "-" : security::htmlsafe($p["category"]))?></li> |
| 48 | <li><b>Dada de baja:</b> <?=($p["baixa"] == 1 ? visual::YES : "No")?></li> |
| 49 | <li><b>Empresas:</b> <?=security::htmlsafe((count($p["companies"]) ? implode(", ", $pcompanies) : "-"))?></li> |
| 50 | <li><b>Tipo de usuario:</b> <?=security::htmlsafe(security::$types[$p["type"]])?></li> |
| 51 | <?php if (secondFactor::isAvailable()) { ?><li><b>Verificación en dos pasos:</b> <?=($secondFactor ? 'activada <button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent disable-second-factor">Desactivar</button>' : 'desactivada')?></li><?php } ?> |
| 52 | </ul> |
| 53 | |
| 54 | <div class="mdl-dialog__actions"> |
| 55 | <button data-dyndialog-close class="mdl-button mdl-js-button mdl-js-ripple-effect cancel">Cerrar</button> |
| 56 | <a href="userregistry.php?id=<?=(int)$p["id"]?>" class="mdl-button mdl-js-button mdl-button--icon mdl-js-ripple-effect"><i class="material-icons">list</i><span class="mdl-ripple"></span></a> |
| 57 | <a href="userincidents.php?id=<?=(int)$p["id"]?>" class="mdl-button mdl-js-button mdl-button--icon mdl-js-ripple-effect"><i class="material-icons">assignment_late</i><span class="mdl-ripple"></span></a> |
| 58 | <a href="workerschedule.php?id=<?=(int)$p["id"]?>" class="mdl-button mdl-js-button mdl-button--icon mdl-js-ripple-effect"><i class="material-icons">timelapse</i><span class="mdl-ripple"></span></a> |
| 59 | </div> |