[Netpass-devel] NetPass/www/components OSDetect,1.1.1.1,1.2
Brought to you by:
jeffmurphy
From: jeff m. <jef...@us...> - 2007-08-29 17:34:26
|
Update of /cvsroot/netpass/NetPass/www/components In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4093/www/components Modified Files: OSDetect Log Message: enhances os detection Index: OSDetect =================================================================== RCS file: /cvsroot/netpass/NetPass/www/components/OSDetect,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- OSDetect 24 Sep 2004 01:05:20 -0000 1.1.1.1 +++ OSDetect 29 Aug 2007 17:34:25 -0000 1.2 @@ -13,16 +13,22 @@ my $ua = lc($ENV{'HTTP_USER_AGENT'}); my $os = "Unknown"; + my @os_list = ( 'linux', 'x11', 'mac', + 'Windows NT 6.0', 'Windows NT 5.1', 'Windows', + 'bsd' ); + my $os_map = { 'linux' => 'Linux', 'x11' => 'Unix', 'mac' => 'Mac', - 'win' => 'Windows', + 'Windows NT 6.0' => 'Windows Vista', + 'Windows NT 5.1' => 'Windows XP', + 'Windows' => 'Windows Other', 'bsd' => 'BSD' }; - foreach my $k (sort keys(%$os_map)) { - if($ua =~ /$k/) { + foreach my $k (@os_list)) { + if($ua =~ /$k/i) { $os = $os_map->{$k}; last; } |