Issues (277)

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/Log.php (3 issues)

1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Wgevents;
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
 * wgEvents module for xoops
17
 *
18
 * @copyright    2021 XOOPS Project (https://xoops.org)
19
 * @license      GPL 2.0 or later
20
 * @package      wgevents
21
 * @since        1.0.0
22
 * @min_xoops    2.5.11 Beta1
23
 * @author       Goffy - Wedega - Email:[email protected] - Website:https://xoops.wedega.com
24
 */
25
26
use XoopsModules\Wgevents;
27
28
\defined('XOOPS_ROOT_PATH') || die('Restricted access');
29
30
/**
31
 * Class Object Log
32
 */
33
class Log extends \XoopsObject
34
{
35
    /**
36
     * @var int
37
     */
38
    public $start = 0;
39
40
    /**
41
     * @var int
42
     */
43
    public $limit = 0;
44
45
    /**
46
     * Constructor
47
     *
48
     */
49
    public function __construct()
50
    {
51
        $this->initVar('id', \XOBJ_DTYPE_INT);
52
        $this->initVar('text', \XOBJ_DTYPE_TXTBOX);
53
        $this->initVar('datecreated', \XOBJ_DTYPE_INT);
54
        $this->initVar('submitter', \XOBJ_DTYPE_INT);
55
    }
56
57
    /**
58
     * @static function &getInstance
59
     *
60
     */
61
    public static function getInstance()
62
    {
63
        static $instance = false;
64
        if (!$instance) {
65
            $instance = new self();
66
        }
67
    }
68
69
    /**
70
     * The new inserted $Id
71
     * @return inserted id
72
     */
73
    public function getNewInsertedId()
74
    {
75
        return $GLOBALS['xoopsDB']->getInsertId();
76
    }
77
78
    /**
79
     * @public function getForm
80
     * @param bool $action
81
     * @return \XoopsThemeForm
82
     */
83
    public function getForm($action = false)
84
    {
85
        $helper = \XoopsModules\Wgevents\Helper::getInstance();
86
        if (!$action) {
87
            $action = $_SERVER['REQUEST_URI'];
88
        }
89
        $isAdmin = (\is_object($GLOBALS['xoopsUser']) && \is_object($GLOBALS['xoopsModule'])) ? $GLOBALS['xoopsUser']->isAdmin($GLOBALS['xoopsModule']->mid()) : false;
90
        // Title
91
        $title = $this->isNew() ? \_AM_WGEVENTS_ADD_LOG : \_AM_WGEVENTS_EDIT_LOG;
92
        // Get Theme Form
93
        \xoops_load('XoopsFormLoader');
94
        $form = new \XoopsThemeForm($title, 'form', $action, 'post', true);
95
        $form->setExtra('enctype="multipart/form-data"');
96
        // Form Text logText
97
        $form->addElement(new \XoopsFormText(\_AM_WGEVENTS_LOG_TEXT, 'text', 50, 255, $this->getVar('text')), true);
98
        // Form Text Date Select logDatecreated
99
        $logDatecreated = $this->isNew() ? \time() : $this->getVar('datecreated');
100
        $form->addElement(new \XoopsFormTextDateSelect(\_MA_WGEVENTS_DATECREATED, 'datecreated', '', $logDatecreated));
101
        // Form Select User logSubmitter
102
        $uidCurrent = \is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->uid() : 0;
103
        $logSubmitter = $this->isNew() ? $uidCurrent : $this->getVar('submitter');
104
        $form->addElement(new \XoopsFormSelectUser(\_MA_WGEVENTS_SUBMITTER, 'submitter', false, $logSubmitter));
105
        // To Save
106
        $form->addElement(new \XoopsFormHidden('op', 'save'));
107
        $form->addElement(new \XoopsFormHidden('start', $this->start));
108
        $form->addElement(new \XoopsFormHidden('limit', $this->limit));
109
        $form->addElement(new \XoopsFormButtonTray('', \_SUBMIT, 'submit', '', false));
110
        return $form;
111
    }
112
113
    /**
114
     * Get Values
115
     * @param null $keys
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $keys is correct as it would always require null to be passed?
Loading history...
116
     * @param null $format
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $format is correct as it would always require null to be passed?
Loading history...
117
     * @param null $maxDepth
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $maxDepth is correct as it would always require null to be passed?
Loading history...
118
     * @return array
119
     */
120
    public function getValuesLogs($keys = null, $format = null, $maxDepth = null)
121
    {
122
        $ret = $this->getValues($keys, $format, $maxDepth);
123
        $ret['datecreated_text'] = \formatTimestamp($this->getVar('datecreated'), 'm');
124
        $ret['submitter_text']   = \XoopsUser::getUnameFromId($this->getVar('submitter'));
125
        return $ret;
126
    }
127
128
    /**
129
     * Returns an array representation of the object
130
     *
131
     * @return array
132
     */
133
    /*
134
    public function toArray()
135
    {
136
        $ret = [];
137
        $vars = $this->getVars();
138
        foreach (\array_keys($vars) as $var) {
139
            $ret[$var] = $this->getVar($var);
140
        }
141
        return $ret;
142
    }
143
    */
144
}
145