Файловый менеджер - Редактировать - /var/www/jonas-eriksen.dk/admin/profile.php
Назад
<?php include('../include.php'); $admin = new admin($db); $admin->passwordResetCheck(); if (!$admin->admin_level(1)) { $admin->redirect('/static/401.php'); } $log = new log($db); $user = $admin->getAdmin($_GET['admin']); if (isset($_POST['change'])) { if (!$admin->changePasswordForUser($_SESSION['username'], $_POST['password'], $_GET['admin'], $_POST['newpassword'])) ; { echo '<span class="badge badge-pill badge-danger" style="background-color: red; font-size: large">Fejl i ændring af kode!</span>'; } $log->addLog($_SESSION['userId'], $_SESSION['username'] . ' har ændret password for ' . $user[0], "Password", null); } if (isset($_POST['reset'])) { $admin->forceChangePasswordForUser($_GET['admin']); $log->addLog($_SESSION['userId'], $_SESSION['username'] . ' har sat password til resat for ' . $user[0], "Password", null); } if (isset($_POST['save'])){ if (isset($_POST['deleted'])) { $isDeleted = 1; } else { $isDeleted = 0; } if (!$admin->saveAdmin($_GET['admin'], $_POST['name'], $isDeleted, $_POST['level'])) { echo '<span class="badge badge-pill badge-danger" style="background-color: red; font-size: large">Information ikke gemt</span>'; } $log->addLog($_SESSION['userId'], $_SESSION['username'] . ' har opdateret brugeren ' . $user[0], 'Admin', '/admin/show.php?admin=' . $_GET['admin']); $link = '/admin/show.php?admin=' . $_GET['admin'] . '&success-save=true'; echo "<script type='text/javascript'>window.location.href = '$link';</script>"; } if (isset($_GET['success-code'])) { echo '<span class="badge badge-pill badge-success" style="background-color: green; font-size: large">Succes! Kode ændret.</span>'; } if(isset($_GET['success-save'])) { echo '<span class="badge badge-pill badge-success" style="background-color: green; font-size: large">Succes! Information gemt.</span>'; } include('../static/header.php'); ?> <h2>Admin profile</h2> <div style="width: 100%;"> <div style="float:left; width: 50%"> <div class="container"> <div class="row"> <div class="col-lg-12"> <table id="userTable" class="table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>Brugernavn</th> <th>Navn</th> <th>Slettet</th> <?php if ($admin->admin_level(1)) { echo '<th>Admin level</th>'; echo '<th>Sidste login</th>'; } ?> </tr> </thead> <tbody> <tr> <td><?php echo $user[0]; ?></td> <td><?php echo $user[1]; ?></td> <td> <?php if ($user[2] == 1) { echo "Ja"; } else { echo "Nej"; } ?> </td> <?php if ($admin->admin_level(1)) { ?> <td><?php echo $user[3]; ?></td> <td><?php echo $user[4]; ?></td> <?php } ?> </tr> </tbody> </table> </div> </div> </div> <h2>Ændre profil</h2> <div class="container"> <div class="row"> <div class="col-lg-12"> <table id="userTable" class="table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>Brugernavn</th> <th>Navn</th> <th>Slettet</th> <?php if ($admin->admin_level(1)) { echo '<th>Admin level</th>'; echo '<th></th>'; } ?> </tr> </thead> <tbody> <tr> <form name="save" method="post"> <td><?php echo $user[0]; ?></td> <td><input type="text" value="<?php echo $user[1]; ?>" name="name"></td> <td style="align-content: center"> <?php if ($user[2]) { echo '<input type="checkbox" name="deleted" checked>'; } else { echo '<input type="checkbox" name="deleted">'; } ?> </td> <td><input type="text" value=" <?php echo $user[3] ?>" name="level"></td> <td> <button name='save'>Gem ændringer</button> </td> </form> </tr> </tbody> </table> </div> </div> </div> </div> </div> <div style="float:right;"> <?php if ($admin->admin_level(1)) { ?> <h3>Ændre password</h3> <form method="post" style=""> <table> <col width="100"> <col width="80"> <tr> <td>Dit brugernavn</td> <td><input type="text" name="username" value="<?php echo $_SESSION['username'] ?>" readonly> </td> </tr> <tr> <td>Dit password</td> <td><input type="password" name="password" required></td> </tr> <tr> <td>Nyt password</td> <td><input type="password" name="newpassword" required></td> </tr> </table> <button name="change"> Ændre password </button> </form> <form method="post"> <button name='reset' value='true'>Nulstil password ved næste login</button> </form> <?php } ?> </div> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка