Example #1
0
 public function get_index(\Fuse_App $app)
 {
     if ($this->di['auth']->isAdminLoggedIn()) {
         return $app->render('mod_index_dashboard');
     } else {
         return $app->redirect('/staff/login');
     }
 }
Example #2
0
 /**
  * Save theme settings
  *
  * @param string $code - client area theme code
  * @return array
  */
 public function save_theme_settings(\Fuse_App $app, $theme)
 {
     $this->di['events_manager']->fire(array('event' => 'onBeforeThemeSettingsSave', 'params' => $_POST));
     $api = $this->di['api_admin'];
     $mod = $this->di['mod']('theme');
     $service = $mod->getService();
     $t = $service->getTheme($theme);
     $isNewPreset = isset($_POST['save-current-setting']) ? (bool) $_POST['save-current-setting'] : false;
     $preset = $service->getCurrentThemePreset($t);
     if ($isNewPreset && isset($_POST['save-current-setting-preset']) && !empty($_POST['save-current-setting-preset'])) {
         $preset = $_POST['save-current-setting-preset'];
         $preset = str_replace(" ", "", $preset);
         $service->setCurrentThemePreset($t, $preset);
     }
     unset($_POST['save-current-setting-preset']);
     unset($_POST['save-current-setting']);
     $error = null;
     try {
         if (!$t->isAssetsPathWritable()) {
             throw new \Fuse_Exception('Theme ":name" assets folder is not writable. Files can not be uploaded and settings can not be saved. Set folder permissions to 777', array(':name' => $t->getName()));
         }
         $service->updateSettings($t, $preset, $_POST);
         $service->uploadAssets($t, $_FILES);
         $service->regenerateThemeCssAndJsFiles($t, $preset, $api);
     } catch (\Exception $e) {
         error_log($e);
         $error = $e->getMessage();
     }
     //optional data file
     try {
         $service->regenerateThemeSettingsDataFile($t);
     } catch (\Exception $e) {
         error_log($e);
         $error = $e->getMessage();
     }
     $red_url = '/theme/' . $theme;
     if ($error) {
         $red_url .= '?error=' . $error;
     }
     $app->redirect($red_url);
 }
Example #3
0
 public function get_index(\Fuse_App $app)
 {
     $this->di['is_admin_logged'];
     $app->redirect('/extension/settings/servicesolusvm');
 }
Example #4
0
 public function get_reset_password_confirm(\Fuse_App $app, $hash)
 {
     $api = $this->di['api_guest'];
     $data = array('hash' => $hash);
     $api->client_confirm_reset($data);
     $app->redirect('/login');
 }