aswi2021mr-proper-gitlab/application/controller/UpdateUserRoleController.php @ 082263b5
1 |
<?php
|
---|---|
2 |
require "../model/DB.php"; |
3 |
|
4 |
if ($_SESSION['role'] == "ADMIN") { |
5 |
$DB = new DB(); |
6 |
|
7 |
$results = $DB->updateUserRole($_POST["userId"], $_POST["role"]); |
8 |
|
9 |
echo json_encode(count($results) == 0 ? null : $results); |
10 |
}
|