. */ $config = parse_ini_file('../../private/config.ini'); try { $dbh = new PDO('mysql:host=' . $config['dbservername'] . ';dbname=' . $config['dbname'], $config['dbusername'], $config['dbpassword'], array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); } catch (PDOException $e) { //echo 'Connection failled: '. $e->getMessage(); // Errormessage kann Sicherheitsrelevantes enthalen echo 'Connection failed'; } session_start(); if ($_SESSION['log'] == 1 and $_SESSION['admin'] == 1) { if (strpos($_POST['newmailpw'] , "'") !== false) { header("Location: ../admin.php?wrongsymbols=1"); exit; } if ($_POST['newmailpw'] == $_POST['newmailpwrep']) { if (strlen($_POST['newmailpw'] ) >= 8) { $newmailpwhashed = password_hash($_POST['newmailpw'] , PASSWORD_ARGON2I, ['memory_cost' => 32768, 'time_cost' => 4]); $eintrag = "UPDATE `accounts` SET `password` = :newmailpwhashed WHERE `id` LIKE :id"; $sth = $dbh->prepare($eintrag); $sth->execute(array(':newmailpwhashed' => $newmailpwhashed, ':id' => $_POST['changemailid'])); header("Location: ../settings.php?success=1"); exit; } else { header("Location: ../admin.php?pwtoshort=1"); exit; } } else { header("Location: ../admin.php?pwnotequal=1"); exit; } } header("Location: index.php"); ?>