Issues (1940)

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.

programs/utilit/right_cet.class.php (4 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
 * OVIDENTIA http://www.ovidentia.org                                   *
4
 ************************************************************************
5
 * Copyright (c) 2003 by CANTICO ( http://www.cantico.fr )              *
6
 *                                                                      *
7
 * This file is part of Ovidentia.                                      *
8
 *                                                                      *
9
 * Ovidentia is free software; you can redistribute it and/or modify    *
10
 * it under the terms of the GNU General Public License as published by *
11
 * the Free Software Foundation; either version 2, or (at your option)  *
12
 * any later version.													*
13
 *																		*
14
 * This program is distributed in the hope that it will be useful, but  *
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of			*
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.					*
17
 * See the  GNU General Public License for more details.				*
18
 *																		*
19
 * You should have received a copy of the GNU General Public License	*
20
 * along with this program; if not, write to the Free Software			*
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,*
22
 * USA.																	*
23
************************************************************************/
24
25
require_once dirname(__FILE__).'/record.class.php';
26
require_once dirname(__FILE__).'/right.class.php';
27
28
/**
29
 * Abscence Right
30
 * 
31
 * @property 	int		$id_right
32
 * @property	string	$saving_begin
33
 * @property	string	$saving_end
34
 * @property	float	$per_year
35
 * @property	float	$per_cet
36
 * @property	float	$ceiling
37
 * @property	float	$min_use
38
 * 
39
 */
40
class absences_RightCet extends absences_Record 
41
{
42
	private $right;
43
	
44
	private $id_right;
45
	
46
	public static function getFromId($id)
47
	{
48
		$rightcet = new absences_RightCet;
49
		$rightcet->id = $id;
50
		return $rightcet;
51
	}
52
	
53
	public static function getFromRight($id_right)
54
	{
55
		$rightcet = new absences_RightCet;
56
		$rightcet->id_right = $id_right;
57
		return $rightcet;
58
	}
59
	
60
	/**
61
	 * 
62
	 * @return array
63
	 */
64 View Code Duplication
	public function getRow()
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...
65
	{
66
		if (null === $this->row)
67
		{
68
			if (!isset($this->id) && !isset($this->id_right))
69
			{
70
				$this->row = false;
0 ignored issues
show
Documentation Bug introduced by
It seems like false of type false is incompatible with the declared type array of property $row.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
71
				return false;
72
			}
73
			
74
			global $babDB;
75
			
76
			$query = 'SELECT * FROM absences_rights_cet WHERE ';
77
			
78
			if (isset($this->id))
79
			{
80
				$query .= 'id='.$babDB->quote($this->id);
81
			}
82
			
83
			if (isset($this->id_right))
84
			{
85
				$query .= 'id_right='.$babDB->quote($this->id_right);
86
			}
87
			
88
			$res = $babDB->db_query($query);
89
			$this->setRow($babDB->db_fetch_assoc($res));
90
		}
91
		
92
		return $this->row;
93
	}
94
	
95
	/**
96
	 * 
97
	 * @param absences_Right $right
98
	 * @return absences_RightCet
99
	 */
100
	public function setRight(absences_Right $right)
101
	{
102
		$this->right = $right;
103
		return $this;
104
	}
105
	
106
	/**
107
	 * @return absences_Right
108
	 */
109
	public function getRight()
110
	{
111
		if (!isset($this->right))
112
		{
113
			$row = $this->getRow();
114
			$this->right = new absences_Right($row['id_right']);
115
		}
116
		
117
		return $this->right;
118
	}
119
	
120
	
121
	
122
	
123 View Code Duplication
	public function insert()
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...
124
	{
125
		global $babDB;
126
	
127
		$babDB->db_query('INSERT INTO absences_rights_cet
128
			(
129
				id_right,
130
				saving_begin,
131
				saving_end,
132
				per_year,
133
				per_cet,
134
				ceiling,
135
				min_use
136
			)
137
				VALUES
138
			(
139
				'.$babDB->quote($this->id_right).',
140
				'.$babDB->quote($this->saving_begin).',
141
				'.$babDB->quote($this->saving_end).',
142
				'.$babDB->quote($this->per_year).',
143
				'.$babDB->quote($this->per_cet).',
144
				'.$babDB->quote($this->ceiling).',
145
				'.$babDB->quote($this->min_use).'
146
			)
147
		');
148
	
149
	
150
		$this->id = $babDB->db_insert_id();
151
	}
152
	
153
	
154
	
155 View Code Duplication
	public function update()
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...
156
	{
157
		global $babDB;
158
	
159
		$babDB->db_query('UPDATE absences_rights_cet SET
160
	
161
				saving_begin 	= '.$babDB->quote($this->saving_begin).',
162
				saving_end 		= '.$babDB->quote($this->saving_end).',
163
				per_year 		= '.$babDB->quote($this->per_year).',
164
				per_cet 		= '.$babDB->quote($this->per_cet).',
165
				ceiling 		= '.$babDB->quote($this->ceiling).',
166
				min_use 		= '.$babDB->quote($this->min_use).' 
167
	
168
				WHERE id_right 	= '.$babDB->quote($this->id_right)
169
		);
170
	
171
	}
172
	
173
}
174