adamjakab /
SuiteCRM
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 | if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
||
| 3 | /********************************************************************************* |
||
| 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
||
| 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
||
| 6 | |||
| 7 | * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. |
||
| 8 | * Copyright (C) 2011 - 2014 Salesagility Ltd. |
||
| 9 | * |
||
| 10 | * This program is free software; you can redistribute it and/or modify it under |
||
| 11 | * the terms of the GNU Affero General Public License version 3 as published by the |
||
| 12 | * Free Software Foundation with the addition of the following permission added |
||
| 13 | * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK |
||
| 14 | * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY |
||
| 15 | * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. |
||
| 16 | * |
||
| 17 | * This program is distributed in the hope that it will be useful, but WITHOUT |
||
| 18 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
||
| 19 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
||
| 20 | * details. |
||
| 21 | * |
||
| 22 | * You should have received a copy of the GNU Affero General Public License along with |
||
| 23 | * this program; if not, see http://www.gnu.org/licenses or write to the Free |
||
| 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
||
| 25 | * 02110-1301 USA. |
||
| 26 | * |
||
| 27 | * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, |
||
| 28 | * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. |
||
| 29 | * |
||
| 30 | * The interactive user interfaces in modified source and object code versions |
||
| 31 | * of this program must display Appropriate Legal Notices, as required under |
||
| 32 | * Section 5 of the GNU Affero General Public License version 3. |
||
| 33 | * |
||
| 34 | * In accordance with Section 7(b) of the GNU Affero General Public License version 3, |
||
| 35 | * these Appropriate Legal Notices must retain the display of the "Powered by |
||
| 36 | * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not |
||
| 37 | * reasonably feasible for technical reasons, the Appropriate Legal Notices must |
||
| 38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
||
| 39 | ********************************************************************************/ |
||
| 40 | |||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | global $theme; |
||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | class Popup_Picker |
||
|
0 ignored issues
–
show
|
|||
| 55 | { |
||
| 56 | |||
| 57 | |||
| 58 | /* |
||
| 59 | * |
||
| 60 | */ |
||
| 61 | function __construct() |
||
| 62 | { |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @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 |
||
| 67 | */ |
||
| 68 | function Popup_Picker(){ |
||
| 69 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
||
| 70 | if(isset($GLOBALS['log'])) { |
||
| 71 | $GLOBALS['log']->deprecated($deprecatedMessage); |
||
| 72 | } |
||
| 73 | else { |
||
| 74 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
||
| 75 | } |
||
| 76 | self::__construct(); |
||
| 77 | } |
||
| 78 | |||
| 79 | |||
| 80 | /* |
||
| 81 | * |
||
| 82 | */ |
||
| 83 | function _get_where_clause() |
||
| 84 | { |
||
| 85 | $where = ''; |
||
| 86 | if(isset($_REQUEST['query'])) |
||
| 87 | { |
||
| 88 | $where_clauses = array(); |
||
| 89 | append_where_clause($where_clauses, "first_name", "users.first_name"); |
||
| 90 | append_where_clause($where_clauses, "last_name", "users.last_name"); |
||
| 91 | append_where_clause($where_clauses, "user_name", "users.user_name"); |
||
| 92 | |||
| 93 | $where = generate_where_statement($where_clauses); |
||
| 94 | } |
||
| 95 | |||
| 96 | return $where; |
||
| 97 | } |
||
| 98 | |||
| 99 | /** |
||
| 100 | * |
||
| 101 | */ |
||
| 102 | function process_page() |
||
| 103 | { |
||
| 104 | global $theme; |
||
| 105 | global $mod_strings; |
||
| 106 | global $app_strings; |
||
| 107 | global $currentModule; |
||
| 108 | global $sugar_version, $sugar_config; |
||
| 109 | |||
| 110 | $output_html = ''; |
||
| 111 | $where = ''; |
||
| 112 | |||
| 113 | $where = $this->_get_where_clause(); |
||
| 114 | |||
| 115 | |||
| 116 | |||
| 117 | $first_name = empty($_REQUEST['first_name']) ? '' : $_REQUEST['first_name']; |
||
| 118 | $last_name = empty($_REQUEST['last_name']) ? '' : $_REQUEST['last_name']; |
||
| 119 | $user_name = empty($_REQUEST['user_name']) ? '' : $_REQUEST['user_name']; |
||
| 120 | $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data']; |
||
| 121 | $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true; |
||
| 122 | |||
| 123 | $button = "<form action='index.php' method='post' name='form' id='form'>\n"; |
||
| 124 | if(!$hide_clear_button) |
||
| 125 | { |
||
| 126 | $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" |
||
| 127 | .$app_strings['LBL_CLEAR_BUTTON_TITLE']."' />\n"; |
||
| 128 | } |
||
| 129 | $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" |
||
| 130 | .$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='" |
||
| 131 | .$app_strings['LBL_CANCEL_BUTTON_KEY']."' value=' " |
||
| 132 | .$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n"; |
||
| 133 | $button .= "</form>\n"; |
||
| 134 | |||
| 135 | $form = new XTemplate('modules/Employees/Popup_picker.html'); |
||
| 136 | $form->assign('MOD', $mod_strings); |
||
| 137 | $form->assign('APP', $app_strings); |
||
| 138 | $form->assign('THEME', $theme); |
||
| 139 | $form->assign('MODULE_NAME', $currentModule); |
||
| 140 | $form->assign('FIRST_NAME', $first_name); |
||
| 141 | $form->assign('LAST_NAME', $last_name); |
||
| 142 | $form->assign('USER_NAME', $user_name); |
||
| 143 | $form->assign('request_data', $request_data); |
||
| 144 | |||
| 145 | ob_start(); |
||
| 146 | insert_popup_header($theme); |
||
| 147 | $output_html .= ob_get_contents(); |
||
| 148 | ob_end_clean(); |
||
| 149 | |||
| 150 | $output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false); |
||
| 151 | |||
| 152 | $form->parse('main.SearchHeader'); |
||
| 153 | $output_html .= $form->text('main.SearchHeader'); |
||
| 154 | |||
| 155 | // Reset the sections that are already in the page so that they do not print again later. |
||
| 156 | $form->reset('main.SearchHeader'); |
||
| 157 | |||
| 158 | // create the listview |
||
| 159 | $seed_bean = new Employee(); |
||
| 160 | $ListView = new ListView(); |
||
| 161 | $ListView->show_export_button = false; |
||
| 162 | $ListView->process_for_popups = true; |
||
| 163 | $ListView->setXTemplate($form); |
||
| 164 | $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']); |
||
| 165 | $ListView->setHeaderText($button); |
||
| 166 | $ListView->setQuery($where, '', 'user_name', 'EMPLOYEE'); |
||
| 167 | $ListView->setModStrings($mod_strings); |
||
| 168 | |||
| 169 | ob_start(); |
||
| 170 | $ListView->processListView($seed_bean, 'main', 'EMPLOYEE'); |
||
| 171 | $output_html .= ob_get_contents(); |
||
| 172 | ob_end_clean(); |
||
| 173 | |||
| 174 | $output_html .= insert_popup_footer(); |
||
| 175 | return $output_html; |
||
| 176 | } |
||
| 177 | } // end of class Popup_Picker |
||
| 178 | ?> |
This check looks for classes that have been defined more than once.
If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.
This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.