Exemple #1
0
 protected function getPage(array $data)
 {
     $data['alerts'] = System::alerts();
     $data['jumbotron'] = view('install.jumbotron', ['title' => 'Database connection', 'description' => 'Setup your default database connection.', 'logo' => asset('opis-colibri/system', 'opis-colibri.png'), 'button' => ['link' => getURL('/install/account'), 'text' => 'Skip this step']]);
     $data['supported'] = class_exists('\\PDO');
     return ['title' => 'Database', 'content' => view('install.page.database', $data)];
 }
 /**
  * @param Router $router
  * @param Context $context
  * @param Route $route
  * @return Html
  */
 public function dispatch(Router $router, Context $context, Route $route)
 {
     $content = $this->getContent($router, $context, $route);
     if ($content instanceof HttpError || $content instanceof Html) {
         return $content;
     }
     $html = Helper::html();
     $callback = $route->get('callback');
     if (is_callable($callback)) {
         $content = $callback($html, $content);
     }
     return $html->body($content);
 }
Exemple #3
0
 public function post()
 {
     $validator = validator();
     $validator->csrf()->validate('csrf', request()->post('csrf_token'));
     if ($validator->hasErrors()) {
         System::alerts()->fromValidator($validator);
         redirect(getURL('/module-manager'));
     }
     if (request()->post('action') === 'logout') {
         session()->destroy();
         System::alerts()->success(t('You have been logged out'));
         redirect(getURL('/module-manager/login'));
     }
     if (app()->getCollector()->recollect()) {
         System::alerts()->success(t('All items have been collected'));
     } else {
         System::alerts()->success(t('Collecting items has failed'));
     }
     redirect(getURL('/module-manager'));
 }
Exemple #4
0
 public function post()
 {
     $modules = request()->post('module', []);
     if (!is_array($modules)) {
         redirect(getURL('/module-manager'));
     }
     foreach ($modules as $module => $action) {
         if (!in_array($action, array('enable', 'disable', 'install', 'uninstall'))) {
             continue;
         }
         $module = getModule($module);
         if (!$module->exists()) {
             continue;
         }
         if ($module->{$action}()) {
             $text = r('Module <stron>@module</strong> was @action', ['module' => $module->name(), 'action' => t($action . 'd')]);
             System::alerts()->success($text);
         } else {
             $text = r('Module <stron>@module</strong> could not be @action', array('module' => $module->name(), 'action' => t($action . 'd')));
             System::alerts()->error($text);
         }
     }
     redirect(getURL('/module-manager'));
 }
Exemple #5
0
 protected function getContent(array $values)
 {
     return view('manager.login', ['alerts' => System::alerts(), 'username' => $values['username'] ?? null, 'password' => $values['password'] ?? null]);
 }
Exemple #6
0
 protected function getContent(array $values = [])
 {
     $values += ['olduser' => null, 'oldpass' => null, 'username' => null, 'password' => null, 'check' => null];
     return view('manager.setup', ['alerts' => System::alerts(), 'olduser' => $values['olduser'], 'oldpass' => $values['oldpass'], 'username' => $values['username'], 'password' => $values['password'], 'check' => $values['check']]);
 }
Exemple #7
0
 protected function getPage(array $data)
 {
     $data['alerts'] = System::alerts();
     $data['jumbotron'] = view('install.jumbotron', ['title' => 'Account setup', 'description' => 'Setup your administrator account.', 'logo' => asset('opis-colibri/system', 'opis-colibri.png'), 'button' => ['link' => getURL('/install/finish'), 'text' => 'Skip this step']]);
     return ['title' => 'Account', 'content' => view('install.page.account', $data)];
 }
Exemple #8
0
 /**
  * @param array $values
  * @return \Opis\Colibri\View
  */
 protected function getContent(array $values = array())
 {
     $values += ['username' => null, 'password' => null, 'check' => null];
     return view('manager.create', ['alerts' => System::alerts(), 'username' => $values['username'], 'password' => $values['password'], 'check' => $values['check']]);
 }