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 | // OVIDENTIA http://www.ovidentia.org |
||
| 4 | // Ovidentia is free software; you can redistribute it and/or modify |
||
| 5 | // it under the terms of the GNU General Public License as published by |
||
| 6 | // the Free Software Foundation; either version 2, or (at your option) |
||
| 7 | // any later version. |
||
| 8 | // |
||
| 9 | // This program is distributed in the hope that it will be useful, but |
||
| 10 | // WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
| 12 | // See the GNU General Public License for more details. |
||
| 13 | // |
||
| 14 | // You should have received a copy of the GNU General Public License |
||
| 15 | // along with this program; if not, write to the Free Software |
||
| 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
||
| 17 | // USA. |
||
| 18 | //------------------------------------------------------------------------- |
||
| 19 | /** |
||
| 20 | * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL) |
||
| 21 | * @copyright Copyright (c) 2006 by CANTICO ({@link http://www.cantico.fr}) |
||
| 22 | */ |
||
| 23 | |||
| 24 | bab_functionality::includeOriginal('Icons'); |
||
|
0 ignored issues
–
show
|
|||
| 25 | |||
| 26 | |||
| 27 | class absences_ManagerMenu |
||
| 28 | { |
||
| 29 | protected function category($name) |
||
| 30 | { |
||
| 31 | $W = bab_Widgets(); |
||
| 32 | |||
| 33 | return $W->Section( |
||
| 34 | $name, |
||
| 35 | $W->VBoxItems() |
||
| 36 | ->setHorizontalSpacing(6, 'px')->setVerticalSpacing(1, 'em') |
||
| 37 | ) |
||
| 38 | ->setFoldable(false); |
||
| 39 | } |
||
| 40 | |||
| 41 | protected function category_settings() |
||
| 42 | { |
||
| 43 | $W = bab_Widgets(); |
||
| 44 | $cat = $this->category(absences_translate('Settings')); |
||
| 45 | |||
| 46 | $cat->addItem( |
||
| 47 | $W->Link( |
||
| 48 | $W->Icon(absences_translate("Vacations types"), Func_Icons::ACTIONS_VIEW_LIST_TEXT), |
||
| 49 | absences_addon()->getUrl()."vacadm&idx=lvt" |
||
| 50 | ) |
||
| 51 | ); |
||
| 52 | |||
| 53 | |||
| 54 | $cat->addItem( |
||
| 55 | $W->Link( |
||
| 56 | $W->Icon(absences_translate("Collections"), Func_Icons::ACTIONS_VIEW_LIST_TEXT), |
||
| 57 | absences_addon()->getUrl()."vacadm&idx=lcol" |
||
| 58 | ) |
||
| 59 | ); |
||
| 60 | |||
| 61 | |||
| 62 | $cat->addItem( |
||
| 63 | $W->Link( |
||
| 64 | $W->Icon(absences_translate("Personnel members"), Func_Icons::ACTIONS_USER_GROUP_PROPERTIES), |
||
| 65 | absences_addon()->getUrl()."vacadm&idx=lper" |
||
| 66 | ) |
||
| 67 | ); |
||
| 68 | |||
| 69 | |||
| 70 | $cat->addItem( |
||
| 71 | $W->Link( |
||
| 72 | $W->Icon(absences_translate("Workdays types entitling recovery"), Func_Icons::APPS_PREFERENCES_DATE_TIME_FORMAT), |
||
| 73 | absences_addon()->getUrl()."workperiod_type" |
||
| 74 | ) |
||
| 75 | ); |
||
| 76 | |||
| 77 | |||
| 78 | View Code Duplication | if (absences_getVacationOption('sync_server')) |
|
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. Loading history...
|
|||
| 79 | { |
||
| 80 | $cat->addItem( |
||
| 81 | $W->Link( |
||
| 82 | $W->Icon(absences_translate("Configure the shared vacation rights"), Func_Icons::APPS_PREFERENCES_WEBSERVICES), |
||
| 83 | absences_addon()->getUrl()."sync_server" |
||
| 84 | ) |
||
| 85 | ); |
||
| 86 | } |
||
| 87 | |||
| 88 | View Code Duplication | if (absences_getVacationOption('sync_url')) |
|
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. Loading history...
|
|||
| 89 | { |
||
| 90 | $cat->addItem( |
||
| 91 | $W->Link( |
||
| 92 | $W->Icon(absences_translate("Configure the synchronized rights"), Func_Icons::APPS_PREFERENCES_WEBSERVICES), |
||
| 93 | absences_addon()->getUrl()."sync_client" |
||
| 94 | ) |
||
| 95 | ); |
||
| 96 | } |
||
| 97 | |||
| 98 | |||
| 99 | $WorkingHours = bab_functionality::get('WorkingHours'); |
||
| 100 | if ($WorkingHours instanceof Func_WorkingHours_Workschedules) |
||
|
0 ignored issues
–
show
The class
Func_WorkingHours_Workschedules does not exist. Did you forget a USE statement, or did you not list all dependencies?
This error could be the result of: 1. Missing dependenciesPHP Analyzer uses your Are you sure this class is defined by one of your dependencies, or did you maybe
not list a dependency in either the 2. Missing use statementPHP does not complain about undefined classes in if ($x instanceof DoesNotExist) {
// Do something.
}
If you have not tested against this specific condition, such errors might go unnoticed. Loading history...
|
|||
| 101 | { |
||
| 102 | $cat->addItem( |
||
| 103 | $W->Link( |
||
| 104 | $W->Icon(absences_translate("Configure the works schedules"), Func_Icons::APPS_PREFERENCES_CALENDAR), |
||
| 105 | $WorkingHours->getProfileListUrl() |
||
| 106 | ) |
||
| 107 | ); |
||
| 108 | } |
||
| 109 | |||
| 110 | |||
| 111 | |||
| 112 | $cat->addItem( |
||
| 113 | $W->Link( |
||
| 114 | $W->Icon(absences_translate("Plannings"), Func_Icons::APPS_CALENDAR), |
||
| 115 | absences_addon()->getUrl()."planning&idx=list" |
||
| 116 | ) |
||
| 117 | ); |
||
| 118 | |||
| 119 | |||
| 120 | |||
| 121 | |||
| 122 | $cat->addItem( |
||
| 123 | $W->Link( |
||
| 124 | $W->Icon(absences_translate("Organizations"), Func_Icons::APPS_GROUPS), |
||
| 125 | absences_addon()->getUrl()."organizations" |
||
| 126 | ) |
||
| 127 | ); |
||
| 128 | |||
| 129 | |||
| 130 | return $cat; |
||
| 131 | } |
||
| 132 | |||
| 133 | |||
| 134 | View Code Duplication | protected function category_rights() |
|
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. Loading history...
|
|||
| 135 | { |
||
| 136 | $W = bab_Widgets(); |
||
| 137 | $cat = $this->category(absences_translate('Vacation rights')); |
||
| 138 | |||
| 139 | $cat->addItem( |
||
| 140 | $W->Link( |
||
| 141 | $W->Icon(absences_translate("Vacations rights"), Func_Icons::APPS_VACATIONS), |
||
| 142 | absences_addon()->getUrl()."vacadma&idx=lrig" |
||
| 143 | ) |
||
| 144 | ); |
||
| 145 | |||
| 146 | $cat->addItem( |
||
| 147 | $W->Link( |
||
| 148 | $W->Icon(absences_translate("Rights groups"), Func_Icons::ACTIONS_LIST_ADD), |
||
| 149 | absences_addon()->getUrl()."vacadma&idx=rgroup" |
||
| 150 | ) |
||
| 151 | ); |
||
| 152 | |||
| 153 | $cat->addItem( |
||
| 154 | $W->Link( |
||
| 155 | $W->Icon(absences_translate("Rights renewal by years"), Func_Icons::ACTIONS_VIEW_CALENDAR_TIMELINE), |
||
| 156 | absences_addon()->getUrl()."vacadma&idx=copy" |
||
| 157 | ) |
||
| 158 | ); |
||
| 159 | |||
| 160 | |||
| 161 | $cat->addItem( |
||
| 162 | $W->Link( |
||
| 163 | $W->Icon(absences_translate("Archive rights"), Func_Icons::ACTIONS_ARCHIVE_CREATE), |
||
| 164 | absences_addon()->getUrl()."archive&idx=right" |
||
| 165 | ) |
||
| 166 | ); |
||
| 167 | |||
| 168 | |||
| 169 | $cat->addItem( |
||
| 170 | $W->Link( |
||
| 171 | $W->Icon(absences_translate("Sort rights"), Func_Icons::ACTIONS_ARROW_DOWN_DOUBLE), |
||
| 172 | absences_addon()->getUrl()."sort&idx=right" |
||
| 173 | ) |
||
| 174 | ); |
||
| 175 | |||
| 176 | return $cat; |
||
| 177 | } |
||
| 178 | |||
| 179 | View Code Duplication | protected function category_requests() |
|
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. Loading history...
|
|||
| 180 | { |
||
| 181 | $W = bab_Widgets(); |
||
| 182 | $cat = $this->category(absences_translate('Users requests')); |
||
| 183 | |||
| 184 | $cat->addItem( |
||
| 185 | $W->Link( |
||
| 186 | $W->Icon(absences_translate("Vacations requests"), Func_Icons::ACTIONS_VIEW_LIST_DETAILS), |
||
| 187 | absences_addon()->getUrl()."vacadmb&idx=lreq" |
||
| 188 | ) |
||
| 189 | ); |
||
| 190 | |||
| 191 | $cat->addItem( |
||
| 192 | $W->Link( |
||
| 193 | $W->Icon(absences_translate("Waiting requests"), Func_Icons::APPS_APPROBATIONS), |
||
| 194 | absences_addon()->getUrl()."waiting" |
||
| 195 | ) |
||
| 196 | ); |
||
| 197 | |||
| 198 | $cat->addItem( |
||
| 199 | $W->Link( |
||
| 200 | $W->Icon(absences_translate("Working days entitling recovery"), Func_Icons::ACTIONS_VIEW_CALENDAR_WORKWEEK), |
||
| 201 | absences_addon()->getUrl()."vacadmwd" |
||
| 202 | ) |
||
| 203 | ); |
||
| 204 | |||
| 205 | $cat->addItem( |
||
| 206 | $W->Link( |
||
| 207 | $W->Icon(absences_translate("Time saving accounts deposits"), Func_Icons::ACTIONS_VIEW_HISTORY), |
||
| 208 | absences_addon()->getUrl()."vacadmcet" |
||
| 209 | ) |
||
| 210 | ); |
||
| 211 | |||
| 212 | $cat->addItem( |
||
| 213 | $W->Link( |
||
| 214 | $W->Icon(absences_translate("Archive requests"), Func_Icons::ACTIONS_ARCHIVE_CREATE), |
||
| 215 | absences_addon()->getUrl()."archive&idx=request" |
||
| 216 | ) |
||
| 217 | ); |
||
| 218 | |||
| 219 | |||
| 220 | |||
| 221 | return $cat; |
||
| 222 | } |
||
| 223 | |||
| 224 | |||
| 225 | |||
| 226 | |||
| 227 | |||
| 228 | View Code Duplication | protected function category_export() |
|
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. Loading history...
|
|||
| 229 | { |
||
| 230 | $W = bab_Widgets(); |
||
| 231 | $cat = $this->category(absences_translate('Exports')); |
||
| 232 | |||
| 233 | |||
| 234 | $cat->addItem( |
||
| 235 | $W->Link( |
||
| 236 | $W->Icon(absences_translate("Rights export"), Func_Icons::MIMETYPES_OFFICE_SPREADSHEET), |
||
| 237 | absences_addon()->getUrl()."vacadm&idx=rightsexport" |
||
| 238 | ) |
||
| 239 | ); |
||
| 240 | |||
| 241 | $cat->addItem( |
||
| 242 | $W->Link( |
||
| 243 | $W->Icon(absences_translate("Vacation requests exports"), Func_Icons::MIMETYPES_OFFICE_SPREADSHEET), |
||
| 244 | absences_addon()->getUrl()."exportvac&idx=reqx" |
||
| 245 | ) |
||
| 246 | ); |
||
| 247 | |||
| 248 | |||
| 249 | $cat->addItem( |
||
| 250 | $W->Link( |
||
| 251 | $W->Icon(absences_translate("Vacation requests Sage exports"), Func_Icons::MIMETYPES_OFFICE_SPREADSHEET), |
||
| 252 | absences_addon()->getUrl()."exportvac&idx=sage" |
||
| 253 | ) |
||
| 254 | ); |
||
| 255 | |||
| 256 | |||
| 257 | $cat->addItem( |
||
| 258 | $W->Link( |
||
| 259 | $W->Icon(absences_translate("Available balances export"), Func_Icons::MIMETYPES_OFFICE_SPREADSHEET), |
||
| 260 | absences_addon()->getUrl()."vacadm&idx=abexport" |
||
| 261 | ) |
||
| 262 | ); |
||
| 263 | |||
| 264 | |||
| 265 | $cat->addItem( |
||
| 266 | $W->Link( |
||
| 267 | $W->Icon(absences_translate("Download statistics"), Func_Icons::MIMETYPES_OFFICE_SPREADSHEET), |
||
| 268 | absences_addon()->getUrl()."statistics&idx=filter" |
||
| 269 | ) |
||
| 270 | ); |
||
| 271 | |||
| 272 | |||
| 273 | return $cat; |
||
| 274 | } |
||
| 275 | |||
| 276 | |||
| 277 | public function getFrame() |
||
| 278 | { |
||
| 279 | $W = bab_Widgets(); |
||
| 280 | |||
| 281 | $frame = $W->Frame() |
||
| 282 | ->setLayout($W->FlowLayout()->setVerticalAlign('top')->setSpacing(5, 'em')) |
||
| 283 | ->addClass(Func_Icons::ICON_LEFT_24) |
||
| 284 | ->addClass('BabLoginMenuBackground') |
||
| 285 | ->addClass('widget-bordered'); |
||
| 286 | |||
| 287 | $frame->addItem($this->category_settings()); |
||
| 288 | $frame->addItem($this->category_rights()); |
||
| 289 | $frame->addItem($this->category_requests()); |
||
| 290 | $frame->addItem($this->category_export()); |
||
| 291 | |||
| 292 | return $frame; |
||
| 293 | } |
||
| 294 | } |
Let’s take a look at an example:
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
Change the type-hint for the parameter:
Add an additional type-check:
Add the method to the parent class: