Issues (964)

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/TablesHandler.php (1 issue)

1
<?php
2
3
namespace XoopsModules\Tdmcreate;
4
5
use XoopsModules\Tdmcreate;
6
7
/*
8
 You may not change or alter any portion of this comment or credits
9
 of supporting developers from this source code or any supporting source code
10
 which is considered copyrighted (c) material of the original comment or credit authors.
11
12
 This program is distributed in the hope that it will be useful,
13
 but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
 */
16
17
/**
18
 * tdmcreate module.
19
 *
20
 * @copyright       XOOPS Project (https://xoops.org)
21
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
22
 *
23
 * @since           2.5.7
24
 *
25
 * @author          Txmod Xoops <[email protected]> - <http://www.txmodxoops.org/>
26
 *
27
 */
28
29
// include __DIR__ . '/autoload.php';
30
31
/**
32
 * @Class TablesHandler
33
 * @extends \XoopsPersistableObjectHandler
34
 */
35
class TablesHandler extends \XoopsPersistableObjectHandler
36
{
37
    /**
38
     * @public function constructor class
39
     *
40
     * @param null|\XoopsDatabase|\XoopsMySQLDatabase $db
41
     */
42
    public function __construct(\XoopsDatabase $db)
43
    {
44
        parent::__construct($db, 'tdmcreate_tables', Tables::class, 'table_id', 'table_name');
45
    }
46
47
    /**
48
     * @param bool $isNew
49
     *
50
     * @return object
51
     */
52
    public function create($isNew = true)
53
    {
54
        return parent::create($isNew);
55
    }
56
57
    /**
58
     * retrieve a field.
59
     *
60
     * @param int  $i field id
61
     * @param null $fields
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $fields is correct as it would always require null to be passed?
Loading history...
62
     *
63
     * @return mixed reference to the <a href='psi_element://Fields'>Fields</a> object
64
     *               object
65
     */
66
    public function get($i = null, $fields = null)
67
    {
68
        return parent::get($i, $fields);
69
    }
70
71
    /**
72
     * get inserted id.
73
     *
74
     * @param null
75
     *
76
     * @return int reference to the {@link Tables} object
77
     */
78
    public function getInsertId()
79
    {
80
        return $this->db->getInsertId();
81
    }
82
83
    /**
84
     * Get Count Modules.
85
     *
86
     * @param int    $start
87
     * @param int    $limit
88
     * @param string $sort
89
     * @param string $order
90
     *
91
     * @return int
92
     */
93
    public function getCountTables($start = 0, $limit = 0, $sort = 'table_id ASC, table_name', $order = 'ASC')
94
    {
95
        $crCountTables = new \CriteriaCompo();
96
        $crCountTables = $this->getTablesCriteria($crCountTables, $start, $limit, $sort, $order);
97
98
        return $this->getCount($crCountTables);
99
    }
100
101
    /**
102
     * Get All Modules.
103
     *
104
     * @param int    $start
105
     * @param int    $limit
106
     * @param string $sort
107
     * @param string $order
108
     *
109
     * @return array
110
     */
111
    public function getAllTables($start = 0, $limit = 0, $sort = 'table_id ASC, table_name', $order = 'ASC')
112
    {
113
        $crAllTables = new \CriteriaCompo();
114
        $crAllTables = $this->getTablesCriteria($crAllTables, $start, $limit, $sort, $order);
115
116
        return $this->getAll($crAllTables);
117
    }
118
119
    /**
120
     * Get All Tables By Module Id.
121
     *
122
     * @param        $modId
123
     * @param int    $start
124
     * @param int    $limit
125
     * @param string $sort
126
     * @param string $order
127
     *
128
     * @return array
129
     */
130
    public function getAllTablesByModuleId($modId, $start = 0, $limit = 0, $sort = 'table_order ASC, table_id, table_name', $order = 'ASC')
131
    {
132
        $crAllTablesByModuleId = new \CriteriaCompo();
133
        $crAllTablesByModuleId->add(new \Criteria('table_mid', $modId));
134
        $crAllTablesByModuleId = $this->getTablesCriteria($crAllTablesByModuleId, $start, $limit, $sort, $order);
135
136
        return $this->getAll($crAllTablesByModuleId);
137
    }
138
139
    /**
140
     * Get Tables Criteria.
141
     *
142
     * @param $crTables
143
     * @param $start
144
     * @param $limit
145
     * @param $sort
146
     * @param $order
147
     *
148
     * @return mixed
149
     */
150
    private function getTablesCriteria($crTables, $start, $limit, $sort, $order)
151
    {
152
        $crTables->setStart($start);
153
        $crTables->setLimit($limit);
154
        $crTables->setSort($sort);
155
        $crTables->setOrder($order);
156
157
        return $crTables;
158
    }
159
}
160