daily pastebin goal
94%
SHARE
TWEET

Untitled

a guest Dec 29th, 2016 184 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <title>Recover password / Recuperare parola - <?php echo Config::$_SITE_NAME; ?></title>
  2. <?php
  3. if(!defined('panel'))
  4.     die('Nope.');
  5. if(isset($_SESSION['user'])) echo '<meta http-equiv="refresh" content="0;URL=\''.Config::$_PAGE_URL.'\'/>';
  6. ?>
  7. </div>
  8.     <div class="main-content">
  9.             <div class="breadcrumbs" id="breadcrumbs">
  10.                 <script type="text/javascript">
  11.                     try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
  12.                 </script>
  13.  
  14.                 <ul class="breadcrumb">
  15.                     <li>
  16.                         <i class="ace-icon fa fa-home home-icon"></i>
  17.                         <a href="<?php echo Config::$_PAGE_URL; ?>">Home</a>
  18.                     </li>
  19.                     <li class="active">Password recovery</li>
  20.                 </ul><!-- /.breadcrumb -->
  21.  
  22.                 <div class="nav-search" id="nav-search">
  23.                     <form method="POST" action="<?php echo Config::$_PAGE_URL; ?>search">
  24.                         <span class="input-icon">
  25.                             <input type="text" placeholder="Search ..." name="sname" id="username" type="submit" class="nav-search-input" autocomplete="on">
  26.                             <i class="ace-icon fa fa-search nav-search-icon"></i>
  27.                         </span>
  28.                     </form>
  29.                 </div> <!-- /.nav-search -->
  30.             </div> 
  31. <div class="page-content">
  32. <?php
  33.         $ipaddress = getenv("REMOTE_ADDR") ;
  34.         $now = date("Y-m-d H:i:s");
  35.  
  36. if(isset($_POST['submit'])) {
  37.     if(!$_POST['recover']) {
  38.         echo '<div class="alert alert-block alert-danger">Complete the field.</div>';
  39.     } else {
  40.         $q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `name` = ?');
  41.         $q->execute(array($_POST['recover']));
  42.         while($row = $q->fetch(PDO::FETCH_OBJ))
  43.         if($q->rowCount()) {
  44.             $d = Config::$g_con->prepare('SELECT * FROM `recover` WHERE `name` = ?');
  45.             $d->execute(array($_POST['recover']));
  46.             if($d->rowCount()) {
  47.                 echo '<div class="alert alert-block alert-danger">Ai mai f&#259;cut deja o cerere de recuperare a parolei.</div>';
  48.             }
  49.             elseif($row->Email == "") {
  50.                 echo '<div class="alert alert-block alert-danger">Acest cont nu are o adres&#259; de Email.</div>';
  51.             }
  52.             else {
  53.                
  54.                 $email = $row->Email;
  55.                 $user = $row->name;
  56.  
  57.                 $first = md5(uniqid());
  58.                 $final_key = $first . md5($first);
  59.                
  60.                 $s = Config::$g_con->prepare("INSERT INTO recover (RecoverKey, name, email) VALUES (?, ?, ?)");
  61.                 $s->execute(array($final_key, $user, $email));
  62.  
  63. require 'inc/PHPMailerAutoload.php';
  64. $mail = new PHPMailer;
  65. $mail->isSMTP();
  66. $mail->Host = 'ssl://smtp.gmail.com';
  67. $mail->SMTPAuth = true;
  68. $mail->Username = 'shendjze@gmail.com';
  69. $mail->Password = 'Ionut690Curiman';
  70. $mail->SMTPSecure = 'ssl';
  71. $mail->Port = 465;
  72. $mail->From = 'shendjze@gmail.com';
  73. $mail->FromName = 'ReborN RPG';
  74. $mail->addAddress($email);
  75. $mail->Subject = 'ReborN RPG - PASSWORD';
  76. $mail->Body    = "$user,
  77. [RO] Ai primit acest email pentru ca ai solicitat resetarea parolei pe serverul ReborN RPG
  78. Daca nu doresti sa iti schimbi parola, poti ignora/sterge acest email.
  79. Pentru a-ti schimba parola, da click pe link-ul de mai jos:
  80. ".Config::$_PAGE_URL."change/".$final_key."
  81.  
  82.  
  83. [EN] You have recived this email because you have requested a reset of your password on ReborN RPG
  84. If you don't want to change your password, please ignore this email.
  85. To change your password, please click the link above this message.
  86.  
  87. Cu stima si respect,
  88. Echipa ReborN KillerZ Brigades.";
  89. if(!$mail->send()) {
  90.     echo "Mailer Error: " . $mail->ErrorInfo;
  91. } else {
  92. $email1 = explode('@', $email);            
  93. $first_part = $email1[0];                  
  94. $domain = $email1[1];
  95. $newemail = substr($first_part, 0, 4) . "****@" . substr($domain, 0, 10);
  96. echo "<div class='alert alert-block alert-success'><center>Code sent!<br />The verification code was sent to ". $newemail ."!<br />Please check your email. Also check the Spam folder!</center></div>";
  97. }
  98.                    
  99.                    
  100.             }
  101.            
  102.         }
  103.         else echo '<div class="alert alert-block alert-danger">Nume incorect.</div>';
  104.     }
  105. }
  106.  
  107.  
  108. ?>
  109.  
  110. <div class="row-fluid">
  111. <div class="span12">
  112. <center>
  113. <form method="POST" action="" accept-charset="UTF-8">
  114. <label>Username:</label><br />
  115. <input type="text" name="recover"><br />
  116. <br>
  117. <input class="btn btn-inverse" name="submit" type="submit" value="Recover password">
  118. </form>
  119. </center>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top