Skip to content
Snippets Groups Projects
Select Git revision
  • 244a6ac9e03eab7a139afb5b72b74d4b1b4e3b6d
  • 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

plugins.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.
    admin.php 1.93 KiB
    <?php
    final class AdminController extends \TracToGitlab\Controller
    {
        public function before_filter(&$action, &$args)
        {
            parent::before_filter($action, $args);
    
            if (User::findCurrent()->perms !== 'root') {
                throw new AccessDeniedException();
            }
    
            Navigation::activateItem('/admin/plugins/trac2gitlab');
            PageLayout::setTitle(_('GitLab-Verbindung konfigurieren'));
        }
    
        public function index_action()
        {
            $this->gitlab_url = Config::get()->TRAC2GITLAB_GITLAB_URL;
            $this->gitlab_token = Config::get()->TRAC2GITLAB_GITLAB_TOKEN;
            $this->gitlab_project_id = Config::get()->TRAC2GITLAB_GITLAB_PROJECT_ID;
            $this->gitlab_container_registry_id = Config::get()->TRAC2GITLAB_GITLAB_CONTAINER_REGISTRY_ID;
            $this->bytist_token = Config::get()->TRAC2GITLAB_BYTIST_TOKEN;
            $this->webhook_secret = Config::get()->TRAC2GITLAB_GITLAB_WEBHOOK_SECRET;
            $this->systemhook_secret = Config::get()->TRAC2GITLAB_GITLAB_SYSTEMHOOK_SECRET;
        }
    
        public function store_action()
        {
            if (!Request::isPost()) {
                throw new MethodNotAllowedException();
            }
    
            Config::get()->store('TRAC2GITLAB_GITLAB_URL', Request::get('gitlab-url'));
            Config::get()->store('TRAC2GITLAB_GITLAB_TOKEN', Request::get('gitlab-token'));
            Config::get()->store('TRAC2GITLAB_GITLAB_PROJECT_ID', Request::int('gitlab-project-id'));
            Config::get()->store('TRAC2GITLAB_GITLAB_CONTAINER_REGISTRY_ID', Request::int('gitlab-container-registry-id'));
            Config::get()->store('TRAC2GITLAB_BYTIST_TOKEN', Request::get('bytist-token'));
            Config::get()->store('TRAC2GITLAB_GITLAB_WEBHOOK_SECRET', Request::get('webhook-secret'));
            Config::get()->store('TRAC2GITLAB_GITLAB_SYSTEMHOOK_SECRET', Request::get('systemhook-secret'));
    
            PageLayout::postSuccess(_('Einstellungen wurden gespeichert'));
            $this->redirect($this->indexURL());
        }
    
    }