Example #1
0
 private function delRepo()
 {
     if (!SPFactory::mainframe()->checkToken()) {
         Sobi::Error('Token', SPLang::e('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), SPC::WARNING, 0, __LINE__, __FILE__);
         $this->response(Sobi::Url('extensions.browse'), Sobi::Txt('UNAUTHORIZED_ACCESS_TASK', SPRequest::task()), true, SPC::ERROR_MSG);
     }
     $repository = SPRequest::cmd('repository');
     if ($repository) {
         if (SPFs::rmdir(SPLoader::dirPath('etc.repos.' . $repository))) {
             $this->response(Sobi::Url('extensions.browse'), Sobi::Txt('EX.REPOSITORY_DELETED'), true, SPC::SUCCESS_MSG);
         } else {
             $this->response(Sobi::Url('extensions.browse'), Sobi::Txt('EX.DEL_REPO_ERROR'), true, SPC::ERROR_MSG);
         }
     }
 }