Groups: Token integration.

This commit is contained in:
Nate
2019-09-19 08:04:04 -06:00
parent d054f15300
commit bd438e4f39
2 changed files with 13 additions and 0 deletions

View File

@@ -50,6 +50,14 @@
$group_name = $_POST["group_name"];
$user_uuid = $_POST["user_uuid"];
//validate the token
$token = new token;
if (!$token->validate('/core/groups/groupmembers.php')) {
message::add($text['message-invalid_token'],'negative');
header('Location: groups.php');
exit;
}
//add the user to the group
if (is_uuid($user_uuid) && is_uuid($group_uuid) && strlen($group_name) > 0) {
$array['user_groups'][0]['user_group_uuid'] = uuid();