Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame^] | 1 | <?php |
2 | require_once(__DIR__."/../core.php"); | ||||
3 | security::checkType(security::ADMIN, security::METHOD_NOTFOUND); | ||||
4 | |||||
5 | if (!security::checkParams("POST", [ | ||||
6 | ["person", security::PARAM_NEMPTY], | ||||
7 | ["company", security::PARAM_NEMPTY] | ||||
8 | ])) { | ||||
9 | api::error(); | ||||
10 | } | ||||
11 | |||||
12 | $person = (int)$_POST["person"]; | ||||
13 | $company = (int)$_POST["company"]; | ||||
14 | |||||
15 | if (people::addToCompany($person, $company)) { | ||||
16 | echo "OK\n"; | ||||
17 | } else { | ||||
18 | api::error(); | ||||
19 | } |