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/Templates/user/Pages.php (1 issue)

Severity
1
<?php namespace XoopsModules\Tdmcreate\Files\Templates\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: TemplatesUserPages.php 12258 2014-01-02 09:33:29Z timgno $
26
 */
27
28
/**
29
 * class Pages.
30
 */
31
class Pages extends Files\CreateFile
32
{
33
    /**
34
     *  @public function constructor
35
     *  @param null
36
     */
37
    public function __construct()
38
    {
39
        parent::__construct();
40
    }
41
42
    /**
43
     *  @static function getInstance
44
     *  @param null
45
     * @return Pages
46
     */
47
    public static function getInstance()
48
    {
49
        static $instance = false;
50
        if (!$instance) {
51
            $instance = new self();
52
        }
53
54
        return $instance;
55
    }
56
57
    /**
58
     *  @public function write
59
     *  @param string $module
60
     *  @param string $table
61
     *  @param string $filename
62
     */
63
    public function write($module, $table, $filename)
64
    {
65
        $this->setModule($module);
66
        $this->setTable($table);
67
        $this->setFileName($filename);
68
    }
69
70
    /**
71
     *  @private function getTemplatesUserPagesHeader
72
     *  @param string $moduleDirname
73
     * @return string
74
     */
75
    private function getTemplatesUserPagesHeader($moduleDirname)
76
    {
77
        $hc = Tdmcreate\Files\CreateHtmlSmartyCodes::getInstance();
78
79
        return $hc->getSmartyIncludeFile($moduleDirname, 'header') . PHP_EOL;
80
    }
81
82
    /**
83
     * @private function getTemplatesUserPagesTable
84
     * @param string $moduleDirname
85
     * @param string $tableName
86
     * @param        $tableSoleName
87
     * @param string $language
88
     * @return string
89
     */
90
    private function getTemplatesUserPagesTable($moduleDirname, $tableName, $tableSoleName, $language)
91
    {
92
        $hc = Tdmcreate\Files\CreateHtmlSmartyCodes::getInstance();
93
        $tbody = $this->getTemplatesUserPagesTableThead($tableName, $language);
94
        $tbody .= $this->getTemplatesUserPagesTableTbody($moduleDirname, $tableName, $tableSoleName, $language);
95
        $tbody .= $this->getTemplatesUserPagesTableTfoot();
96
        $single = $hc->getSmartySingleVar('table_type');
97
98
        return $hc->getHtmlTable($tbody, 'table table-' . $single) . PHP_EOL;
99
    }
100
101
    /**
102
     *  @private function getTemplatesUserPagesThead
103
     *  @param string $language
104
     * @param $tableName
105
     * @return string
106
     */
107
    private function getTemplatesUserPagesTableThead($tableName, $language)
108
    {
109
        $hc = Tdmcreate\Files\CreateHtmlSmartyCodes::getInstance();
110
        $stuTableName = mb_strtoupper($tableName);
111
        $single = $hc->getSmartySingleVar('divideby');
112
        $lang = $hc->getSmartyConst($language, $stuTableName . '_TITLE');
113
        $th = $hc->getHtmlTableHead($lang, '', $single) . PHP_EOL;
114
        $tr = $hc->getHtmlTableRow($th, 'head') . PHP_EOL;
115
116
        return $hc->getHtmlTableThead($tr) . PHP_EOL;
117
    }
118
119
    /**
120
     *  @private function getTemplatesUserPagesTbody
121
     *  @param string $moduleDirname
122
     *  @param string $language
123
     * @param $tableName
124
     * @param $tableSoleName
125
     * @return string
126
     */
127
    private function getTemplatesUserPagesTableTbody($moduleDirname, $tableName, $tableSoleName, $language)
0 ignored issues
show
The parameter $language is not used and could be removed. ( Ignorable by Annotation )

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

127
    private function getTemplatesUserPagesTableTbody($moduleDirname, $tableName, $tableSoleName, /** @scrutinizer ignore-unused */ $language)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
128
    {
129
        $hc = Tdmcreate\Files\CreateHtmlSmartyCodes::getInstance();
130
        $single = $hc->getSmartySingleVar('panel_type');
131
        $include = $hc->getSmartyIncludeFileListForeach($moduleDirname, $tableName, $tableSoleName);
132
        $div = $hc->getHtmlDiv($include, 'panel panel-' . $single);
133
        $cont = $hc->getHtmlTableData($div) . PHP_EOL;
134
        $html = $hc->getHtmlEmpty('</tr><tr>') . PHP_EOL;
135
        $cont .= $hc->getSmartyConditions($tableSoleName . '.count', ' is div by ', '$divideby', $html) . PHP_EOL;
136
        $foreach = $hc->getSmartyForeach($tableSoleName, $tableName, $cont) . PHP_EOL;
137
        $tr = $hc->getHtmlTableRow($foreach) . PHP_EOL;
138
139
        return $hc->getHtmlTableTbody($tr) . PHP_EOL;
140
    }
141
142
    /**
143
     *  @private function getTemplatesUserPagesTfoot
144
     * @param null
145
     * @return string
146
     */
147
    private function getTemplatesUserPagesTableTfoot()
148
    {
149
        $hc = Tdmcreate\Files\CreateHtmlSmartyCodes::getInstance();
150
        $td = $hc->getHtmlTableData('&nbsp;') . PHP_EOL;
151
        $tr = $hc->getHtmlTableRow($td) . PHP_EOL;
152
153
        return $hc->getHtmlTableTfoot($tr) . PHP_EOL;
154
    }
155
156
    /**
157
     *  @private function getTemplatesUserPages
158
     * @param $moduleDirname
159
     * @param $tableName
160
     * @param $tableSoleName
161
     * @param $language
162
     * @return string
163
     */
164
    private function getTemplatesUserPages($moduleDirname, $tableName, $tableSoleName, $language)
165
    {
166
        $hc = Tdmcreate\Files\CreateHtmlSmartyCodes::getInstance();
167
        $table = $this->getTemplatesUserPagesTable($moduleDirname, $tableName, $tableSoleName, $language) . PHP_EOL;
168
        $div = $hc->getHtmlDiv($table, 'table-responsive') . PHP_EOL;
169
170
        return $hc->getSmartyConditions($tableName, ' > ', '0', $div, false, true, true) . PHP_EOL;
171
    }
172
173
    /**
174
     *  @private function getTemplatesUserPagesFooter
175
     *  @param string $moduleDirname
176
     *
177
     * @return string
178
     */
179
    private function getTemplatesUserPagesFooter($moduleDirname)
180
    {
181
        $hc = Tdmcreate\Files\CreateHtmlSmartyCodes::getInstance();
182
183
        return $hc->getSmartyIncludeFile($moduleDirname, 'footer');
184
    }
185
186
    /**
187
     *  @public function render
188
     *  @param null
189
     *
190
     * @return bool|string
191
     */
192
    public function render()
193
    {
194
        $module = $this->getModule();
195
        $table = $this->getTable();
196
        $filename = $this->getFileName();
197
        $moduleDirname = $module->getVar('mod_dirname');
198
        $tableName = $table->getVar('table_name');
199
        $tableSoleName = $table->getVar('table_solename');
200
        $language = $this->getLanguage($moduleDirname, 'MA');
201
        $content = $this->getTemplatesUserPagesHeader($moduleDirname);
202
        $content .= $this->getTemplatesUserPages($moduleDirname, $tableName, $tableSoleName, $language);
203
        $content .= $this->getTemplatesUserPagesFooter($moduleDirname);
204
205
        $this->create($moduleDirname, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
206
207
        return $this->renderFile();
208
    }
209
}
210