function __construct()
 {
     parent::__construct();
     Loader::helper('Url');
     View::registerFunction('baseUrl', 'baseUrl');
     $this->account = Request::getParameter('account');
     $this->project = Request::getParameter('project');
 }
 public function checkAccess()
 {
     Loader::helper('Repo');
     $command = Input::request('command');
     $keyId = Input::request('key_id');
     $repo = fetchRepoIdentifier(Input::request('repo'));
     $result = false;
     if ($command == 'git-upload-pack') {
         $result = $this->_pullCommandAccessCheck($repo, $keyId);
     } else {
         $result = $this->_pushCommandAccessCheck($repo, $keyId);
     }
     Response::json(['code' => 0, 'data' => $result]);
 }
 function __construct()
 {
     parent::__construct();
     Loader::helper('Url');
     View::registerFunction('baseUrl', 'baseUrl');
     $this->validation = Loader::library('Validation');
     $this->validation->load('Account');
     if (!$this->validation->run()) {
         $errors = $this->validation->error();
         foreach ($errors as $key => $value) {
             if (!empty($value)) {
                 ErrorManager::throwCustomException(500, $value);
             }
         }
     }
 }
예제 #4
0
function registerFunction()
{
    Loader::helper('Url');
    \Foundation\Support\Facades\View::registerFunction('baseUrl', 'baseUrl');
}