[PC-BSD Commits] r2085 - websites/pbidir.com/bibivu/sbin

svn at pcbsd.org svn at pcbsd.org
Wed Jun 11 07:45:01 PDT 2008


Author: fabry
Date: 2008-06-11 07:45:00 -0700 (Wed, 11 Jun 2008)
New Revision: 2085

Modified:
   websites/pbidir.com/bibivu/sbin/user_info.php
Log:
it is possible to grab more info from the user_agent

Modified: websites/pbidir.com/bibivu/sbin/user_info.php
===================================================================
--- websites/pbidir.com/bibivu/sbin/user_info.php	2008-06-11 03:01:13 UTC (rev 2084)
+++ websites/pbidir.com/bibivu/sbin/user_info.php	2008-06-11 14:45:00 UTC (rev 2085)
@@ -33,6 +33,7 @@
 			$return['encoding']			= $this->encoding();
 			$return['charset']			= $this->charset();
 			$return['IP']				= $this->IP();
+			$return['security']			= $this->security();
 			$return['is_crawler']		= $this->is_crawler();
 			//return the Country
 //			$return['country'] = phpAds_geoip_getGeo($IP, dirname(__FILE__).'/files_includes/geoip/GeoIP-106_20040501.dat');
@@ -67,11 +68,22 @@
 		}
 		return $return;
 	}
-	
 	public function user_agent(){
 		//return the user agent
 		return isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:'';
 	}
+	public function security(){
+		$return = 'unknown';
+		$ua = $this->user_agent();
+		if(($pos = strpos($ua,' N;')) !== false) {
+			$return = 'no';
+		}elseif(($pos = strpos($ua,' U;')) !== false) {
+			$return = 'strong';
+		}elseif(($pos = strpos($ua,' I;')) !== false) {
+			$return = 'weak';
+		}
+		return $return;		
+	}
 	public function browser($what=''){
 		//return the Browser
 		$UserAgent = $this->user_agent();
@@ -235,6 +247,10 @@
 		//mac
 		$os['mac']			= array('name'=>'macintosh','version'=>'');
 		$os['Mac OS X']		= array('name'=>'macintosh','version'=>'OS X');
+		$os['Mac OS X 10_4']		= array('name'=>'macintosh','version'=>'OS X 10.4.x (Tiger)');
+		$os['Mac OS X 10_5']		= array('name'=>'macintosh','version'=>'OS X 10.5.x (Leopard)');
+		$os['Mac OS X 10_5_2']		= array('name'=>'macintosh','version'=>'OS X 10.5.2 (Leopard)');
+		$os['Mac OS X 10_5_3']		= array('name'=>'macintosh','version'=>'OS X 10.5.3 (Leopard)');
 		$os['Mac 10']		= array('name'=>'macintosh','version'=>'OS X');
 		$os['PowerPC']		= array('name'=>'macintosh','version'=>'PPC');
 		$os['PPC']			= array('name'=>'macintosh','version'=>'PPC');
@@ -648,7 +664,12 @@
 Here a few info about you
 <ul>
 <li>IP: <?=$uinfo->IP();?></li>
-<li>OS: <?=$uinfo->os();?></li>
+<li>OS: <?=$uinfo->os();?>
+	<ul>
+		<li>name: <?=$uinfo->os('name');?></li>
+		<li>version: <?=$uinfo->os('version');?></li>
+	</ul>
+</li>
 <li>Are you a spider/robot: <?=$uinfo->is_crawler()?'Yes':'No'?></li>
 <li>Browser: <?=$uinfo->browser();?>
 	<ul>
@@ -656,6 +677,7 @@
 		<li>version: <?=$uinfo->browser('version');?></li>
 	</ul>
 </li>
+<li>Security: <?=$uinfo->security();?></li>
 <li>Languages:
 	<ul><?php
 	$tmps = $uinfo->language();
@@ -701,4 +723,4 @@
 
 
 */
-?>
\ No newline at end of file
+?>



More information about the Commits mailing list