Guest User

Untitled

a guest
Apr 7th, 2018
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.79 KB | None | 0 0
  1. <?php
  2. /*---------------------------------------------------+
  3. | HoloCMS - Website and Content Management System
  4. +----------------------------------------------------+
  5. | Copyright © 2008 Meth0d
  6. +----------------------------------------------------+
  7. | HoloCMS is provided "as is" and comes without
  8. | warrenty of any kind.
  9. +---------------------------------------------------*/
  10.  
  11. include('core.php');
  12.  
  13. session_start();
  14.  
  15. if(!session_is_registered(username)){
  16.  
  17. include("locale/".$language."/login.php");
  18.  
  19. include('templates/login/subheader.php');
  20. include('templates/login/header.php');
  21.  
  22. if(isset($_POST['actionForgot'])){
  23. $forgot_name = $_POST['forgottenpw-username'];
  24. $forgot_mail = $_POST['forgottenpw-email'];
  25. $sql_forgot = mysql_query("SELECT password FROM users WHERE name = '".$forgot_name."' and email = '".$forgot_mail ."'") or die(mysql_error());
  26. $sql_num = mysql_num_rows($sql_forgot);
  27.     if($sql_num > 0){
  28.       $password = "";
  29.       $length = 8;
  30.       $possible = "0123456789qwertyuiopasdfghjkzxcvbnm";
  31.       $i = 0;
  32.       while ($i < $length) {
  33.         $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
  34.         if (!strstr($password, $char)) {
  35.           $password .= $char;
  36.           $i++;
  37.         }
  38.       }
  39.     $result = $locale['forgot_mail_send'];
  40.     $sql_row = mysql_fetch_assoc($sql_forgot);
  41.     $hashed_pass = HoloHash($password, $sql_row['name']);
  42.     mysql_query("UPDATE users SET password = '".$hashed_pass."' WHERE name = '".$forgot_name."'") or die(mysql_error());
  43.     $teh_pass = $password;
  44.     $subject = 'Your ".$shortname." Password';
  45.     $headers = "From: ".$sitename." <mailings@".strtolower($shortname).".com>\r\nReply-To:admin@".strtolower($shortname).".com";
  46.     $headers .= "\r\nContent-Type: text/html;charset=ISO-8859-1\r\nContent-Transfer-Encoding: 7bit";
  47.     ob_start(); //Turn on output buffering
  48.     ?>
  49.     <html><head><style type="text/css">a { color: #fc6204; }</style></head><body style="background-color: #e3e3db; margin: 0; padding: 0; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000;"><div style="background-color: #bce0ee; padding: 14px; border-bottom: 3px solid #000;"> <img src="<?php echo $path; ?>web-gallery/v2/images/habbo.png" alt="<?php echo $shortname; ?>" /></div><div style="padding: 14px 14px 50px 14px; background-color: #e3e3db;">   <div style="background-color: #fff; padding: 14px; border: 1px solid #ccc"><h1 style="font-size: 16px">Your new password:</h1>
  50.  
  51.     <p>
  52.     Hello <b><?php echo $forgot_name; ?></b>, your new password is:<br /><b><?php echo $teh_pass; ?></b><br />Please change it after you log in.
  53.     </p>    </div>  <div style="padding: 14px 0; text-align: center; font-size: 10px;">     All rights including trademarks, copyright and database rights in the Habbo website and its contents are owned by or licensed to Sulake Inc. All rights reserved.   Note! If you do not wish to receive any future e-mails from <?php echo $shortname; ?>, please send e-mail to optout@<?php echo $shortname; ?>.com. Please note that this will prevent you from receiving all e-mails from <?php echo $sitename; ?>, including customer service e-mails. </div></div></body></html>
  54.     <?
  55.     $message = ob_get_clean();
  56.     $mail_sent = @mail($forgot_mail, $subject, $message, $headers );
  57.     } else {
  58.     $result = $locale['forgot_error_invalid'];
  59.     }
  60. }
  61.  
  62. ?>
  63.  
  64. <?php /* We have to use special CSS formatting for the page to display properly here. */ ?>
  65.  
  66. <style type="text/css">
  67.         div.left-column { float: left; width: 50% }
  68.         div.right-column { float: right; width: 49% }
  69.         label { display: block }
  70.         input { width: 98% }
  71.         input.process-button { width: auto; float: right }
  72.     </style>
  73.  
  74.             <div id="process-content">
  75.                 <div class="left-column">
  76.  
  77. <?php if(!empty($result)){ ?>
  78. <div class="cbb clearfix white">
  79.     <div class="box-content">
  80.  
  81.         <p><?php echo "<div align='center'><b>".$result."</b></div>"; ?></p>
  82.  
  83.     </div>
  84. </div>
  85. <?php } ?>
  86.  
  87. <div class="cbb clearfix">
  88.     <h2 class="title"><?php echo $locale['forgot_pass']; ?></h2>
  89.     <div class="box-content">
  90.  
  91.         <p><?php echo $locale['forgot_pass_content']; ?></p>
  92.  
  93.         <div class="clear"></div>
  94.  
  95.         <form method="post" action="forgot.php" id="forgottenpw-form">
  96.             <p>
  97.             <label for="forgottenpw-username"><?php echo $locale['forgot_username']; ?></label>
  98.             <input type="text" name="forgottenpw-username" id="forgottenpw-username" value="" />
  99.             </p>
  100.  
  101.             <p>
  102.             <label for="forgottenpw-email"><?php echo $locale['forgot_email']; ?></label>
  103.             <input type="text" name="forgottenpw-email" id="forgottenpw-email" value="" />
  104.             </p>
  105.  
  106.             <p>
  107.             <input type="submit" value="<?php echo $locale['forgot_button']; ?>" name="actionForgot" class="submit process-button" id="forgottenpw-submit" />
  108.             </p>
  109.             <input type="hidden" value="default" name="origin" />
  110.         </form>
  111.     </div>
  112. </div>
  113.  
  114. </div>
  115.  
  116.  
  117. <div class="right-column">
  118.  
  119. <div class="cbb clearfix">
  120.     <h2 class="title"><?php echo $locale['forgot_false_alarm']; ?></h2>
  121.     <div class="box-content">
  122.         <p><?php echo $locale['forgot_false_alarm_content']; ?></p>
  123.         <p><a href="index.php"><?php echo $locale['forgot_back']; ?> &raquo;</a></p>
  124.     </div>
  125. </div>
  126.  
  127. </div>
  128.  
  129. <?php
  130.  
  131. } else {
  132.  
  133. include('templates/login/subheader.php');
  134. include('templates/login/header.php');
  135.  
  136. ?>
  137.  
  138. <div id="process-content">
  139.                 <div class="action-error flash-message">
  140.     <div class="rounded">
  141.         Please log out first!
  142.     </div>
  143. </div>
  144.  
  145. <div style="text-align: center">
  146.  
  147.     <div style="width:100px; margin: 10px auto"><a href="index.php" id="logout-ok" class="new-button fill"><b>Back</b><i></i></a></div>
  148.  
  149. <div id="column1" class="column">
  150. </div>
  151. <div id="column2" class="column">
  152. </div>
  153.  
  154. </div>
  155.  
  156. <?php
  157.  
  158. }
  159.  
  160. include('templates/login/footer.php');
  161.  
  162. ?>
Add Comment
Please, Sign In to add comment