Code Duplication    Length = 27-27 lines in 2 locations

programs/configuration.php 2 locations

@@ 541-567 (lines=27) @@
538
	;
539
540
541
	if (!empty($id_server))
542
	{
543
		$babDB->db_query('
544
			UPDATE libcaldav_servers SET
545
				name='.$babDB->quote($name).',
546
				server_url='.$babDB->quote($server_url).',
547
				user_calendar_path='.$babDB->quote($user_calendar_path).',
548
                use_unique_id='.$babDB->quote($use_unique_id).' 
549
			WHERE id='.$babDB->quote($id_server)
550
		);
551
552
553
	} else {
554
555
		$babDB->db_query('
556
			INSERT INTO libcaldav_servers
557
				(name, server_url, user_calendar_path,use_unique_id)
558
			VALUES
559
				(
560
				'.$babDB->quote($name).',
561
				'.$babDB->quote($server_url).',
562
				'.$babDB->quote($user_calendar_path).',
563
                '.$babDB->quote($use_unique_id).'    
564
				)'
565
		);
566
567
	}
568
569
570
	$url = bab_url::get_request('tg');
@@ 603-629 (lines=27) @@
600
	}
601
	
602
	
603
	if (!empty($id_resource))
604
	{
605
		$babDB->db_query('
606
			UPDATE libcaldav_resources SET 
607
				name='.$babDB->quote($name).',
608
				url='.$babDB->quote($url).',
609
				nickname='.$babDB->quote($nickname).',
610
				password='.$babDB->quote($password).' 
611
			WHERE id='.$babDB->quote($id_resource)
612
		);
613
		
614
		
615
	} else {
616
		
617
		$babDB->db_query('
618
				INSERT INTO libcaldav_resources 
619
					(name, url, nickname, password) 
620
				VALUES 
621
					(
622
						'.$babDB->quote($name).', 
623
						'.$babDB->quote($url).',
624
						'.$babDB->quote($nickname).',
625
						'.$babDB->quote($password).'
626
					)'
627
		);
628
		
629
	}
630
	
631
	
632
	$url = bab_url::get_request('tg');