This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /********************************************************************************* |
||
3 | * SugarCRM Community Edition is a customer relationship management program developed by |
||
4 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
||
5 | |||
6 | * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. |
||
7 | * Copyright (C) 2011 - 2014 Salesagility Ltd. |
||
8 | * |
||
9 | * This program is free software; you can redistribute it and/or modify it under |
||
10 | * the terms of the GNU Affero General Public License version 3 as published by the |
||
11 | * Free Software Foundation with the addition of the following permission added |
||
12 | * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK |
||
13 | * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY |
||
14 | * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. |
||
15 | * |
||
16 | * This program is distributed in the hope that it will be useful, but WITHOUT |
||
17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
||
18 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
||
19 | * details. |
||
20 | * |
||
21 | * You should have received a copy of the GNU Affero General Public License along with |
||
22 | * this program; if not, see http://www.gnu.org/licenses or write to the Free |
||
23 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
||
24 | * 02110-1301 USA. |
||
25 | * |
||
26 | * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, |
||
27 | * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. |
||
28 | * |
||
29 | * The interactive user interfaces in modified source and object code versions |
||
30 | * of this program must display Appropriate Legal Notices, as required under |
||
31 | * Section 5 of the GNU Affero General Public License version 3. |
||
32 | * |
||
33 | * In accordance with Section 7(b) of the GNU Affero General Public License version 3, |
||
34 | * these Appropriate Legal Notices must retain the display of the "Powered by |
||
35 | * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not |
||
36 | * reasonably feasible for technical reasons, the Appropriate Legal Notices must |
||
37 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
||
38 | ********************************************************************************/ |
||
39 | |||
40 | require_once('modules/ModuleBuilder/MB/AjaxCompose.php'); |
||
41 | require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
||
42 | class Viewpackage extends SugarView |
||
43 | { |
||
44 | /** |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
45 | * @see SugarView::_getModuleTitleParams() |
||
46 | */ |
||
47 | protected function _getModuleTitleParams($browserTitle = false) |
||
48 | { |
||
49 | global $mod_strings; |
||
50 | |||
51 | return array( |
||
52 | translate('LBL_MODULE_NAME','Administration'), |
||
53 | ModuleBuilderController::getModuleTitle(), |
||
54 | ); |
||
55 | } |
||
56 | |||
57 | function display() |
||
58 | { |
||
59 | global $mod_strings; |
||
60 | $smarty = new Sugar_Smarty(); |
||
61 | $mb = new ModuleBuilder(); |
||
62 | //if (!empty($_REQUEST['package'])) { |
||
63 | if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) { |
||
64 | $this->generatePackageButtons($mb->getPackageList()); |
||
65 | |||
66 | $smarty->assign('buttons', $this->buttons); |
||
67 | $smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']); |
||
68 | $smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']); |
||
69 | $smarty->assign("defaultHelp", "mbHelp"); |
||
70 | |||
71 | $ajax = new AjaxCompose(); |
||
72 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); |
||
73 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'],''); |
||
74 | $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); |
||
75 | echo $ajax->getJavascript(); |
||
76 | } |
||
77 | else { |
||
78 | |||
79 | $name = (!empty($_REQUEST['package']))?$_REQUEST['package']:''; |
||
80 | $mb->getPackage($name); |
||
81 | |||
82 | require_once ('modules/ModuleBuilder/MB/MBPackageTree.php') ; |
||
83 | $mbt = new MBPackageTree(); |
||
84 | $nodes = $mbt->fetchNodes(); |
||
85 | |||
86 | $package_labels = array(); |
||
87 | if(!empty($nodes['tree_data']['nodes'])) |
||
88 | { |
||
89 | foreach($nodes['tree_data']['nodes'] as $entry) |
||
90 | { |
||
91 | if(!empty($entry['data']['label']) && $name != $entry['data']['label']) |
||
92 | { |
||
93 | $package_labels[] = strtoupper($entry['data']['label']); |
||
94 | } |
||
95 | } |
||
96 | } |
||
97 | |||
98 | $json = getJSONobj(); |
||
99 | $smarty->assign('package_labels', $json->encode($package_labels)); |
||
100 | |||
101 | $this->package =& $mb->packages[$name]; |
||
102 | $this->loadModuleTypes(); |
||
103 | $this->loadPackageHelp($name); |
||
104 | $this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified); |
||
105 | $smarty->assign('package', $this->package); |
||
106 | $smarty->assign('mod_strings',$mod_strings); |
||
107 | $smarty->assign('package_already_deployed', 'false'); |
||
108 | foreach($this->package->modules as $a_module){ |
||
109 | if(in_array($a_module->key_name, $GLOBALS['moduleList'])){ |
||
110 | $smarty->assign('package_already_deployed', 'true'); |
||
111 | break; |
||
112 | } |
||
113 | } |
||
114 | |||
115 | $ajax = new AjaxCompose(); |
||
116 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); |
||
117 | if(empty($name))$name = $mod_strings['LBL_NEW_PACKAGE']; |
||
118 | $ajax->addCrumb($name,''); |
||
119 | $html=$smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl'); |
||
120 | if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage') |
||
121 | $html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
||
122 | $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html); |
||
123 | echo $ajax->getJavascript(); |
||
124 | } |
||
125 | } |
||
126 | |||
127 | function loadModuleTypes() |
||
128 | { |
||
129 | $this->package->moduleTypes = array(); |
||
130 | $this->package->loadModules(); |
||
131 | foreach(array_keys($this->package->modules) as $name){ |
||
132 | foreach($this->package->modules[$name]->config['templates'] as $template=>$var){ |
||
133 | |||
134 | $this->package->moduleTypes[$name] = $template; |
||
135 | |||
136 | } |
||
137 | } |
||
138 | } |
||
139 | function loadPackageHelp( |
||
140 | $name |
||
141 | ) |
||
142 | { |
||
143 | $this->package->help['default'] = (empty($name))?'create':'modify'; |
||
144 | $this->package->help['group'] = 'package'; |
||
145 | } |
||
146 | |||
147 | function generatePackageButtons( |
||
148 | $packages |
||
149 | ) |
||
150 | { |
||
151 | global $mod_strings; |
||
152 | $this->buttons[$mod_strings['LBL_NEW_PACKAGE']] = array( |
||
153 | 'action' => "module=ModuleBuilder&action=package&new=1", |
||
154 | 'imageTitle' => 'package_create', |
||
155 | 'size' => '64', |
||
156 | 'help' => 'newPackage', |
||
157 | 'linkId' => 'newPackageLink' |
||
158 | ); |
||
159 | foreach($packages as $package) { |
||
160 | $this->buttons[$package] = array( |
||
161 | 'action' =>"module=ModuleBuilder&action=package&package={$package}", |
||
162 | 'imageTitle' => 'package', |
||
163 | 'size' => '64', |
||
164 | ); |
||
165 | } |
||
166 | } |
||
167 | } |