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_inperiod.class.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
 * 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
 * Absence InPeriod
30
 * 
31
 * @property 	int		$id_right
32
 * @property	string	$period_start
33
 * @property	string	$period_end
34
 * @property	int		$right_inperiod
35
 * @property	string	$uuid
36
 * 
37
 */
38
class absences_RightInPeriod extends absences_Record 
39
{
40
	private $right;
41
	
42
	private $id_right;
43
	
44
	public static function getFromId($id)
45
	{
46
		$rightinperiod = new absences_RightInPeriod;
47
		$rightinperiod->id = $id;
48
		return $rightinperiod;
49
	}
50
	
51
	/**
52
	 * 
53
	 * @return array
54
	 */
55 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...
56
	{
57
		if (null === $this->row)
58
		{
59
			global $babDB;
60
			
61
			$query = 'SELECT * FROM absences_rights_inperiod WHERE ';
62
			
63
			if (isset($this->id))
64
			{
65
				$query .= 'id='.$babDB->quote($this->id);
66
			}
67
			
68
			$res = $babDB->db_query($query);
69
			$this->setRow($babDB->db_fetch_assoc($res));
70
		}
71
		
72
		return $this->row;
73
	}
74
	
75
	/**
76
	 * 
77
	 * @param absences_Right $right
78
	 * @return absences_RightInPeriod
79
	 */
80
	public function setRight(absences_Right $right)
81
	{
82
		$this->right = $right;
83
		return $this;
84
	}
85
	
86
	/**
87
	 * @return absences_Right
88
	 */
89
	public function getRight()
90
	{
91
		if (!isset($this->right))
92
		{
93
			$row = $this->getRow();
94
			$this->right = new absences_Right($row['id_right']);
95
		}
96
		
97
		return $this->right;
98
	}
99
	
100
	
101
	
102
	public function save()
103
	{
104
		global $babDB;
105
		
106
		$res = $babDB->db_query('SELECT * FROM absences_rights_inperiod WHERE uuid='.$babDB->quote($this->uuid));
107
		if (0 === $babDB->db_num_rows($res))
108
		{
109
			$this->insert();
110
		} else {
111
			
112
			$this->update();
113
		}
114
	}
115
	
116
	
117
	public function insert()
118
	{
119
		global $babDB;
120
		require_once $GLOBALS['babInstallPath'].'utilit/uuid.php';
121
		
122
		$right = $this->getRight();
123
		$this->id_right = $right->id;
124
		
125
		$babDB->db_query('
126
			INSERT INTO absences_rights_inperiod 
127
				(
128
					id_right,
129
					period_start,
130
					period_end,
131
					right_inperiod,
132
					uuid
133
				)
134
			VALUES 
135
				(
136
					'.$babDB->quote($this->id_right).',
137
					'.$babDB->quote($this->period_start).',
138
					'.$babDB->quote($this->period_end).',
139
					'.$babDB->quote($this->right_inperiod).',
140
					'.$babDB->quote($this->uuid).'
141
				)
142
		');
143
	}
144
	
145
	
146
	public function update()
147
	{
148
		global $babDB;
149
		
150
		if (empty($this->uuid))
151
		{
152
			throw new Exception('missing absences_rights_inperiod.uuid');
153
		}
154
		
155
		$babDB->db_query('UPDATE absences_rights_inperiod SET 
156
			period_start	='.$babDB->quote($this->period_start).',
157
			period_end		='.$babDB->quote($this->period_end).',
158
			right_inperiod	='.$babDB->quote($this->right_inperiod).' 
159
		WHERE uuid='.$babDB->quote($this->uuid));
160
	}
161
}
162