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 | //FILE SUGARCRM flav=pro || flav=sales |
||
3 | if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
||
4 | /********************************************************************************* |
||
5 | * SugarCRM Community Edition is a customer relationship management program developed by |
||
6 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
||
7 | |||
8 | * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. |
||
9 | * Copyright (C) 2011 - 2014 Salesagility Ltd. |
||
10 | * |
||
11 | * This program is free software; you can redistribute it and/or modify it under |
||
12 | * the terms of the GNU Affero General Public License version 3 as published by the |
||
13 | * Free Software Foundation with the addition of the following permission added |
||
14 | * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK |
||
15 | * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY |
||
16 | * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. |
||
17 | * |
||
18 | * This program is distributed in the hope that it will be useful, but WITHOUT |
||
19 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
||
20 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
||
21 | * details. |
||
22 | * |
||
23 | * You should have received a copy of the GNU Affero General Public License along with |
||
24 | * this program; if not, see http://www.gnu.org/licenses or write to the Free |
||
25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
||
26 | * 02110-1301 USA. |
||
27 | * |
||
28 | * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, |
||
29 | * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. |
||
30 | * |
||
31 | * The interactive user interfaces in modified source and object code versions |
||
32 | * of this program must display Appropriate Legal Notices, as required under |
||
33 | * Section 5 of the GNU Affero General Public License version 3. |
||
34 | * |
||
35 | * In accordance with Section 7(b) of the GNU Affero General Public License version 3, |
||
36 | * these Appropriate Legal Notices must retain the display of the "Powered by |
||
37 | * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not |
||
38 | * reasonably feasible for technical reasons, the Appropriate Legal Notices must |
||
39 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
||
40 | ********************************************************************************/ |
||
41 | |||
42 | |||
43 | require_once('include/EditView/EditView2.php'); |
||
44 | /** |
||
45 | * Quick edit form in the subpanel |
||
46 | * @api |
||
47 | */ |
||
48 | class SubpanelQuickEdit{ |
||
49 | var $defaultProcess = true; |
||
50 | |||
51 | function __construct($module, $view='QuickEdit', $proccessOverride = false){ |
||
52 | //treat quickedit and quickcreate views as the same |
||
53 | if($view == 'QuickEdit') {$view = 'QuickCreate';} |
||
54 | |||
55 | // locate the best viewdefs to use: 1. custom/module/quickcreatedefs.php 2. module/quickcreatedefs.php 3. custom/module/editviewdefs.php 4. module/editviewdefs.php |
||
56 | $base = 'modules/' . $module . '/metadata/'; |
||
57 | $source = 'custom/' . $base . strtolower($view) . 'defs.php'; |
||
58 | if (!file_exists( $source)) |
||
59 | { |
||
60 | $source = $base . strtolower($view) . 'defs.php'; |
||
61 | if (!file_exists($source)) |
||
62 | { |
||
63 | //if our view does not exist default to EditView |
||
64 | $view = 'EditView'; |
||
65 | $source = 'custom/' . $base . 'editviewdefs.php'; |
||
66 | if (!file_exists($source)) |
||
67 | { |
||
68 | $source = $base . 'editviewdefs.php'; |
||
69 | } |
||
70 | } |
||
71 | } |
||
72 | |||
73 | |||
74 | $this->ev = new EditView(); |
||
0 ignored issues
–
show
|
|||
75 | $this->ev->view = $view; |
||
76 | $this->ev->ss = new Sugar_Smarty(); |
||
77 | $_REQUEST['return_action'] = 'SubPanelViewer'; |
||
78 | |||
79 | |||
80 | |||
81 | //retrieve bean if id or record is passed in |
||
82 | if (isset($_REQUEST['record']) || isset($_REQUEST['id'])){ |
||
83 | global $beanList; |
||
84 | $bean = $beanList[$module]; |
||
85 | $this->ev->focus = new $bean(); |
||
86 | |||
87 | if (isset($_REQUEST['record']) && empty($_REQUEST['id'])){ |
||
88 | $_REQUEST['id'] = $_REQUEST['record']; |
||
89 | } |
||
90 | $this->ev->focus->retrieve($_REQUEST['record']); |
||
91 | //call setup with focus passed in |
||
92 | $this->ev->setup($module, $this->ev->focus, $source); |
||
0 ignored issues
–
show
It seems like you code against a specific sub-type and not the parent class
EditView as the method setup() does only exist in the following sub-classes of EditView : DetailView2 . Maybe you want to instanceof check for one of these explicitly?
Let’s take a look at an example: abstract class User
{
/** @return string */
abstract public function getPassword();
}
class MyUser extends User
{
public function getPassword()
{
// return something
}
public function getDisplayName()
{
// return some name.
}
}
class AuthSystem
{
public function authenticate(User $user)
{
$this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
// do something.
}
}
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different sub-classes of User which does not have a getDisplayName() method, the code will break. Available Fixes
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
![]() |
|||
93 | }else{ |
||
94 | //no id, call setup on new bean |
||
95 | $this->ev->setup($module, null, $source); |
||
0 ignored issues
–
show
It seems like you code against a specific sub-type and not the parent class
EditView as the method setup() does only exist in the following sub-classes of EditView : DetailView2 . Maybe you want to instanceof check for one of these explicitly?
Let’s take a look at an example: abstract class User
{
/** @return string */
abstract public function getPassword();
}
class MyUser extends User
{
public function getPassword()
{
// return something
}
public function getDisplayName()
{
// return some name.
}
}
class AuthSystem
{
public function authenticate(User $user)
{
$this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
// do something.
}
}
In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different sub-classes of User which does not have a getDisplayName() method, the code will break. Available Fixes
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types
inside the if block in such a case.
![]() |
|||
96 | } |
||
97 | |||
98 | $this->ev->defs['templateMeta']['form']['headerTpl'] = 'include/EditView/header.tpl'; |
||
99 | $this->ev->defs['templateMeta']['form']['footerTpl'] = 'include/EditView/footer.tpl'; |
||
100 | $this->ev->defs['templateMeta']['form']['buttons'] = array('SUBPANELSAVE', 'SUBPANELCANCEL', 'SUBPANELFULLFORM'); |
||
101 | $this->ev->defs['templateMeta']['form']['hideAudit'] = true; |
||
102 | |||
103 | |||
104 | $viewEditSource = 'modules/'.$module.'/views/view.edit.php'; |
||
105 | if (file_exists('custom/'. $viewEditSource)) { |
||
106 | $viewEditSource = 'custom/'. $viewEditSource; |
||
107 | } |
||
108 | |||
109 | if(file_exists($viewEditSource) && !$proccessOverride) { |
||
110 | include($viewEditSource); |
||
111 | $c = $module . 'ViewEdit'; |
||
112 | |||
113 | $customClass = 'Custom' . $c; |
||
114 | if(class_exists($customClass)) { |
||
115 | $c = $customClass; |
||
116 | } |
||
117 | |||
118 | if(class_exists($c)) { |
||
119 | $view = new $c; |
||
120 | if($view->useForSubpanel) { |
||
121 | $this->defaultProcess = false; |
||
122 | |||
123 | //Check if we should use the module's QuickCreate.tpl file. |
||
124 | if($view->useModuleQuickCreateTemplate && file_exists('modules/'.$module.'/tpls/QuickCreate.tpl')) { |
||
125 | $this->ev->defs['templateMeta']['form']['headerTpl'] = 'modules/'.$module.'/tpls/QuickCreate.tpl'; |
||
126 | } |
||
127 | |||
128 | $view->ev = & $this->ev; |
||
129 | $view->ss = & $this->ev->ss; |
||
130 | $class = $GLOBALS['beanList'][$module]; |
||
131 | if(!empty($GLOBALS['beanFiles'][$class])){ |
||
132 | require_once($GLOBALS['beanFiles'][$class]); |
||
133 | $bean = new $class(); |
||
134 | $view->bean = $bean; |
||
135 | } |
||
136 | $this->ev->formName = 'form_Subpanel'.$this->ev->view .'_'.$module; |
||
137 | $view->showTitle = false; // Do not show title since this is for subpanel |
||
138 | $view->display(); |
||
139 | } |
||
140 | } |
||
141 | } //if |
||
142 | |||
143 | if($this->defaultProcess && !$proccessOverride) { |
||
144 | $this->process($module); |
||
145 | } |
||
146 | } |
||
147 | |||
148 | /** |
||
149 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
||
150 | */ |
||
151 | function SubpanelQuickEdit($module, $view='QuickEdit', $proccessOverride = false){ |
||
152 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
||
153 | if(isset($GLOBALS['log'])) { |
||
154 | $GLOBALS['log']->deprecated($deprecatedMessage); |
||
155 | } |
||
156 | else { |
||
157 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
||
158 | } |
||
159 | self::__construct($module, $view, $proccessOverride); |
||
160 | } |
||
161 | |||
162 | function process($module){ |
||
163 | $form_name = 'form_Subpanel'.$this->ev->view .'_'.$module; |
||
164 | $this->ev->formName = $form_name; |
||
165 | $this->ev->process(true, $form_name); |
||
166 | echo $this->ev->display(false, true); |
||
167 | } |
||
168 | } |
||
169 | ?> |
||
170 |
This class, trait or interface has been deprecated.