|
Configuration Tool Change Password |
|
|
|
Please complete all fields! |
';
$test123 = 'true';}
if($_POST['formPassNew'] != "" and strlen($_POST['formPassNew']) < 6) {
echo "Your password is too short. |
";
$check = "true";}
if ($_POST['formPassNew'] != "" and preg_match("/^[0-9]+$/", $_POST['formPassNew'])) {
echo "Your password contains numbers only. |
";
$check = "true"; }
if ($_POST['formPassNew'] != "" and preg_match("/^[a-zA-Z]+$/", $_POST['formPassNew'])) {
echo "Your password contents letters only. |
";
$check = "true";}
if ($_POST['formPassNew'] != "" and preg_match('/[^a-zA-Z0-9-_.]/', $_POST['formPassNew'])) {
echo "Your password contains special characters! Only − _ and . can be used. |
";
$check = "true";}
$testnew1 = md5($_POST['formPassNew']);
$testnew2 = md5($_POST['formPassNew2']);
if($testnew1 != $testnew2)
{ echo 'Please repeat your new password correctly! Please notice that small letters and capital letters will be considered as separate characters. |
';
$test123 = 'true'; }
if($check != "true") {
$ID = $_SESSION['log2'];
$test = md5($_POST['formPassOld']);
$sql = "SELECT * FROM user WHERE BINARY ID_User = '$ID' AND Password = '$test'";
$result = mysqli_query($GLOBALS["___mysqli_ston"], $sql);
if(!mysqli_num_rows($result))
{
echo 'Please check your current password! Please notice that small letters and capital letters will be considered as separate characters. |
';
$check = 'true';}
if(mysqli_num_rows($result)) {
while($row = mysqli_fetch_object($result))
{ $Mail = $row->Email;
$Signature = $row->Signature;}
$sql1 = "UPDATE user SET Password = '$testnew1' WHERE ID_User = '$ID'";
$result1 = mysqli_query($GLOBALS["___mysqli_ston"], $sql1);
$mesg = "