Current Path : /data/web/virtuals/51568/virtual/www/subdom/douc/php/ |
Current File : /data/web/virtuals/51568/virtual/www/subdom/douc/php/pass.php |
<?php if (session_status() !== PHP_SESSION_ACTIVE) { session_start(); } unset($_SESSION["account"]); ?> <!DOCTYPE html> <html lang="cz"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.1.0/css/all.css" integrity="sha512-ajhUYg8JAATDFejqbeN7KbF2zyPbbqz04dgOLyGcYEk/MJD3V+HJhJLKvJ2VVlqrr4PwHeGTTWxbI+8teA7snw==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <title>Doučování: zapomenuté heslo</title> </head> <body> <div class="container-fluid"> <?php include('funkce.php'); $token = isset($_REQUEST["token"]) ? trim($_REQUEST["token"]) : ""; $pokracovat = true; $db = new DB(); if ($rec = $db->fetchOne("SELECT `ucitele_id`, `token`, `time`, `ucitele`.`email` FROM `ucitele_verify` LEFT JOIN `ucitele` on `ucitele`.`id` = `ucitele_verify`.`ucitele_id` WHERE `token` = :token", $token)){ $nyni = new Datetime(); $nyni = strtotime($nyni->format('Y-m-d H:i:s')); $timetoken = strtotime($rec->time); if (($nyni - $timetoken) > 60 * 60 * 6 ){ $pokracovat = false; ?> <div class="alert alert-warning mt-5 h5"> Byla překročena doba platnosti odkazu na změnu hesla (okamžik vygenerování hesla: <?= date("d.m.Y H:i:s", strtotime($rec->time))?>). <br> Pokud cheš heslo obnovit / nově zadat, musíš odkaz vygenerovat znovu. </div> <?php ;} } else { $pokracovat = false; ?> <div class="alert alert-warning mt-5 h6 border-0"> Požadovaný odkaz na změnu hesla neexistuje: <ul> <li>byl nahrazen jiným, později vyvolaným</li> <li>byl již použit</li> <li>jedná se o něco nekalého :(</li> </ul> </div> <?php } if ($pokracovat){ ?> <div id="pass-change-email" class="mt-5"> <div class="modal-dialog border shadow rounded-0"> <div class="modal-content rounded-0"> <div class="card-header bg-success text-white rounded-0"> <div class="card-title h5 mb-0">Změna hesla: <small><?= $rec->email?></small> </div> </div> <div class="modal-body"> <div class="form-group"> <div class="form-group mt-1 row"> <div class="input-group"> <span class="input-group-text"> <i class="fa fa-lock"></i> </span> <input type="password" class="form-control rounded-0" placeholder="nové heslo" id="newPasswordEmail" required name="newPasswordEmail" required minlength="8" value=""> <span class="input-group-text" id="newPassVisibleEmail" newpassem-visible="0" style="cursor: pointer"> <i class="far fa-eye"></i> </span> </div> <div id="groupConfirmPasswordEmail" class="input-group my-3"> <span class="input-group-text"> <i class="fa fa-lock"></i> </span> <input type="password" class="form-control rounded-0" placeholder="povrzení hesla" id="confirmPasswordEmail" required name="confirmPasswordEmail" minlength="5" /> <div class="input-group-append"> </div> </div> <div class="pl-2 mb-2"> <small class="text-muted form-text">Podmínky pro heslo: <div class="row"> <div class="col-6"> <ul> <li>alespoň jedno malé písmeno </li> <li>alespoň jedna číslice </li> </ul> </div> <div class="col-6"> <ul> <li>délka 8 - 16 znaků </li> <li>alespoň jedno velké písmeno </li> </ul> </div> </div> <ul> <li>nedoporučuje se znaky s nabodeníčky </li> </ul> </small> </div> </div> <div id="errChangePassEmail" class="h6 alert alert-danger d-none rounded-0 shadow-sm"> </div> </div> <div class="modal-footer justify-content-right"> <button id="passChangeEmail" class="btn btn-success rounded-0 w-50" onclick="passEmailChange(<?= $rec->ucitele_id;?>)" name="passChangeEmail">Změnit <i class="fas fa-key"></i> </button> </div> </div> </div> </div> <?php } ?> </div> <script src="pass.js"></script> </body> </html>