Select Git revision
MyRealmModel.php
Forked from
Stud.IP / Stud.IP
Source project has a limited visibility.
-
David Siegfried authored
Merge request studip/studip!1543
David Siegfried authoredMerge request studip/studip!1543
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
users.php 757 B
<?php
final class UsersController extends TracToGitlab\EventController
{
const SECRET_USER_CREATED = 'q<-%Y7Ys>h(@LHgg';
public function created_action()
{
if (!Request::isPost()) {
throw new MethodNotAllowedException();
}
if (
!$this->verifySecret(self::SECRET_USER_CREATED)
|| !$this->verifyEventType('System Hook')
) {
throw new AccessDeniedException();
}
if ($this->getFromPayload('event_name') === 'user_create') {
$this->gitlab->projects()->addMember(
$this->gitlabProjectId,
$this->getFromPayload('user_id'),
10
);
}
$this->render_nothing();
}
}