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_day.php (3 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
use XoopsModules\Extcal\{Helper,
13
    Utility,
14
    CategoryHandler,
15
    EventHandler
16
};
17
use Xmf\Request;
18
19
/**
20
 * @copyright    {@link https://xoops.org/ XOOPS Project}
21
 * @license      {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
22
 * @package      extcal
23
 * @since
24
 * @author       XOOPS Development Team,
25
 */
26
27
require_once __DIR__ . '/include/constantes.php';
28
$params                                  = ['view' => _EXTCAL_NAV_DAY, 'file' => _EXTCAL_FILE_DAY];
29
$GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl";
30
require_once __DIR__ . '/header.php';
31
32
global $xoopsUser, $xoopsTpl;
33
34
/** @var Time $timeHandler */
35
/** @var CategoryHandler $categoryHandler */
36
/** @var EventHandler $eventHandler */
37
/** @var Helper $helper */
38
$helper = Helper::getInstance();
39
40
/* ========================================================================== */
41
$year  = 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

41
$year  = Request::getInt('year', /** @scrutinizer ignore-type */ date('Y'), 'GET');
Loading history...
42
$month = Request::getInt('month', date('n'), 'GET');
43
$day   = Request::getInt('day', date('j'), 'GET');
44
$cat   = Request::getInt('cat', 0, 'GET');
45
/* ========================================================================== */
46
47
$form = new \XoopsSimpleForm('', 'navigSelectBox', $params['file'], 'get');
48
$form->addElement(getListYears($year, $helper->getConfig('agenda_nb_years_before'), $helper->getConfig('agenda_nb_years_after')));
49
$form->addElement(getListMonths($month));
50
$form->addElement(getListDays($day));
51
$form->addElement(Utility::getListCategories($cat));
52
$form->addElement(new \XoopsFormButton('', '', _SUBMIT, 'submit'));
53
54
// Assigning the form to the template
55
$form->assign($xoopsTpl);
56
57
/**********************************************************************/
58
// Retriving events and formatting them
59
//$events = $eventHandler->objectToArray($eventHandler->getEventDay($day, $month, $year, $cat), array('cat_id'));
60
$criteres = [
61
    'periode'      => _EXTCAL_EVENTS_DAY,
62
    'day'          => $day,
63
    'month'        => $month,
64
    'year'         => $year,
65
    'cat'          => $cat,
66
    'externalKeys' => 'cat_id',
67
];
68
$events   = $eventHandler->getEventsOnPeriode($criteres);
69
/**********************************************************************/
70
$eventsArray = $events;
71
72
// Formating date
73
//$eventHandler->formatEventsDate($events, $helper->getConfig('event_date_year'));
74
75
// Treatment for recurring event
76
// $startDay = mktime(0, 0, 0, $month, $day, $year);
77
// $endDay = $startDay + _EXTCAL_TS_DAY;
78
//$eventsArray = [];
79
80
// foreach ($events as $event) {
81
//
82
//     if (!$event['event_isrecur']) {
83
//         // Formating date
84
//         $eventHandler->formatEventDate($event, $helper->getConfig('event_date_week'));
85
//         $eventsArray[] = $event;
86
//     } else {
87
//         $recurEvents = $eventHandler->getRecurEventToDisplay($event, $startDay, $endDay);
88
//         // Formating date
89
//         $eventHandler->formatEventsDate($recurEvents, $helper->getConfig('event_date_week'));
90
//         $eventsArray = array_merge($eventsArray, $recurEvents);
91
//
92
//     }
93
//
94
// }
95
96
// Sort event array by event start
97
// usort($eventsArray, "orderEvents");
98
99
// Assigning events to the template
100
$xoopsTpl->assign('events', $eventsArray);
101
102
// Retriving categories
103
$cats = $categoryHandler->objectToArray($categoryHandler->getAllCat($xoopsUser));
104
// Assigning categories to the template
105
$xoopsTpl->assign('cats', $cats);
106
107
// Making navig data
108
$dayCalObj  = new Calendar_Day($year, $month, $day);
109
$pDayCalObj = $dayCalObj->prevDay('object');
110
$nDayCalObj = $dayCalObj->nextDay('object');
111
112
$navig = [
113
    'prev' => [
114
        'uri'  => 'year=' . $pDayCalObj->thisYear() . '&amp;month=' . $pDayCalObj->thisMonth() . '&amp;day=' . $pDayCalObj->thisDay(),
0 ignored issues
show
The method thisYear() does not exist on integer. ( Ignorable by Annotation )

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

114
        'uri'  => 'year=' . $pDayCalObj->/** @scrutinizer ignore-call */ thisYear() . '&amp;month=' . $pDayCalObj->thisMonth() . '&amp;day=' . $pDayCalObj->thisDay(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
115
        'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_day'), $pDayCalObj->getTimestamp()),
116
    ],
117
    'this' => [
118
        'uri'  => 'year=' . $dayCalObj->thisYear() . '&amp;month=' . $dayCalObj->thisMonth() . '&amp;day=' . $dayCalObj->thisDay(),
119
        'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_day'), $dayCalObj->getTimestamp()),
120
    ],
121
    'next' => [
122
        'uri'  => 'year=' . $nDayCalObj->thisYear() . '&amp;month=' . $nDayCalObj->thisMonth() . '&amp;day=' . $nDayCalObj->thisDay(),
0 ignored issues
show
The method thisYear() does not exist on integer. ( Ignorable by Annotation )

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

122
        'uri'  => 'year=' . $nDayCalObj->/** @scrutinizer ignore-call */ thisYear() . '&amp;month=' . $nDayCalObj->thisMonth() . '&amp;day=' . $nDayCalObj->thisDay(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
123
        'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_day'), $nDayCalObj->getTimestamp()),
124
    ],
125
];
126
127
// Title of the page
128
$xoopsTpl->assign('xoops_pagetitle', $helper->getModule()->getVar('name') . ' ' . $navig['this']['name']);
129
130
// Assigning navig data to the template
131
$xoopsTpl->assign('navig', $navig);
132
133
//Display tooltip
134
$xoopsTpl->assign('showInfoBulle', $helper->getConfig('showInfoBulle'));
135
$xoopsTpl->assign('showId', $helper->getConfig('showId'));
136
137
// Assigning current form navig data to the template
138
$xoopsTpl->assign('selectedCat', $cat);
139
$xoopsTpl->assign('year', $year);
140
$xoopsTpl->assign('month', $month);
141
$xoopsTpl->assign('day', $day);
142
$xoopsTpl->assign('params', $params);
143
144
$tNavBar = getNavBarTabs($params['view']);
145
$xoopsTpl->assign('tNavBar', $tNavBar);
146
$xoopsTpl->assign('list_position', $helper->getConfig('list_position'));
147
// echoArray($tNavBar,true);
148
//---------------------------------------------------------------
149
if ($xoopsUser) {
150
    $xoopsTpl->assign('isAdmin', $xoopsUser->isAdmin());
151
    $canEdit = false;
152
    /* todo
153
        $canEdit
154
            =
155
            $permHandler->isAllowed($xoopsUser, 'extcal_cat_edit', $event['cat']['cat_id'])
156
                && $xoopsUser->getVar('uid') == $event['user']['uid'];
157
        $xoopsTpl->assign('canEdit', $canEdit);
158
    */
159
} else {
160
    $xoopsTpl->assign('isAdmin', false);
161
    $xoopsTpl->assign('canEdit', false);
162
}
163
/** @var xos_opal_Theme $xoTheme */
164
$xoTheme->addScript('browse.php?modules/extcal/assets/js/highslide.js');
165
$xoTheme->addStylesheet('browse.php?modules/extcal/assets/js/highslide.css');
166
167
//mb missing for xBootstrap templates by Angelo
168
$lang = [
169
    'start'      => _MD_EXTCAL_START,
170
    'end'        => _MD_EXTCAL_END,
171
    'calmonth'   => _MD_EXTCAL_NAV_CALMONTH,
172
    'calweek'    => _MD_EXTCAL_NAV_CALWEEK,
173
    'year'       => _MD_EXTCAL_NAV_YEAR,
174
    'month'      => _MD_EXTCAL_NAV_MONTH,
175
    'week'       => _MD_EXTCAL_NAV_WEEK,
176
    'day'        => _MD_EXTCAL_NAV_DAY,
177
    'agendaweek' => _MD_EXTCAL_NAV_AGENDA_WEEK,
178
    'agendaday'  => _MD_EXTCAL_NAV_AGENDA_DAY,
179
    'search'     => _MD_EXTCAL_NAV_SEARCH,
180
    'newevent'   => _MD_EXTCAL_NAV_NEW_EVENT,
181
];
182
183
// Assigning language data to the template
184
$xoopsTpl->assign('lang', $lang);
185
$xoopsTpl->assign('view', 'day');
186
187
require_once XOOPS_ROOT_PATH . '/footer.php';
188