Select Git revision
-
Jan-Hendrik Willms authoredJan-Hendrik Willms authored
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();
}
}