[795] | 1 | <?php |
---|
| 2 | /**************************************************************************\ |
---|
| 3 | * eGroupWare * |
---|
| 4 | * http://www.egroupware.org * |
---|
| 5 | * -------------------------------------------- * |
---|
| 6 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 7 | * under the terms of the GNU General Public License as published by the * |
---|
| 8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 9 | * option) any later version. * |
---|
| 10 | \**************************************************************************/ |
---|
| 11 | |
---|
| 12 | /** |
---|
| 13 | * Caracter separador |
---|
| 14 | * @name SEP |
---|
| 15 | */ |
---|
| 16 | if (!defined('PHPGW_SERVER_ROOT')) |
---|
| 17 | { |
---|
| 18 | define('SEP', '/'); |
---|
| 19 | /** |
---|
| 20 | * Raiz do servidor |
---|
| 21 | * @name PHPGW_SERVER_ROOT |
---|
| 22 | */ |
---|
| 23 | define('PHPGW_SERVER_ROOT' , $_SESSION['phpgw_info']['workflow']['server_root']); |
---|
| 24 | /** |
---|
| 25 | * Caminho para o diretorio INCLUDE |
---|
| 26 | * @name PHPGW_INCLUDE_ROOT |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | define('PHPGW_INCLUDE_ROOT', $_SESSION['phpgw_info']['workflow']['phpgw_include_root']); |
---|
| 30 | /** |
---|
| 31 | * Caminho para a PHPGW_API |
---|
| 32 | * @name PHPGW_API_INC |
---|
| 33 | */ |
---|
| 34 | define('PHPGW_API_INC' , $_SESSION['phpgw_info']['workflow']['phpgw_api_inc']); |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'common.inc.php'); |
---|
| 38 | require_once(PHPGW_API_INC . SEP . 'class.db.inc.php'); |
---|
| 39 | require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'class.ajax_ldap.inc.php'); |
---|
| 40 | require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'class.ajax_config.inc.php'); |
---|
| 41 | require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'config.ajax.inc.php'); |
---|
| 42 | require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'class.so_adminaccess.inc.php'); |
---|
| 43 | |
---|
| 44 | /** |
---|
| 45 | * Implementa o suporte básico para execução de métodos requisitados via AJAX |
---|
| 46 | * Cria objetos globais para bancos de dados, ldap, config do eGroupware e |
---|
| 47 | * acl do workflow |
---|
| 48 | * |
---|
| 49 | * @package Workflow |
---|
| 50 | * @author Mauricio Luiz Viani - viani@celepar.pr.gov.br |
---|
| 51 | * @author Sidnei Augusto C Drovetto - drovetto@gmail.com |
---|
| 52 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
| 53 | * @access public |
---|
| 54 | */ |
---|
| 55 | class bo_ajaxinterface |
---|
| 56 | { |
---|
| 57 | /** |
---|
| 58 | * Cria objetos globais para o ldap, banco do expresso, banco do workflow, |
---|
| 59 | * e acl do workflow |
---|
| 60 | * |
---|
| 61 | * @return void |
---|
| 62 | * @access public |
---|
| 63 | */ |
---|
| 64 | function bo_ajaxinterface() |
---|
| 65 | { |
---|
| 66 | if (isset($_SESSION['phpgw_info']['workflow']['account_id'])) |
---|
| 67 | { |
---|
| 68 | $GLOBALS['ajax']->ldap = new ajax_ldap(); |
---|
| 69 | $GLOBALS['ajax']->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso(); |
---|
| 70 | $GLOBALS['ajax']->db->Halt_On_Error = 'no'; |
---|
| 71 | |
---|
| 72 | $GLOBALS['ajax']->db_workflow = &$GLOBALS['workflow']['workflowObjects']->getDBWorkflow(); |
---|
| 73 | $GLOBALS['ajax']->db_workflow->Halt_On_Error = 'no'; |
---|
| 74 | |
---|
| 75 | $GLOBALS['phpgw']->ADOdb = &$GLOBALS['ajax']->db->Link_ID; |
---|
| 76 | $GLOBALS['ajax']->acl = new so_adminaccess($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); |
---|
| 77 | } |
---|
| 78 | else |
---|
| 79 | { |
---|
| 80 | die("Impossível executar a operação solicitada."); |
---|
| 81 | } |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | /** |
---|
| 85 | * Fecha a conexão com os objetos globais |
---|
| 86 | * |
---|
| 87 | * @return void |
---|
| 88 | * @access public |
---|
| 89 | */ |
---|
| 90 | function disconnect_all() |
---|
| 91 | { |
---|
| 92 | $GLOBALS['ajax']->db->Link_ID->Close(); |
---|
| 93 | $GLOBALS['ajax']->db_workflow->Link_ID->Close(); |
---|
| 94 | $GLOBALS['ajax']->ldap->close(); |
---|
| 95 | } |
---|
| 96 | } |
---|
| 97 | ?> |
---|