????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.191 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/var/www/www.evacuationplans.se/scripts/ |
Upload File : |
<?php
function generatePassword($length=9, $strength=0) {
$vowels = 'aeuy';
$consonants = 'bdghjmnpqrstvz';
if ($strength & 1) {
$consonants .= 'BDGHJLMNPQRSTVWXZ';
}
if ($strength & 2) {
$vowels .= "AEUY";
}
if ($strength & 4) {
$consonants .= '23456789';
}
if ($strength & 8) {
$consonants .= '@#$%';
}
$password = '';
$alt = time() % 2;
for ($i = 0; $i < $length; $i++) {
if ($alt == 1) {
$password .= $consonants[(rand() % strlen($consonants))];
$alt = 0;
} else {
$password .= $vowels[(rand() % strlen($vowels))];
$alt = 1;
}
}
return $password;
}
session_start();
session_regenerate_id();
$username = $_POST['username'];
$username = stripslashes($username);
$username = mysql_real_escape_string($username);
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("notes");
$mailtext = "Hello, we have genereated the following password:<br><br>";
$sql = "select * from tblUsers where username = '".$username."' and application ='Utrym'";
$result = mysql_query($sql);
$posid = 0;
while ($row = mysql_fetch_assoc($result)){
$password = generatePassword(9,8);
$password_md5 = md5($password);
$mailtext .= "Username: ".$row['username']."<br>";
$mailtext .= "Password: ".$password."<br><br>";
$sql = "update tblUsers set password = '".$password_md5."' where userId =".$row['userId'];
mysql_query($sql);
}
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: noreply@astacus.se\r\n";
mail($username, "Evacuation Plans - New Password", $mailtext."Don't forget to change the password after you have logged in.<br><br>Best regards, Evacuation Plans team", $headers);
header("Location: http://www.evacuationplans.se/loggain.php?msg=A new password was sent to your e-mail!");
?>