daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Dec 29th, 2016 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <title>Schimba-ti adresa de email - <?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.'\'/>'; } else {
  6. ?>
  7.  
  8. </div>
  9.     <div class="main-content">
  10.             <div class="breadcrumbs" id="breadcrumbs">
  11.                 <script type="text/javascript">
  12.                     try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
  13.                 </script>
  14.  
  15.                 <ul class="breadcrumb">
  16.                     <li>
  17.                         <i class="ace-icon fa fa-home home-icon"></i>
  18.                         <a href="<?php echo Config::$_PAGE_URL; ?>">Home</a>
  19.                     </li>
  20.                     <li class="active">Schimba-ti adresa de email</li>
  21.                 </ul><!-- /.breadcrumb -->
  22.  
  23.                 <div class="nav-search" id="nav-search">
  24.                     <form method="POST" action="<?php echo Config::$_PAGE_URL; ?>search">
  25.                         <span class="input-icon">
  26.                             <input type="text" placeholder="Search ..." name="sname" id="username" type="submit" class="nav-search-input" autocomplete="on">
  27.                             <i class="ace-icon fa fa-search nav-search-icon"></i>
  28.                         </span>
  29.                     </form>
  30.                 </div> <!-- /.nav-search -->
  31.             </div> 
  32. <div class="page-content">
  33. <div class="row-fluid">
  34. <div class="span12">
  35. <?php
  36. if(isset($_POST['submit'])) {
  37.     if(!$_POST['email'] || !$_POST['password']) {
  38.         echo '<div class="alert alert-block alert-danger">Invalid email / Email invalid.</div>';
  39.     } else {
  40.         $q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `name` = ? AND `password` = ?');
  41.         $q->execute(array(Config::getData('users','name',$_SESSION['user']),$_POST['password']));
  42.         while($row = $q->fetch(PDO::FETCH_OBJ))
  43.         if($q->rowCount()) {
  44.             $d = Config::$g_con->prepare('SELECT * FROM `changemail` WHERE `name` = ?');
  45.             $d->execute(array(Config::getData('users','name',$_SESSION['user'])));
  46.             if($d->rowCount()) {
  47.                 echo '<div class="alert alert-block alert-danger">Ai mai f&#259;cut deja o cerere de schimbare a emailului.</div>';
  48.             }
  49.             else {
  50.                 if($row->Email == "email@yahoo.com") {                 
  51.                     $email = htmlspecialchars($_POST['email']);
  52.                 } else {
  53.                     $email = $row->Email;
  54.                 }
  55.                 $user = $row->name;
  56.  
  57.                 $first = md5(uniqid());
  58.                 $final_key = $first . md5($first);
  59.                
  60.                 $s = Config::$g_con->prepare("INSERT INTO changemail (ChangeMailKey, name, Email) VALUES (?, ?, ?)");
  61.                 $s->execute(array($final_key, $user, $_POST['email']));
  62.  
  63. require 'inc/PHPMailerAutoload.php';
  64. $mail = new PHPMailer;
  65. $mail->isSMTP();
  66. $mail->Host = 'localhost';
  67. $mail->SMTPAuth = false;
  68. $mail->Username = '';
  69. $mail->Password = '';
  70. $mail->SMTPSecure = 'tls';
  71. $mail->Port = 25;
  72. $mail->setFrom('no-reply@xgaming.ro', 'xGaming.ro');
  73. $mail->addAddress($email);
  74. $mail->Subject = 'xGaming.ro - confirmare email / validate your email';
  75. $mail->Body    = "Salutare $user,
  76. [RO] Ai primit acest email pentru ca ai solicitat confirmarea emailului pe serverul pe serverul rpg.xGaming.ro
  77. Pentru a avea emailul ". $_POST['email'] ." asociat cu contul tau, da click pe link-ul de mai jos:
  78. ".Config::$_PAGE_URL."checkmail/".$final_key."
  79.  
  80.  
  81. [EN] You have received this email because you have requested to confirm your email on the server rpg.xGaming.ro
  82. To have the email ". $_POST['email'] ." associated with your account, please click the link above.
  83.  
  84.  
  85. Cu stima,
  86. Echipa xGaming.ro
  87. Contact: stilgaming@yahoo.com";
  88. if(!$mail->send()) {
  89.     echo 'Email could not be sent.';
  90. } else {
  91.     $err = "<br />Un email a fost trimis catre ". $email ." pentru confirmarea emailului.<br />
  92.     In acel email vei gasi un link pe care va trebui sa dai click pentru a confirma schimbarea adresei de email asociata cu contul tau.<br /><br />
  93.     Emailul va ajunge la tine in cateva minute in casuta ta de email.<br />
  94.     Daca nu ai primit emailul, verifica si folderul de spam sau foloseste optiunea de search din yahoo/gmail pentru a cauta xGaming.ro.";
  95. }
  96.             }
  97.            
  98.         }
  99.         else echo '<div class="alert alert-block alert-danger"><button type="button" class="close" data-dismiss="alert">Invalid email / Email invalid.</div>';
  100.     }
  101. } ?>
  102.  
  103. <div class="page-header">
  104. <h1>Schimba-ti adresa de email</h1>
  105. </div>
  106. <p>
  107. <b>Atentie!</b><br>E interzis sa vinzi contul sau sa-l dai la schimb.<br>O data ce ai schimbat emailul, nu vei mai putea recupera contul daca nu ai acces la noul email.<br>Nu seta emailul altcuiva daca nu vrei sa ramai fara cont.
  108. <hr>
  109. </p>
  110. <?php if(isset($err)): ?>
  111. <?php echo $err ?>
  112. <?php else: ?>
  113. <form method="POST" action="" accept-charset="UTF-8">
  114. New email:<br />
  115. <input placeholder="Scrie noua adresa de email aici..." name="email" type="email"><br />
  116. SA:MP Password:<br />
  117. <input name="password" type="password"><br/><br />
  118. <input class="btn btn-inverse" type="submit" name="submit" value="Modifica!">
  119. </form>
  120.  <?php endif;
  121. } ?>
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