diff -ruN lib.orig/Vulture/ResponseHandler.pm lib/Vulture/ResponseHandler.pm
--- lib.orig/Vulture/ResponseHandler.pm	2008-03-05 16:44:36.000000000 +0100
+++ lib/Vulture/ResponseHandler.pm	2008-03-05 16:43:08.000000000 +0100
@@ -22,7 +22,7 @@
 use Encode;
 use URI::Escape;
 
-use Vulture qw(&get_app &get_vpn_app &session &get_cookie);
+use Vulture qw(&get_app &session &get_cookie);
 
 sub ldap_obj {
 	my ($log, $app, $dbh) = @_;
@@ -783,14 +783,6 @@
 			$session{user} ||= $session{'SSL_CLIENT_M_SERIAL'};
 		}
 	}
-
-	#-------------------------------------------------------------------
-	#	VPN APP ADDON :	
-	#	It's not a webApps so it's a vpnApps : 
-	#-------------------------------------------------------------------		
-	my $app = get_vpn_app($session{site},$dbh,$session{iface},$log)	if(!$app);
-	#-------------------------------------------------------------------		
-
 	my ($is_one_time_password, $ask_pin) = one_time_password($dbh, $app);
 
 	$session{pin} = param('vulture_pin');
@@ -1051,132 +1043,6 @@
 		return Apache2::Const::OK;
 	}
 	
-	#-------------------------------------------------------------------
-	#	VPN APP ADDON :	
-	#	It's not a webApps so it's a vpnApps : 
-	#-------------------------------------------------------------------		
-	if(my $vpn_app = get_vpn_app($r->hostname,$dbh,$r->dir_config('VultureID'),$log)){
-		my %session;
-		my ($cookie_id) = get_cookie($r->headers_in->{Cookie}, 'vulture_app=([^;]*)') if ($r->unparsed_uri !~ /vulture_logout/);
-		session(\%session, $vpn_app->{timeout}, $cookie_id);
-		$session{proto} = $is_ssl ? "https" : "http";
-
-		#If application need authentification : 
-		if ($vpn_app->{auth_id} and not $session{post}	){
-			
-			$session{site} 	= $r->hostname;
-			$session{iface}	= $r->dir_config('VultureID');
-			$session{port} 	= $r->get_server_port;
-			$session{uri} = $r->uri . ($r->args ? "?".$r->args : "");
-			$r->headers_out->add('Set-Cookie' => 'vulture_app='.$session{_session_id}.'; path=/; domain='.$r->hostname);	
-			my $url_redirect = $session{proto}."://".$sso_portal. ":". $port . "/?vulture_app=".  $session{_session_id};
-			$log->debug($url_redirect);
-			$r->status(200);
-			$r->content_type('text/html');
-			$r->print(get_redirect($url_redirect));
-			return Apache2::Const::OK;			
-		}
-
-
-		#Applet need application XML list : 
-		#$session{post} and 
-		#TODO : Create ACL by users & groups before return XML code 
-		if(($r->unparsed_uri =~ /getApps/)){
-			my $crlf="\r\n";
-			my $tbs="	";
-			my $local_host='127.0.0.1';			
-
-			my $sql_get_vpn_app_for_user = "SELECT id, internet_name, service_name, local_port_client, remote_host_port, remote_host_name FROM vpn";
-			my $sth = $dbh->prepare($sql_get_vpn_app_for_user);
-			$sth->execute();
-			
-			my $xml_get_apps='<?xml version="1.0" encoding="utf8" ?>'.$crlf;
-			$xml_get_apps.='<root>'.$crlf;
-			while ( 	my ($app_id, $app_iname, $app_service_name, $local_port, $target_port, $target_host) = $sth->fetchrow() ) {
-				$xml_get_apps.=$tbs.'<vpnApp>'.$crlf;	
-					$xml_get_apps.=$tbs.$tbs.'<vpnAppId>';				$xml_get_apps.=$app_id;				$xml_get_apps.='</vpnAppId>'.$crlf;
-					$xml_get_apps.=$tbs.$tbs.'<internetName>';			$xml_get_apps.=$app_iname;			$xml_get_apps.='</internetName>'.$crlf;
-					$xml_get_apps.=$tbs.$tbs.'<serviceName>';			$xml_get_apps.=$app_service_name;	$xml_get_apps.='</serviceName>'.$crlf;		
-					$xml_get_apps.=$tbs.$tbs.'<targetPort>';			$xml_get_apps.=$target_port;		$xml_get_apps.='</targetPort>'.$crlf;
-					$xml_get_apps.=$tbs.$tbs.'<targetHost>';			$xml_get_apps.=$target_host;		$xml_get_apps.='</targetHost>'.$crlf;
-					$xml_get_apps.=$tbs.$tbs.'<localBindingPort>';		$xml_get_apps.=$local_port;		$xml_get_apps.='</localBindingPort>'.$crlf;
-					$xml_get_apps.=$tbs.$tbs.'<localBindingHost>';		$xml_get_apps.=$local_host;		$xml_get_apps.='</localBindingHost>'.$crlf;
-				$xml_get_apps.=$tbs.'</vpnApp>'.$crlf;
-			}
-			$xml_get_apps.='</root>'.$crlf;
-			$r->content_type('text/html');
-			$r->print($xml_get_apps);				
-			return Apache2::Const::OK;	
-		}
-		
-		#User is authentified and can view the vpn ssl java applet : 	
-		if(($r->method eq "GET" or $r->method eq "POST") and ($session{post})){
-			#https://mobi.purpledrm.com/
-			#Prepare HTML code  :	
-			my $html;
-			$html = '
-			<html>
-			<HEAD>
-				<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
-				<META HTTP-EQUIV="Expires" CONTENT="-1">
-			</HEAD>
-			<body>';			
-
-			$html .= '<applet ';
-			$html .= 'codebase="'.$session{proto}.'://'.$vpn_app->{vpn_application_internet_name}.':'.$r->get_server_port().'/static/" ';
-			$html .= 'archive="vpnclient.jar" ';
-			$html .= 'code="vpnClient.vpnclient.class" ';
-			$html .= 'name="vpnclient" ';
-			$html .= 'width="450" height="350">
-				<param name="PROXY_IP" value="'.$vpn_app->{vpn_application_internet_name}.'">
-				<param name="PROXY_PORT" value="443">
-				<param name="NO_CACHE" value="'.time().'">
-				<param name="SID" value="'.$session{_session_id}.'">
-			</applet>';				
-			
-			$html .= '</body></html>';
-
-			$r->content_type('text/html');
-			$r->print($html);				
-
-			return Apache2::Const::OK;	
-		
-		}
-		
-		#TODO : display application list after login :
-		$session{site} 	= $r->hostname;
-		$session{iface}	= $r->dir_config('VultureID');
-		$session{port} 	= $r->get_server_port;
-		$session{uri} = $r->uri . ($r->args ? "?".$r->args : "");
-		$session{SSL_CLIENT_M_SERIAL} = $r->ssl_lookup('SSL_CLIENT_M_SERIAL');
-		$session{SSL_CLIENT_I_DN_CN} = $r->ssl_lookup('SSL_CLIENT_I_DN_CN');
-		if ($session_referer{hostname}) {
-			$r->headers_out->set('Set-Cookie' => "vulture_app=".  $session{_session_id} . "; path=/; domain=".$session_referer{hostname});
-		}
-		else {
-			$r->headers_out->set('Set-Cookie' => "vulture_app=".  $session{_session_id} . "; path=/; domain=".$r->hostname);
-		}		
-		$r->status(200);
-		$r->content_type('text/html');
-		if ($r->unparsed_uri !~ /vulture_logout/) {
-			if ($r->headers_in->{'Vulture_portail'}) {
-				$r->print(get_redirect($session{proto}."://".$sso_portal. ":". $port . "/?vulture_app=".  $session{_session_id} . "&vulture_portail=". $r->headers_in->{'Vulture_portail'}));
-			}
-			else {
-				$r->print(get_redirect($session{proto}."://".$sso_portal. ":". $port . "/?vulture_app=".  $session{_session_id}));
-			}
-		}		
-		else {
-			$session{uri} = "/";
-			$sso_session{$vpn_app->{auth}} = undef;
-			$r->print(get_redirect($session{proto}."://".$sso_portal. ":". $port . "/?vulture_logout&vulture_app=".  $session{_session_id}));
-		}		
-		
-		return Apache2::Const::OK;	
-	
-	}
-	#-------------------------------------------------------------------		
-	
 	# User ask for the portal directly. We provide application's list he can access to.
 	if ($r->hostname eq $sso_portal) {
 
@@ -1275,29 +1141,6 @@
 				}
 			}
 		}
-		
-		#-------------------------------------------------------------------
-		#VPN APP ADDON :	
-		#It's not a webApps so it's a vpn apps : 
-		#-------------------------------------------------------------------		
-		foreach my $k (keys %sso_session) {
-			# looking for authentication method ids in SSO session
-			if ($k ne "date" and $k ne "_session_id") {
-				# foreach application using this authentication, check the ACL
-				my $query;
-				# vpn.name, vpn.id, auth.type, if.port, if.crt, auth.display_portal
-				$query = "SELECT vpn.internet_name, vpn.id, auth.type, if.port, if.crt, auth.display_portal";
-				$query.=" FROM vpn, auth, if WHERE vpn.id_auth = auth.id AND if.id=vpn.id_if AND auth.id=? GROUP BY internet_name";
-				my $sth = $dbh->prepare($query);
-				$sth->execute($k);
-				while(my ($name, $app_id, $auth_type, $port, $is_ssl, $display_portal) = $sth->fetchrow()){
-					push(@apps, [$is_ssl, $name, $port]);
-				}
-				
-			}
-		}		
-		#-------------------------------------------------------------------		
-		
 		$r->status(200);
 		$r->content_type('text/html');
 		$log->debug($r->headers_in->{'Vulture_portail'});
diff -ruN lib.orig/Vulture/TransHandler.pm lib/Vulture/TransHandler.pm
--- lib.orig/Vulture/TransHandler.pm	2008-03-05 16:44:36.000000000 +0100
+++ lib/Vulture/TransHandler.pm	2008-03-05 16:44:12.000000000 +0100
@@ -15,7 +15,7 @@
 use Apache2::Connection;
 use Apache::SSLLookup;
 
-use Vulture qw(&get_app &get_vpn_app $proto &read_conf &get_cookie &session);
+use Vulture qw(&get_app $proto &read_conf &get_cookie &session);
 
 use Data::Dumper;
 
@@ -116,74 +116,6 @@
 
 	my $app = get_app($log, $r->hostname, $dbh, $r->dir_config('VultureID')) if ($r->unparsed_uri !~ /vulture_app/ and $r->unparsed_uri !~ /vulture_logout/);
 
-	#-------------------------------------------------------------------
-	#VPN APP ADDON :
-	#It's not a webApps so it's a vpn apps :
-	#-------------------------------------------------------------------
-
-	if (!$app) {
-		my $vpn_app = "";
-		if (defined($r->headers_in->{'HOST'})) {
-			#prototype : get_vpn_app($application_hostname, $database_instance,$config_file_id,$log_instance)
-			#$r->hostname
-			my $vpn_app = get_vpn_app($r->headers_in->{'HOST'},$dbh,$r->dir_config('VultureID'),$log);
-			#A VPN app is requested : 
-			if ($vpn_app) {
-				my %session;
-				#	The connect http request look like : 
-				#	CONNECT 192.168.2.223:22 HTTP/1.1
-				#	HOST: vpn1.intra.local
-				#	Cookie: vulture_app=xxxxxxxxxxxxxxxxx     (xxxxx mean the cookie received when user authentified)
-				if ($vpn_app->{auth_id}) {
-					# Get the param Cookie value : 	
-					my ($id) = get_cookie($r->headers_in->{Cookie}, 'vulture_app=([^;]*)');
-
-					# Extract session hash from id value :
-					session(\%session, 1000,$id);
-					#[Mon Sep 10 10:58:02 2007] [debug] TransHandler.pm(139): PROXY REQUEST :
-					#$VAR1 = 'CONNECT 192.168.2.223:22 HTTP/1.1';\n
-					$log->debug('PROXY REQUEST :'.Dumper $r->the_request());
-
-					# If param is missed return forbidden :
-					if (!$id) {
-						#ID is not present inside CONNECT request so we return forbidden :
-						#$r->headers_out->add('Set-Cookie' => 'vulture_app='.$session{_session_id}.'; path=/; domain='.$r->hostname);
-						$log->debug('FORB - GET vpn-app :'.Dumper $vpn_app);
-					}
-
-					if (not($r->method eq "GET" or $r->method eq "POST")) {
-						#If the ID is valid on this application and the name match with the vpn host server name
-						#we can accept CONNECT request  : 
-
-						my $vpn_get_name_from_request = $vpn_app->{vpn_application_internet_name};
-						my $vpn_session_name 		  = $session{site};
-						my $request 				  = $r->the_request();
-						$request =~ /^CONNECT(.*):(.*) (.*)/;
-
-						$log->debug("-----------------");
-						$log->debug(" VPN - APP ");
-						$log->debug("-----------------");
-						$log->debug("- IP:".$1);
-						$log->debug("- PORT:".$2);
-						$log->debug('- DB:'.Dumper $vpn_app);
-						$log->debug('- SESSION NAME :'.Dumper $session{site});
-						$log->debug('- INPUT NAME :'.Dumper $vpn_app->{vpn_application_internet_name});
-						$log->debug('- INPUT REQUEST :'.Dumper $request);
-						$log->debug('Check app name ... ');
-
-						if ($vpn_get_name_from_request eq $vpn_session_name) {
-							#Change handler to mod proxy
-							$r->handler('proxy-server');
-							$r->proxyreq(2);
-							return Apache2::Const::OK;
-						}
-						return Apache2::Const::FORBIDDEN;
-					}
-				}
-			}
-		}
-	}			#if(!$app){
-
 	if ($app and $app->{up}) {
 		my ($id) = get_cookie($r->headers_in->{Cookie}, 'vulture_app=([^;]*)') if ($app->{auth});
 		my ($vulture_portail) = get_cookie($r->headers_in->{Cookie}, 'vulture_portail=([^;]*)');
diff -ruN lib.orig/Vulture.pm lib/Vulture.pm
--- lib.orig/Vulture.pm	2008-03-05 16:45:42.000000000 +0100
+++ lib/Vulture.pm	2008-03-03 18:00:33.000000000 +0100
@@ -4,7 +4,7 @@
 BEGIN {
     use Exporter ();
     @ISA = qw(Exporter);
-    @EXPORT_OK = qw($proto &get_app $proxy_name $auth_url &session &get_cookie &read_conf &init $db_uri $path);
+    @EXPORT_OK = qw($proto &get_vpn_app &get_app $proxy_name $auth_url &session &get_cookie &read_conf &init $db_uri $path);
 }
 
 use Apache::Session::Generate::MD5;
@@ -16,6 +16,52 @@
 
 our ($proto, $proxy_name, $auth_url, $db_uri, $conf, $path, $proxy_port, $proxy_proto);
 
+
+#@Params : String application internet name , Object Database instance, Integer Configuration file id ex: 1.conf,  Object Server log instance (syslog apache)
+sub get_vpn_app{
+	
+	#Get get_vpn_app params : 
+	my ($application_hostname, $database_instance,$config_file_id,$log_instance) = @_;	
+	
+	my ($id_method, $auth_type, $result, $query_get_vpn_app, $get_all_vpnapp_from_interfaceid, $sql_get_authentification_conf);	
+	
+	#Get vpn application from interface (vhost )  id 
+	$query_get_vpn_app="SELECT id, internet_name, local_port_client, remote_host_port, remote_host_name, id_auth FROM vpn WHERE id_if='".$config_file_id."'";
+
+	$get_all_vpnapp_from_interfaceid = $database_instance->selectall_arrayref($query_get_vpn_app);
+		
+	foreach my $tuple_vpn_app (@$get_all_vpnapp_from_interfaceid) {
+		
+		#We try to found vpn app match with internet name : 
+		if (@$tuple_vpn_app[1] eq $application_hostname) {
+			
+			#If application need authentification : 
+			#and if it's ok get the authentification properties 
+			if (@$tuple_vpn_app[5]) {
+				#Build request to get authentification info : 
+				$sql_get_authentification_conf = "SELECT id_method, type ";
+				$sql_get_authentification_conf.="FROM auth WHERE id='".@$tuple_vpn_app[5]."'";
+				#Get result 
+				($id_method, $auth_type) = $database_instance->selectrow_array($sql_get_authentification_conf);
+			}
+
+			$result = {
+				'vpn_application_id'    =>	@$tuple_vpn_app[0],
+				'vpn_application_internet_name'	=>	@$tuple_vpn_app[1],
+				'local_port_client'		=>	@$tuple_vpn_app[2],
+				'remote_host_port'		=>	@$tuple_vpn_app[3],
+				'remote_host_name'		=>	@$tuple_vpn_app[4],
+				'auth'					=>	@$tuple_vpn_app[5],
+				'auth_id'				=>	@$tuple_vpn_app[5],
+				'id_method'				=>	$id_method,
+				'auth_id_method'        =>	$id_method,
+				'auth_type'             =>	$auth_type,
+			};			
+		}
+	}
+	return $result;	
+}
+
 sub	session {
 	my ($session, $timeout, $id, $n) = @_;
 
