Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once("core.php"); |
| 3 | security::checkType(security::WORKER); |
| 4 | security::checkWorkerUIEnabled(); |
| 5 | |
| 6 | if (!security::checkParams("POST", [ |
| 7 | ["oldpassword", security::PARAM_NEMPTY], |
| 8 | ["newpassword", security::PARAM_NEMPTY] |
| 9 | ])) { |
| 10 | security::go("users.php?msg=empty"); |
| 11 | } |
| 12 | |
| 13 | $oldpassword = $_POST["oldpassword"]; |
| 14 | $newpassword = $_POST["newpassword"]; |
| 15 | |
| 16 | if (people::workerViewChangePassword($oldpassword, $newpassword)) { |
| 17 | header("Location: workerhome.php?msg=passwordchanged"); |
| 18 | } else { |
| 19 | header("Location: changepassword.php?msg=wrong"); |
| 20 | } |