Code Duplication    Length = 4-6 lines in 2 locations

programs/init.php 2 locations

@@ 121-126 (lines=6) @@
118
	$res = $babDB->db_query("SELECT id, kind, date_begin_fixed FROM absences_rights WHERE kind='0'");
119
	while ($arr = $babDB->db_fetch_assoc($res))
120
	{
121
		if ($arr['date_begin_fixed'] !== '0000-00-00 00:00:00')
122
		{
123
			$babDB->db_query("UPDATE absences_rights SET kind='2' WHERE id=".$babDB->quote($arr['id']));
124
		} else {
125
			$babDB->db_query("UPDATE absences_rights SET kind='1' WHERE id=".$babDB->quote($arr['id']));
126
		}
127
	}
128
	
129
	
@@ 229-232 (lines=4) @@
226
					AND ur.id IS NULL 
227
			');
228
			
229
			if ($babDB->db_num_rows($res2) == 0)
230
			{
231
				$babDB->db_query('INSERT INTO absences_coll_rights (id_coll, id_right) VALUES ('.$babDB->quote($link['id_coll']).','.$babDB->quote($link['id']).')');
232
			}
233
		}
234
	}
235