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_agenda-week.php (4 issues)

Labels
Severity
1
<?php
2
3
use XoopsModules\Extcal\{Helper,
4
    Utility,
5
    CategoryHandler,
6
    EventHandler,
7
    Time
8
};
9
use Xmf\Request;
10
11
require_once __DIR__ . '/include/constantes.php';
12
$params                                  = ['view' => _EXTCAL_NAV_AGENDA_WEEK, 'file' => _EXTCAL_FILE_AGENDA_WEEK];
13
$GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl";
14
require_once __DIR__ . '/header.php';
15
16
global $xoopsUser, $xoopsTpl;
17
18
/** @var Time $timeHandler */
19
/** @var CategoryHandler $categoryHandler */
20
/** @var EventHandler $eventHandler */
21
/** @var Helper $helper */
22
$helper = Helper::getInstance();
23
24
/* ========================================================================== */
25
$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

25
$year  = \Xmf\Request::getInt('year', /** @scrutinizer ignore-type */ date('Y'), 'GET');
Loading history...
26
$month = \Xmf\Request::getInt('month', date('n'), 'GET');
27
$day   = \Xmf\Request::getInt('day', date('j'), 'GET');
28
$cat   = \Xmf\Request::getInt('cat', 0, 'GET');
29
30
// Validate the date (day, month and year)
31
$dayTS = mktime(0, 0, 0, $month, $day, $year);
32
//$offset = date('w', $dayTS) - $helper->getConfig('week_start_day');
33
$offset = date('w', $dayTS) + 7 - $helper->getConfig('week_start_day') < 7 ? date('w', $dayTS) + 7 - $helper->getConfig('week_start_day') : 0;
34
$dayTS  -= ($offset * _EXTCAL_TS_DAY);
35
$year   = date('Y', $dayTS);
36
$month  = date('n', $dayTS);
37
$day    = date('j', $dayTS);
38
39
$form = new \XoopsSimpleForm('', 'navigSelectBox', $params['file'], 'get');
40
$form->addElement(getListYears($year, $helper->getConfig('agenda_nb_years_before'), $helper->getConfig('agenda_nb_years_after')));
41
$form->addElement(getListMonths($month));
42
$form->addElement(getListDays($day));
43
$form->addElement(Utility::getListCategories($cat));
44
$form->addElement(new \XoopsFormButton('', '', _SUBMIT, 'submit'));
45
46
// Assigning the form to the template
47
$form->assign($xoopsTpl);
48
49
$mTranche = $helper->getConfig('agenda_tranche_minutes'); //minutes
50
$hStart   = $helper->getConfig('agenda_start_hour'); //heure debut de journee
51
$hEnd     = $helper->getConfig('agenda_end_hour'); //heure fin de journee
52
//$helper->getConfig('agenda_nb_days_week') = 5;
53
$nbJours = $helper->getConfig('agenda_nb_days_week'); //nombre de jour
54
55
/**********************************************************************/
56
// Retriving events and formatting them
57
//$events = $eventHandler->objectToArray($eventHandler->getEventWeek($day, $month, $year, $cat, $nbJours), array('cat_id'));
58
$criteres = [
59
    'periode'      => _EXTCAL_EVENTS_AGENDA_WEEK,
60
    'day'          => $day,
61
    'month'        => $month,
62
    'year'         => $year,
63
    'cat'          => $cat,
64
    'nbJours'      => $nbJours,
65
    'externalKeys' => 'cat_id',
66
];
67
$events   = $eventHandler->getEventsOnPeriode($criteres);
68
/**********************************************************************/
69
$eventsArray = $events;
70
// Formating date
71
// $eventHandler->formatEventsDate($events, $helper->getConfig('event_date_year'));
72
//
73
// Treatment for recurring event
74
// $startWeek = mktime(0, 0, 0, $month, $day, $year);
75
// $endWeek = $startWeek + _EXTCAL_TS_WEEK;
76
//
77
// $eventsArray = [];
78
// foreach ($events as $event) {
79
//     if (!$event['event_isrecur']) {
80
//         // Formating date
81
//         $eventHandler->formatEventDate($event, $helper->getConfig('event_date_week'));
82
//         $eventsArray[] = $event;
83
//     } else {
84
//         $recurEvents = $eventHandler->getRecurEventToDisplay($event, $startWeek, $endWeek);
85
//         // Formating date
86
//         $eventHandler->formatEventsDate($recurEvents, $helper->getConfig('event_date_week'));
87
//         $eventsArray = array_merge($eventsArray, $recurEvents);
88
//     }
89
// }
90
//
91
// Sort event array by event start
92
// usort($eventsArray, "orderEvents");
93
94
//-------------------------------------------------------------------
95
// Assigning events to the template
96
//-------------------------------------------------------------------
97
98
//$params['colJourWidth'] = (int)((((500-50)/$nbJours)/500*100)+.5);
99
$params['colJourWidth'] = (int)((((500 - 50) / $nbJours) / 500 * 100) + .6);
100
//  echo "agenda_week : {$dayTS}<br>";
101
$tAgenda = agenda_getEvents($eventsArray, $dayTS, $hStart, $hEnd, $mTranche, $nbJours);
102
//$exp = print_r($eventsArray, true);
103
$exp = print_r($tAgenda, true);
104
//echo "<pre>{$exp}</pre>";
105
106
$xoopsTpl->assign('agenda', $tAgenda);
107
//-------------------------------------------------------------------
108
109
// Retriving categories
110
$cats = $categoryHandler->objectToArray($categoryHandler->getAllCat($xoopsUser));
111
// Assigning categories to the template
112
$xoopsTpl->assign('cats', $cats);
113
114
// Making navig data
115
$weekCalObj  = new Calendar_Week($year, $month, $day, $helper->getConfig('week_start_day'));
0 ignored issues
show
$month of type string is incompatible with the type integer expected by parameter $m of Calendar_Week::__construct(). ( Ignorable by Annotation )

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

115
$weekCalObj  = new Calendar_Week($year, /** @scrutinizer ignore-type */ $month, $day, $helper->getConfig('week_start_day'));
Loading history...
$year of type string is incompatible with the type integer expected by parameter $y of Calendar_Week::__construct(). ( Ignorable by Annotation )

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

115
$weekCalObj  = new Calendar_Week(/** @scrutinizer ignore-type */ $year, $month, $day, $helper->getConfig('week_start_day'));
Loading history...
$day of type string is incompatible with the type integer expected by parameter $d of Calendar_Week::__construct(). ( Ignorable by Annotation )

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

115
$weekCalObj  = new Calendar_Week($year, $month, /** @scrutinizer ignore-type */ $day, $helper->getConfig('week_start_day'));
Loading history...
116
$pWeekCalObj = $weekCalObj->prevWeek('object');
117
$nWeekCalObj = $weekCalObj->nextWeek('object');
118
119
$navig = [
120
    'prev' => [
121
        'uri'  => 'year=' . $pWeekCalObj->thisYear() . '&amp;month=' . $pWeekCalObj->thisMonth() . '&amp;day=' . $pWeekCalObj->thisDay(),
122
        'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_week'), $pWeekCalObj->getTimestamp()),
123
    ],
124
    'this' => [
125
        'uri'  => 'year=' . $weekCalObj->thisYear() . '&amp;month=' . $weekCalObj->thisMonth() . '&amp;day=' . $weekCalObj->thisDay(),
126
        'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_week'), $weekCalObj->getTimestamp()),
127
    ],
128
    'next' => [
129
        'uri'  => 'year=' . $nWeekCalObj->thisYear() . '&amp;month=' . $nWeekCalObj->thisMonth() . '&amp;day=' . $nWeekCalObj->thisDay(),
130
        'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_week'), $nWeekCalObj->getTimestamp()),
131
    ],
132
];
133
134
// Title of the page
135
$xoopsTpl->assign('xoops_pagetitle', $helper->getModule()->getVar('name') . ' ' . $navig['this']['name']);
136
137
// Assigning navig data to the template
138
$xoopsTpl->assign('navig', $navig);
139
140
//Display tooltip
141
$xoopsTpl->assign('showInfoBulle', $helper->getConfig('showInfoBulle'));
142
$xoopsTpl->assign('showId', $helper->getConfig('showId'));
143
144
// Assigning current form navig data to the template
145
$xoopsTpl->assign('selectedCat', $cat);
146
$xoopsTpl->assign('year', $year);
147
$xoopsTpl->assign('month', $month);
148
$xoopsTpl->assign('day', $day);
149
$xoopsTpl->assign('params', $params);
150
151
$tNavBar = getNavBarTabs($params['view']);
152
$xoopsTpl->assign('tNavBar', $tNavBar);
153
$xoopsTpl->assign('list_position', $helper->getConfig('list_position'));
154
155
// echoArray($tNavBar,true);
156
157
//mb missing for xBootstrap templates by Angelo
158
$lang = [
159
    'start'      => _MD_EXTCAL_START,
160
    'end'        => _MD_EXTCAL_END,
161
    'calmonth'   => _MD_EXTCAL_NAV_CALMONTH,
162
    'calweek'    => _MD_EXTCAL_NAV_CALWEEK,
163
    'year'       => _MD_EXTCAL_NAV_YEAR,
164
    'month'      => _MD_EXTCAL_NAV_MONTH,
165
    'week'       => _MD_EXTCAL_NAV_WEEK,
166
    'day'        => _MD_EXTCAL_NAV_DAY,
167
    'agendaweek' => _MD_EXTCAL_NAV_AGENDA_WEEK,
168
    'agendaday'  => _MD_EXTCAL_NAV_AGENDA_DAY,
169
    'search'     => _MD_EXTCAL_NAV_SEARCH,
170
    'newevent'   => _MD_EXTCAL_NAV_NEW_EVENT,
171
];
172
// Assigning language data to the template
173
$xoopsTpl->assign('lang', $lang);
174
$xoopsTpl->assign('view', 'agendaweek');
175
176
require_once XOOPS_ROOT_PATH . '/footer.php';
177