PostfixAdmin - web based virtual user administration interface for Postfix mail servers https://postfixadmin.github.io/postfixadmin/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1009 B

  1. <?php
  2. require "../config.inc.php";
  3. require "../my_lib.php";
  4. print_header("admin");
  5. $username = $_GET['username'];
  6. if (!empty($_POST['submit'])) {
  7. $form_new_passwd1 = $_POST['form_new_passwd1'];
  8. if (empty($form_new_passwd1)) {
  9. print_error("You will need to fill in the password field!");
  10. }
  11. $new_passwd = md5crypt($form_new_passwd1);
  12. $result = db_query("UPDATE admin SET password='$new_passwd',change_date=NOW() WHERE username='$username'");
  13. if ($result['rows'] == 1) {
  14. print "The password has been updated!\n";
  15. print "<p />\n";
  16. print_footer();
  17. exit;
  18. } else {
  19. print_error("Unable to update your password!");
  20. }
  21. }
  22. ?>
  23. Change admin password.
  24. <p>
  25. <form name="passwd" method="post">
  26. <table class="form">
  27. <tr><td>Login:</td><td><?php print "$username"; ?></td></tr>
  28. <tr><td>New Password:</td><td><input type="text" name="form_new_passwd1"></td></tr>
  29. <tr><td colspan="2" align="center"><input type="submit" name="submit" value="Enter"></td></tr>
  30. </table>
  31. </form>
  32. <?php
  33. print_footer();
  34. ?>