Issues (222)

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.

admin/links.php (14 issues)

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       XOOPS Project (https://xoops.org)
14
 * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
15
 * @package         Mymenus
16
 * @since           1.0
17
 * @author          trabis <[email protected]>, bleekk <[email protected]>
18
 */
19
20
use Xmf\Request;
0 ignored issues
show
The type Xmf\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
use XoopsModules\Mymenus;
22
23
require __DIR__   . '/admin_header.php';
24
25
$currentFile = basename(__FILE__);
26
27
$mymenusTpl       = new \XoopsTpl(); // will be removed???
0 ignored issues
show
The type XoopsTpl was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
28
$mymenusAdminPage = 'links.php'; // will be removed???
29
30
$menusCriteria = new \CriteriaCompo();
0 ignored issues
show
The type CriteriaCompo was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
31
$menusCriteria->setSort('id');
32
$menusCriteria->setOrder('ASC');
33
$menusList = $helper->getHandler('Menus')->getList($menusCriteria);
34
if (!$menusList) {
35
    redirect_header('menus.php', 1, _AM_MYMENUS_MSG_NOMENUS);
0 ignored issues
show
The function redirect_header was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

35
    /** @scrutinizer ignore-call */ 
36
    redirect_header('menus.php', 1, _AM_MYMENUS_MSG_NOMENUS);
Loading history...
36
}
37
38
$valid_menu_ids = array_keys($menusList);
39
$mid            = Request::getInt('mid', Request::getInt('mid', '', 'POST'), 'GET');
40
if ($mid && in_array($mid, $valid_menu_ids)) {
41
    $menuTitle = $menusList[$mid];
42
} else {
43
    $keys      = array_keys($menusList);
44
    $mid       = $valid_menu_ids[0]; //force menu id to first valid menu id in the list
45
    $menuTitle = $menusList[$mid]; // and get it's title
46
}
47
$mymenusTpl->assign('mid', $mid);
48
$mymenusTpl->assign('menuTitle', $menuTitle);
49
$mymenusTpl->assign('menus_list', $menusList);
50
51
$id      = Request::getInt('id', 0);
52
$pid     = Request::getInt('pid', 0);
53
$start   = Request::getInt('start', 0);
54
$weight  = Request::getInt('weight', 0);
55
$visible = Request::getInt('visible', 0);
56
57
$op = Request::getString('op', 'list');
58
switch ($op) {
59
60
/*
61
        case 'form':
62
            xoops_cp_header();
63
            $adminObject  = \Xmf\Module\Admin::getInstance();
64
            $adminObject->displayNavigation($currentFile);
65
            //
66
            echo editLink(null, $pid, $mid);
67
            //
68
            require __DIR__   . '/admin_footer.php';
69
            break;
70
*/
71
72
    case 'edit':
73
        echo Mymenus\LinksUtility::editLink($id, null, $mid);
74
        break;
75
76
    case 'add':
77
        Mymenus\LinksUtility::addLink($mid);
78
        break;
79
80
    case 'save':
81
        Mymenus\LinksUtility::saveLink($id, $mid);
82
        break;
83
84
    case 'delete':
85
        $id       = Request::getInt('id', null);
86
        $linksObj = $helper->getHandler('Links')->get($id);
87
        if (true === Request::getBool('ok', false, 'POST')) {
88
            if (!$GLOBALS['xoopsSecurity']->check()) {
89
                redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
90
            }
91
            //get sub item
92
            $linksCriteria = new \CriteriaCompo();
93
            $linksCriteria->add(new \Criteria('id', $id));
0 ignored issues
show
The type Criteria was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
94
            $linksCriteria->add(new \Criteria('pid', $id), 'OR');
95
            //first delete links level 2
96
            $query  = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('mymenus_links');
97
            $query  .= ' WHERE pid = (SELECT id FROM (SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('mymenus_links') . " WHERE pid = {$id}) AS sec);";
98
            $result = $GLOBALS['xoopsDB']->queryF($query);
99
            //delete links level 0 and 1
100
            if (!$helper->getHandler('Links')->deleteAll($linksCriteria)) {
101
                xoops_cp_header();
0 ignored issues
show
The function xoops_cp_header was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

101
                /** @scrutinizer ignore-call */ 
102
                xoops_cp_header();
Loading history...
102
                xoops_error(_AM_MYMENUS_MSG_ERROR, $linksObj->getVar('id'));
0 ignored issues
show
The function xoops_error was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

102
                /** @scrutinizer ignore-call */ 
103
                xoops_error(_AM_MYMENUS_MSG_ERROR, $linksObj->getVar('id'));
Loading history...
103
                xoops_cp_footer();
0 ignored issues
show
The function xoops_cp_footer was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

103
                /** @scrutinizer ignore-call */ 
104
                xoops_cp_footer();
Loading history...
104
                exit();
105
            }
106
            redirect_header($currentFile, 3, _AM_MYMENUS_MSG_DELETE_LINK_SUCCESS);
107
        } else {
108
            xoops_cp_header();
109
            xoops_confirm(['ok' => true, 'id' => $id, 'op' => 'delete'], //                $_SERVER['REQUEST_URI'],
0 ignored issues
show
The function xoops_confirm was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

109
            /** @scrutinizer ignore-call */ 
110
            xoops_confirm(['ok' => true, 'id' => $id, 'op' => 'delete'], //                $_SERVER['REQUEST_URI'],
Loading history...
110
                          Request::getString('REQUEST_URI', '', 'SERVER'), sprintf(_AM_MYMENUS_LINKS_SUREDEL, $linksObj->getVar('title')));
111
            require __DIR__   . '/admin_footer.php';
112
        }
113
        break;
114
115
    case 'move':
116
        xoops_cp_header();
117
        $adminObject = \Xmf\Module\Admin::getInstance();
0 ignored issues
show
The type Xmf\Module\Admin was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
118
        $adminObject->displayNavigation($currentFile);
119
        //
120
        Mymenus\LinksUtility::moveLink($id, $weight);
121
        echo Mymenus\LinksUtility::listLinks($start, $mid);
122
        //
123
        require __DIR__   . '/admin_footer.php';
124
        break;
125
126
    case 'toggle':
127
        Mymenus\LinksUtility::toggleLinkVisibility($id, $visible);
128
        break;
129
130
    case 'order':
131
        $test  = [];
132
        $order = Request::getString('mod', '', 'POST');
133
        parse_str($order, $test);
134
        $i = 1;
135
        foreach ($test['mod'] as $order => $value) {
136
            $linksObj = $helper->getHandler('Links')->get($order);
137
            $linksObj->setVar('weight', ++$i);
138
            // Set submenu
139
            if (isset($value)) {
140
                $linksObj->setVar('pid', $value);
141
            } else {
142
                $linksObj->setVar('pid', 0);
143
            }
144
            $helper->getHandler('Links')->insert($linksObj);
145
            $helper->getHandler('Links')->updateWeights($linksObj);
146
        }
147
        break;
148
149
    case 'list':
150
    default:
151
        xoops_cp_header();
152
        $adminObject = \Xmf\Module\Admin::getInstance();
153
        $adminObject->displayNavigation($currentFile);
154
        // Add module stylesheet
155
        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/system/css/ui/' . xoops_getModuleOption('jquery_theme', 'system') . '/ui.all.css');
0 ignored issues
show
The constant XOOPS_URL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The function xoops_getModuleOption was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

155
        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/system/css/ui/' . /** @scrutinizer ignore-call */ xoops_getModuleOption('jquery_theme', 'system') . '/ui.all.css');
Loading history...
156
        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . "/modules/{$helper->getDirname()}/assets/css/admin.css");
157
        $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/Frameworks/moduleclasses/moduleadmin/css/admin.css');
158
        // Define scripts
159
        $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
160
        $GLOBALS['xoTheme']->addScript(XOOPS_URL . "/modules/{$helper->getDirname()}/assets/js/nestedSortable.js");
161
        //$GLOBALS['xoTheme']->addScript(XOOPS_URL . '/modules/{$mymenus->dirname}/assets/js/switchButton.js');
162
        $GLOBALS['xoTheme']->addScript(XOOPS_URL . "/modules/{$helper->getDirname()}/assets/js/links.js");
163
        echo Mymenus\LinksUtility::listLinks($start, $mid);
164
        // Disable xoops debugger in dialog window
165
//        require $GLOBALS['xoops']->path('/class/logger/xoopslogger.php');
166
        xoops_load('xoopslogger');
0 ignored issues
show
The function xoops_load was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

166
        /** @scrutinizer ignore-call */ 
167
        xoops_load('xoopslogger');
Loading history...
167
        $xoopsLogger            = XoopsLogger::getInstance();
0 ignored issues
show
The type XoopsLogger was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
168
        $xoopsLogger->activated = true;
169
        error_reporting(-1);
170
        //
171
        require __DIR__   . '/admin_footer.php';
172
        break;
173
}
174