Issues (48)

Security Analysis    not enabled

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.

app/models/User.php (3 issues)

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
class User extends \Phalcon\Mvc\Model
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
6
    /**
7
     *
8
     * @var integer
9
     */
10
    protected $id;
11
12
    /**
13
     *
14
     * @var string
15
     */
16
    protected $mail;
17
18
    protected $image;
19
    /**
20
     *
21
     * @var string
22
     */
23
    protected $password;
24
25
    /**
26
     *
27
     * @var string
28
     */
29
    protected $identite;
30
31
    /**
32
     *
33
     * @var int
34
     */
35
    protected $idTypeUser;
36
37
    /**
38
     * Method to set the value of field id
39
     *
40
     * @param integer $id
41
     * @return $this
42
     */
43
    public function setId($id)
44
    {
45
        $this->id = $id;
46
47
        return $this;
48
    }
49
50
    /**
51
     * Method to set the value of field mail
52
     *
53
     * @param string $mail
54
     * @return $this
55
     */
56
    public function setMail($mail)
57
    {
58
        $this->mail = $mail;
59
60
        return $this;
61
    }
62
63
    /**
64
     * Method to set the value of field password
65
     *
66
     * @param string $password
67
     * @return $this
68
     */
69
    public function setPassword($password)
70
    {
71
        $this->password = $password;
72
73
        return $this;
74
    }
75
76
    /**
77
     * Method to set the value of field identite
78
     *
79
     * @param string $identite
80
     * @return $this
81
     */
82
    public function setIdentite($identite)
83
    {
84
        $this->identite = $identite;
85
86
        return $this;
87
    }
88
89
    /**
90
     * Method to set the value of field role
91
     *
92
     * @param string $role
0 ignored issues
show
There is no parameter named $role. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
93
     * @return $this
94
     */
95
    public function setIdTypeUser($idTypeUser)
96
    {
97
        $this->idTypeUser = $idTypeUser;
98
99
        return $this;
100
    }
101
102
    public function setImage($image){
103
        $this->image = $image;
104
        return $this;
105
    }
106
107
    /**
108
     * Returns the value of field id
109
     *
110
     * @return integer
111
     */
112
    public function getId()
113
    {
114
        return $this->id;
115
    }
116
117
    /**
118
     * Returns the value of field mail
119
     *
120
     * @return string
121
     */
122
    public function getMail()
123
    {
124
        return $this->mail;
125
    }
126
127
    public function getImage(){
128
        return $this->image;
129
    }
130
    /**
131
     * Returns the value of field password
132
     *
133
     * @return string
134
     */
135
    public function getPassword()
136
    {
137
        return $this->password;
138
    }
139
140
    /**
141
     * Returns the value of field identite
142
     *
143
     * @return string
144
     */
145
    public function getIdentite()
146
    {
147
        return $this->identite;
148
    }
149
150
    /**
151
     * Returns the value of field role
152
     *
153
     * @return string
154
     */
155
    public function getIdTypeUser()
156
    {
157
        return $this->idTypeUser;
158
    }
159
160
    /**
161
     * Initialize method for model.
162
     */
163 View Code Duplication
    public function initialize()
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
164
    {
165
        $this->hasMany('id', 'Message', 'idUser', array('alias' => 'Messages'));
166
        $this->hasMany('id', 'Projet', 'idClient', array('alias' => 'Projets'));
167
        $this->hasMany('id', 'Usecase', 'idDev', array('alias' => 'Usecases'));
168
        $this->belongsTo('idTypeUser', 'TypeUser', 'id', array('alias' => 'TypeUser'));
169
    }
170
171
    public function toString(){
172
        return $this->identite."(".$this->mail.")";
173
    }
174
175
    //Return a string containing the principal content of the model
176
    public function getPrincipal(){
177
        return "Identité : ".$this->identite." <br/> Email : ".$this->mail;
178
    }
179
180
181
    /**
182
     * Returns table name mapped in the model.
183
     *
184
     * @return string
185
     */
186
    public function getSource()
187
    {
188
        return 'user';
189
    }
190
191
    /**
192
     * Allows to query a set of records that match the specified conditions
193
     *
194
     * @param mixed $parameters
195
     * @return User[]
196
     */
197
    public static function find($parameters = null)
198
    {
199
        return parent::find($parameters);
200
    }
201
202
    /**
203
     * Allows to query the first record that match the specified conditions
204
     *
205
     * @param mixed $parameters
206
     * @return User
207
     */
208
    public static function findFirst($parameters = null)
209
    {
210
        return parent::findFirst($parameters);
211
    }
212
213
}
214