Changeset 2492 for sandbox/workflow/branches/993/inc
- Timestamp:
- 04/12/10 16:21:32 (14 years ago)
- Location:
- sandbox/workflow/branches/993/inc
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/branches/993/inc/class.TemplateServer.inc.php
r2372 r2492 112 112 113 113 /* 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 139 116 $this->WEB_PATH = $this->WEB_WORKFLOW_BASE . '/templates'; 140 117 } -
sandbox/workflow/branches/993/inc/class.WorkflowLDAP.inc.php
r2372 r2492 53 53 54 54 /* 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; 66 67 67 68 $this->cache = array( -
sandbox/workflow/branches/993/inc/class.WorkflowMacro.inc.php
r2372 r2492 43 43 $_SESSION['phpgw_info']['workflow']['vfs_basedir'] = ($row !== false) ? $row['config_value'] : '/home/expressolivre'; 44 44 $_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'); 46 46 $_SESSION['phpgw_info']['workflow']['server']['webserver_url'] = $GLOBALS['phpgw_info']['server']['webserver_url']; 47 47 -
sandbox/workflow/branches/993/inc/class.WorkflowObjects.inc.php
r2429 r2492 40 40 41 41 /* if any parameter is not set, then we will return expresso database */ 42 if ((Settings::get('workflow', ' galaxia', 'db', 'name') == '') or43 (Settings::get('workflow', ' galaxia', 'db', 'host') == '') or44 (Settings::get('workflow', ' galaxia', 'db', 'port') == '') or45 (Settings::get('workflow', ' galaxia', 'db', 'user') == '') or46 (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') == '')) 47 47 $dedicatedDB = false; 48 48 … … 55 55 $this->cache['DBGalaxia']->Halt_On_Error = 'no'; 56 56 $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') 63 63 ); 64 64 Factory::getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBGalaxia']); … … 114 114 $this->cache['DBWorkflow']->Halt_On_Error = 'no'; 115 115 $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') 122 122 ); 123 123 Factory::getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBWorkflow']); -
sandbox/workflow/branches/993/inc/class.bo_agent_mail_smtp.inc.php
r2372 r2492 300 300 $data['smtpAuth'] = $profileData['smtpAuth']; 301 301 $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); 303 303 $data['emailAddress'] = $useremail[0]['address']; 304 304 return $data; … … 422 422 function prepare_mail() 423 423 { 424 $userLang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];424 $userLang = Settings::get('expresso', 'preferences', 'lang'); 425 425 $langFile = PHPGW_SERVER_ROOT."/phpgwapi/setup/phpmailer.lang-$userLang.php"; 426 426 if(file_exists($langFile)) … … 448 448 { 449 449 $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'); 452 452 } 453 453 … … 668 668 //the current instance/activity user which is in fact running 669 669 //this class actually 670 $matches[1][$key] = $GLOBALS['phpgw_info']['user']['email'];670 $matches[1][$key] = Settings::get('expresso', 'user', 'email'); 671 671 break; 672 672 case 'owner' : -
sandbox/workflow/branches/993/inc/class.bo_workflow_forms.inc.php
r2372 r2492 93 93 94 94 // 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'); 98 98 } 99 99 else -
sandbox/workflow/branches/993/inc/class.external_bridge.inc.php
r2372 r2492 65 65 $tmpOrg = ""; 66 66 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')); 69 69 $tmpOrg = explode(",", $tmpOrg[1]); 70 70 $tmpOrg = $tmpOrg[0]; … … 73 73 '%user%' => $tmpUser, 74 74 '%organization%' => $tmpOrg, 75 '%password%' => $GLOBALS['phpgw_info']['user']['passwd']);75 '%password%' => Settings::get('expresso', 'user', 'passwd')); 76 76 77 77 /* select the required form values for submission */ … … 130 130 /* check if the user has the permission to access the requested site */ 131 131 $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)) 133 133 $redirect = true; 134 134 } -
sandbox/workflow/branches/993/inc/class.run_activity.inc.php
r2372 r2492 293 293 //set some global variables needed 294 294 $GLOBALS['workflow']['__leave_activity']=false; 295 $GLOBALS['user'] = $GLOBALS['phpgw_info']['user']['account_id'];295 $GLOBALS['user'] = Settings::get('expresso', 'user', 'account_id'); 296 296 297 297 //load role names, just an information … … 319 319 $GLOBALS['workflow']['wf_user_id'] =& $GLOBALS['user']; 320 320 $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='; 324 324 $GLOBALS['workflow']['wf_default_resources_path'] = Factory::getInstance('TemplateServer')->generateLink('processes'); 325 325 $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; 327 327 $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'; 330 330 $GLOBALS['workflow']['wf_user_activities'] = $this->GUI->gui_list_user_activities($GLOBALS['user'], '0', '-1', 'ga.wf_name__ASC', '', '', false, true, true, true, ''); 331 331 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; 333 333 else 334 334 unset($GLOBALS['workflow']['wf_instance_url']); … … 375 375 $_SESSION['phpgw_info']['workflow']['user_groups'] = galaxia_retrieve_user_groups($newUser); 376 376 $_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 378 380 $GLOBALS['workflow']['wf_user_id'] = $newUser; 379 381 $GLOBALS['user'] = $newUser; … … 384 386 $_SESSION['phpgw_info']['workflow']['user_groups'] = $actualUserGroups; 385 387 $_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 387 391 $GLOBALS['workflow']['wf_user_id'] = $actualUser; 388 392 $GLOBALS['user'] = $actualUser; … … 503 507 $_SESSION['phpgw_info']['workflow']['user_groups'] = $actualUserGroups; 504 508 $_SESSION['phpgw_info']['workflow']['account_id'] = $actualUser; 505 $GLOBALS['phpgw_info']['user']['account_id'] = $actualUser;509 Settings::set('expresso', 'user', 'account_id', $actualUser); 506 510 $GLOBALS['workflow']['wf_user_id'] = $actualUser; 507 511 $GLOBALS['user'] = $actualUser; … … 549 553 $this->assignCommonVariables(); 550 554 // 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') 552 556 header('Location: workflow/index.php'); 553 557 else … … 648 652 649 653 //set some global variables needed 650 $GLOBALS['user'] = $GLOBALS['phpgw_info']['user']['account_id'];654 $GLOBALS['user'] = Settings::get('expresso', 'user', 'account_id'); 651 655 652 656 //load role names, just an information … … 674 678 $GLOBALS['workflow']['wf_user_id'] =& $GLOBALS['user']; 675 679 $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='; 678 682 $GLOBALS['workflow']['wf_default_resources_path'] = Factory::getInstance('TemplateServer')->generateLink('processes'); 679 683 $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; 681 685 $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'; 684 688 $GLOBALS['workflow']['wf_user_activities'] = $this->GUI->gui_list_user_activities($GLOBALS['user'], '0', '-1', 'ga.wf_name__ASC', '', '', false, true, true, true, ''); 685 689 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; 687 691 else 688 692 unset($GLOBALS['workflow']['wf_instance_url']); … … 824 828 $this->workflowSmarty->assign('activityName', $this->activity_name); 825 829 $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); 827 831 $this->workflowSmarty->assign('activityList', $activityList); 828 832 -
sandbox/workflow/branches/993/inc/class.ui_adminaccess.inc.php
r2372 r2492 41 41 function ui_adminaccess() 42 42 { 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'))) 44 44 { 45 45 $GLOBALS['phpgw']->common->phpgw_header(); -
sandbox/workflow/branches/993/inc/class.ui_adminactivities.inc.php
r2372 r2492 74 74 $this->workflow_acl = Factory::getInstance('workflow_acl'); 75 75 $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'))) 77 77 { 78 78 /* the user is an Expresso/Workflow admin */ … … 85 85 /* check if the user can admin the informed process */ 86 86 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); 88 88 else 89 89 $denyAccess = false; -
sandbox/workflow/branches/993/inc/class.ui_adminprocesses.inc.php
r2372 r2492 57 57 $this->workflow_acl = Factory::getInstance('workflow_acl'); 58 58 $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'))) 60 60 { 61 61 /* the user is an Expresso/Workflow admin */ … … 68 68 /* check if the user can admin the informed process */ 69 69 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); 71 71 else 72 72 $denyAccess = false; … … 128 128 } 129 129 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') ); 133 133 if (count($proc_ids)) 134 134 { -
sandbox/workflow/branches/993/inc/class.ui_adminroles.inc.php
r2372 r2492 44 44 $this->workflow_acl = Factory::getInstance('workflow_acl'); 45 45 $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'))) 47 47 { 48 48 /* the user is an Expresso/Workflow admin */ … … 55 55 /* check if the user can admin the informed process */ 56 56 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); 58 58 else 59 59 $denyAccess = false; -
sandbox/workflow/branches/993/inc/class.ui_ajaxinterface.inc.php
r2372 r2492 57 57 $_SESSION['phpgw_info']['workflow']['server'] = $GLOBALS['phpgw_info']['server']; 58 58 $_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')); 62 62 $_SESSION['phpgw_info']['workflow']['user_is_admin'] = $user_is_admin; 63 63 $_SESSION['phpgw_info']['workflow']['user_can_admin_process'] = ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow'))); 64 64 $_SESSION['phpgw_info']['workflow']['user_can_admin_instance'] = ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_instance_workflow',1,'workflow'))); 65 65 66 $can_monitor = $acl->checkUserGroupAccessToType('MON', $GLOBALS['phpgw_info']['user']['account_id']);66 $can_monitor = $acl->checkUserGroupAccessToType('MON', Settings::get('expresso', 'user', 'account_id')); 67 67 $_SESSION['phpgw_info']['workflow']['user_can_monitor'] = ($user_is_admin || $can_monitor); 68 68 $_SESSION['phpgw_info']['workflow']['user_can_clean_instances'] = $_SESSION['phpgw_info']['workflow']['user_can_monitor']; 69 69 $_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'); 71 71 $_SESSION['phpgw_info']['workflow']['voip_groups'] = $GLOBALS['phpgw_info']['server']['voip_groups']; 72 72 } … … 80 80 function get_common_js() 81 81 { 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>"; 83 83 $result = $result . $this->get_js_link('workflow','jscode', 'globals'); 84 84 $result = $result . $this->get_js_link('workflow','jscode', 'common_functions'); … … 147 147 else 148 148 $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'; 150 150 return '<script src="'.$js_file.'?'.implode('&', $params).'" type="text/javascript"></script>'; 151 151 } -
sandbox/workflow/branches/993/inc/class.ui_external_applications.inc.php
r2372 r2492 49 49 function draw() 50 50 { 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'))) 52 52 { 53 53 $GLOBALS['phpgw']->common->phpgw_header(); -
sandbox/workflow/branches/993/inc/class.ui_generic_select.inc.php
r2372 r2492 82 82 $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_FOOTER); 83 83 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>'; 85 85 86 86 /* pass the variables to Smarty */ -
sandbox/workflow/branches/993/inc/class.ui_orgchart.inc.php
r2418 r2492 49 49 $this->workflow_acl = Factory::getInstance('workflow_acl'); 50 50 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')); 53 53 54 54 if (!($isAdmin || $isOrgchartManager)) -
sandbox/workflow/branches/993/inc/class.ui_participants.inc.php
r2372 r2492 54 54 $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_FOOTER); 55 55 $ldap = Factory::getInstance('WorkflowLDAP'); 56 $userDN = $GLOBALS['phpgw_info']['user']['account_dn'];56 $userDN = Settings::get('expresso', 'user', 'account_dn'); 57 57 $account = Factory::getInstance('accounts', $userDN); 58 58 $organizationList = $this->bo->getOrganizations(); -
sandbox/workflow/branches/993/inc/class.workflow_processmanager.inc.php
r2372 r2492 41 41 if (isset($_GET['p_id'])) 42 42 { 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']))) 44 44 { 45 45 $GLOBALS['phpgw']->common->phpgw_header(); … … 633 633 $this->_rec_copy($old_name,$new_name); 634 634 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') )); 636 636 637 637 return $new_id; … … 665 665 if (!$pId) 666 666 { 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') ) ); 668 668 } 669 669 -
sandbox/workflow/branches/993/inc/common.inc.php
r2429 r2492 11 11 12 12 /** 13 * This is other big workaround. In ajax calls, we use controller.php13 * This is an other big workaround. In ajax calls, we use controller.php 14 14 * directly, which do not includes header.inc for performance issues. 15 15 * However, for phpgwAPI to work properly we need to set several … … 24 24 'currentapp' => 'workflow' 25 25 ); 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 */ 27 31 $base = dirname(dirname(dirname(__FILE__))); 32 33 /* including expresso's header.inc.php */ 28 34 require_once ($base . '/header.inc.php'); 35 36 /* restoring old flags */ 29 37 $GLOBALS['phpgw_info']['flags'] = $old; 38 39 40 /* assure that the correct encoding will be used (e.g string functions) */ 41 setlocale(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 */ 45 umask(007); 30 46 31 47 … … 66 82 67 83 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 77 84 /* including common classes */ 78 85 require_once WF_LIB_ROOT . 'security/Security.php'; … … 83 90 require_once WF_LIB_ROOT . 'settings/Settings.php'; 84 91 92 /** 93 * Expresso base url. 94 * @name EGW_BASE_URL 95 */ 96 define('EGW_BASE_URL', Settings::get('expresso', 'webserver_url')); 97 98 /** 99 * Workflow base url. 100 * @name WF_BASE_URL 101 */ 102 define('WF_BASE_URL', EGW_BASE_URL . "/workflow/"); 103 104 85 105 $GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects'); 86 106 ?> -
sandbox/workflow/branches/993/inc/engine/config.egw.inc.php
r2372 r2492 151 151 function galaxia_user_can_admin_process() 152 152 { 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')); 154 154 } 155 155 } … … 165 165 function galaxia_user_can_admin_instance() 166 166 { 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')); 168 168 } 169 169 } … … 179 179 function galaxia_user_can_clean_instances() 180 180 { 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')); 182 182 } 183 183 } … … 191 191 function galaxia_user_can_clean_aborted_instances() 192 192 { 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')); 194 194 } 195 195 } … … 203 203 function galaxia_user_can_monitor() 204 204 { 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')); 206 206 } 207 207 } … … 219 219 { 220 220 if ($user == '') 221 $user = $GLOBALS['phpgw_info']['user']['account_id'];221 $user = Settings::get('expresso', 'user', 'account_id'); 222 222 223 223 $memberships = Factory::getInstance('WorkflowLDAP')->getUserGroups($user); … … 271 271 function galaxia_retrieve_running_user() 272 272 { 273 return ($GLOBALS['phpgw_info']['user']['account_id']);273 return Settings::get('expresso', 'user', 'account_id'); 274 274 } 275 275 } -
sandbox/workflow/branches/993/inc/engine/src/API/BaseActivity.php
r2372 r2492 242 242 243 243 // 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') ); 245 245 // and append it to query 246 246 $query = 'select `wf_role_id` from `'.GALAXIA_TABLE_PREFIX."user_roles` -
sandbox/workflow/branches/993/inc/hook_home.inc.php
r2372 r2492 12 12 $_SESSION['phpgw_info']['workflow']['user_groups'][] = $group['account_id']; 13 13 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'); 15 15 $_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] = dirname(__FILE__) . '/../../phpgwapi/inc'; 16 16 $_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 19 19 { 20 20 $workflowACL = Factory::getInstance('workflow_acl'); 21 $userID = $GLOBALS['phpgw_info']['user']['account_id'];21 $userID = Settings::get('expresso', 'user', 'account_id'); 22 22 $apptitle = $GLOBALS['phpgw_info']['apps'][$appname]['title']; 23 23 $isWorkflowAdmin = $workflowACL->checkWorkflowAdmin($userID); -
sandbox/workflow/branches/993/inc/local/classes/class.JobBase.php
r2372 r2492 223 223 if (empty($uidNumber)) return false; 224 224 225 $GLOBALS['phpgw_info']['user']['account_id'] = $uidNumber;225 Settings::set('expresso', 'user', 'account_id', $uidNumber); 226 226 $_SESSION['phpgw_info']['workflow']['account_id'] = $uidNumber; 227 227 $GLOBALS['user'] = $uidNumber; -
sandbox/workflow/branches/993/inc/local/classes/class.wf_mail.php
r2372 r2492 51 51 52 52 /* configura os parâmetros para envio de e-mail */ 53 $userLang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];53 $userLang = Settings('expresso', 'preferences', 'lang'); 54 54 /* FIXME: hardcoded 'br' because phpmailer don't use pt-br */ 55 55 if ($userLang == 'pt-br') … … 70 70 { 71 71 $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'); 74 74 } 75 75 $this->Encoding = '8bit'; -
sandbox/workflow/branches/993/inc/smarty/wf_plugins/function.wf_redir_menu.php
r2372 r2492 53 53 $select_tag .= "<option value=\"og\">Organograma</option>"; 54 54 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')); 56 56 if ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow'))) { 57 57 $select_tag .= "<option value=\"ad\">Administração</option>";
Note: See TracChangeset
for help on using the changeset viewer.