Issues (733)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

view_year.php (4 issues)

Labels
1
<?php
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright    {@link https://xoops.org/ XOOPS Project}
14
 * @license      {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
15
 * @package      extcal
16
 * @since
17
 * @author       XOOPS Development Team,
18
 */
19
20
use Xmf\Request;
21
use XoopsModules\Extcal\{Helper,
22
    CategoryHandler,
23
    EventHandler,
24
    Utility
25
};
26
27
require_once __DIR__ . '/include/constantes.php';
28
$params                                  = ['view' => _EXTCAL_NAV_YEAR, 'file' => _EXTCAL_FILE_YEAR];
29
$GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl";
30
require_once __DIR__ . '/header.php';
31
32
global $xoopsUser, $xoopsTpl;
33
34
/** @var Helper $helper */
35
$helper = Helper::getInstance();
36
37
/* ========================================================================== */
38
$year = \Xmf\Request::getInt('year', date('Y'), 'GET');
0 ignored issues
show
date('Y') of type string is incompatible with the type integer expected by parameter $default of Xmf\Request::getInt(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

38
$year = \Xmf\Request::getInt('year', /** @scrutinizer ignore-type */ date('Y'), 'GET');
Loading history...
39
$cat  = \Xmf\Request::getInt('cat', 0, 'GET');
40
41
// Getting eXtCal object's handler
42
$categoryHandler = Helper::getInstance()->getHandler(_EXTCAL_CLN_CAT);
43
$eventHandler    = Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
44
45
// Tooltips include
46
/** @var xos_opal_Theme $xoTheme */
47
$xoTheme->addScript('modules/extcal/assets/js/ToolTips.js');
48
$xoTheme->addStylesheet('modules/extcal/assets/css/infobulle.css');
49
50
$form = new \XoopsSimpleForm('', 'navigSelectBox', $params['file'], 'get');
51
$form->addElement(getListYears($year, $helper->getConfig('agenda_nb_years_before'), $helper->getConfig('agenda_nb_years_after')));
52
53
$form->addElement(Utility::getListCategories($cat));
54
$form->addElement(new \XoopsFormButton('', 'form_submit', _SUBMIT, 'submit'));
55
56
// Assigning the form to the template
57
$form->assign($xoopsTpl);
58
59
/**********************************************************************/
60
// Retriving events and formatting them
61
//$events = $eventHandler->objectToArray($eventHandler->getEventYear($year, $cat), array('cat_id'));
62
$criteres = [
63
    'periode'      => _EXTCAL_EVENTS_YEAR,
64
    'year'         => $year,
65
    'cat'          => $cat,
66
    'externalKeys' => 'cat_id',
67
];
68
$events   = $eventHandler->getEventsOnPeriode($criteres);
0 ignored issues
show
The method getEventsOnPeriode() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

68
$events   = $eventHandler->/** @scrutinizer ignore-call */ getEventsOnPeriode($criteres);
Loading history...
69
/**********************************************************************/
70
$eventsArray = $events;
71
// Formating date
72
// $eventHandler->formatEventsDate($events, $helper->getConfig('event_date_year'));
73
//
74
// // Treatment for recurring event
75
// $startYear = mktime(0, 0, 0, 1, 1, $year);
76
// $endYear = mktime(23, 59, 59, 12, 31, $year);
77
//
78
// $eventsArray = [];
79
// foreach ($events as $event) {
80
//     if (!$event['event_isrecur']) {
81
//         // Formating date
82
//         $eventHandler->formatEventDate($event, $helper->getConfig('event_date_week'));
83
//         $eventsArray[] = $event;
84
//     } else {
85
//         $recurEvents = $eventHandler->getRecurEventToDisplay($event, $startYear, $endYear);
86
//         // Formating date
87
//         $eventHandler->formatEventsDate($recurEvents, $helper->getConfig('event_date_week'));
88
//         $eventsArray = array_merge($eventsArray, $recurEvents);
89
//     }
90
// }
91
//
92
// // Sort event array by event start
93
// usort($eventsArray, "orderEvents");
94
95
// $t=print_r($eventsArray,true);
96
// echo "<pre>{$t}</pre>";
97
98
// Assigning events to the template
99
$xoopsTpl->assign('events', $eventsArray);
100
101
// Retriving categories
102
$cats = $categoryHandler->objectToArray($categoryHandler->getAllCat($xoopsUser));
0 ignored issues
show
The method objectToArray() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

102
$cats = $categoryHandler->/** @scrutinizer ignore-call */ objectToArray($categoryHandler->getAllCat($xoopsUser));
Loading history...
The method getAllCat() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

102
$cats = $categoryHandler->objectToArray($categoryHandler->/** @scrutinizer ignore-call */ getAllCat($xoopsUser));
Loading history...
103
104
// Assigning categories to the template
105
$xoopsTpl->assign('cats', $cats);
106
107
$prevYear = $year - 1;
108
$nexYear  = $year + 1;
109
// Making navig data
110
$navig = [
111
    'prev' => [
112
        'uri'  => 'year=' . $prevYear,
113
        'name' => $prevYear,
114
    ],
115
    'this' => [
116
        'uri'  => 'year=' . $year,
117
        'name' => $year,
118
    ],
119
    'next' => [
120
        'uri'  => 'year=' . $nexYear,
121
        'name' => $nexYear,
122
    ],
123
];
124
125
// Title of the page
126
$xoopsTpl->assign('xoops_pagetitle', $helper->getModule()->getVar('name') . ' ' . $navig['this']['name']);
127
128
// Assigning navig data to the template
129
$xoopsTpl->assign('navig', $navig);
130
131
//Display tooltip
132
$xoopsTpl->assign('showInfoBulle', $helper->getConfig('showInfoBulle'));
133
$xoopsTpl->assign('showId', $helper->getConfig('showId'));
134
135
// Assigning current form navig data to the template
136
$xoopsTpl->assign('selectedCat', $cat);
137
$xoopsTpl->assign('year', $year);
138
$xoopsTpl->assign('params', $params);
139
140
$tNavBar = getNavBarTabs($params['view']);
141
$xoopsTpl->assign('tNavBar', $tNavBar);
142
$xoopsTpl->assign('list_position', $helper->getConfig('list_position'));
143
// echoArray($tNavBar,true);
144
145
//---------------------------------------------------------------
146
if ($xoopsUser) {
147
    $xoopsTpl->assign('isAdmin', $xoopsUser->isAdmin());
148
    $canEdit = false;
149
    /* todo
150
        $canEdit
151
            =
152
            $permHandler->isAllowed($xoopsUser, 'extcal_cat_edit', $event['cat']['cat_id'])
153
                && $xoopsUser->getVar('uid') == $event['user']['uid'];
154
        $xoopsTpl->assign('canEdit', $canEdit);
155
    */
156
} else {
157
    $xoopsTpl->assign('isAdmin', false);
158
    $xoopsTpl->assign('canEdit', false);
159
}
160
161
//mb missing for xBootstrap templates by Angelo
162
$lang = [
163
    'start'      => _MD_EXTCAL_START,
164
    'end'        => _MD_EXTCAL_END,
165
    'calmonth'   => _MD_EXTCAL_NAV_CALMONTH,
166
    'calweek'    => _MD_EXTCAL_NAV_CALWEEK,
167
    'year'       => _MD_EXTCAL_NAV_YEAR,
168
    'month'      => _MD_EXTCAL_NAV_MONTH,
169
    'week'       => _MD_EXTCAL_NAV_WEEK,
170
    'day'        => _MD_EXTCAL_NAV_DAY,
171
    'agendaweek' => _MD_EXTCAL_NAV_AGENDA_WEEK,
172
    'agendaday'  => _MD_EXTCAL_NAV_AGENDA_DAY,
173
    'search'     => _MD_EXTCAL_NAV_SEARCH,
174
    'newevent'   => _MD_EXTCAL_NAV_NEW_EVENT,
175
];
176
// Assigning language data to the template
177
$xoopsTpl->assign('lang', $lang);
178
$xoopsTpl->assign('view', 'year');
179
180
require_once XOOPS_ROOT_PATH . '/footer.php';
181