-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditprofile.inc.php
More file actions
27 lines (25 loc) · 912 Bytes
/
editprofile.inc.php
File metadata and controls
27 lines (25 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
$userUid = $_GET['userUid'];
if (isset($_POST["submit"])) {
$oldPassword = $_POST["oldPassword"];
$newPassword = $_POST["newPassword"];
$repeatNewPassword = $_POST["repeatNewPassword"];
require_once 'dbh.inc.php';
require_once 'editProfileFunctions.inc.php';
if (emptySignupInput($oldPassword, $newPassword, $repeatNewPassword) !== false) {
header("location: ../profile.php?error=emptyinput");
exit();
}
if (passwordStrength($newPassword) !== false) {
header("location: ../profile.php?error=weakpassword");
exit();
}
if (passwordMatch($newPassword, $repeatNewPassword) !== false) {
header("location: ../profile.php?error=newpasswordsdontmatch");
exit();
}
editUserProfile($conn, $newPassword, $oldPassword, $userUid);
} else {
header("location: ../profile.php");
exit();
}