Apache2-ApacheMobileFilter

 view release on metacpan or  search on metacpan

CHANGE  view on Meta::CPAN


ApacheMobileFilter 3.05
Added parameter AMFMobileKeys for patch identify mobile useragent.
Delete warn in AMFMobileCachingMemcached
Add new module AMFTrace for trace.
Added parameter AMFTraceDebug is boolean (false is the default value, and trace only new useragent, true trace the capabilitis setted in AMFTraceCapability.
Added parameter AMFTraceCapability is the capability name you want to trace (for ex. brand, model, etc....).
Added parameter AMFTraceFS to set the field separate between the capabilities to trace.

ApacheMobileFilter 3.04
Deprecated parameter CookieCacheSystem is changed in AMFProductionMode
Change Makefile.PL
Fixed bugs. Thanks to Ivancho.
Fixed bugs for CookieCacheSystem (now AMFProductionMode)

ApacheMobileFilter 3.03
Deprecated parameter MOBILE_HOME is changed in AMFMobileHome
Fixed Bug in AMFWURFLFilter. Thanks to Allison.
Fixed Bug for AMFImageRender (with different virtual host conflic with images with the same name). Thanks to Sergio.
Fixed Bug for AMFImageRender (with different uri conflict with images with the same name).

ApacheMobileFilter 3.02
Fixed Bug in AMFWURFLFilter. If  CapabilityList was not setted, caused an "uninitialized value".
Fixed Bug in AMFSwitcher. (the bug is it only in 3.01) Thanks to Richard W.

CHANGE  view on Meta::CPAN

WURFLFilter 2.04
Deprecated parameter Log4WurflNoDeviceDetect, the strange parameter is logged into error_log as warning type
Deprecated parameter DirWebPatch, now if LoadWebPatch is true and PatchWurflNetDownload is false the Apache Mobile FIlter load the web_browsers_patch.xml file into MOBILE_HOME parameter
Deprecated parameter ConvertImage this parameter has not sense.
Deprecated parameter WebAppConvertImages this parameter has not sense.
Deprecated parameter DetectAccuracy this parameter causes the decrease of filter performance.
Deprecated parameter RedirectTranscoder this parameter has not sense.
Complete with more info the POD 

WURFLFilter 2.03
Added Parameter CookieCacheSystem to enable cookie cache mechanism.
Cache cookie system
Clear code

WURFLFilter 2.02
I leaved (in the same day) the cookie system, and I'm using pnote 

WURFLFilter 2.01
WURFLFilter pass the dimension of screen size to ImageRenderFilter by cookie system 

WURFLFilter 2.00

CHANGE  view on Meta::CPAN

WURFLFilter 1.31
After talking with Gianugo R. it's possible to configure the filter into httpd.conf file
Added Parameter XML_CONFIG to set where to read WURFLFilter configuration (to set in httpd.conf)
Added Parameter CapabilityList the same of the old attribute "capability" in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter XHTMLUrl the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter WMLUrl the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter CHTMLUrl the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter MobileVersionUrl the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter IntelliSwitch  the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter FullBrowserUrl the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter CookieSet the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter PassQueryStringSet the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter ShowDefaultVariable the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter WurflNetDownload the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter DownloadWurflURL the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter DownloadZipFile the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter ConvertImage the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter ResizeImageDirectory the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter WebAppConvertImages the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter WebAppDirectory the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)
Added Parameter ConvertOnlyImages the same of the old attribute with the same name in WURFLFilterConfig.configure (to set in httpd.conf)

META.json  view on Meta::CPAN

      },
      "runtime" : {
         "requires" : {
            "APR::Table" : "0",
            "Apache2::Connection" : "0",
            "Apache2::Const" : "0",
            "Apache2::Filter" : "0",
            "Apache2::RequestRec" : "0",
            "Apache2::RequestUtil" : "0",
            "Apache2::SubRequest" : "0",
            "CGI::Cookie" : "0",
            "Cache::FileBackend" : "0",
            "Cache::Memcached" : "1.27",
            "Digest::MD5" : "0",
            "File::Copy" : "0",
            "IO::Uncompress::Gunzip" : "0",
            "IO::Uncompress::Unzip" : "0",
            "Image::Resize" : "0",
            "Image::Scale" : "0",
            "Imager" : "0",
            "LWP::Protocol::https" : "0",

META.yml  view on Meta::CPAN

    - t
    - inc
requires:
  APR::Table: '0'
  Apache2::Connection: '0'
  Apache2::Const: '0'
  Apache2::Filter: '0'
  Apache2::RequestRec: '0'
  Apache2::RequestUtil: '0'
  Apache2::SubRequest: '0'
  CGI::Cookie: '0'
  Cache::FileBackend: '0'
  Cache::Memcached: '1.27'
  Digest::MD5: '0'
  File::Copy: '0'
  IO::Uncompress::Gunzip: '0'
  IO::Uncompress::Unzip: '0'
  Image::Resize: '0'
  Image::Scale: '0'
  Imager: '0'
  LWP::Protocol::https: '0'

Makefile.PL  view on Meta::CPAN

    VERSION_FROM	=> 'lib/Apache2/AMFWURFLFilter.pm',
    DISTNAME	=> "Apache2-ApacheMobileFilter",
    dist		=> {COMPRESS => 'gzip', SUFFIX => 'gz'},
    PREREQ_PM    => {
                     'POSIX' => 0,
                     'Apache2::Filter' => 0,
                     'Apache2::RequestRec' => 0,
                     'Apache2::RequestUtil' => 0,
                     'Apache2::SubRequest' => 0,
                     'Apache2::Connection' => 0,
                     'CGI::Cookie' => 0, 
                     'APR::Table' => 0, 
                     'Apache2::Const' => 0, 
                     'Image::Resize' => 0,
                     'Image::Scale' => 0,
                     'Image::Magick ' => 0,
                     'Imager' => 0,
                     'LWP::Simple' => 0,
            		     'File::Copy' => 0,
      	       	     'IO::Uncompress::Unzip'  => 0,
                     'IO::Uncompress::Gunzip' => 0,

lib/Apache2/AMF51DegreesFilter.pm  view on Meta::CPAN

				      $MobileArray{$dummy}='mobile';
				}
				      $CommonLib->printLog("AMFMobileKeys is: $ENV{AMFMobileKeys}");
		} 	
	             

			 if ($ENV{AMFProductionMode}) {
				$cookiecachesystem=$ENV{AMFProductionMode};
				$CommonLib->printLog("AMFProductionMode is: $cookiecachesystem");
			 } else {
				$CommonLib->printLog("AMFProductionMode (the CookieCacheSystem is deprecated) is not setted the default value is $cookiecachesystem");			   
			 }		
		if ($ENV{Personal51DegreesFileName}) {
			$personal51Degreesurl=$ENV{AMFMobileHome}."/".$ENV{Personal51DegreesFileName};
			$CommonLib->printLog("Personal51DegreesFileName is: $ENV{Personal51DegreesFileName}");
		}
		if ($ENV{RestMode}) {
			$restmode=$ENV{RestMode};
			$CommonLib->printLog("RestMode is: $restmode");
		}
		if ($ENV{AMFDeepParse}) {

lib/Apache2/AMF51DegreesFilter.pm  view on Meta::CPAN

    my $query_string=$f->args;
    my $docroot = $f->document_root();
    my $id="";
    my $location="none";
    my $width_toSearch;
    my $type_redirect="internal";
    my $return_value;
    my $dummy="";
    my $variabile2="";
    my %ArrayCapFound;
    my $controlCookie;
    my $query_img="";
    $ArrayCapFound{is_transcoder}='false';
    $ArrayCapFound{'IsMobile'}='true';

    my %ArrayQuery;
    my $var;
    my $version="";
    my $realPCbrowser='none';
    if ($user_agent eq "") {
	$user_agent="no useragent found";
    }
    if ($x_user_agent) {
       $user_agent=lc($x_user_agent);
    }	  
    if ($x_operamini_phone_ua) {
       $user_agent=lc($x_operamini_phone_ua);
    }
    my $cookie = $f->headers_in->{Cookie} || '';
    $id=$CommonLib->readCookie($cookie);
    my $amfFull=$CommonLib->readCookie_fullB($cookie);
    if ($query_string) {
    		  my @vars = split(/&/, $query_string); 	  
    		  foreach $var (sort @vars){
    			if ($var) {
    				my ($v,$i) = split(/=/, $var);
    				$v =~ tr/+/ /;
    				$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
				if ($i) {
					$i =~ tr/+/ /;
					$i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
					$i =~ s/<!--(.|\n)*-->//g;
					$ArrayQuery{$v}=$i;
				}
    			}
    		  }
    	  if (($ArrayQuery{amf})  && $restmode eq 'true') {
    		$user_agent=lc($ArrayQuery{amf});
    	  }
          if ($ArrayQuery{$mobilenable}) {
                $f->err_headers_out->set('Set-Cookie' => "amfFull=false; path=/;");
                $amfFull='ok';
          }    

    }

          $user_agent=lc($user_agent);
	if ($user_agent =~ m/blackberry/i) {	 
		$user_agent=substr($user_agent,index($user_agent,'blackberry'));
	}
	if ($user_agent =~ m/up.link/i ) {

lib/Apache2/AMF51DegreesFilter.pm  view on Meta::CPAN

					$f->pnotes("$capability2" => $ArrayCapFound{$capability2});
				}

				$variabile2="id=$id&$variabile2&realpcbrowser=$realPCbrowser";
				$f->subprocess_env("AMF_ID" => $id);
				$f->pnotes('id' => $id);
				$cacheSystem->store( '51Degrees-id', $id, $variabile2 );
				$cacheSystem->store( '51Degrees-ua', $user_agent, $id);
			}
			if ($cookiecachesystem eq "true") {
				$f->err_headers_out->set('Set-Cookie' => "amf=$id; path=/;");	
			}		  			  
	      	} 
    }
        if ($ArrayCapFound{'ScreenPixelsWidth'} ne 'Unknown') {
            $f->pnotes("max_image_width" => $ArrayCapFound{'ScreenPixelsWidth'});
            $f->pnotes("max_image_height" => $ArrayCapFound{'ScreenPixelsHeight'});            
        }
        if ($ArrayCapFound{'IsTablet'}) {
            $f->pnotes("is_tablet" => lc($ArrayCapFound{'IsTablet'}));
            $f->subprocess_env("AMF_DEVICE_IS_TABLET" => lc($ArrayCapFound{'IsTablet'}));

lib/Apache2/AMF51DegreesFilterMemcached.pm  view on Meta::CPAN

				      $MobileArray{$dummy}='mobile';
				}
				      $CommonLib->printLog("AMFMobileKeys is: $ENV{AMFMobileKeys}");
		} 	
	             

		 if ($ENV{AMFProductionMode}) {
			$cookiecachesystem=$ENV{AMFProductionMode};
			$CommonLib->printLog("AMFProductionMode is: $cookiecachesystem");
		 } else {
			$CommonLib->printLog("AMFProductionMode (the CookieCacheSystem is deprecated) is not setted the default value is $cookiecachesystem");			   
      		 }		
	
		if ($ENV{Personal51DegreesFileName}) {
			$personal51Degreesurl=$ENV{AMFMobileHome}."/".$ENV{Personal51DegreesFileName};
			$CommonLib->printLog("Personal51DegreesFileName is: $ENV{Personal51DegreesFileName}");
		}

		if ($ENV{RestMode}) {
			$restmode=$ENV{RestMode};
			$CommonLib->printLog("RestMode is: $restmode");

lib/Apache2/AMF51DegreesFilterMemcached.pm  view on Meta::CPAN

    my $query_string=$f->args;
    my $docroot = $f->document_root();
    my $id="";
    my $location="none";
    my $width_toSearch;
    my $type_redirect="internal";
    my $return_value;
    my $dummy="";
    my $variabile2="";
    my %ArrayCapFound;
    my $controlCookie;
    my $query_img="";
    $ArrayCapFound{is_transcoder}='false';
    $ArrayCapFound{'IsMobile'}='true';

    my %ArrayQuery;
    my $var;
    my $version="";
    my $realPCbrowser='none';

    if ($user_agent eq "") {
	$user_agent="no useragent found";
    }
    if ($x_user_agent) {
       $user_agent=lc($x_user_agent);
    }	  
    if ($x_operamini_phone_ua) {
       $user_agent=lc($x_operamini_phone_ua);
    }
    my $cookie = $f->headers_in->{Cookie} || '';
    $id=$CommonLib->readCookie($cookie);
    my $amfFull=$CommonLib->readCookie_fullB($cookie);
    if ($query_string) {
    		  my @vars = split(/&/, $query_string); 	  
    		  foreach $var (sort @vars){
    			if ($var) {
    				my ($v,$i) = split(/=/, $var);
    				$v =~ tr/+/ /;
    				$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
				if ($i) {
					$i =~ tr/+/ /;
					$i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
					$i =~ s/<!--(.|\n)*-->//g;
					$ArrayQuery{$v}=$i;
				}
    			}
    		  }
    	  if (($ArrayQuery{amf})  && $restmode eq 'true') {
    		$user_agent=lc($ArrayQuery{amf});
    	  }
          if ($ArrayQuery{$mobilenable}) {
                $f->err_headers_out->set('Set-Cookie' => "amfFull=false; path=/;");
                $amfFull='ok';
          }    

    }
    $user_agent=lc($user_agent);
	if ($user_agent =~ m/blackberry/i) {	 
		$user_agent=substr($user_agent,index($user_agent,'blackberry'));
	}
	if ($user_agent =~ m/up.link/i ) {
		$user_agent=substr($user_agent,0,index($user_agent,'up.link') - 1);

lib/Apache2/AMF51DegreesFilterMemcached.pm  view on Meta::CPAN

						$f->subprocess_env("AMF_$upper" => $ArrayCapFound{$capability2});
						$f->pnotes("$capability2" => $ArrayCapFound{$capability2});
					}
                                    
                                    $variabile2="id=$id&$variabile2";
				    $f->subprocess_env("AMF_ID" => $id);
                                    $f->pnotes('id' => $id);
				    $memd->set("D51_$id",$variabile2);
			}
			if ($cookiecachesystem eq "true") {
						$f->err_headers_out->set('Set-Cookie' => "amf=$id; path=/;");	
			}		  			  
	}
        if ($ArrayCapFound{'ScreenPixelsWidth'} ne 'Unknown') {
            $f->pnotes("max_image_width" => $ArrayCapFound{'ScreenPixelsWidth'});
            $f->pnotes("max_image_height" => $ArrayCapFound{'ScreenPixelsHeight'});            
        }
        if ($ArrayCapFound{'IsTablet'}) {
            $f->pnotes("is_tablet" => lc($ArrayCapFound{'IsTablet'}));
            $f->subprocess_env("AMF_DEVICE_IS_TABLET" => lc($ArrayCapFound{'IsTablet'}));
        }

lib/Apache2/AMFCommonLib.pm  view on Meta::CPAN

	    $ua = shift;
	}
	foreach my $pair (@arrayBot) {
	  if (index($ua,$pair) > -1 ) {
	    $ua='It is a bot';
	  }
	}
	return $ua;

}
sub readCookie {
    my $self = shift;
    my $cookie_search;
	if (@_) {
		    $cookie_search = shift;
	}
    my $param_tofound;
    my $string_tofound;
    my $value="";
    my $id_return="";
    my @pairs = split(/;/, $cookie_search);
    my $name;
    foreach $param_tofound (@pairs) {
       ($string_tofound,$value)=split(/=/, $param_tofound);
       if ($string_tofound =~ "amfID") {
           $id_return=$value;
       }
    }   
    return $id_return;
}
sub readCookie_fullB {
    my $self = shift;
    my $cookie_search;
	if (@_) {
		    $cookie_search = shift;
	}
    my $param_tofound;
    my $string_tofound;
    my $value="";
    my $id_return="";
    my @pairs = split(/;/, $cookie_search);

lib/Apache2/AMFDetectRightFilter.pm  view on Meta::CPAN

				      $MobileArray{$dummy}='mobile';
				}
				      $CommonLib->printLog("AMFMobileKeys is: $ENV{AMFMobileKeys}");
		} 	
	             

			 if ($ENV{AMFProductionMode}) {
				$cookiecachesystem=$ENV{AMFProductionMode};
				$CommonLib->printLog("AMFProductionMode is: $cookiecachesystem");
			 } else {
				$CommonLib->printLog("AMFProductionMode (the CookieCacheSystem is deprecated) is not setted the default value is $cookiecachesystem");			   
			 }		
		if ($ENV{PersonalDetectRightFileName}) {
			$personalDetectRighturl=$ENV{AMFMobileHome}."/".$ENV{PersonalDetectRightFileName};
			$CommonLib->printLog("PersonalDetectRightFileName is: $ENV{PersonalDetectRightFileName}");
		}
		if ($ENV{RestMode}) {
			$restmode=$ENV{RestMode};
			$CommonLib->printLog("RestMode is: $restmode");
		}
		if ($ENV{AMFDeepParse}) {

lib/Apache2/AMFDetectRightFilter.pm  view on Meta::CPAN

    my $query_string=$f->args;
    my $docroot = $f->document_root();
    my $id="";
    my $location="none";
    my $width_toSearch;
    my $type_redirect="internal";
    my $return_value;
    my $dummy="";
    my $variabile2="";
    my %ArrayCapFound;
    my $controlCookie;
    my $query_img="";
    $ArrayCapFound{is_transcoder}='false';
    $ArrayCapFound{'device_claims_web_support'}='none';
    $ArrayCapFound{'is_wireless_device'}='none';
    my %ArrayQuery;
    my $var;
    my $mobile=0;
    my $version="";
    my $realPCbrowser='none';
    if ($user_agent eq "") {
	$user_agent="no useragent found";
    }
    if ($x_user_agent) {
       $user_agent=lc($x_user_agent);
    }	  
    if ($x_operamini_phone_ua) {
       $user_agent=lc($x_operamini_phone_ua);
    }
    my $cookie = $f->headers_in->{Cookie} || '';
    $id=$CommonLib->readCookie($cookie);
    my $amfFull=$CommonLib->readCookie_fullB($cookie);
    if ($query_string) {
    		  my @vars = split(/&/, $query_string); 	  
    		  foreach $var (sort @vars){
    			if ($var) {
    				my ($v,$i) = split(/=/, $var);
    				$v =~ tr/+/ /;
    				$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
				if ($i) {
					$i =~ tr/+/ /;
					$i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
					$i =~ s/<!--(.|\n)*-->//g;
					$ArrayQuery{$v}=$i;
				}
    			}
    		  }
    	  if (($ArrayQuery{amf})  && $restmode eq 'true') {
    		$user_agent=lc($ArrayQuery{amf});
    	  }
          if ($ArrayQuery{$mobilenable}) {
                $f->err_headers_out->set('Set-Cookie' => "amfFull=false; path=/;");
                $amfFull='ok';
          }    

    }
    $user_agent=lc($user_agent);
	if ($user_agent =~ m/blackberry/i) {	 
		$user_agent=substr($user_agent,index($user_agent,'blackberry'));
		$mobile=1;
	}
	if ($user_agent =~ m/up.link/i ) {

lib/Apache2/AMFDetectRightFilter.pm  view on Meta::CPAN

                                    $ArrayCapFound{'device_claims_web_support'}='true';
                                }

				$variabile2="id=$id&$variabile2&realpcbrowser=$realPCbrowser";
				$f->subprocess_env("AMF_ID" => $id);
				$f->pnotes('id' => $id);
				$cacheSystem->store( 'DetectRight-id', $id, $variabile2 );
				$cacheSystem->store( 'DetectRight-ua', $user_agent, $id);
			}
			if ($cookiecachesystem eq "true") {
				$f->err_headers_out->set('Set-Cookie' => "amfID=$id; path=/;");	
			}		  			  
	      	} 
    }
        my $amf_device_ismobile = 'true';
	if ($ArrayCapFound{'device_claims_web_support'} eq 'true' && $ArrayCapFound{'is_wireless_device'} eq 'false') {
	        $amf_device_ismobile = 'false';		
	}
        if ($ArrayCapFound{'is_tablet'}) {
            $f->subprocess_env("AMF_DEVICE_IS_TABLET" => lc($ArrayCapFound{'is_tablet'}));
        }

lib/Apache2/AMFDetectRightFilterMemcached.pm  view on Meta::CPAN

				      $MobileArray{$dummy}='mobile';
				}
				      $CommonLib->printLog("AMFMobileKeys is: $ENV{AMFMobileKeys}");
		} 	
	             

		 if ($ENV{AMFProductionMode}) {
			$cookiecachesystem=$ENV{AMFProductionMode};
			$CommonLib->printLog("AMFProductionMode is: $cookiecachesystem");
		 } else {
			$CommonLib->printLog("AMFProductionMode (the CookieCacheSystem is deprecated) is not setted the default value is $cookiecachesystem");			   
      		 }		
	
		if ($ENV{PersonalDetectRightFileName}) {
			$personalDetectRighturl=$ENV{AMFMobileHome}."/".$ENV{PersonalDetectRightFileName};
			$CommonLib->printLog("PersonalDetectRightFileName is: $ENV{PersonalDetectRightFileName}");
		}

		if ($ENV{RestMode}) {
			$restmode=$ENV{RestMode};
			$CommonLib->printLog("RestMode is: $restmode");

lib/Apache2/AMFDetectRightFilterMemcached.pm  view on Meta::CPAN

    my $query_string=$f->args;
    my $docroot = $f->document_root();
    my $id="";
    my $location="none";
    my $width_toSearch;
    my $type_redirect="internal";
    my $return_value;
    my $dummy="";
    my $variabile2="";
    my %ArrayCapFound;
    my $controlCookie;
    my $query_img="";
    $ArrayCapFound{is_transcoder}='false';
    $ArrayCapFound{'device_claims_web_support'}='none';
    $ArrayCapFound{'is_wireless_device'}='none';

    my %ArrayQuery;
    my $var;
    my $mobile=0;
    my $version="";
    my $realPCbrowser='none';

    if ($user_agent eq "") {
	$user_agent="no useragent found";
    }
    if ($x_user_agent) {
       $user_agent=lc($x_user_agent);
    }	  
    if ($x_operamini_phone_ua) {
       $user_agent=lc($x_operamini_phone_ua);
    }
    my $cookie = $f->headers_in->{Cookie} || '';
    $id=$CommonLib->readCookie($cookie);
    my $amfFull=$CommonLib->readCookie_fullB($cookie);
    if ($query_string) {
    		  my @vars = split(/&/, $query_string); 	  
    		  foreach $var (sort @vars){
    			if ($var) {
    				my ($v,$i) = split(/=/, $var);
    				$v =~ tr/+/ /;
    				$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
				if ($i) {
					$i =~ tr/+/ /;
					$i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
					$i =~ s/<!--(.|\n)*-->//g;
					$ArrayQuery{$v}=$i;
				}
    			}
    		  }
    	  if (($ArrayQuery{amf})  && $restmode eq 'true') {
    		$user_agent=lc($ArrayQuery{amf});
    	  }
          if ($ArrayQuery{$mobilenable}) {
                $f->err_headers_out->set('Set-Cookie' => "amfFull=false; path=/;");
                $amfFull='ok';
          }    

    }
    $user_agent=lc($user_agent);
	if ($user_agent =~ m/blackberry/i) {	 
		$user_agent=substr($user_agent,index($user_agent,'blackberry'));
		$mobile=1;
	}
	if ($user_agent =~ m/up.link/i ) {

lib/Apache2/AMFDetectRightFilterMemcached.pm  view on Meta::CPAN

						$f->subprocess_env("AMF_$upper" => $ArrayCapFound{$capability2});
						$f->pnotes("$capability2" => $ArrayCapFound{$capability2});
					}
                                    
                                    $variabile2="id=$id&$variabile2";
				    $f->subprocess_env("AMF_ID" => $id);
                                    $f->pnotes('id' => $id);
      				    $memd->set("DR_$id",$variabile2);
			}
			if ($cookiecachesystem eq "true") {
						$f->err_headers_out->set('Set-Cookie' => "amfID=$id; path=/;");	
			}		  			  
	} 
        my $amf_device_ismobile = 'true';
	if ($ArrayCapFound{'device_claims_web_support'} eq 'true' && $ArrayCapFound{'is_wireless_device'} eq 'false') {
	        $amf_device_ismobile = 'false';		
	}
        if ($amfFull ne "") {
            $f->subprocess_env("AMF_FORCE_TO_DESKTOP" => 'true');
            $f->pnotes("amf_force_to_desktop" => 'true');
        }

lib/Apache2/AMFImageRendering.pm  view on Meta::CPAN

      my $servername=$f->r->get_server_name();
      my $id="";
      my $method="";     
      my $location;
      my $width_toSearch;
      my $type_redirect="internal";
      my $return_value=Apache2::Const::DECLINED;
	  my $dummy="";
	  my $variabile2="";
	  my %ArrayCapFound;
	  my $controlCookie;
	  my $query_img="";
      my %ArrayQuery;
      my $var;
      my $cookie = $f->r->headers_in->{Cookie} || '';
      my $width=1000;
      my $height=1000;
      my $image2="";
      my $device_claims_web_support='null';
      my $is_wireless_device='null';
      my $isMobile='true';

      $content_type=lc($content_type);
      if ($f->r->pnotes('max_image_width')) {      
      	$width=$f->r->pnotes('max_image_width')

lib/Apache2/AMFLiteDetectionFilter.pm  view on Meta::CPAN

    my $docroot = $f->document_root();
    my $id="";
    my $location="none";
    my $isTablet="false";
    my $width_toSearch;
    my $type_redirect="internal";
    my $return_value;
    my $dummy="";
    my $variabile2="";
    my %ArrayCapFound;
    my $controlCookie;
    my $query_img="";
    $ArrayCapFound{is_transcoder}='false';
    my %ArrayQuery;
    my $var;
    my $mobile=0;
    my $amf_device_istablet='false';
    my $amf_device_istouch='false';
    my $amf_device_ismobile='';
    my $amf_device_istv='';
    my $version="";

lib/Apache2/AMFLiteDetectionFilter.pm  view on Meta::CPAN

    my $amf_browser_version='nc';
    if ($user_agent eq "") {
	$user_agent="no useragent found";
    }
    if ($x_user_agent) {
       $user_agent=lc($x_user_agent);
    }	  
    if ($x_operamini_phone_ua) {
       $user_agent=lc($x_operamini_phone_ua);
    }
    my $cookie = $f->headers_in->{Cookie} || '';
    if ($CommonLib->readCookie($cookie) eq 'true' || $CommonLib->readCookie($cookie) eq 'false') {
	$amf_device_ismobile=$CommonLib->readCookie($cookie);	
    }
    my $amfFull=$CommonLib->readCookie_fullB($cookie);
    if ($query_string) {
    		  my @vars = split(/&/, $query_string); 	  
    		  foreach $var (sort @vars){
    			if ($var) {
    				my ($v,$i) = split(/=/, $var);
    				$v =~ tr/+/ /;
    				$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
				if ($i) {
					$i =~ tr/+/ /;
					$i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
					$i =~ s/<!--(.|\n)*-->//g;
					$ArrayQuery{$v}=$i;
				}
    			}
    		  }
          if (($ArrayQuery{amf})  && $restmode eq 'true') {
    		$user_agent=lc($ArrayQuery{amf});
    	  }
          if ($ArrayQuery{$mobilenable}) {
                $f->err_headers_out->set('Set-Cookie' => "amfFull=false; path=/;");
                $amfFull='ok';
          }    

    }
    $user_agent=&cleanUA($user_agent);
	if ($amf_device_ismobile eq "") {
		$amf_device_ismobile = &isMobile($user_agent);
		if ($amf_device_ismobile eq 'true') {
			$amf_device_istouch = &isTouch($user_agent);
			$amf_device_istablet=&isTablet($user_agent);
            $amf_device_os=&getOperativeSystem($user_agent);
 		} else {
            $amf_device_os=&getOperativeDesktopSystem($user_agent);            
        }
        $amf_device_os_version=&getOperativeSystemVersion($user_agent,$amf_device_os);            
		$amf_device_istv = &isTV($user_agent);
		if ($cookiecachesystem eq "true") {
			$f->err_headers_out->set('Set-Cookie' => "amfID=$id; path=/;");	
		}	
	}
    ($amf_browser_type,$amf_browser_version)=&getBrowserVersion($user_agent);
        if ($amfFull ne "") {
            $f->subprocess_env("AMF_FORCE_TO_DESKTOP" => 'true');
            $f->pnotes("amf_force_to_desktop" => 'true');
        }
	$f->pnotes('is_tablet' => $amf_device_istablet);
	$f->pnotes("amf_device_ismobile" => $amf_device_ismobile);
	$f->pnotes("is_touch" => $amf_device_istouch);

lib/Apache2/AMFWURFLFilter.pm  view on Meta::CPAN

				      $MobileArray{$dummy}='mobile';
				}
				      $CommonLib->printLog("AMFMobileKeys is: $ENV{AMFMobileKeys}");
		} 	
	             

			 if ($ENV{AMFProductionMode}) {
				$cookiecachesystem=$ENV{AMFProductionMode};
				$CommonLib->printLog("AMFProductionMode is: $cookiecachesystem");
			 } else {
				$CommonLib->printLog("AMFProductionMode (the CookieCacheSystem is deprecated) is not setted the default value is $cookiecachesystem");			   
			 }		
		if ($ENV{PersonalWurflFileName}) {
			$personalwurflurl=$ENV{AMFMobileHome}."/".$ENV{PersonalWurflFileName};
			$CommonLib->printLog("PersonalWurflFileName is: $ENV{PersonalWurflFileName}");
		}
		if ($ENV{RestMode}) {
			$restmode=$ENV{RestMode};
			$CommonLib->printLog("RestMode is: $restmode");
		}
		if ($ENV{AMFDeepParse}) {

lib/Apache2/AMFWURFLFilter.pm  view on Meta::CPAN

    my $query_string=$f->args;
    my $docroot = $f->document_root();
    my $id="";
    my $location="none";
    my $width_toSearch;
    my $type_redirect="internal";
    my $return_value;
    my $dummy="";
    my $variabile2="";
    my %ArrayCapFound;
    my $controlCookie;
    my $query_img="";
    $ArrayCapFound{is_transcoder}='false';
    $ArrayCapFound{'device_claims_web_support'}='none';
    $ArrayCapFound{'is_wireless_device'}='none';

    my %ArrayQuery;
    my $var;
    my $mobile=0;
    my $version="";
    if ($user_agent eq "") {
	$user_agent="no useragent found";
    }
    if ($x_user_agent) {
       $user_agent=lc($x_user_agent);
    }	  
    if ($x_operamini_phone_ua) {
       $user_agent=lc($x_operamini_phone_ua);
    }
    my $cookie = $f->headers_in->{Cookie} || '';
    $id=$CommonLib->readCookie($cookie);
    my $amfFull=$CommonLib->readCookie_fullB($cookie);
    if ($query_string) {
    		  my @vars = split(/&/, $query_string); 	  
    		  foreach $var (sort @vars){
    			if ($var) {
    				my ($v,$i) = split(/=/, $var);
    				$v =~ tr/+/ /;
    				$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
				if ($i) {
					$i =~ tr/+/ /;
					$i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
					$i =~ s/<!--(.|\n)*-->//g;
					$ArrayQuery{$v}=$i;
				}
    			}
    		  }
    	  if (($ArrayQuery{amf})  && $restmode eq 'true') {
    		$user_agent=lc($ArrayQuery{amf});
    	  }
          if ($ArrayQuery{$mobilenable}) {
                $f->err_headers_out->set('Set-Cookie' => "amfFull=false; path=/;");
                $amfFull='ok';
          }    

    }

        $user_agent=lc($user_agent);
	if ($user_agent =~ m/blackberry/i) {	 
		$user_agent=substr($user_agent,index($user_agent,'blackberry'));
		$mobile=1;
	}

lib/Apache2/AMFWURFLFilter.pm  view on Meta::CPAN

					$f->subprocess_env("AMF_$upper" => $ArrayCapFound{$capability2});
					$f->pnotes("$capability2" => $ArrayCapFound{$capability2});
				}
				$variabile2="id=$id&$variabile2";
				$f->subprocess_env("AMF_ID" => $id);
				$f->pnotes('id' => $id);
				$cacheSystem->store( 'wurfl-id', $id, $variabile2 );
				$cacheSystem->store( 'wurfl-ua', $user_agent, $id);
			}
			if ($cookiecachesystem eq "true") {
				$f->err_headers_out->set('Set-Cookie' => "amfID=$id; path=/;");	
			}		  			  
	      	} 
    }
        my $amf_device_ismobile = 'true';
	if (($ArrayCapFound{'device_claims_web_support'}) && ($ArrayCapFound{'device_claims_web_support'})) {
		if ($ArrayCapFound{'device_claims_web_support'} eq 'true' && $ArrayCapFound{'is_wireless_device'} eq 'false') {
			$amf_device_ismobile = 'false';		
		}
	}
        if ($amfFull ne "") {

lib/Apache2/AMFWURFLFilterMemcached.pm  view on Meta::CPAN

				      $MobileArray{$dummy}='mobile';
				}
				      $CommonLib->printLog("AMFMobileKeys is: $ENV{AMFMobileKeys}");
		} 	
	             

			 if ($ENV{AMFProductionMode}) {
				$cookiecachesystem=$ENV{AMFProductionMode};
				$CommonLib->printLog("AMFProductionMode is: $cookiecachesystem");
			 } else {
				$CommonLib->printLog("AMFProductionMode (the CookieCacheSystem is deprecated) is not setted the default value is $cookiecachesystem");			   
			 }		
	
		if ($ENV{PersonalWurflFileName}) {
			$personalwurflurl=$ENV{AMFMobileHome}."/".$ENV{PersonalWurflFileName};
			$CommonLib->printLog("PersonalWurflFileName is: $ENV{PersonalWurflFileName}");
		}

		if ($ENV{RestMode}) {
			$restmode=$ENV{RestMode};
			$CommonLib->printLog("RestMode is: $restmode");

lib/Apache2/AMFWURFLFilterMemcached.pm  view on Meta::CPAN

    my $query_string=$f->args;
    my $docroot = $f->document_root();
    my $id="";
    my $location="none";
    my $width_toSearch;
    my $type_redirect="internal";
    my $return_value;
	my $dummy="";
	my $variabile2="";
	my %ArrayCapFound;
	my $controlCookie;
	my $query_img="";
	$ArrayCapFound{is_transcoder}='false';
    my %ArrayQuery;
    my $var;
    my $mobile=0;
    my $version="";
    if ($user_agent eq "") {
	$user_agent="no useragent found";
    }
    if ($x_user_agent) {
       $user_agent=lc($x_user_agent);
    }	  
    if ($x_operamini_phone_ua) {
       $user_agent=lc($x_operamini_phone_ua);
    }
    my $cookie = $f->headers_in->{Cookie} || '';
    $id=$CommonLib->readCookie($cookie);
    my $amfFull=$CommonLib->readCookie_fullB($cookie);
    if ($query_string) {
    		  my @vars = split(/&/, $query_string); 	  
    		  foreach $var (sort @vars){
    			if ($var) {
    				my ($v,$i) = split(/=/, $var);
    				$v =~ tr/+/ /;
    				$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
				if ($i) {
					$i =~ tr/+/ /;
					$i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
					$i =~ s/<!--(.|\n)*-->//g;
					$ArrayQuery{$v}=$i;
				}
    			}
    		  }
    	  if (($ArrayQuery{amf})  && $restmode eq 'true') {
    		$user_agent=lc($ArrayQuery{amf});
    	  }
          if ($ArrayQuery{$mobilenable}) {
                $f->err_headers_out->set('Set-Cookie' => "amfFull=false; path=/;");
                $amfFull='ok';
          }    

    }
    $user_agent=lc($user_agent);

	if ($user_agent =~ m/blackberry/i) {	 
		$user_agent=substr($user_agent,index($user_agent,'blackberry'));
		$mobile=1;
	}

lib/Apache2/AMFWURFLFilterMemcached.pm  view on Meta::CPAN

						my $upper=uc($capability2);
						$f->subprocess_env("AMF_$upper" => $ArrayCapFound{$capability2});
						$f->pnotes("$capability2" => $ArrayCapFound{$capability2});
					}
					$variabile2="id=$id&$variabile2";
					$f->subprocess_env("AMF_ID" => $id);
					$f->pnotes('id' => $id);
					$memd->set("WURFL_$id",$variabile2);
			}
			if ($cookiecachesystem eq "true") {
						$f->err_headers_out->set('Set-Cookie' => "amfID=$id; path=/;");	
			}		  			  
	} 
        my $amf_device_ismobile = 'true';
	if (($ArrayCapFound{'device_claims_web_support'}) && ($ArrayCapFound{'device_claims_web_support'})) {
		if ($ArrayCapFound{'device_claims_web_support'} eq 'true' && $ArrayCapFound{'is_wireless_device'} eq 'false') {
			$amf_device_ismobile = 'false';		
		}
	}
        if ($amfFull ne "") {
            $f->subprocess_env("AMF_FORCE_TO_DESKTOP" => 'true');



( run in 1.726 second using v1.01-cache-2.11-cpan-c966e8aa7e8 )