$value) { if (empty($value) && in_array($key, $required_fields) === true) { $errors[] = 'You need to fill in all fields.'; break 1; } } $pass_data = user_data($session_user_id, 'password'); //$pass_data['password']; // $_POST[''] // .3 compatibility if ($config['TFSVersion'] == 'TFS_03' && $config['salt'] === true) { $salt = user_data($session_user_id, 'salt'); } if (sha1($_POST['current_password']) === $pass_data['password'] || $config['TFSVersion'] == 'TFS_03' && $config['salt'] === true && sha1($salt['salt'].$_POST['current_password']) === $pass_data['password']) { if (trim($_POST['new_password']) !== trim($_POST['new_password_again'])) { $errors[] = 'Your new passwords do not match.'; } else if (strlen($_POST['new_password']) < 6) { $errors[] = 'Your new passwords must be at least 6 characters.'; } else if (strlen($_POST['new_password']) > 100) { $errors[] = 'Your new passwords must be less than 100 characters.'; } } else { $errors[] = 'Your current password is incorrect.'; } } include 'layout/overall/header.php'; ?>

Change Password:

You will need to login again with the new password.'; session_destroy(); header("refresh:2;url=index.php"); exit(); } else { if (empty($_POST) === false && empty($errors) === true) { //Posted the form without errors if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') { user_change_password($session_user_id, $_POST['new_password']); } else if ($config['TFSVersion'] == 'TFS_03') { user_change_password03($session_user_id, $_POST['new_password']); } header('Location: changepassword.php?success'); } else if (empty($errors) === false){ echo ''; echo output_errors($errors); echo ''; } ?>