T4125Gamer

pw_reset.php

Aug 8th, 2014
275
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2. if(isset($_GET['mail']) && isset($_GET["username"])){
  3.     $code = $_GET['mail'];
  4.     $username = $_GET['username'];
  5.     $from = "From: ";
  6.     $from .= "info@domain.de";
  7.     $from .= " <";
  8.     $from .= "info@domain.de";
  9.     $from .= ">\n";
  10.     $from .= "Reply-To: ";
  11.     $from .= "noreply@domain.de";
  12.     $from .="\n";
  13.     $from .= "Content-Type: text/html charset=\"utf-8\"\n";
  14.     $message = 'Dies ist eine Automatisch generierte E-Mail. Bitte nicht auf diese E-Mail antworten.<br>
  15.     Best&auml;tige nun durch den Link deine Identit&auml;t. Ist die Best&auml;tigung abgeschlossen, bekommst du eine neue E-Mail mit deinem Passwort<br>
  16.     Dein Passwort kannst du Ingame, oder im UCP, wieder &auml;ndern.<br>
  17.     Das Team w&uuml;nscht dir weiterhin viel Spa&szlig; auf dem Server<br><br>Best&auml;tigungslink: <a href="http://ni130511_1.vweb19.nitrado.net/samp/pw_reset.php?status=resetcomplete&username_n='.$username.'&mail='.$code.'">http://ni130511_1.vweb19.nitrado.net/samp/pw_reset.php?status=resetcomplete&username_n='.$username.'&mail='.$code.'</a>';
  18.     mail($code, "Passwort Vergessen E-Mail", $message,$from);
  19.     echo "E-Mail gesendet";
  20. }
  21. if(isset($_GET['status']) && isset($_GET['username_n']) && isset($_GET['mail'])){
  22.     $from = "From: ";
  23.     $from .= "info@domain.de";
  24.     $from .= " <";
  25.     $from .= "info@domain.de";
  26.     $from .= ">\n";
  27.     $from .= "Reply-To: ";
  28.     $from .= "noreply@domain.dee";
  29.     $from .="\n";
  30.     $from .= "Content-Type: text/html charset=\"utf-8\"\n";
  31.     $randoma = "1234567890abcdefghijklmnopqrstuvwxyz";
  32.     function GetRandomString($length)
  33.     {
  34.         global $randoma;
  35.         settype($length, "integer");
  36.         settype($rndstring, "string");
  37.         settype($a, "integer");
  38.         settype($b, "integer");
  39.        
  40.         for ($a = 0; $a <= $length; $a++)
  41.         {
  42.             $b = rand(0, strlen($randoma) - 1);
  43.             $rndstring .= $randoma[$b];
  44.         }          
  45.         return $rndstring;
  46.                        
  47.     }
  48.     $keycode = GetRandomString(10);
  49.     $username = $_GET['username_n'];
  50.     $keycodeh = strtoupper(md5($keycode));
  51.     $code = $_GET['mail'];
  52.     $verbindung = mysql_connect("Host","User","Passwort");
  53.     mysql_select_db("Datenbank");
  54.     $query = mysql_query("UPDATE `accounts` SET `Passwort`='$keycodeh' WHERE `Name`='$username'");
  55.     if($query){
  56.         $message = 'Dein neues Passwort: <b>'.$keycode.'</b>';
  57.         mail($code, "Passwort Vergessen E-Mail", $message,$from);
  58.         echo "E-Mail gesendet";
  59.     }
  60.     else mysql_error();
  61.     mysql_close($verbindung);
  62. }
  63. ?>
RAW Paste Data