Skip to content
Snippets Groups Projects
Select Git revision
  • 60e93bc477a94a1fc4d997844ae1e39c884ba270
  • main default protected
  • studip-rector
  • ci-opt
  • course-members-export-as-word
  • data-vue-app
  • pipeline-improvements
  • webpack-optimizations
  • rector
  • icon-renewal
  • http-client-and-factories
  • jsonapi-atomic-operations
  • vueify-messages
  • tic-2341
  • 135-translatable-study-areas
  • extensible-sorm-action-parameters
  • sorm-configuration-trait
  • jsonapi-mvv-routes
  • docblocks-for-magic-methods
19 results

MyRealmModel.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    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();
        }
    }