Ignore:
Timestamp:
04/12/10 16:21:32 (14 years ago)
Author:
pedroerp
Message:

Ticket #993 - Trocando acessos à GLOBALS por acessos à Settings.

Location:
sandbox/workflow/branches/993
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/993/inc/class.TemplateServer.inc.php

    r2372 r2492  
    112112 
    113113                /* tenta carregar o endereço Web do Workflow */ 
    114                 if (isset($_SESSION['workflow']['TemplateServer']['workflowBase'])) 
    115                 { 
    116                         $this->WEB_WORKFLOW_BASE = $_SESSION['workflow']['TemplateServer']['workflowBase']; 
    117                 } 
    118                 else 
    119                 { 
    120                         if (isset($GLOBALS['phpgw_info']['server']) && is_array($GLOBALS['phpgw_info']['server']) && array_key_exists('webserver_url', $GLOBALS['phpgw_info']['server'])) 
    121                         { 
    122                                 $this->WEB_WORKFLOW_BASE = ((string) $GLOBALS['phpgw_info']['server']['webserver_url']) . '/workflow'; 
    123                         } 
    124                         else 
    125                         { 
    126                                 if (isset($_SESSION['phpgw_info']['workflow']['server']) && is_array($_SESSION['phpgw_info']['workflow']['server']) && array_key_exists('webserver_url', $_SESSION['phpgw_info']['workflow']['server'])) 
    127                                 { 
    128                                         $this->WEB_WORKFLOW_BASE = ((string) $_SESSION['phpgw_info']['workflow']['server']['webserver_url']) . '/workflow'; 
    129                                 } 
    130                                 else 
    131                                 { 
    132                                         /* se não for encontrado em nenhuma variável de ambiente, tenta carregar do banco de dados */ 
    133                                         $webServerURL = (string) Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID->GetOne('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'webserver_url')); 
    134                                         $this->WEB_WORKFLOW_BASE = str_replace('//', '/', "{$webServerURL}/workflow"); 
    135                                 } 
    136                         } 
    137                         $_SESSION['workflow']['TemplateServer']['workflowBase'] = $this->WEB_WORKFLOW_BASE; 
    138                 } 
     114                $this->WEB_WORKFLOW_BASE = WF_BASE_URL; 
     115 
    139116                $this->WEB_PATH = $this->WEB_WORKFLOW_BASE . '/templates'; 
    140117        } 
  • sandbox/workflow/branches/993/inc/class.WorkflowLDAP.inc.php

    r2372 r2492  
    5353 
    5454                /* get the required parameters */ 
    55                 $info = (isset($GLOBALS['phpgw_info']['server']['ldap_context'])) ? 
    56                         $GLOBALS['phpgw_info']['server'] : 
    57                         $_SESSION['phpgw_info']['workflow']['server']; 
    58                 $ldapConfigValues = galaxia_get_config_values(array('ldap_user_context' => '', 'ldap_group_context' => '')); 
    59                 if (empty($ldapConfigValues['ldap_user_context'])) 
    60                         $ldapConfigValues['ldap_user_context'] = $info['ldap_context']; 
    61                 if (empty($ldapConfigValues['ldap_group_context'])) 
    62                         $ldapConfigValues['ldap_group_context'] = $info['ldap_group_context']; 
    63                 $this->userContext = $ldapConfigValues['ldap_user_context']; 
    64                 $this->groupContext = $ldapConfigValues['ldap_group_context']; 
    65                 $this->ldapContext = $ldapConfigValues['ldap_user_context']; 
     55                $ldapUserContext = Settings::get('workflow', 'ldap', 'user_context'); 
     56                $ldapGroupContext = Settings::get('workflow', 'ldap', 'group_context'); 
     57 
     58                if (empty($ldapUserContext)) 
     59                        $ldapUserContext = Settings::get('expresso', 'ldap', 'user_context'); 
     60 
     61                if (empty($ldapGroupContext)) 
     62                        $ldapGroupContext = Settings::get('expresso', 'ldap', 'group_context'); 
     63 
     64                $this->userContext = $ldapUserContext; 
     65                $this->groupContext = $ldapGroupContext; 
     66                $this->ldapContext = $ldapUserContext; 
    6667 
    6768                $this->cache = array( 
  • sandbox/workflow/branches/993/inc/class.WorkflowMacro.inc.php

    r2372 r2492  
    4343                $_SESSION['phpgw_info']['workflow']['vfs_basedir'] = ($row !== false) ? $row['config_value'] : '/home/expressolivre'; 
    4444                $_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] = PHPGW_API_INC; 
    45                 $_SESSION['phpgw_info']['workflow']['account_id'] = $GLOBALS['phpgw_info']['user']['account_id']; 
     45                $_SESSION['phpgw_info']['workflow']['account_id'] = Settings::get('expresso', 'user', 'account_id'); 
    4646                $_SESSION['phpgw_info']['workflow']['server']['webserver_url'] = $GLOBALS['phpgw_info']['server']['webserver_url']; 
    4747 
  • sandbox/workflow/branches/993/inc/class.WorkflowObjects.inc.php

    r2429 r2492  
    4040 
    4141                        /* if any parameter is not set, then we will return expresso database */ 
    42                         if ((Settings::get('workflow', 'galaxia', 'db', 'name') == '') or 
    43                                 (Settings::get('workflow', 'galaxia', 'db', 'host') == '') or 
    44                                 (Settings::get('workflow', 'galaxia', 'db', 'port') == '') or 
    45                                 (Settings::get('workflow', 'galaxia', 'db', 'user') == '') or 
    46                                 (Settings::get('workflow', 'galaxia', 'db', 'type') == '')) 
     42                        if ((Settings::get('workflow', 'db_module', 'name') == '') or 
     43                                (Settings::get('workflow', 'db_module', 'host') == '') or 
     44                                (Settings::get('workflow', 'db_module', 'port') == '') or 
     45                                (Settings::get('workflow', 'db_module', 'user') == '') or 
     46                                (Settings::get('workflow', 'db_module', 'type') == '')) 
    4747                                $dedicatedDB = false; 
    4848 
     
    5555                                $this->cache['DBGalaxia']->Halt_On_Error = 'no'; 
    5656                                $this->cache['DBGalaxia']->connect( 
    57                                         Settings::get('workflow', 'galaxia', 'db', 'name'), 
    58                                         Settings::get('workflow', 'galaxia', 'db', 'host'), 
    59                                         Settings::get('workflow', 'galaxia', 'db', 'port'), 
    60                                         Settings::get('workflow', 'galaxia', 'db', 'user'), 
    61                                         Settings::get('workflow', 'galaxia', 'db', 'password'), 
    62                                         Settings::get('workflow', 'galaxia', 'db', 'type') 
     57                                        Settings::get('workflow', 'db_module', 'name'), 
     58                                        Settings::get('workflow', 'db_module', 'host'), 
     59                                        Settings::get('workflow', 'db_module', 'port'), 
     60                                        Settings::get('workflow', 'db_module', 'user'), 
     61                                        Settings::get('workflow', 'db_module', 'password'), 
     62                                        Settings::get('workflow', 'db_module', 'type') 
    6363                                ); 
    6464                                Factory::getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBGalaxia']); 
     
    114114                        $this->cache['DBWorkflow']->Halt_On_Error = 'no'; 
    115115                        $this->cache['DBWorkflow']->connect( 
    116                                 Settings::get('workflow', 'db', 'name'), 
    117                                 Settings::get('workflow', 'db', 'host'), 
    118                                 Settings::get('workflow', 'db', 'port'), 
    119                                 Settings::get('workflow', 'db', 'admin_user'), 
    120                                 Settings::get('workflow', 'db', 'admin_password'), 
    121                                 Settings::get('workflow', 'db', 'type') 
     116                                Settings::get('workflow', 'db_processes', 'name'), 
     117                                Settings::get('workflow', 'db_processes', 'host'), 
     118                                Settings::get('workflow', 'db_processes', 'port'), 
     119                                Settings::get('workflow', 'db_processes', 'admin_user'), 
     120                                Settings::get('workflow', 'db_processes', 'admin_password'), 
     121                                Settings::get('workflow', 'db_processes', 'type') 
    122122                        ); 
    123123                        Factory::getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBWorkflow']); 
  • sandbox/workflow/branches/993/inc/class.bo_agent_mail_smtp.inc.php

    r2372 r2492  
    300300                $data['smtpAuth']               = $profileData['smtpAuth']; 
    301301                $data['smtpType']               = $profileData['smtpType']; 
    302                 $useremail = $this->bo_emailadmin->getAccountEmailAddress($GLOBALS['phpgw_info']['user']['userid'], $this->profileID); 
     302                $useremail = $this->bo_emailadmin->getAccountEmailAddress(Settings::get('expresso', 'user', 'userid'), $this->profileID); 
    303303                $data['emailAddress']           = $useremail[0]['address']; 
    304304                return $data; 
     
    422422        function prepare_mail() 
    423423        { 
    424                 $userLang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; 
     424                $userLang = Settings::get('expresso', 'preferences', 'lang'); 
    425425                $langFile = PHPGW_SERVER_ROOT."/phpgwapi/setup/phpmailer.lang-$userLang.php"; 
    426426                if(file_exists($langFile)) 
     
    448448                { 
    449449                        $this->mail->SMTPAuth   = true; 
    450                         $this->mail->Username   = $GLOBALS['phpgw_info']['user']['userid']; 
    451                         $this->mail->Password   = $GLOBALS['phpgw_info']['user']['passwd']; 
     450                        $this->mail->Username   = Settings::get('expresso', 'user', 'userid'); 
     451                        $this->mail->Password   = Settings::get('expresso', 'user', 'passwd'); 
    452452                } 
    453453                 
     
    668668                                        //the current instance/activity user which is in fact running 
    669669                                        //this class actually 
    670                                         $matches[1][$key] = $GLOBALS['phpgw_info']['user']['email']; 
     670                                        $matches[1][$key] = Settings::get('expresso', 'user', 'email'); 
    671671                                        break; 
    672672                                case 'owner' : 
  • sandbox/workflow/branches/993/inc/class.bo_workflow_forms.inc.php

    r2372 r2492  
    9393                         
    9494                        // number of rows allowed 
    95                         if ($GLOBALS['phpgw_info']['user']['preferences']['workflow']['ui_items_per_page'] > 0) 
    96                         { 
    97                                 $this->offset = $GLOBALS['phpgw_info']['user']['preferences']['workflow']['ui_items_per_page']; 
     95                        if (Settings::get('workflow', 'preferences', 'ui_items_per_page') > 0) 
     96                        { 
     97                                $this->offset = Settings::get('workflow', 'preferences', 'ui_items_per_page'); 
    9898                        } 
    9999                        else 
  • sandbox/workflow/branches/993/inc/class.external_bridge.inc.php

    r2372 r2492  
    6565                $tmpOrg = ""; 
    6666 
    67                 $tmpUser = $GLOBALS['phpgw_info']['user']['account_lid']; 
    68                 $tmpOrg = explode(",ou=", $GLOBALS['phpgw_info']['user']['account_dn']); 
     67                $tmpUser = Settings::get('expresso', 'user', 'account_lid'); 
     68                $tmpOrg = explode(",ou=", Settings::get('expresso', 'user', 'account_dn')); 
    6969                $tmpOrg = explode(",", $tmpOrg[1]); 
    7070                $tmpOrg = $tmpOrg[0]; 
     
    7373                                        '%user%' => $tmpUser, 
    7474                                        '%organization%' => $tmpOrg, 
    75                                         '%password%' => $GLOBALS['phpgw_info']['user']['passwd']); 
     75                                        '%password%' => Settings::get('expresso', 'user', 'passwd')); 
    7676 
    7777                /* select the required form values for submission */ 
     
    130130                        /* check if the user has the permission to access the requested site */ 
    131131                        $site = (int) $site; 
    132                         if (!$this->acl->checkUserGroupAccessToResource('APX', $GLOBALS['phpgw_info']['user']['account_id'], $site)) 
     132                        if (!$this->acl->checkUserGroupAccessToResource('APX', Settings('expresso', 'user', 'account_id'), $site)) 
    133133                                $redirect = true; 
    134134                } 
  • sandbox/workflow/branches/993/inc/class.run_activity.inc.php

    r2372 r2492  
    293293                        //set some global variables needed 
    294294                        $GLOBALS['workflow']['__leave_activity']=false; 
    295                         $GLOBALS['user'] = $GLOBALS['phpgw_info']['user']['account_id']; 
     295                        $GLOBALS['user'] = Settings::get('expresso', 'user', 'account_id'); 
    296296 
    297297                        //load role names, just an information 
     
    319319                        $GLOBALS['workflow']['wf_user_id']                                      =& $GLOBALS['user']; 
    320320                        $GLOBALS['workflow']['wf_view_activity']                        =& $this->view_activity; 
    321                         $GLOBALS['workflow']['wf_webserver_url']                        = $GLOBALS['phpgw_info']['server']['webserver_url']; 
    322                         $GLOBALS['workflow']['wf_workflow_path']                        = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'; 
    323                         $GLOBALS['workflow']['wf_resources_path']                       = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow/redirect.php?pid=' . $this->process_id . '&file='; 
     321                        $GLOBALS['workflow']['wf_webserver_url']                        = EGW_BASE_URL; 
     322                        $GLOBALS['workflow']['wf_workflow_path']                        = WF_BASE_URL; 
     323                        $GLOBALS['workflow']['wf_resources_path']                       = WF_BASE_URL . SEP . 'redirect.php?pid=' . $this->process_id . '&file='; 
    324324                        $GLOBALS['workflow']['wf_default_resources_path']       = Factory::getInstance('TemplateServer')->generateLink('processes'); 
    325325                        $GLOBALS['workflow']['wf_workflow_resources_path']      = Factory::getInstance('TemplateServer')->generateLink(''); 
    326                         $GLOBALS['workflow']['wf_activity_url']                         = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 
     326                        $GLOBALS['workflow']['wf_activity_url']                         = EGW_BASE_URL . SEP . 'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 
    327327                        $GLOBALS['workflow']['wf_user_cnname']                          = Factory::getInstance('WorkflowLDAP')->getName($GLOBALS['user']); 
    328                         $GLOBALS['workflow']['wf_back_link']                            = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'index.php?start_tab=1'; 
    329                         $GLOBALS['workflow']['wf_js_path']                                      = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'js'.SEP.'jscode'; 
     328                        $GLOBALS['workflow']['wf_back_link']                            = WF_BASE_URL . SEP . 'index.php?start_tab=1'; 
     329                        $GLOBALS['workflow']['wf_js_path']                                      = WF_BASE_URL . SEP . 'js' . SEP . 'jscode'; 
    330330                        $GLOBALS['workflow']['wf_user_activities']                      = $this->GUI->gui_list_user_activities($GLOBALS['user'], '0', '-1', 'ga.wf_name__ASC', '', '', false, true, true, true, ''); 
    331331                        if ($iid) 
    332                                 $GLOBALS['workflow']['wf_instance_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id."&iid=".$iid; 
     332                                $GLOBALS['workflow']['wf_instance_url'] = EGW_BASE_URL . SEP . 'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id."&iid=".$iid; 
    333333                        else 
    334334                                unset($GLOBALS['workflow']['wf_instance_url']); 
     
    375375                                $_SESSION['phpgw_info']['workflow']['user_groups'] = galaxia_retrieve_user_groups($newUser); 
    376376                                $_SESSION['phpgw_info']['workflow']['account_id'] = $newUser; 
    377                                 $GLOBALS['phpgw_info']['user']['account_id'] = $newUser; 
     377 
     378                                Settings::set('expresso', 'user', 'account_id', $newUser); 
     379 
    378380                                $GLOBALS['workflow']['wf_user_id'] = $newUser; 
    379381                                $GLOBALS['user'] = $newUser; 
     
    384386                                        $_SESSION['phpgw_info']['workflow']['user_groups'] = $actualUserGroups; 
    385387                                        $_SESSION['phpgw_info']['workflow']['account_id'] = $actualUser; 
    386                                         $GLOBALS['phpgw_info']['user']['account_id'] = $actualUser; 
     388 
     389                                        Settings::set('expresso', 'user', 'account_id', $actualUser); 
     390 
    387391                                        $GLOBALS['workflow']['wf_user_id'] = $actualUser; 
    388392                                        $GLOBALS['user'] = $actualUser; 
     
    503507                                $_SESSION['phpgw_info']['workflow']['user_groups'] = $actualUserGroups; 
    504508                                $_SESSION['phpgw_info']['workflow']['account_id'] = $actualUser; 
    505                                 $GLOBALS['phpgw_info']['user']['account_id'] = $actualUser; 
     509                                Settings::set('expresso', 'user', 'account_id', $actualUser); 
    506510                                $GLOBALS['workflow']['wf_user_id'] = $actualUser; 
    507511                                $GLOBALS['user'] = $actualUser; 
     
    549553                                                $this->assignCommonVariables(); 
    550554                                                // and display completed template 
    551                                                 if ($GLOBALS['phpgw_info']['user']['preferences']['workflow']['show_activity_complete_page'] === '0') 
     555                                                if (Settings::get('workflow', 'preferences', 'show_activity_complete_page') === '0') 
    552556                                                        header('Location: workflow/index.php'); 
    553557                                                else 
     
    648652 
    649653                        //set some global variables needed 
    650                         $GLOBALS['user'] = $GLOBALS['phpgw_info']['user']['account_id']; 
     654                        $GLOBALS['user'] = Settings::get('expresso', 'user', 'account_id'); 
    651655 
    652656                        //load role names, just an information 
     
    674678                        $GLOBALS['workflow']['wf_user_id']                                      =& $GLOBALS['user']; 
    675679                        $GLOBALS['workflow']['wf_view_activity']                        =& $this->view_activity; 
    676                         $GLOBALS['workflow']['wf_workflow_path']                        = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'; 
    677                         $GLOBALS['workflow']['wf_resources_path']                       = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow/redirect.php?pid=' . $this->process_id . '&file='; 
     680                        $GLOBALS['workflow']['wf_workflow_path']                        = WF_BASE_URL; 
     681                        $GLOBALS['workflow']['wf_resources_path']                       = WF_BASE_URL . SEP . 'redirect.php?pid=' . $this->process_id . '&file='; 
    678682                        $GLOBALS['workflow']['wf_default_resources_path']       = Factory::getInstance('TemplateServer')->generateLink('processes'); 
    679683                        $GLOBALS['workflow']['wf_workflow_resources_path']      = Factory::getInstance('TemplateServer')->generateLink(''); 
    680                         $GLOBALS['workflow']['wf_activity_url']                         = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 
     684                        $GLOBALS['workflow']['wf_activity_url']                         = EGW_BASE_URL . SEP . 'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 
    681685                        $GLOBALS['workflow']['wf_user_cnname']                          = Factory::getInstance('WorkflowLDAP')->getName($GLOBALS['user']); 
    682                         $GLOBALS['workflow']['wf_back_link']                            = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'index.php?start_tab=1'; 
    683                         $GLOBALS['workflow']['wf_js_path']                                      = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'js'.SEP.'jscode'; 
     686                        $GLOBALS['workflow']['wf_back_link']                            = WF_BASE_URL . SEP . 'index.php?start_tab=1'; 
     687                        $GLOBALS['workflow']['wf_js_path']                                      = WF_BASE_URL . SEP . 'js' . SEP . 'jscode'; 
    684688                        $GLOBALS['workflow']['wf_user_activities']                      = $this->GUI->gui_list_user_activities($GLOBALS['user'], '0', '-1', 'ga.wf_name__ASC', '', '', false, true, true, true, ''); 
    685689                        if ($iid) 
    686                                 $GLOBALS['workflow']['wf_instance_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id."&iid=".$iid; 
     690                                $GLOBALS['workflow']['wf_instance_url'] = EGW_BASE_URL . SEP . 'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id."&iid=".$iid; 
    687691                        else 
    688692                                unset($GLOBALS['workflow']['wf_instance_url']); 
     
    824828                        $this->workflowSmarty->assign('activityName', $this->activity_name); 
    825829                        $this->workflowSmarty->assign('activityCompleteMessage', $this->activityCompleteMessage); 
    826                         $this->workflowSmarty->assign('activityBaseURL', $GLOBALS['phpgw_info']['server']['webserver_url']); 
     830                        $this->workflowSmarty->assign('activityBaseURL', EGW_BASE_URL); 
    827831                        $this->workflowSmarty->assign('activityList', $activityList); 
    828832 
  • sandbox/workflow/branches/993/inc/class.ui_adminaccess.inc.php

    r2372 r2492  
    4141        function ui_adminaccess() 
    4242        { 
    43                 if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 
     43                if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id'))) 
    4444                { 
    4545                        $GLOBALS['phpgw']->common->phpgw_header(); 
  • sandbox/workflow/branches/993/inc/class.ui_adminactivities.inc.php

    r2372 r2492  
    7474                $this->workflow_acl = Factory::getInstance('workflow_acl'); 
    7575                $denyAccess = true; 
    76                 if ($this->workflow_acl->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 
     76                if ($this->workflow_acl->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id'))) 
    7777                { 
    7878                        /* the user is an Expresso/Workflow admin */ 
     
    8585                                /* check if the user can admin the informed process */ 
    8686                                if ($this->wf_p_id != 0) 
    87                                         $denyAccess = !$this->workflow_acl->check_process_access($GLOBALS['phpgw_info']['user']['account_id'], $this->wf_p_id); 
     87                                        $denyAccess = !$this->workflow_acl->check_process_access(Settings::get('expresso', 'user', 'account_id'), $this->wf_p_id); 
    8888                                else 
    8989                                        $denyAccess = false; 
  • sandbox/workflow/branches/993/inc/class.ui_adminprocesses.inc.php

    r2372 r2492  
    5757                $this->workflow_acl = Factory::getInstance('workflow_acl'); 
    5858                $denyAccess = true; 
    59                 if ($this->workflow_acl->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 
     59                if ($this->workflow_acl->checkWorkflowAdmin( Settings::get('expresso', 'user', 'account_id'))) 
    6060                { 
    6161                        /* the user is an Expresso/Workflow admin */ 
     
    6868                                /* check if the user can admin the informed process */ 
    6969                                if ($this->wf_p_id != 0) 
    70                                         $denyAccess = !$this->workflow_acl->check_process_access($GLOBALS['phpgw_info']['user']['account_id'], $this->wf_p_id); 
     70                                        $denyAccess = !$this->workflow_acl->check_process_access( Settings::get('expresso', 'user', 'account_id'), $this->wf_p_id); 
    7171                                else 
    7272                                        $denyAccess = false; 
     
    128128                } 
    129129 
    130                 if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 
    131                 { 
    132                         $proc_ids = $this->workflow_acl->get_granted_processes($GLOBALS['phpgw_info']['user']['account_id']); 
     130                if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin( Settings::get('expresso', 'user', 'account_id' ))) 
     131                { 
     132                        $proc_ids = $this->workflow_acl->get_granted_processes( Settings::get('expresso', 'user', 'account_id') ); 
    133133                        if (count($proc_ids)) 
    134134                        { 
  • sandbox/workflow/branches/993/inc/class.ui_adminroles.inc.php

    r2372 r2492  
    4444                $this->workflow_acl = Factory::getInstance('workflow_acl'); 
    4545                $denyAccess = true; 
    46                 if ($this->workflow_acl->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 
     46                if ($this->workflow_acl->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id'))) 
    4747                { 
    4848                        /* the user is an Expresso/Workflow admin */ 
     
    5555                                /* check if the user can admin the informed process */ 
    5656                                if ($this->wf_p_id != 0) 
    57                                         $denyAccess = !$this->workflow_acl->check_process_access($GLOBALS['phpgw_info']['user']['account_id'], $this->wf_p_id); 
     57                                        $denyAccess = !$this->workflow_acl->check_process_access(Settings::get('expresso', 'user', 'account_id'), $this->wf_p_id); 
    5858                                else 
    5959                                        $denyAccess = false; 
  • sandbox/workflow/branches/993/inc/class.ui_ajaxinterface.inc.php

    r2372 r2492  
    5757                $_SESSION['phpgw_info']['workflow']['server'] = $GLOBALS['phpgw_info']['server']; 
    5858                $_SESSION['phpgw_info']['workflow']['lang'] = $GLOBALS['lang']; 
    59                 $_SESSION['phpgw_info']['workflow']['account_id'] = $GLOBALS['phpgw_info']['user']['account_id']; 
    60                 $_SESSION['phpgw_info']['workflow']['user_groups'] = Factory::getInstance('WorkflowLDAP')->getUserGroups($GLOBALS['phpgw_info']['user']['account_id']); 
    61                 $user_is_admin = $acl->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']); 
     59                $_SESSION['phpgw_info']['workflow']['account_id'] = Settings::get('expresso', 'user', 'account_id'); 
     60                $_SESSION['phpgw_info']['workflow']['user_groups'] = Factory::getInstance('WorkflowLDAP')->getUserGroups(Settings::get('expresso', 'user', 'account_id')); 
     61                $user_is_admin = $acl->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')); 
    6262                $_SESSION['phpgw_info']['workflow']['user_is_admin'] = $user_is_admin; 
    6363                $_SESSION['phpgw_info']['workflow']['user_can_admin_process'] = ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow'))); 
    6464                $_SESSION['phpgw_info']['workflow']['user_can_admin_instance'] = ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_instance_workflow',1,'workflow'))); 
    6565 
    66                 $can_monitor = $acl->checkUserGroupAccessToType('MON', $GLOBALS['phpgw_info']['user']['account_id']); 
     66                $can_monitor = $acl->checkUserGroupAccessToType('MON', Settings::get('expresso', 'user', 'account_id')); 
    6767                $_SESSION['phpgw_info']['workflow']['user_can_monitor'] = ($user_is_admin || $can_monitor); 
    6868                $_SESSION['phpgw_info']['workflow']['user_can_clean_instances'] = $_SESSION['phpgw_info']['workflow']['user_can_monitor']; 
    6969                $_SESSION['phpgw_info']['workflow']['user_can_clean_aborted_instances'] = $_SESSION['phpgw_info']['workflow']['user_can_monitor']; 
    70                 $_SESSION['phpgw_info']['workflow']['user']['preferences'] = $GLOBALS['phpgw_info']['user']['preferences']['workflow']; 
     70                $_SESSION['phpgw_info']['workflow']['user']['preferences'] = Settings::get('workflow', 'preferences'); 
    7171                $_SESSION['phpgw_info']['workflow']['voip_groups'] = $GLOBALS['phpgw_info']['server']['voip_groups']; 
    7272        } 
     
    8080        function get_common_js() 
    8181        { 
    82                 $result = "<script language='javascript'>var _web_server_url = '" . $GLOBALS['phpgw_info']['server']['webserver_url'] . "';</script>"; 
     82                $result = "<script language='javascript'>var _web_server_url = '" . EGW_BASE_URL . "';</script>"; 
    8383                $result = $result . $this->get_js_link('workflow','jscode', 'globals');                  
    8484                $result = $result . $this->get_js_link('workflow','jscode', 'common_functions'); 
     
    147147                else 
    148148                        $params[] = $this->num_version; 
    149                 $js_file = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.$module.SEP.'js'.SEP.$js_package.SEP.$js_name.'.js'; 
     149                $js_file = EGW_BASE_URL . SEP . $module . SEP . 'js' . SEP . $js_package . SEP . $js_name . '.js'; 
    150150                return '<script src="'.$js_file.'?'.implode('&', $params).'" type="text/javascript"></script>'; 
    151151        } 
  • sandbox/workflow/branches/993/inc/class.ui_external_applications.inc.php

    r2372 r2492  
    4949        function draw() 
    5050        { 
    51                 if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 
     51                if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id'))) 
    5252                { 
    5353                        $GLOBALS['phpgw']->common->phpgw_header(); 
  • sandbox/workflow/branches/993/inc/class.ui_generic_select.inc.php

    r2372 r2492  
    8282                $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_FOOTER); 
    8383 
    84                 $javaScripts = '<script src="' . $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow' . SEP . 'js' . SEP . 'jscode' . SEP . 'generic_select.js' . '" type="text/javascript"></script>'; 
     84                $javaScripts = '<script src="' . Settings::get('expresso', 'webserver_url') . SEP . 'workflow' . SEP . 'js' . SEP . 'jscode' . SEP . 'generic_select.js' . '" type="text/javascript"></script>'; 
    8585 
    8686                /* pass the variables to Smarty */ 
  • sandbox/workflow/branches/993/inc/class.ui_orgchart.inc.php

    r2418 r2492  
    4949                $this->workflow_acl = Factory::getInstance('workflow_acl'); 
    5050 
    51                 $isAdmin = $this->workflow_acl->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']); 
    52                 $isOrgchartManager = $this->workflow_acl->checkUserGroupAccessToType('ORG', $GLOBALS['phpgw_info']['user']['account_id']); 
     51                $isAdmin = $this->workflow_acl->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')); 
     52                $isOrgchartManager = $this->workflow_acl->checkUserGroupAccessToType('ORG', Settings::get('expresso', 'user', 'account_id')); 
    5353 
    5454                if (!($isAdmin || $isOrgchartManager)) 
  • sandbox/workflow/branches/993/inc/class.ui_participants.inc.php

    r2372 r2492  
    5454                $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_FOOTER); 
    5555                $ldap = Factory::getInstance('WorkflowLDAP'); 
    56                 $userDN = $GLOBALS['phpgw_info']['user']['account_dn']; 
     56                $userDN = Settings::get('expresso', 'user', 'account_dn'); 
    5757                $account = Factory::getInstance('accounts', $userDN); 
    5858                $organizationList = $this->bo->getOrganizations(); 
  • sandbox/workflow/branches/993/inc/class.workflow_processmanager.inc.php

    r2372 r2492  
    4141                        if (isset($_GET['p_id'])) 
    4242                        { 
    43                                 if (!($this->workflow_acl->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $this->workflow_acl->check_process_access($GLOBALS['phpgw_info']['user']['account_id'], (int) $_GET['p_id']))) 
     43                                if (!($this->workflow_acl->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')) || $this->workflow_acl->check_process_access(Settings::get('expresso', 'user', 'account_id'), (int) $_GET['p_id']))) 
    4444                { 
    4545                    $GLOBALS['phpgw']->common->phpgw_header(); 
     
    633633                                $this->_rec_copy($old_name,$new_name); 
    634634 
    635                          $this->workflow_acl->add_process_admins($new_id, array( $GLOBALS['phpgw_info']['user']['account_id'] )); 
     635                         $this->workflow_acl->add_process_admins($new_id, array( Settings::get('expresso', 'user', 'account_id') )); 
    636636 
    637637                         return $new_id; 
     
    665665            if (!$pId) 
    666666            { 
    667                                 $this->workflow_acl->add_process_admins($id, array( $GLOBALS['phpgw_info']['user']['account_id'] ) ); 
     667                                $this->workflow_acl->add_process_admins($id, array( Settings::get('expresso', 'user', 'account_id') ) ); 
    668668            } 
    669669 
  • sandbox/workflow/branches/993/inc/common.inc.php

    r2429 r2492  
    1111 
    1212/** 
    13  * This is other big workaround. In ajax calls, we use controller.php 
     13 * This is an other big workaround. In ajax calls, we use controller.php 
    1414 * directly, which do not includes header.inc for performance issues. 
    1515 * However, for phpgwAPI to work properly we need to set several 
     
    2424        'currentapp' => 'workflow' 
    2525); 
    26 /* TODO TODO TODO TODO */ 
     26 
     27/** 
     28 * the base dir must be relative to this file location because 
     29 * the root directory is not the some in every call. 
     30 */ 
    2731$base = dirname(dirname(dirname(__FILE__))); 
     32 
     33/* including expresso's header.inc.php */ 
    2834require_once ($base . '/header.inc.php'); 
     35 
     36/* restoring old flags */ 
    2937$GLOBALS['phpgw_info']['flags'] = $old; 
     38 
     39 
     40/* assure that the correct encoding will be used (e.g string functions) */ 
     41setlocale(LC_CTYPE, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8'); 
     42 
     43 
     44/* define o umask para a criação de arquivos por parte do Workflow */ 
     45umask(007); 
    3046 
    3147 
     
    6682 
    6783 
    68  
    69 /* assure that the correct encondig will be used (e.g string functions) */ 
    70 setlocale(LC_CTYPE, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8'); 
    71  
    72  
    73 /* define o umask para a criação de arquivos por parte do Workflow */ 
    74 umask(007); 
    75  
    76  
    7784/* including common classes */ 
    7885require_once WF_LIB_ROOT . 'security/Security.php'; 
     
    8390require_once WF_LIB_ROOT . 'settings/Settings.php'; 
    8491 
     92/** 
     93 * Expresso base url. 
     94 * @name EGW_BASE_URL 
     95 */ 
     96define('EGW_BASE_URL', Settings::get('expresso', 'webserver_url')); 
     97 
     98/** 
     99 * Workflow base url. 
     100 * @name WF_BASE_URL 
     101 */ 
     102define('WF_BASE_URL', EGW_BASE_URL . "/workflow/"); 
     103 
     104 
    85105$GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects'); 
    86106?> 
  • sandbox/workflow/branches/993/inc/engine/config.egw.inc.php

    r2372 r2492  
    151151        function galaxia_user_can_admin_process() 
    152152        { 
    153                 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('admin_workflow', 1, 'workflow')); 
     153                return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')) || $GLOBALS['phpgw']->acl->check('admin_workflow', 1, 'workflow')); 
    154154        } 
    155155} 
     
    165165        function galaxia_user_can_admin_instance() 
    166166        { 
    167                 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('admin_instance_workflow', 1, 'workflow')); 
     167                return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')) || $GLOBALS['phpgw']->acl->check('admin_instance_workflow', 1, 'workflow')); 
    168168        } 
    169169} 
     
    179179        function galaxia_user_can_clean_instances() 
    180180        { 
    181                 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('cleanup_workflow', 1, 'workflow')); 
     181                return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')) || $GLOBALS['phpgw']->acl->check('cleanup_workflow', 1, 'workflow')); 
    182182        } 
    183183} 
     
    191191        function galaxia_user_can_clean_aborted_instances() 
    192192        { 
    193                 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('cleanup_aborted_workflow', 1, 'workflow')); 
     193                return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')) || $GLOBALS['phpgw']->acl->check('cleanup_aborted_workflow', 1, 'workflow')); 
    194194        } 
    195195} 
     
    203203        function galaxia_user_can_monitor() 
    204204        { 
    205                 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('monitor_workflow', 1, 'workflow')); 
     205                return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')) || $GLOBALS['phpgw']->acl->check('monitor_workflow', 1, 'workflow')); 
    206206        } 
    207207} 
     
    219219                { 
    220220                        if ($user == '') 
    221                                 $user = $GLOBALS['phpgw_info']['user']['account_id']; 
     221                                $user = Settings::get('expresso', 'user', 'account_id'); 
    222222 
    223223                        $memberships = Factory::getInstance('WorkflowLDAP')->getUserGroups($user); 
     
    271271        function galaxia_retrieve_running_user() 
    272272        { 
    273                         return ($GLOBALS['phpgw_info']['user']['account_id']); 
     273                        return Settings::get('expresso', 'user', 'account_id'); 
    274274        } 
    275275} 
  • sandbox/workflow/branches/993/inc/engine/src/API/BaseActivity.php

    r2372 r2492  
    242242     
    243243    // retrieve user_groups information in an array containing all groups for this user 
    244     $user_groups = galaxia_retrieve_user_groups($GLOBALS['phpgw_info']['user']['account_id'] ); 
     244    $user_groups = galaxia_retrieve_user_groups(Settings::get('expresso', 'user', 'account_id') ); 
    245245    // and append it to query                       
    246246    $query = 'select `wf_role_id` from `'.GALAXIA_TABLE_PREFIX."user_roles`  
  • sandbox/workflow/branches/993/inc/hook_home.inc.php

    r2372 r2492  
    1212                $_SESSION['phpgw_info']['workflow']['user_groups'][] = $group['account_id']; 
    1313 
    14         $_SESSION['phpgw_info']['workflow']['account_id'] = $GLOBALS['phpgw_info']['user']['account_id']; 
     14        $_SESSION['phpgw_info']['workflow']['account_id'] = Settings::get('expresso', 'user', 'account_id'); 
    1515        $_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] = dirname(__FILE__) . '/../../phpgwapi/inc'; 
    1616        $_SESSION['phpgw_info']['workflow']['server']['db_name'] = $GLOBALS['phpgw_info']['server']['db_name']; 
  • sandbox/workflow/branches/993/inc/hook_sidebox_menu.inc.php

    r2372 r2492  
    1919{ 
    2020        $workflowACL = Factory::getInstance('workflow_acl'); 
    21         $userID = $GLOBALS['phpgw_info']['user']['account_id']; 
     21        $userID = Settings::get('expresso', 'user', 'account_id'); 
    2222        $apptitle = $GLOBALS['phpgw_info']['apps'][$appname]['title']; 
    2323        $isWorkflowAdmin = $workflowACL->checkWorkflowAdmin($userID); 
  • sandbox/workflow/branches/993/inc/local/classes/class.JobBase.php

    r2372 r2492  
    223223                if (empty($uidNumber)) return false; 
    224224 
    225                 $GLOBALS['phpgw_info']['user']['account_id'] = $uidNumber; 
     225                Settings::set('expresso', 'user', 'account_id', $uidNumber); 
    226226                $_SESSION['phpgw_info']['workflow']['account_id'] = $uidNumber; 
    227227                $GLOBALS['user'] = $uidNumber; 
  • sandbox/workflow/branches/993/inc/local/classes/class.wf_mail.php

    r2372 r2492  
    5151 
    5252                /* configura os parâmetros para envio de e-mail */ 
    53                 $userLang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; 
     53                $userLang = Settings('expresso', 'preferences', 'lang'); 
    5454                /* FIXME: hardcoded 'br' because phpmailer don't use pt-br */ 
    5555                if ($userLang == 'pt-br') 
     
    7070                { 
    7171                        $this->SMTPAuth = true; 
    72                         $this->Username = $GLOBALS['phpgw_info']['user']['userid']; 
    73                         $this->Password = $GLOBALS['phpgw_info']['user']['passwd']; 
     72                        $this->Username = Settings::get('expresso', 'user', 'userid'); 
     73                        $this->Password = Settings::get('expresso', 'user', 'passwd'); 
    7474                } 
    7575                $this->Encoding = '8bit'; 
  • sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_redir_menu.php

    r2372 r2492  
    5353        $select_tag .= "<option value=\"og\">Organograma</option>"; 
    5454 
    55         $user_is_admin = Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']); 
     55        $user_is_admin = Factory::getInstance('workflow_acl')->checkWorkflowAdmin(Settings::get('expresso', 'user', 'account_id')); 
    5656        if ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow'))) { 
    5757                $select_tag .= "<option value=\"ad\">Administração</option>"; 
  • sandbox/workflow/branches/993/index.php

    r2418 r2492  
    4646        else 
    4747        { 
    48                 $start_tab = $GLOBALS['phpgw_info']['user']['preferences']['workflow']['startpage']; 
     48                $start_tab = Settings::get('workflow', 'preferences', 'startpage'); 
    4949                if (is_null($start_tab)) 
    5050                        $start_tab = 1; 
  • sandbox/workflow/branches/993/lib/settings/Settings.php

    r2429 r2492  
    2929        private static $_configs = array( 
    3030                'workflow' => array( 
    31                         'intranet_subnetworks' => '', 
    32                         'db' => array( 
     31                        'db_processes' => array( 
    3332                                'name' => '', 
    3433                                'host' => '', 
     
    3837                                'type' => '' 
    3938                        ), 
    40                         'galaxia' => array( 
    41                                 'db' => array( 
    42                                         'name' => '', 
    43                                         'host' => '', 
    44                                         'port' => '', 
    45                                         'user' => '', 
    46                                         'password' => '', 
    47                                         'type' => '' 
    48                                 ) 
    49                         ), 
    50                         'ldap' => array( 
    51                                 'host' => '', 
     39                        'db_module' => array( 
     40                                'name' => '', 
     41                                'host' => '', 
     42                                'port' => '', 
    5243                                'user' => '', 
    5344                                'password' => '', 
    54                                 'follow_referrals' => '' 
    55                         ), 
     45                                'type' => '' 
     46                        ), 
     47                        'ldap' => array( 
     48                                'host' => '', 
     49                                'user' => '', 
     50                                'password' => '', 
     51                                'follow_referrals' => '', 
     52                                'user_context' => '', 
     53                                'group_context' => '' 
     54                        ), 
     55                        'preferences' => array( 
     56                                'startpage' => '', 
     57                                'ui_items_per_page' => '', 
     58                                'show_activity_complete_page' => '' 
     59                        ), 
     60                        'intranet_subnetworks' => '', 
     61                        'user_can_clean_instances' => '' 
    5662                ), 
    5763                'expresso' => array( 
     
    6571                        ), 
    6672                        'ldap' => array( 
    67                                 'host' => '' 
    68                         ), 
    69                 ), 
    70                 'process' => array( 
     73                                'host' => '', 
     74                                'user_context' => '', 
     75                                'group_context' => '' 
     76                        ), 
     77                        'user' => array( 
     78                                'account_id' => '', 
     79                                'account_lid' => '', 
     80                                'account_dn' => '', 
     81                                'userid' => '', 
     82                                'passwd' => '', 
     83                                'email' => '' 
     84                        ), 
     85                        'preferences' => array( 
     86                                'lang' => '' 
     87                        ), 
     88                        'webserver_url' => '' 
    7189                ) 
    7290        ); 
     
    92110 
    93111        /** 
    94          * Returns settings. 
     112         * Returns settings. If the hole path has not be setted, return the hole 
     113         * hierarchy under it. 
    95114         * 
    96115         * @param string $args  A variable number of parameters which specify the scope 
     
    105124                $args = func_get_args(); 
    106125 
    107                 /** 
    108                  * Here we check if the configuration was defined into $_configs array. 
    109                  * If it does not, an exception will be thrown. 
    110                  * p.s. Do not try to understand this piece of code. Just fave faith! It works... 
    111                  */ 
    112                 for ($i=0, $sub_array=&self::$_configs; $i<count($args); $sub_array=&$sub_array[$args[$i++]]) { 
    113                         if (!array_key_exists($args[$i], $sub_array)) 
    114                                 throw new Exception("Sorry! Setting '".implode("->", $args)."' do not exists."); 
    115                 } 
     126                /* checking if the key exists */ 
     127                self::_keyExists($args); 
    116128 
    117129                /* check if we already load the settings */ 
     
    123135 
    124136                return $value; 
     137        } 
     138 
     139 
     140        public static function set() { 
     141 
     142                /* getting the variable number of parameters */ 
     143                $args = func_get_args(); 
     144 
     145                /* the last position is always the value that we are trying to set, so pop it */ 
     146                $value = array_pop($args); 
     147 
     148                /* checking if the key exists */ 
     149                self::_keyExists($args); 
     150 
     151                /* check if we already load the settings */ 
     152                if (!self::$_isLoaded) 
     153                        self::_load(); 
     154 
     155                /* retrieving the setting. More 'for' programming. */ 
     156                for ($i=0, $key=&self::$_configs; $i<count($args); $key=&$key[$args[$i++]]); 
     157 
     158                /* updating the value. p.s: $key is a pointer to a $_config node */ 
     159                $key = $value; 
     160                return true; 
     161        } 
     162 
     163        /** 
     164         * Here we check if the configuration was defined into $_configs array. 
     165         * If it does not, an exception will be thrown. 
     166         * 
     167         * @param string $args  A variable number of parameters which specify the scope 
     168         *                                              and the configuration to be retrieved. 
     169         * @access private 
     170         * @return boolean 
     171         * @static 
     172         */ 
     173        private static function _keyExists($path) { 
     174 
     175                /** 
     176                 * p.s: Do not try to understand this piece of code. Just fave faith! It works... 
     177                 */ 
     178                for ($i=0, $sub_array=&self::$_configs; $i<count($path); $sub_array=&$sub_array[$path[$i++]]) { 
     179                        if (!array_key_exists($path[$i], $sub_array)) 
     180                                throw new Exception("Sorry! Setting '".implode("->", $path)."' do not exists."); 
     181                } 
     182                return true; 
    125183        } 
    126184 
     
    143201                self::$_configs['expresso']['db']['type'] = $GLOBALS['phpgw_info']['server']['db_type']; 
    144202 
     203                /* current user information */ 
     204                self::$_configs['expresso']['user']['account_id'] = $GLOBALS['phpgw_info']['user']['account_id']; 
     205                self::$_configs['expresso']['user']['account_lid'] = $GLOBALS['phpgw_info']['user']['account_lid']; 
     206                self::$_configs['expresso']['user']['account_dn'] = $GLOBALS['phpgw_info']['user']['account_dn']; 
     207                self::$_configs['expresso']['user']['userid'] = $GLOBALS['phpgw_info']['user']['userid']; 
     208                self::$_configs['expresso']['user']['passwd'] = $GLOBALS['phpgw_info']['user']['passwd']; 
     209                self::$_configs['expresso']['user']['email'] = $GLOBALS['phpgw_info']['user']['email']; 
     210 
    145211                self::$_configs['expresso']['ldap']['host'] = $GLOBALS['phpgw_info']['server']['ldap_host']; 
     212                self::$_configs['expresso']['ldap']['user_context'] = $GLOBALS['phpgw_info']['server']['ldap_user_context']; 
     213                self::$_configs['expresso']['ldap']['group_context'] = $GLOBALS['phpgw_info']['server']['ldap_group_context']; 
     214 
     215                /* workflow specific preferences */ 
     216                self::$_configs['workflow']['preferences']['startpage'] = $GLOBALS['phpgw_info']['user']['preferences']['workflow']['startpage']; 
     217                self::$_configs['workflow']['preferences']['ui_items_per_page'] = $GLOBALS['phpgw_info']['user']['preferences']['workflow']['ui_items_per_page']; 
     218                self::$_configs['workflow']['preferences']['show_activity_complete_page'] = $GLOBALS['phpgw_info']['user']['preferences']['workflow']['show_activity_complete_page']; 
     219 
     220                /*expresso preferences */ 
     221                self::$_configs['expresso']['preferences']['lang'] = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; 
     222 
     223                self::$_configs['expresso']['webserver_url'] = $GLOBALS['phpgw_info']['server']['webserver_url']; 
    146224 
    147225                /* loading database settings */ 
     
    151229                self::$_configs['workflow']['intranet_subnetworks'] = $values['intranet_subnetworks']; 
    152230 
    153                 self::$_configs['workflow']['db']['name'] = $values['database_name']; 
    154                 self::$_configs['workflow']['db']['host'] = $values['database_host']; 
    155                 self::$_configs['workflow']['db']['port'] = $values['database_port']; 
    156                 self::$_configs['workflow']['db']['admin_user'] = $values['database_admin_user']; 
    157                 self::$_configs['workflow']['db']['admin_password'] = $values['database_admin_password']; 
    158                 self::$_configs['workflow']['db']['type'] = $values['database_type']; 
    159  
    160                 self::$_configs['workflow']['galaxia']['db']['name'] = $values['workflow_database_name']; 
    161                 self::$_configs['workflow']['galaxia']['db']['host'] = $values['workflow_database_host']; 
    162                 self::$_configs['workflow']['galaxia']['db']['port'] = $values['workflow_database_port']; 
    163                 self::$_configs['workflow']['galaxia']['db']['user'] = $values['workflow_database_user']; 
    164                 self::$_configs['workflow']['galaxia']['db']['password'] = $values['workflow_database_password']; 
    165                 self::$_configs['workflow']['galaxia']['db']['type'] = $values['workflow_database_type']; 
     231                self::$_configs['workflow']['db_processes']['name'] = $values['database_name']; 
     232                self::$_configs['workflow']['db_processes']['host'] = $values['database_host']; 
     233                self::$_configs['workflow']['db_processes']['port'] = $values['database_port']; 
     234                self::$_configs['workflow']['db_processes']['admin_user'] = $values['database_admin_user']; 
     235                self::$_configs['workflow']['db_processes']['admin_password'] = $values['database_admin_password']; 
     236                self::$_configs['workflow']['db_processes']['type'] = $values['database_type']; 
     237 
     238                self::$_configs['workflow']['db_module']['name'] = $values['workflow_database_name']; 
     239                self::$_configs['workflow']['db_module']['host'] = $values['workflow_database_host']; 
     240                self::$_configs['workflow']['db_module']['port'] = $values['workflow_database_port']; 
     241                self::$_configs['workflow']['db_module']['user'] = $values['workflow_database_user']; 
     242                self::$_configs['workflow']['db_module']['password'] = $values['workflow_database_password']; 
     243                self::$_configs['workflow']['db_module']['type'] = $values['workflow_database_type']; 
    166244 
    167245                self::$_configs['workflow']['ldap']['host'] = $values['ldap_host']; 
     
    169247                self::$_configs['workflow']['ldap']['password'] = $values['ldap_password']; 
    170248                self::$_configs['workflow']['ldap']['follow_referrals'] = $values['ldap_follow_referrals']; 
     249                self::$_configs['workflow']['ldap']['user_context'] = $values['ldap_user_context']; 
     250                self::$_configs['workflow']['ldap']['group_context'] = $values['ldap_group_context']; 
    171251 
    172252                /* the settings are already loaded. No need to call this method again. */ 
Note: See TracChangeset for help on using the changeset viewer.