Issues (519)

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 (7 issues)

1
<?php namespace XoopsModules\Tdmcreate\Files\User;
2
3
use XoopsModules\Tdmcreate;
4
use XoopsModules\Tdmcreate\Files;
5
6
/*
7
 You may not change or alter any portion of this comment or credits
8
 of supporting developers from this source code or any supporting source code
9
 which is considered copyrighted (c) material of the original comment or credit authors.
10
11
 This program is distributed in the hope that it will be useful,
12
 but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 */
15
/**
16
 * tdmcreate module.
17
 *
18
 * @copyright       XOOPS Project (https://xoops.org)
19
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
20
 *
21
 * @since           2.5.0
22
 *
23
 * @author          Txmod Xoops http://www.txmodxoops.org
24
 *
25
 * @version         $Id: UserVisit.php 12258 2014-01-02 09:33:29Z timgno \$
26
 */
27
28
/**
29
 * Class UserVisit.
30
 */
31
class UserVisit extends Files\CreateFile
32
{
33
    /**
34
    * @var mixed
35
    */
36
    private $uc = null;
37
38
    /**
39
    * @var string
40
    */
41
    private $xc = null;
42
43
    /**
44
    *  @public function constructor
45
    *  @param null
46
    */
47
48
    public function __construct()
49
    {
50
        parent::__construct();
51
        $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...
52
        $this->phpcode = 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 $phpcode.

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...
53
        $this->uc = UserXoopsCode::getInstance();
54
    }
55
56
    /**
57
    *  @static function getInstance
58
    *  @param null
59
     * @return UserVisit
60
     */
61
    public static function getInstance()
62
    {
63
        static $instance = false;
64
        if (!$instance) {
65
            $instance = new self();
66
        }
67
68
        return $instance;
69
    }
70
71
    /**
72
    *  @public function write
73
    *  @param string $module
74
    *  @param mixed $table
75
    *  @param string $filename
76
     */
77
    public function write($module, $table, $filename)
78
    {
79
        $this->setModule($module);
80
        $this->setTable($table);
81
        $this->setFileName($filename);
82
    }
83
84
    /**
85
     * @private function getUserVisitHeader
86
     *
87
     * @param $table
88
     *
89
     * @param $fields
90
     * @return string
91
     */
92
    private function getUserVisitHeader($table, $fields)
93
    {
94
        $ret = $this->getInclude();
95
        foreach (array_keys($fields) as $f) {
96
            $fieldName = $fields[$f]->getVar('field_name');
97
            if (0 == $f) {
98
                $fieldId = $fieldName;
99
            }
100
            if (1 == $fields[$f]->getVar('field_parent')) {
101
                $fieldPid = $fieldName;
102
            }
103
        }
104
        if (1 == $table->getVar('table_category')) {
105
            $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...
106
            $ret .= $this->xc->getXcXoopsRequest($ccFieldPid, (string)$fieldPid, '0', 'Int');
107
        }
108
        $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...
109
        $ret .= $this->xc->getXcXoopsRequest($ccFieldId, (string)$fieldId, '0', 'Int');
110
111
        return $ret;
112
    }
113
114
    /**
115
     * @private function getUserVisitCheckPermissions
116
     *
117
     * @param null
118
     *
119
     * @return string
120
     */
121
    private function getUserVisitCheckPermissions()
122
    {
123
        $ret = '';
124
125
        return $ret;
126
    }
127
128
    /**
129
     * @private function getUserVisitCheckLimit
130
     *
131
     * @param null
132
     *
133
     * @return string
134
     */
135
    private function getUserVisitCheckLimit()
136
    {
137
        $ret = '';
138
139
        return $ret;
140
    }
141
142
    /**
143
     * @private function getUserVisitCheckHost
144
     *
145
     * @param null
146
     *
147
     * @return string
148
     */
149
    private function getUserVisitCheckHost()
150
    {
151
        $ret = '';
152
153
        return $ret;
154
    }
155
156
    /**
157
    *  @public function render
158
    *  @param null
159
     * @return bool|string
160
     */
161
    public function render()
162
    {
163
        $module = $this->getModule();
164
        $table = $this->getTable();
165
        $filename = $this->getFileName();
166
        $moduleDirname = $module->getVar('mod_dirname');
167
        $tableId = $table->getVar('table_id');
168
        $tableMid = $table->getVar('table_mid');
169
        $tableName = $table->getVar('table_name');
0 ignored issues
show
The assignment to $tableName is dead and can be removed.
Loading history...
170
        $tableSoleName = $table->getVar('table_solename');
0 ignored issues
show
The assignment to $tableSoleName is dead and can be removed.
Loading history...
171
        $fields = $this->getTableFields($tableMid, $tableId);
172
        $language = $this->getLanguage($moduleDirname, 'MA');
0 ignored issues
show
The assignment to $language is dead and can be removed.
Loading history...
173
        $content = $this->getHeaderFilesComments($module, $filename);
174
        $content .= $this->getUserVisitHeader($table, $fields);
175
        $content .= $this->getUserVisitCheckPermissions();
176
        $content .= $this->getUserVisitCheckLimit();
177
        $content .= $this->getUserVisitCheckHost();
178
179
        $this->create($moduleDirname, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
180
181
        return $this->renderFile();
182
    }
183
}
184