adminpwd.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. include_once ('includes/checklogin.php');
  3. include_once ('includes/head.php');
  4. include_once ('includes/nav.php');
  5. include_once ('tools/htpasswd.php');
  6. ?>
  7. <div class="container box">
  8. <div class="row">
  9. <div class="col-xs-12">
  10. <h2>Create Admin Password Hash</h2>
  11. <?php
  12. if (isset ( $_POST ['pwd'] )) {
  13. ?>
  14. <div class="alert alert-info">
  15. <?php
  16. echo "<p>Your new hash: <code>" . htpasswd::htcrypt($_POST['pwd']) . "</code></p>";
  17. ?>
  18. </div>
  19. <?php
  20. }
  21. ?>
  22. <p>Create a new password hash for the config file:</p>
  23. <form class="navbar-form navbar-left" action="adminpwd.php" method="post">
  24. <div class="form-group">
  25. <p>
  26. <input class="form-control" type="password" name="pwd"
  27. placeholder="Password" />
  28. </p>
  29. <button type="submit" class="btn btn-default">Submit</button>
  30. </div>
  31. </form>
  32. </div>
  33. </div>
  34. <div class=row>
  35. <br/><br/>
  36. <div class="col-xs-12 col-md-10 well">
  37. <p>Use this generated hash in <code>config/config.ini</code> for the <code>admin_pwd_hash</code> key.</p>
  38. </div>
  39. </div>
  40. </div>
  41. <?php
  42. include_once ('includes/nav.php');
  43. include_once ('includes/footer.php');
  44. ?>