Issues (432)

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.

class/Configs.php (1 issue)

1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Suico;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 * @category        Module
17
 * @copyright       {@link https://xoops.org/ XOOPS Project}
18
 * @license         GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
19
 * @author          Bruno Barthez, Marcello Brandão aka  Suico, Mamba, LioMJ  <https://xoops.org>
20
 */
21
22
use Xmf\Module\Helper\Permission;
23
use XoopsDatabaseFactory;
24
use XoopsObject;
25
26
require_once XOOPS_ROOT_PATH . '/kernel/object.php';
27
28
/**
29
 * Configs class.
30
 * $this class is responsible for providing data access mechanisms to the data source
31
 * of XOOPS user class objects.
32
 */
33
class Configs extends XoopsObject
34
{
35
    public \XoopsDatabase $db;
36
    public Helper         $helper;
37
    public Permission     $permHelper;
38
    public                $config_id;
39
    public $config_uid;
40
    public $pictures;
41
    public $audio;
42
    public $videos;
43
    public $groups;
44
    public $notes;
45
    public $friends;
46
    public $profile_contact;
47
    public $profile_general;
48
    public $profile_stats;
49
    public $suspension;
50
    public $backup_password;
51
    public $backup_email;
52
    public $end_suspension;
53
    // constructor
54
55
    /**
56
     * Configs constructor.
57
     * @param null $id
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $id is correct as it would always require null to be passed?
Loading history...
58
     */
59
    public function __construct($id = null)
60
    {
61
        /** @var Helper $helper */
62
        $this->helper     = Helper::getInstance();
63
        $this->permHelper = new Permission();
64
        $this->db         = XoopsDatabaseFactory::getDatabaseConnection();
65
        $this->initVar('config_id', \XOBJ_DTYPE_INT);
66
        $this->initVar('config_uid', \XOBJ_DTYPE_INT, null, false, 10);
67
        $this->initVar('pictures', \XOBJ_DTYPE_INT, null, false, 10);
68
        $this->initVar('audio', \XOBJ_DTYPE_INT, null, false, 10);
69
        $this->initVar('videos', \XOBJ_DTYPE_INT, null, false, 10);
70
        $this->initVar('groups', \XOBJ_DTYPE_INT, null, false, 10);
71
        $this->initVar('notes', \XOBJ_DTYPE_INT, null, false, 10);
72
        $this->initVar('friends', \XOBJ_DTYPE_INT, null, false, 10);
73
        $this->initVar('profile_contact', \XOBJ_DTYPE_INT, null, false, 10);
74
        $this->initVar('profile_general', \XOBJ_DTYPE_INT, null, false, 10);
75
        $this->initVar('profile_stats', \XOBJ_DTYPE_INT, null, false, 10);
76
        $this->initVar('suspension', \XOBJ_DTYPE_INT, null, false, 10);
77
        $this->initVar('backup_password', \XOBJ_DTYPE_TXTBOX, null, false);
78
        $this->initVar('backup_email', \XOBJ_DTYPE_TXTBOX, null, false);
79
        $this->initVar('end_suspension', \XOBJ_DTYPE_INT, 0, false);
80
        if (!empty($id)) {
81
            if (\is_array($id)) {
82
                $this->assignVars($id);
83
            } else {
84
                $this->load((int)$id);
85
            }
86
        } else {
87
            $this->setNew();
88
        }
89
    }
90
91
    /**
92
     * @param $id
93
     */
94
    public function load($id): void
95
    {
96
        $sql   = 'SELECT * FROM ' . $this->db->prefix('suico_configs') . ' WHERE config_id=' . $id;
97
        $myrow = $this->db->fetchArray($this->db->query($sql));
98
        $this->assignVars($myrow);
99
        if (!$myrow) {
100
            $this->setNew();
101
        }
102
    }
103
104
    /**
105
     * @param array  $criteria
106
     * @param bool   $asobject
107
     * @param string $sort
108
     * @param string $order
109
     * @param int    $limit
110
     * @param int    $start
111
     * @return array
112
     */
113
    public function getAllConfigs(
114
        $criteria = [],
115
        $asobject = false,
116
        $sort = 'config_id',
117
        $order = 'ASC',
118
        $limit = 0,
119
        $start = 0
120
    ) {
121
        $db         = XoopsDatabaseFactory::getDatabaseConnection();
122
        $ret        = [];
123
        $whereQuery = '';
124
        if (\is_array($criteria) && \count($criteria) > 0) {
125
            $whereQuery = ' WHERE';
126
            foreach ($criteria as $c) {
127
                $whereQuery .= " {$c} AND";
128
            }
129
            $whereQuery = mb_substr($whereQuery, 0, -4);
130
        } elseif (!\is_array($criteria) && $criteria) {
131
            $whereQuery = ' WHERE ' . $criteria;
132
        }
133
        if ($asobject) {
134
            $sql    = 'SELECT * FROM ' . $db->prefix('suico_configs') . "{$whereQuery} ORDER BY {$sort} {$order}";
135
            $result = $db->query($sql, $limit, $start);
136
            while (false !== ($myrow = $db->fetchArray($result))) {
137
                $ret[] = new self($myrow);
138
            }
139
        } else {
140
            $sql    = 'SELECT config_id FROM ' . $db->prefix(
141
                    'suico_configs'
142
                ) . "{$whereQuery} ORDER BY {$sort} {$order}";
143
            $result = $db->query($sql, $limit, $start);
144
            while (false !== ($myrow = $db->fetchArray($result))) {
145
                $ret[] = $myrow['suico_configs_id'];
146
            }
147
        }
148
149
        return $ret;
150
    }
151
152
    /**
153
     * Get form
154
     *
155
     * @return \XoopsModules\Suico\Form\ConfigsForm
156
     */
157
    public function getForm()
158
    {
159
        return new Form\ConfigsForm($this);
160
    }
161
162
    /**
163
     * @return array|null
164
     */
165
    public function getGroupsRead()
166
    {
167
        //$permHelper = new \Xmf\Module\Helper\Permission();
168
        return $this->permHelper->getGroupsForItem(
169
            'sbcolumns_read',
170
            $this->getVar('config_id')
171
        );
172
    }
173
174
    /**
175
     * @return array|null
176
     */
177
    public function getGroupsSubmit()
178
    {
179
        //$permHelper = new \Xmf\Module\Helper\Permission();
180
        return $this->permHelper->getGroupsForItem(
181
            'sbcolumns_submit',
182
            $this->getVar('config_id')
183
        );
184
    }
185
186
    /**
187
     * @return array|null
188
     */
189
    public function getGroupsModeration()
190
    {
191
        //$permHelper = new \Xmf\Module\Helper\Permission();
192
        return $this->permHelper->getGroupsForItem(
193
            'sbcolumns_moderation',
194
            $this->getVar('config_id')
195
        );
196
    }
197
}
198