blob: 179b0e8dcc665135f0a848cd6e87d55379723587 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::WORKER);
4security::checkWorkerUIEnabled();
5
6if (!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
16if (people::workerViewChangePassword($oldpassword, $newpassword)) {
17 header("Location: workerhome.php?msg=passwordchanged");
18} else {
19 header("Location: changepassword.php?msg=wrong");
20}