Issues (733)

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

Labels
1
<?php
2
3
namespace XoopsModules\Extcal;
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
 * @copyright    {@link https://xoops.org/ XOOPS Project}
17
 * @license      {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
18
 * @package      extcal
19
 * @since
20
 * @author       XOOPS Development Team,
21
 */
22
23
use XoopsModules\Extcal\{Helper
0 ignored issues
show
This use statement conflicts with another class in this namespace, XoopsModules\Extcal\Helper. Consider defining an alias.

Let?s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let?s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
24
};
25
26
// // require_once __DIR__ . '/ExtcalPersistableObjectHandler.php';
27
28
/**
29
 * Class EventNotMemberHandler.
30
 */
31
class EventNotMemberHandler extends ExtcalPersistableObjectHandler
32
{
33
    /**
34
     * @param \XoopsDatabase|null $db
35
     */
36
    public function __construct(\XoopsDatabase $db = null)
37
    {
38
        if (null === $db) {
39
            $db = \XoopsDatabaseFactory::getDatabaseConnection();
40
        }
41
        parent::__construct($db, 'extcal_eventnotmember', EventNotMember::class, ['event_id', 'uid']);
0 ignored issues
show
array('event_id', 'uid') of type array<integer,string> is incompatible with the type string expected by parameter $keyname of XoopsModules\Extcal\Extc...tHandler::__construct(). ( Ignorable by Annotation )

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

41
        parent::__construct($db, 'extcal_eventnotmember', EventNotMember::class, /** @scrutinizer ignore-type */ ['event_id', 'uid']);
Loading history...
42
    }
43
44
    /**
45
     * @param $varArr
46
     */
47
    public function createEventNotMember($varArr)
48
    {
49
        $eventnotmember = $this->create();
50
        $eventnotmember->setVars($varArr);
51
52
        if ($this->insert($eventnotmember, true)) {
53
            $eventmemberHandler = Helper::getInstance()->getHandler(\_EXTCAL_CLN_MEMBER);
54
            $eventmemberHandler->deleteById([$varArr['event_id'], $varArr['uid']]);
0 ignored issues
show
The method deleteById() does not exist on XoopsObjectHandler. Did you maybe mean delete()? ( Ignorable by Annotation )

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

54
            $eventmemberHandler->/** @scrutinizer ignore-call */ 
55
                                 deleteById([$varArr['event_id'], $varArr['uid']]);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
55
        }
56
    }
57
58
    /**
59
     * @param $id
60
     *
61
     * @return bool
62
     */
63
    public function deleteEventNotMember($id)
64
    {
65
        return $this->deleteById($id, true);
66
    }
67
68
    /**
69
     * @param $eventId
70
     *
71
     * @return mixed
72
     */
73
    public function getMembers($eventId)
74
    {
75
        /** @var \XoopsMemberHandler $memberHandler */
76
        $memberHandler  = \xoops_getHandler('member');
77
        $eventNotMember = $this->getObjects(new \Criteria('event_id', $eventId));
78
        $count          = \count($eventNotMember);
79
        if ($count > 0) {
80
            $in = '(' . $eventNotMember[0]->getVar('uid');
81
            \array_shift($eventNotMember);
82
            foreach ($eventNotMember as $member) {
83
                $in .= ',' . $member->getVar('uid');
84
            }
85
            $in       .= ')';
86
            $criteria = new \Criteria('uid', $in, 'IN');
87
        } else {
88
            $criteria = new \Criteria('uid', '(0)', 'IN');
89
        }
90
91
        return $memberHandler->getUsers($criteria, true);
92
    }
93
94
    /**
95
     * @param $eventId
96
     *
97
     * @return int|array
98
     */
99
    public function getNbMember($eventId)
100
    {
101
        $criteria = new \Criteria('event_id', $eventId);
102
103
        return $this->getCount($criteria);
104
    }
105
}
106