<?php
	require_once '../../autoload.php';
	
	// RightsCheck ("VIEW_LOGINROLE");

	$id		 	= -1;
		
	if ( isset ( $_REQUEST['id'] ) 		)	$id		 	= $_REQUEST['id'];
	
	$conn = get_dbconnection();
	
	$response = -1;
	
	if ( $conn )
	{
		$sql = "";
		
		if ( $id != -1 )
			$sql = 'update login_role set removed = true where lro_id = '.$id.';commit;';
		
		$result = pg_query ( $conn, $sql );
		
		if ( $result )
		{
			if ( $row = pg_fetch_row($result) )
			{
				$response = $row [0];
			}
		}
	}
	
	header ('Content-type: text/xml' );
	
	echo $response;
?>