kompass/modules/Gruppen/Actions/CreateGroupMemberAction.php
2024-03-23 20:46:44 +01:00

21 lines
572 B
PHP

<?php
use Bdp\Modules\Gruppen\Controllers\MainController;
class CreateGroupMemberAction
{
public static function execute(array $userData) : int
{
global $dbHandler;
if (!current_user_can('create_teilis')) {
kompass_print_message_box(__('You are not allowed to add a member', BDP_LV_PLUGIN_SLUG), 'error');
}
global $dbHandler;
$userData['gruppe_id'] = 1;
kompass_print_message_box(__('The member was added.', BDP_LV_PLUGIN_SLUG));
return $dbHandler->insertRows(MainController::KOMPASS_STAMMESGRUPPEN_TEILIS, $userData);
}
}