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/Files/User/UserVisit.php (4 issues)

1
<?php
2
3
namespace XoopsModules\Tdmcreate\Files\User;
4
5
use XoopsModules\Tdmcreate;
6
use XoopsModules\Tdmcreate\Files;
7
8
/*
9
 You may not change or alter any portion of this comment or credits
10
 of supporting developers from this source code or any supporting source code
11
 which is considered copyrighted (c) material of the original comment or credit authors.
12
13
 This program is distributed in the hope that it will be useful,
14
 but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
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.0
24
 *
25
 * @author          Txmod Xoops http://www.txmodxoops.org
26
 *
27
 */
28
29
/**
30
 * Class UserVisit.
31
 */
32
class UserVisit extends Files\CreateFile
33
{
34
    /**
35
     * @var mixed
36
     */
37
    private $uxc = null;
38
39
    /**
40
     * @var string
41
     */
42
    private $xc = null;
43
	
44
	/**
45
     * @var string
46
     */
47
    private $pc = null;
48
49
    /**
50
     * @public function constructor
51
     * @param null
52
     */
53
    public function __construct()
54
    {
55
        parent::__construct();
56
        $this->xc  = Tdmcreate\Files\CreateXoopsCode::getInstance();
0 ignored issues
show
Documentation Bug introduced by
It seems like XoopsModules\Tdmcreate\F...oopsCode::getInstance() of type XoopsModules\Tdmcreate\Files\CreateXoopsCode is incompatible with the declared type string of property $xc.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
57
        $this->pc  = Tdmcreate\Files\CreatePhpCode::getInstance();
0 ignored issues
show
Documentation Bug introduced by
It seems like XoopsModules\Tdmcreate\F...ePhpCode::getInstance() of type XoopsModules\Tdmcreate\Files\CreatePhpCode is incompatible with the declared type string of property $pc.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
58
        $this->uxc = UserXoopsCode::getInstance();
59
    }
60
61
    /**
62
     * @static function getInstance
63
     * @param null
64
     * @return UserVisit
65
     */
66
    public static function getInstance()
67
    {
68
        static $instance = false;
69
        if (!$instance) {
70
            $instance = new self();
71
        }
72
73
        return $instance;
74
    }
75
76
    /**
77
     * @public function write
78
     * @param string $module
79
     * @param mixed  $table
80
     * @param string $filename
81
     */
82
    public function write($module, $table, $filename)
83
    {
84
        $this->setModule($module);
85
        $this->setTable($table);
86
        $this->setFileName($filename);
87
    }
88
89
    /**
90
     * @private function getUserVisitHeader
91
     *
92
     * @param $table
93
     *
94
     * @param $fields
95
     * @return string
96
     */
97
    private function getUserVisitHeader($table, $fields)
98
    {
99
        $pc  = Tdmcreate\Files\CreatePhpCode::getInstance();
100
        $module        = $this->getModule();
101
        $moduleDirname = $module->getVar('mod_dirname');
102
        $ret = $pc->getPhpCodeUseNamespace(['Xmf', 'Request'], '', '');
103
        $ret .= $pc->getPhpCodeUseNamespace(['XoopsModules', $moduleDirname], '', '');
104
        $ret .= $pc->getPhpCodeUseNamespace(['XoopsModules', $moduleDirname, 'Constants']);
105
        $ret .= $this->getInclude();
106
        foreach (array_keys($fields) as $f) {
107
            $fieldName = $fields[$f]->getVar('field_name');
108
            if (0 == $f) {
109
                $fieldId = $fieldName;
110
            }
111
            if (1 == $fields[$f]->getVar('field_parent')) {
112
                $fieldPid = $fieldName;
113
            }
114
        }
115
        if (1 == $table->getVar('table_category')) {
116
            $ccFieldPid = $this->getCamelCase($fieldPid, false, true);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $fieldPid does not seem to be defined for all execution paths leading up to this point.
Loading history...
117
            $ret        .= $this->xc->getXcXoopsRequest($ccFieldPid, (string)$fieldPid, '0', 'Int');
118
        }
119
        $ccFieldId = $this->getCamelCase($fieldId, false, true);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $fieldId does not seem to be defined for all execution paths leading up to this point.
Loading history...
120
        $ret       .= $this->xc->getXcXoopsRequest($ccFieldId, (string)$fieldId, '0', 'Int');
121
122
        return $ret;
123
    }
124
125
    /**
126
     * @private function getUserVisitCheckPermissions
127
     *
128
     * @param null
129
     *
130
     * @return string
131
     */
132
    private function getUserVisitCheckPermissions()
133
    {
134
        $ret = '';
135
136
        return $ret;
137
    }
138
139
    /**
140
     * @private function getUserVisitCheckLimit
141
     *
142
     * @param null
143
     *
144
     * @return string
145
     */
146
    private function getUserVisitCheckLimit()
147
    {
148
        $ret = '';
149
150
        return $ret;
151
    }
152
153
    /**
154
     * @private function getUserVisitCheckHost
155
     *
156
     * @param null
157
     *
158
     * @return string
159
     */
160
    private function getUserVisitCheckHost()
161
    {
162
        $ret = '';
163
164
        return $ret;
165
    }
166
167
    /**
168
     * @public function render
169
     * @param null
170
     * @return bool|string
171
     */
172
    public function render()
173
    {
174
        $module        = $this->getModule();
175
        $table         = $this->getTable();
176
        $filename      = $this->getFileName();
177
        $moduleDirname = $module->getVar('mod_dirname');
178
        $tableId       = $table->getVar('table_id');
179
        $tableMid      = $table->getVar('table_mid');
180
        $fields        = $this->getTableFields($tableMid, $tableId);
181
        $content       = $this->getHeaderFilesComments($module);
182
        $content       .= $this->getUserVisitHeader($table, $fields);
183
        $content       .= $this->getUserVisitCheckPermissions();
184
        $content       .= $this->getUserVisitCheckLimit();
185
        $content       .= $this->getUserVisitCheckHost();
186
187
        $this->create($moduleDirname, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
188
189
        return $this->renderFile();
190
    }
191
}
192