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 | * @package Workflow |
---|
14 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
15 | * @author Rodrigo Daniel C de Lira - rodrigo.lira@gmail.com |
---|
16 | * @author Sidnei Augusto Drovetto Jr. - drovetto@gmail.com |
---|
17 | */ |
---|
18 | require_once dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php'; |
---|
19 | require_once dirname(__FILE__) . SEP . 'class.workflow_acl.inc.php'; |
---|
20 | require_once 'engine' . SEP . 'config.ajax.inc.php'; |
---|
21 | |
---|
22 | class ui_adminsource extends ui_ajaxinterface |
---|
23 | { |
---|
24 | /** |
---|
25 | * @var array $public_functions |
---|
26 | * @access public |
---|
27 | */ |
---|
28 | var $public_functions = array( |
---|
29 | 'form' => true, |
---|
30 | ); |
---|
31 | |
---|
32 | /** |
---|
33 | * @var array $workflow_acl |
---|
34 | * @access public |
---|
35 | */ |
---|
36 | var $workflow_acl; |
---|
37 | |
---|
38 | /** |
---|
39 | * Constructor |
---|
40 | * @access public |
---|
41 | * @return object |
---|
42 | */ |
---|
43 | function ui_adminsource() |
---|
44 | { |
---|
45 | $this->workflow_acl = new workflow_acl(); |
---|
46 | $denyAccess = true; |
---|
47 | if ($this->workflow_acl->checkWorkflowAdmin($_SESSION['phpgw_info']['workflow']['account_id'])) |
---|
48 | { |
---|
49 | /* the user is an Expresso/Workflow admin */ |
---|
50 | $denyAccess = false; |
---|
51 | } |
---|
52 | else |
---|
53 | { |
---|
54 | if ($GLOBALS['phpgw']->acl->check('admin_workflow', 1, 'workflow')) |
---|
55 | { |
---|
56 | $pid = (int) $_GET['p_id']; |
---|
57 | /* check if the user can admin the informed process */ |
---|
58 | $denyAccess = !$this->workflow_acl->check_process_access($_SESSION['phpgw_info']['workflow']['account_id'], $pid); |
---|
59 | } |
---|
60 | } |
---|
61 | |
---|
62 | if ($denyAccess) |
---|
63 | { |
---|
64 | $GLOBALS['phpgw']->common->phpgw_header(); |
---|
65 | echo parse_navbar(); |
---|
66 | echo lang('access not permitted'); |
---|
67 | $GLOBALS['phpgw']->log->message('F-Abort, Unauthorized access to workflow.ui_adminprocesses'); |
---|
68 | $GLOBALS['phpgw']->log->commit(); |
---|
69 | $GLOBALS['phpgw']->common->phpgw_exit(); |
---|
70 | } |
---|
71 | } |
---|
72 | |
---|
73 | /** |
---|
74 | * Show user interface admin source form |
---|
75 | * @access public |
---|
76 | * @return object |
---|
77 | */ |
---|
78 | function form() |
---|
79 | { |
---|
80 | $smarty = $GLOBALS['workflow']['factory']->getInstance('workflow_smarty', false); |
---|
81 | $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_NAVIGATION_BAR | workflow_smarty::SHOW_FOOTER, $GLOBALS['phpgw_info']['apps']['workflow']['title'] . ' - ' . lang('Admin Processes Sources')); |
---|
82 | |
---|
83 | $javaScripts = $this->get_common_js(); |
---|
84 | $javaScripts .= $this->get_js_link('workflow','jscode', 'prototype'); |
---|
85 | $javaScripts .= $this->get_js_link('workflow','adminsource', 'php_folder'); |
---|
86 | $javaScripts .= $this->get_js_link('workflow','adminsource', 'templates_folder'); |
---|
87 | $javaScripts .= $this->get_js_link('workflow','adminsource', 'resources_folder'); |
---|
88 | $javaScripts .= $this->get_js_link('workflow','adminsource', 'includes_folder'); |
---|
89 | $javaScripts .= $this->get_js_link('workflow','jscode', 'lightbox'); |
---|
90 | $javaScripts .= $this->get_js_link('workflow','adminsource', 'main'); |
---|
91 | |
---|
92 | $css = $this->get_common_css(); |
---|
93 | $css .= $this->get_css_link('lb'); |
---|
94 | |
---|
95 | $tabs = array( |
---|
96 | 'Atividades', |
---|
97 | 'Includes', |
---|
98 | 'Templates', |
---|
99 | 'Resources' |
---|
100 | ); |
---|
101 | |
---|
102 | $smarty->assign('header', $smarty->expressoHeader); |
---|
103 | $smarty->assign('footer', $smarty->expressoFooter); |
---|
104 | $smarty->assign('txt_loading', lang('loading')); |
---|
105 | $smarty->assign('javaScripts', $javaScripts); |
---|
106 | $smarty->assign('css', $css); |
---|
107 | $smarty->assign('tabs', $tabs); |
---|
108 | $smarty->assign('processID', $_GET['p_id']); |
---|
109 | $smarty->display('adminsource.tpl'); |
---|
110 | } |
---|
111 | } |
---|
112 | ?> |
---|