File indexing completed on 2024-12-29 05:24:48

0001 <?php 
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 $modelMemberToken = new Default_Model_DbTable_MemberToken();
0023 $tokenData = $modelMemberToken->fetchRow('token_member_id = ' . Zend_Auth::getInstance()->getIdentity()->member_id . ' and token_deleted is null and token_provider_name = "github_personal"');
0024 $tokenValue = isset($tokenData->token_value) ? $tokenData->token_value : null;
0025 ?>
0026 
0027 
0028 <div class="panel-collapse " id="github-collapse">
0029     <div class="panel-body">
0030         <form class="standard-form partial well" action="<?= $this->github->getAction(); ?>"
0031               method="<?= $this->github->getMethod(); ?>" data-target="#form-github"
0032               data-trigger="#github-trigger">
0033             <div class="row">
0034                 <div class="col-md-4 col-lg-4 col-sm-4 col-xs-4">
0035                   <?= $this->github->link_github
0036                       ->setAttrib('tabindex', 11)
0037                       ->setAttrib('class', 'form-control')
0038                       ->setAttrib('pattern', '^\w+-?\w+(?!-)$')
0039                   ?>
0040                   <p class="help-block small">Insert your Github username here.</p>
0041                 </div>
0042             </div>
0043           <div class="row">
0044             <div class="col-md-4 col-lg-4 col-sm-4 col-xs-4">
0045                 <?= $this->github->token_github
0046                     ->setAttrib('tabindex', 11)
0047                     ->setAttrib('class', 'form-control')
0048                     ->setAttrib('pattern', '^[\w\-\.\/\+~]+$')
0049                     ->setValue($tokenValue)
0050                 ?>
0051               <p class="help-block small">Insert your personal access token from Github here.</p>
0052             </div>
0053           </div>
0054           <!-- /.row-fluid -->
0055             <hr>
0056             <div class="row">
0057                 <div class="box pull-left margin-left-15" style="padding-left: 15px;">
0058                     <?php echo $this->formResult($this->github, $this->save, null, 'Changes saved.'); ?>
0059                 </div>
0060                 <button type="submit" class="btn btn-submit btn-native pull-right"
0061                         tabindex="12"><?= $this->translate('Save &amp; Update') ?>
0062                 </button>
0063             </div>
0064         </form>
0065     </div>
0066 </div>