Exemplo n.º 1
0
 /**
  * Load all available themes in the system.
  * 
  * @param sfWebRequest $request
  * @return <type>
  */
 public function executeLoadAllTheme(sfWebRequest $request) {
     $tm = new ThemeManagement();
     $defaultTheme = UserConfigurationTable::instance()->getUserConfiguration()->toArray();
     $tm->setContext($this->getContext());
     $data = $tm->getThemes();
     $data = $tm->checkDefault($data, $defaultTheme[0]['theme']);
     $this->renderText('({"result":'.json_encode($data).'})');
     return sfView::NONE;
 }
Exemplo n.º 2
0
    /**
    * Show the login page
    *
    * @param sfRequest $request A request object
    */
    public function executeIndex(sfWebRequest $request) {
        $this->getUser()->setAuthenticated(false);
        sfLoader::loadHelpers('Url');
        $this->getUser()->setCulture(Language::loadDefaultLanguage());
        $tm = new ThemeManagement();
        $systemTheme = UserConfigurationTable::instance()->getUserConfiguration()->toArray();
        $this->theTheme = $systemTheme[0]['theme'];

        /*
         * -1 is set when user uses login form to login
         * int is set, when user logges in from en email link, then a workflow needs to opened
         */
        $this->version_id = $request->getParameter('versionid',-1);
        $this->workflow_id = $request->getParameter('workflow',-1);
        $this->window  = $request->getParameter('window',-1);
        return sfView::SUCCESS;
    }
Exemplo n.º 3
0
    /**
     *
     * Saves SystemSettings to additional Tables in database
     * @param sfWebRequest $request
     * @return <type>
     */
    public function executeSaveSystem(sfWebRequest $request) {
        $sysObj = new SystemSetting();
        $data = $request->getPostParameters();

        
        // save auth settings
        if (isset($data['authentication_type'])) {
            if($data['authentication_type'] == 'DBONLY') {
                AuthenticationConfigurationTable::instance()->updateAuthenticationConfigurationCuteflowDatabase($data);
            }
            elseif ($data['authentication_type'] == 'DATABASE_LDAP') {
                AuthenticationConfigurationTable::instance()->updateAuthenticationConfigurationCuteflowDatabaseAndLDAP($data);
            }
            else {
                AuthenticationConfigurationTable::instance()->updateAuthenticationConfigurationCuteflowDatabaseAndOpenId($data);
            }
        }

        // save systemsetting
        if (isset($data['systemsetting_language'])) {
            $data = $sysObj->buildSystemSetting($data);
            SystemConfigurationTable::instance()->updateSystemConfiguration($data);
        }

        // store Email tab
        if (isset($data['emailtab_emailtype'])) {
            $data = $sysObj->buildEmailSetting($data);
            EmailConfigurationTable::instance()->updateEmailConfiguration($data);
        }

        // store user tab
        if (isset($data['userTab_defaultdurationtype'])) {
            $data = $sysObj->buildUserSetting($data);
            UserConfigurationTable::instance()->updateUserConfiguration($data);
        }
        // save authorization
        if(isset($data['authorizationTab_hiddenpanel'])) {
            AuthorizationConfigurationTable::instance()->setAuthorizationConfigurationToNull();
            $items = $data['authorizationTab'];
            foreach ($items as $item => $key) {
                $item_data = array();
                $item_data = explode('__', $item);
                AuthorizationConfigurationTable::instance()->updateAuthorizationConfigurationById($item_data[0],$item_data[1]);
            }
        }
        // save theme
        if(isset($data['guitab_theme'])) {
            UserConfigurationTable::instance()->updateTheme($data['guitab_theme']);
        }

        // store useragent settings tab
        if(isset($data['useragent_useragentsettings']) OR isset($data['useragent_useragentcreation'])) {
            $data = $sysObj->prepareUserAgentData($data);
            SystemConfigurationTable::instance()->updateUserAgent($data);
        }
        else {
            $data['useragent_useragentsettings'] = 0;
            $data['useragent_useragentcreation'] = 0;
            $data['writeDays'] = 0;
        }
        SystemConfigurationTable::instance()->updateUserAgent($data);

        // save worklfow config 
        WorkflowConfigurationTable::instance()->deleteSettings();
        $worklfow = $data['worklfow'];
        $position = 1;
        foreach($worklfow as $item => $key) {
            $workflow = new WorkflowConfiguration();
            $workflow->setColumntext($item);
            $workflow->setIsactive($key);
            $workflow->setPosition($position++);
            $workflow->save();
        }

        $this->renderText('{success:true}');
        return sfView::NONE;
    }
Exemplo n.º 4
0
 /**
  * Load default system settings for creating new user.
  * 
  * @param sfWebRequest $request
  * @return <type>
  */
 public function executeLoadDefaultData(sfWebRequest $request) {
     $result = UserConfigurationTable::instance()->getUserConfiguration()->toArray();
     $this->renderText('{"result":'.json_encode($result[0]).'}');
     return sfView::NONE;
 }