Advertisement
Guest User

Untitled

a guest
Oct 13th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.84 KB | None | 0 0
  1. <?php
  2.  
  3. ob_start();
  4.  
  5. if(file_exists("install.php") == "1"){
  6. header('Location: install.php');
  7. exit();
  8. }
  9.  
  10. include 'inc/database.php';
  11.  
  12. $result = mysqli_query($con, "SELECT * FROM `settings` LIMIT 1") or die(mysqli_error($con));
  13. while($row = mysqli_fetch_assoc($result)){
  14. $website = $row['website'];
  15. $favicon = $row['favicon'];
  16. }
  17.  
  18. if (!isset($_SESSION)) {
  19. session_start();
  20. }
  21.  
  22. if(isset($_POST['password']) && isset($_POST['newpassword']) && isset($_POST['confirmpassword'])){
  23.  
  24. $username = $_SESSION['username'];
  25. $password = mysqli_real_escape_string($con, md5($_POST['password']));
  26. $newpassword = mysqli_real_escape_string($con, md5($_POST['newpassword']));
  27. $confirmpassword = mysqli_real_escape_string($con, md5($_POST['repeatpassword']));
  28.  
  29. if($password != $confirmpassword){
  30. die("The confirmation password was not equal to the password.");
  31. }
  32. mysqli_query($con, "UPDATE users SET password = '$confirmpassword' WHERE username = '$username' and password = '$password'") or die(mysqli_error($con));
  33.  
  34. header("Location: login.php?action=registered");
  35. }
  36.  
  37. ?>
  38.  
  39. <!DOCTYPE html>
  40. <html lang="en">
  41. <head>
  42. <meta charset="utf-8">
  43. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  44. <meta name="description" content="">
  45. <meta name="author" content="24/7">
  46. <meta name="keyword" content="">
  47. <link rel="shortcut icon" href="<?php echo $favicon;?>">
  48.  
  49. <title><?php echo $website;?> - Support</title>
  50.  
  51. <!-- Bootstrap core CSS -->
  52. <link href="../css/bootstrap.min.css" rel="stylesheet">
  53. <link href="../css/bootstrap-reset.css" rel="stylesheet">
  54. <!--external css-->
  55. <link href="../assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
  56. <!-- Custom styles for this template -->
  57. <link href="../css/style.css" rel="stylesheet">
  58. <link href="../css/style-responsive.css" rel="stylesheet" />
  59.  
  60. <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
  61. <!--[if lt IE 9]>
  62. <script src="../js/html5shiv.js"></script>
  63. <script src="../js/respond.min.js"></script>
  64. <![endif]-->
  65. </head>
  66.  
  67. <body class="login-body">
  68.  
  69. <div class="container">
  70.  
  71. <form class="form-signin" action="reset.php" method="POST">
  72. <h2 class="form-signin-heading"><?php echo $website;?></h2>
  73. <div class="login-wrap">
  74. <input type="password" id="currentpassword" name="password" class="form-control" placeholder="Current Password" autofocus>
  75. <input type="password" id="password" name="newpassword" class="form-control" placeholder="New Password" autofocus>
  76. <input type="password" id="password" name="repeatpassword" class="form-control" placeholder="Retype New Password" autofocus>
  77. <button name="save" class="btn btn-lg btn-login btn-block" type="submit">Change Password</button>
  78.  
  79.  
  80. </form>
  81. <div class="registration">
  82. Already know your password?&nbsp;
  83. <a class="" href="login">
  84. Sign In
  85. </a>
  86. </div>
  87.  
  88. </div>
  89.  
  90. </div>
  91.  
  92.  
  93. <div class="modal fade" id="error" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true" style="padding-top: 15%; overflow-y: visible; display: none;">
  94. <div class="modal-dialog modal-sm">
  95. <div class="modal-content panel-success">
  96. <div class="modal-header panel-heading">
  97. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  98. <center><h3 style="margin:0;"><i class="icon-success"></i> Email Sent!</h3></center>
  99. </div>
  100. <div class="modal-body">
  101. <center>
  102. <strong>Please check your email for your reset token.</strong>
  103. </center>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108.  
  109. <!-- js placed at the end of the document so the pages load faster -->
  110. <script src="js/jquery.js"></script>
  111. <script src="js/jquery-1.8.3.min.js"></script>
  112. <script src="js/bootstrap.min.js"></script>
  113. <script src="js/jquery.scrollTo.min.js"></script>
  114. <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
  115. <script src="js/jquery.customSelect.min.js" ></script>
  116. <script src="js/respond.min.js" ></script>
  117.  
  118. <script class="include" type="text/javascript" src="js/jquery.dcjqaccordion.2.7.js"></script>
  119.  
  120. <!--common script for all pages-->
  121. <script src="js/common-scripts.js"></script>
  122.  
  123. </body>
  124. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement