Issues (21)

Security Analysis    not enabled

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

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

admin/slides.php (4 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
 * presenter module for xoops
13
 *
14
 * @copyright       XOOPS Project (https://xoops.org)
15
 * @license         GPL 2.0 or later
16
 * @package         presenter
17
 * @since           2.5.5
18
 * @author          XOOPS Development Team <[email protected]> - <https://xoops.org>
19
 */
20
require_once __DIR__ . '/admin_header.php';
21
xoops_cp_header();
22
23
//It recovered the value of argument op in URL$
24
$op = presenter_CleanVars($_REQUEST, 'op', 'list', 'string');
25
$adminObject->displayNavigation(basename(__FILE__));
26
switch ($op) {
27
    case 'list':
28
    default:
29
        $adminObject->addItemButton(_AM_PRESENTER_ADD_SLIDES, 'slides.php?op=new', 'add');
30
        $adminObject->displayButton('left');
31
        $criteria = new CriteriaCompo();
32
        $criteria->setSort('slides_id ASC, slides_id');
33
        $criteria->setOrder('ASC');
34
        $numrows    = $slidesHandler->getCount();
35
        $slides_arr = $slidesHandler->getAll($criteria);
36
37
        // Table view
38
        if ($numrows > 0) {
39
            echo "<table width='100%' cellspacing='1' class='outer'>
40
                    <tr>
41
                        <th class='center'>" . _AM_PRESENTER_SLIDES_CID . "</th>
42
                        <th class='center'>" . _AM_PRESENTER_SLIDES_UID . "</th>
43
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TITLE . "</th>
44
                        <th class='center'>" . _AM_PRESENTER_SLIDES_CONTENT . "</th>
45
46
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TITLE . "</th>
47
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TITLE . "</th>
48
49
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TRANSITION_X . "</th>
50
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TRANSITION_Y . "</th>
51
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TRANSITION_Z . "</th>
52
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ROTATION_X . "</th>
53
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ROTATION_Y . "</th>
54
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ROTATION_Z . "</th>
55
                        <th class='center'>" . _AM_PRESENTER_SLIDES_SCALE_X . "</th>
56
                        <th class='center'>" . _AM_PRESENTER_SLIDES_SCALE_Y . "</th>
57
                        <th class='center'>" . _AM_PRESENTER_SLIDES_SCALE_Z . "</th>
58
                        <th class='center'>" . _AM_PRESENTER_SLIDES_CREATED . "</th>
59
                        <th class='center'>" . _AM_PRESENTER_SLIDES_PUBLISHED . "</th>
60
                        <th class='center'>" . _AM_PRESENTER_SLIDES_POSITION . "</th>
61
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ONLINE . "</th>
62
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TYPE . "</th>
63
                        <th class='center'>" . _AM_PRESENTER_SLIDES_NOTES . "</th>
64
                        <th class='center'>" . _AM_PRESENTER_SLIDES_MP3 . "</th>
65
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TIME . "</th>
66
                        <th class='center'>" . _AM_PRESENTER_SLIDES_STATUS . "</th>
67
                        <th class='center'>" . _AM_PRESENTER_SLIDES_WAITING . "</th>
68
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ONLINE . "</th>
69
                        <th class='center width5'>" . _AM_PRESENTER_FORMACTION . '</th>
70
                    </tr>';
71
72
            $class = 'odd';
73
74
            foreach (array_keys($slides_arr) as $i) {
75
                echo "<tr class='" . $class . "'>";
76
                $class = ('even' === $class) ? 'odd' : 'even';
77
                echo "<td class='center'>" . strip_tags($slides_arr[$i]->getVar('slides_cid')) . '</td>';
78
                echo "<td class='center'>" . strip_tags($slides_arr[$i]->getVar('slides_uid')) . '</td>';
79
                echo "<td class='left'>" . $slides_arr[$i]->getVar('slides_title') . '</td>';
80
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_content') . '</td>';
81
82
                echo "<td class='left'>" . $slides_arr[$i]->getVar('css_id') . '</td>';
83
                echo "<td class='left'>" . $slides_arr[$i]->getVar('css_class') . '</td>';
84
85
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_transition_x') . '</td>';
86
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_transition_y') . '</td>';
87
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_transition_z') . '</td>';
88
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_rotation_x') . '</td>';
89
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_rotation_y') . '</td>';
90
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_rotation_z') . '</td>';
91
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_scale_x') . '</td>';
92
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_scale_y') . '</td>';
93
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_scale_z') . '</td>';
94
                echo "<td class='center'>" . formatTimestamp($slides_arr[$i]->getVar('slides_created'), 'S') . '</td>';
95
                echo "<td class='center'>" . formatTimestamp($slides_arr[$i]->getVar('slides_published'), 'S') . '</td>';
96
                echo "<td class='center'>" . strip_tags($slides_arr[$i]->getVar('slides_position')) . '</td>';
97
                echo "<td class='center'>" . ((1 == $slides_arr[$i]->getVar('slides_online')) ? _YES : _NO) . '</td>';
98
                echo "<td class='center'>" . strip_tags($slides_arr[$i]->getVar('slides_type')) . '</td>';
99
                echo "<td class='center'>" . strip_tags($slides_arr[$i]->getVar('slides_notes')) . '</td>';
100
                echo "<td class='center'>" . $slides_arr[$i]->getVar('slides_mp3') . '</td>';
101
                echo "<td class='center'>" . strip_tags($slides_arr[$i]->getVar('slides_time')) . '</td>';
102
                echo "<td class='center'>" . ((1 == $slides_arr[$i]->getVar('slides_status')) ? _YES : _NO) . '</td>';
103
                echo "<td class='center'>" . ((1 == $slides_arr[$i]->getVar('slides_waiting')) ? _YES : _NO) . '</td>';
104
                echo "<td class='center'>" . ((1 == $slides_arr[$i]->getVar('slides_online')) ? _YES : _NO) . '</td>';
105
106
                echo "<td class='center width5'>
107
                    <a href='slides.php?op=edit&slides_id=" . $i . "'><img src=" . $pathIcon16 . "/edit.png alt='" . _EDIT . "' title='" . _EDIT . "'></a>
108
                    <a href='slides.php?op=delete&slides_id=" . $i . "'><img src=" . $pathIcon16 . "/delete.png alt='" . _DELETE . "' title='" . _DELETE . "'></a>
109
                    </td>";
110
                echo '</tr>';
111
            }
112
            echo '</table><br><br>';
113
        } else {
114
            echo "<table width='100%' cellspacing='1' class='outer'>
115
                    <tr>
116
                        <th class='center'>" . _AM_PRESENTER_SLIDES_CID . "</th>
117
                        <th class='center'>" . _AM_PRESENTER_SLIDES_UID . "</th>
118
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TITLE . "</th>
119
                        <th class='center'>" . _AM_PRESENTER_SLIDES_CONTENT . "</th>
120
121
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TITLE . "</th>
122
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TITLE . "</th>
123
124
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TRANSITION_X . "</th>
125
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TRANSITION_Y . "</th>
126
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TRANSITION_Z . "</th>
127
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ROTATION_X . "</th>
128
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ROTATION_Y . "</th>
129
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ROTATION_Z . "</th>
130
                        <th class='center'>" . _AM_PRESENTER_SLIDES_SCALE_X . "</th>
131
                        <th class='center'>" . _AM_PRESENTER_SLIDES_SCALE_Y . "</th>
132
                        <th class='center'>" . _AM_PRESENTER_SLIDES_SCALE_Z . "</th>
133
                        <th class='center'>" . _AM_PRESENTER_SLIDES_CREATED . "</th>
134
                        <th class='center'>" . _AM_PRESENTER_SLIDES_PUBLISHED . "</th>
135
                        <th class='center'>" . _AM_PRESENTER_SLIDES_POSITION . "</th>
136
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ONLINE . "</th>
137
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TYPE . "</th>
138
                        <th class='center'>" . _AM_PRESENTER_SLIDES_NOTES . "</th>
139
                        <th class='center'>" . _AM_PRESENTER_SLIDES_MP3 . "</th>
140
                        <th class='center'>" . _AM_PRESENTER_SLIDES_TIME . "</th>
141
                        <th class='center'>" . _AM_PRESENTER_SLIDES_STATUS . "</th>
142
                        <th class='center'>" . _AM_PRESENTER_SLIDES_WAITING . "</th>
143
                        <th class='center'>" . _AM_PRESENTER_SLIDES_ONLINE . "</th>
144
                        <th class='center width5'>" . _AM_PRESENTER_FORMACTION . "</th>
145
                    </tr><tr><td class='errorMsg' colspan='25'>There are no slides</td></tr>";
146
            echo '</table><br><br>';
147
        }
148
149
        break;
150
151 View Code Duplication
    case 'new':
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...
152
        $adminObject->addItemButton(_AM_PRESENTER_SLIDES_LIST, 'slides.php', 'list');
153
        $adminObject->displayButton('left');
154
155
        $obj  = $slidesHandler->create();
156
        $form = $obj->getForm();
157
        $form->display();
158
        break;
159
160
    case 'save':
161
        if (!$GLOBALS['xoopsSecurity']->check()) {
162
            redirect_header('slides.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
163
        }
164
        if (isset($_REQUEST['slides_id'])) {
165
            $obj = $slidesHandler->get($_REQUEST['slides_id']);
166
        } else {
167
            $obj = $slidesHandler->create();
168
        }
169
170
        // Form save fields
171
        $obj->setVar('slides_cid', $_REQUEST['slides_cid']);
172
        $obj->setVar('slides_uid', $_REQUEST['slides_uid']);
173
        $obj->setVar('slides_title', $_REQUEST['slides_title']);
174
        $obj->setVar('slides_content', $_REQUEST['slides_content']);
175
176
        $obj->setVar('css_id', $_REQUEST['css_id']);
177
        $obj->setVar('css_class', $_REQUEST['css_class']);
178
179
        $obj->setVar('slides_transition_x', $_REQUEST['slides_transition_x']);
180
        $obj->setVar('slides_transition_y', $_REQUEST['slides_transition_y']);
181
        $obj->setVar('slides_transition_z', $_REQUEST['slides_transition_z']);
182
        $obj->setVar('slides_rotation_x', $_REQUEST['slides_rotation_x']);
183
        $obj->setVar('slides_rotation_y', $_REQUEST['slides_rotation_y']);
184
        $obj->setVar('slides_rotation_z', $_REQUEST['slides_rotation_z']);
185
        $obj->setVar('slides_scale_x', $_REQUEST['slides_scale_x']);
186
        $obj->setVar('slides_scale_y', $_REQUEST['slides_scale_y']);
187
        $obj->setVar('slides_scale_z', $_REQUEST['slides_scale_z']);
188
        $obj->setVar('slides_created', strtotime($_REQUEST['slides_created']));
189
        $obj->setVar('slides_published', strtotime($_REQUEST['slides_published']));
190
        $obj->setVar('slides_position', $_REQUEST['slides_position']);
191
        $obj->setVar('slides_online', ((1 == $_REQUEST['slides_online']) ? '1' : '0'));
192
        $obj->setVar('slides_type', $_REQUEST['slides_type']);
193
        $obj->setVar('slides_notes', $_REQUEST['slides_notes']);
194
        require_once XOOPS_ROOT_PATH . '/class/uploader.php';
195
        $uploaddir = XOOPS_UPLOAD_PATH . '/presenter/files/slides/';
196
        $uploader  = new XoopsMediaUploader($uploaddir, $GLOBALS['xoopsModuleConfig']['mimetypes'], $GLOBALS['xoopsModuleConfig']['maxsize'], null, null);
197
        if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
198
            $uploader->setPrefix('slides_mp3_');
199
            $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
200 View Code Duplication
            if (!$uploader->upload()) {
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...
201
                $errors = $uploader->getErrors();
202
                redirect_header('javascript:history.go(-1)', 3, $errors);
203
            } else {
204
                $obj->setVar('slides_mp3', $uploader->getSavedFileName());
205
            }
206
        }
207
208
        $obj->setVar('slides_time', $_REQUEST['slides_time']);
209
        $obj->setVar('slides_status', ((1 == $_REQUEST['slides_status']) ? '1' : '0'));
210
        $obj->setVar('slides_waiting', ((1 == $_REQUEST['slides_waiting']) ? '1' : '0'));
211
        $obj->setVar('slides_online', ((1 == $_REQUEST['slides_online']) ? '1' : '0'));
212
213
        if ($slidesHandler->insert($obj)) {
214
            redirect_header('slides.php?op=list', 2, _AM_PRESENTER_FORMOK);
215
        }
216
217
        echo $obj->getHtmlErrors();
218
        $form =& $obj->getForm();
219
        $form->display();
220
        break;
221
222 View Code Duplication
    case 'edit':
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...
223
        $adminObject->addItemButton(_AM_PRESENTER_ADD_SLIDES, 'slides.php?op=new', 'add');
224
        $adminObject->addItemButton(_AM_PRESENTER_SLIDES_LIST, 'slides.php', 'list');
225
        $adminObject->displayButton('left');
226
        $obj  = $slidesHandler->get($_REQUEST['slides_id']);
227
        $form = $obj->getForm();
228
        $form->display();
229
        break;
230
231 View Code Duplication
    case 'delete':
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...
232
        $obj = $slidesHandler->get($_REQUEST['slides_id']);
233
        if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
234
            if (!$GLOBALS['xoopsSecurity']->check()) {
235
                redirect_header('slides.php', 3, implode(', ', $GLOBALS['xoopsSecurity']->getErrors()));
236
            }
237
            if ($slidesHandler->delete($obj)) {
238
                redirect_header('slides.php', 3, _AM_PRESENTER_FORMDELOK);
239
            } else {
240
                echo $obj->getHtmlErrors();
241
            }
242
        } else {
243
            xoops_confirm(['ok' => 1, 'slides_id' => $_REQUEST['slides_id'], 'op' => 'delete'], $_SERVER['REQUEST_URI'], sprintf(_AM_PRESENTER_FORMSUREDEL, $obj->getVar('slides_id')));
244
        }
245
        break;
246
}
247
require_once __DIR__ . '/admin_footer.php';
248