From 078fb91f6b58233066d96a3ff0b4cde19d8e4db2 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 4 Oct 2006 07:50:05 +0000 Subject: --- system/helpers/user_agent_helper.php | 89 ++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 system/helpers/user_agent_helper.php (limited to 'system/helpers') diff --git a/system/helpers/user_agent_helper.php b/system/helpers/user_agent_helper.php new file mode 100644 index 000000000..3c6085e77 --- /dev/null +++ b/system/helpers/user_agent_helper.php @@ -0,0 +1,89 @@ + 'Windows Longhorn', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 5.1' => 'Windows XP', + 'windows nt 4.0' => 'Windows NT 4.0', + 'winnt4.0' => 'Windows NT 4.0', + 'winnt 4.0' => 'Windows NT', + 'winnt' => 'Windows NT', + 'windows 98' => 'Windows 98', + 'win98' => 'Windows 98', + 'windows 95' => 'Windows 95', + 'win95' => 'Windows 95', + 'windows' => 'Unknown Windows OS', + 'mac os x' => 'Mac OS X', + 'freebsd' => 'FreeBSD', + 'ppc' => 'Macintosh', + 'sunos' => 'Sun Solaris', + 'linux' => 'Linux', + 'debian' => 'Debian', + 'beos' => 'BeOS', + 'apachebench' => 'ApacheBench', + 'aix' => 'AIX', + 'irix' => 'Irix', + 'osf' => 'DEC OSF', + 'hp-ux' => 'HP-UX', + 'netbsd' => 'NetBSD', + 'bsdi' => 'BSDi', + 'openbsd' => 'OpenBSD', + 'gnu' => 'GNU/Linux', + 'unix' => 'Unknown Unix OS' + ); + + + foreach ($os as $key => $val) + { + if (preg_match("|$key|i", $_SERVER['HTTP_USER_AGENT'])) + { + return $val; + } + } + + return 'Unknown OS'; +} + + +?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b