Skip to content
Snippets Groups Projects
Select Git revision
  • cb8947e7f88ea07a15689bcfd7c4f400bb4ed004
  • main default protected
  • step-01354-5.5
  • biest-504
  • issue-3215
  • step-03209-bald-rapunzel
  • tic-3123
  • tic-2720-remove-less-compilation-in-plugins
  • step-1800
  • tic-2532
  • biest-561
  • tic-3225
  • 5.3
  • 5.4
  • step-2472
  • step-2660
  • step-1559
  • tic-3094
  • biest-3206
  • biest-3207
  • 5.0
  • v5.3.1
  • v5.2.3
  • v5.1.4
  • v5.0.6
  • v5.3
  • v5.2.2
  • v5.1.3
  • v5.0.5
  • v5.2.1
  • v5.1.2
  • v5.0.4
  • v5.2
  • v5.1.1
  • v5.0.3
  • v5.1
  • v5.0.2
  • v5.0.1
  • v5.0
39 results

ForumEntry.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());
        }
    
    }