Issues (1)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

Model/Organization.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher MultiTenancy Component.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Component\MultiTenancy\Model;
16
17
use Doctrine\Common\Collections\ArrayCollection;
18
use Doctrine\Common\Collections\Collection;
19
use SWP\Component\Common\Model\EnableableTrait;
20
use SWP\Component\Common\Model\SoftDeletableTrait;
21
use SWP\Component\Common\Model\TimestampableTrait;
22
23
class Organization implements OrganizationInterface
24
{
25
    use SoftDeletableTrait;
26
    use TimestampableTrait;
27
    use EnableableTrait;
28
29
    /**
30
     * @var mixed
31
     */
32
    protected $id;
33
34
    /**
35
     * @var string
36
     */
37
    protected $name;
38
39
    /**
40
     * @var string
41
     */
42
    protected $code;
43
44
    /**
45
     * @var Collection|TenantInterface[]
46
     */
47
    protected $tenants;
48
49
    /**
50
     * Organization constructor.
51
     */
52
    public function __construct()
53
    {
54
        $this->createdAt = new \DateTime();
55
        $this->tenants = new ArrayCollection();
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function getId()
62
    {
63
        return $this->id;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function setId($id)
70
    {
71
        $this->id = $id;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getName()
78
    {
79
        return $this->name;
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function setName($name)
86
    {
87
        $this->name = $name;
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function getCode()
94
    {
95
        return $this->code;
96
    }
97
98
    /**
99
     * {@inheritdoc}
100
     */
101
    public function setCode($code)
102
    {
103
        if (null !== $this->code) {
104
            throw new \LogicException('The code is already set. Can not change it.');
105
        }
106
107
        $this->code = $code;
108
    }
109
110
    /**
111
     * {@inheritdoc}
112
     */
113
    public function getTenants()
114
    {
115
        return $this->tenants;
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->tenants; of type Doctrine\Common\Collecti...Model\TenantInterface[] adds the type Doctrine\Common\Collections\Collection to the return on line 115 which is incompatible with the return type declared by the interface SWP\Component\MultiTenan...onInterface::getTenants of type SWP\Component\MultiTenancy\Model\TenantInterface[].
Loading history...
116
    }
117
118
    /**
119
     * {@inheritdoc}
120
     */
121
    public function hasTenant(TenantInterface $tenant)
122
    {
123
        return $this->tenants->contains($tenant);
124
    }
125
126
    /**
127
     * {@inheritdoc}
128
     */
129
    public function addTenant(TenantInterface $tenant)
130
    {
131
        if (!$this->hasTenant($tenant)) {
132
            $this->tenants->add($tenant);
133
        }
134
    }
135
136
    /**
137
     * {@inheritdoc}
138
     */
139
    public function removeTenant(TenantInterface $tenant)
140
    {
141
        if ($this->hasTenant($tenant)) {
142
            $this->tenants->removeElement($tenant);
143
        }
144
    }
145
}
146