Index: branches/2.2/phpgwapi/inc/class.browser.inc.php
===================================================================
--- branches/2.2/phpgwapi/inc/class.browser.inc.php	(revision 2)
+++ branches/2.2/phpgwapi/inc/class.browser.inc.php	(revision 3621)
@@ -33,4 +33,16 @@
 		var $data;
 
+		const PLATFORM_WINDOWS = 'Win';
+		const PLATFORM_MAC = 'Mac';
+		const PLATFORM_LINUX = 'Linux';
+		const PLATFORM_BEOS = 'Beos';
+		const PLATFORM_IPHONE = 'iPhone';
+		const PLATFORM_IPOD = 'iPod';
+		const PLATFORM_IPAD = 'iPad';
+		const PLATFORM_BLACKBERRY = 'BlackBerry';
+		const PLATFORM_NOKIA = 'Nokia';
+		const PLATFORM_ANDROID = 'Android';
+		const PLATFORM_UNIX = 'Unix';
+
 		function browser()
 		{
@@ -76,23 +88,47 @@
 				Determine platform
 			*/
-			if(strstr($HTTP_USER_AGENT,'Win'))
-			{
-				$this->BROWSER_PLATFORM='Win';
-			}
+			if(strstr($HTTP_USER_AGENT,'iPad'))
+			{
+				$this->BROWSER_PLATFORM = self::PLATFORM_IPAD;
+			}
+			elseif(strstr($HTTP_USER_AGENT,'iPod'))
+			{
+				$this->BROWSER_PLATFORM = self::PLATFORM_IPOD;
+			}
+			elseif(strstr($HTTP_USER_AGENT,'iPhone'))
+			{
+				$this->BROWSER_PLATFORM = self::PLATFORM_IPHONE;
+			}
+			elseif(strstr($HTTP_USER_AGENT,'BlackBerry'))
+			{
+				$this->BROWSER_PLATFORM = self::PLATFORM_BLACKBERRY;
+			}
+			elseif(strstr($HTTP_USER_AGENT,'Android'))
+			{
+				$this->BROWSER_PLATFORM = self::PLATFORM_ANDROID;
+			}
+			elseif(strstr($HTTP_USER_AGENT,'Nokia'))
+			{
+				$this->BROWSER_PLATFORM = self::PLATFORM_NOKIA;
+			}			
 			elseif(strstr($HTTP_USER_AGENT,'Mac'))
 			{
-				$this->BROWSER_PLATFORM='Mac';
-			}
+				$this->BROWSER_PLATFORM = self::PLATFORM_MAC;
+			}
+			elseif(strstr($HTTP_USER_AGENT,'Win'))
+			{
+				$this->BROWSER_PLATFORM = self::PLATFORM_WINDOWS;
+			}			
 			elseif(strstr($HTTP_USER_AGENT,'Linux'))
 			{
-				$this->BROWSER_PLATFORM='Linux';
+				$this->BROWSER_PLATFORM = self::PLATFORM_LINUX;
 			}
 			elseif(strstr($HTTP_USER_AGENT,'Unix'))
 			{
-				$this->BROWSER_PLATFORM='Unix';
+				$this->BROWSER_PLATFORM = self::PLATFORM_UNIX;
 			}
 			elseif(strstr($HTTP_USER_AGENT,'Beos'))
 			{
-				$this->BROWSER_PLATFORM='Beos';
+				$this->BROWSER_PLATFORM = self::PLATFORM_BEOS;
 			}
 			else
@@ -155,60 +191,55 @@
 		function is_linux()
 		{
-			if($this->get_platform()=='Linux')
-			{
-				return true;
-			}
-			else
-			{
-				return false;
-			}
+			return ($this->get_platform()==self::PLATFORM_LINUX);
 		}
 
 		function is_unix()
 		{
-			if($this->get_platform()=='Unix')
-			{
-				return true;
-			}
-			else
-			{
-				return false;
-			}
+			return ($this->get_platform()==self::PLATFORM_UNIX);
 		}
 
 		function is_beos()
 		{
-			if($this->get_platform()=='Beos')
-			{
-				return true;
-			}
-			else
-			{
-				return false;
-			}
+			return ($this->get_platform()==self::PLATFORM_BEOS);
 		}
 
 		function is_mac()
 		{
-			if($this->get_platform()=='Mac')
-			{
-				return true;
-			}
-			else
-			{
-				return false;
-			}
+			return ($this->get_platform()==self::PLATFORM_MAC);
 		}
 
 		function is_windows()
 		{
-			if($this->get_platform()=='Win')
-			{
-				return true;
-			}
-			else
-			{
-				return false;
-			}
+			return ($this->get_platform()==self::PLATFORM_WINDOWS);
+		}
+		
+		function is_ipad()
+		{
+			return ($this->get_platform()==self::PLATFORM_IPAD);
+		}
+		
+		function is_iphone()
+		{
+			return ($this->get_platform()==self::PLATFORM_IPHONE);
+		}
+		
+		function is_nokia()
+		{
+			return ($this->get_platform()==self::PLATFORM_NOKIA);
+		}
+		
+		function is_ipod()
+		{
+			return ($this->get_platform()==self::PLATFORM_IPOD);
+		}
+		
+		function is_blackberry()
+		{
+			return ($this->get_platform()==self::PLATFORM_BLACKBERRY);
+		}
+		
+		function is_android()
+		{
+			return ($this->get_platform()==self::PLATFORM_ANDROID);
 		}
 
Index: branches/2.2/login.php
===================================================================
--- branches/2.2/login.php	(revision 3448)
+++ branches/2.2/login.php	(revision 3621)
@@ -11,5 +11,5 @@
 	*  option) any later version.                                              *
 	\**************************************************************************/
-
+	
 	$phpgw_info = array();
 	$submit = False;			// set to some initial value
@@ -40,4 +40,20 @@
 		if(function_exists('CreateObject'))
 		{
+			//detect if the user has a compatible browser, if don't have send him to expresso mini
+			$browser = CreateObject('phpgwapi.browser');
+			
+			switch ($browser->get_platform()) {
+				case browser::PLATFORM_IPHONE:
+				case browser::PLATFORM_IPOD:
+				case browser::PLATFORM_IPAD:
+				case browser::PLATFORM_BLACKBERRY:
+				case browser::PLATFORM_NOKIA:
+				case browser::PLATFORM_ANDROID:
+					$GLOBALS['phpgw']->redirect_link('/mobile/');					
+					break;
+				default:
+					break;
+			}
+			
 			$GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions');
 		}
@@ -99,9 +115,9 @@
 		$GLOBALS['phpgw']->session->phpgw_setcookie('serverID', $GLOBALS['phpgw_info']['server']['use_frontend_id']);
 	}
-if($GLOBALS['phpgw_info']['server']['captcha']==1)
+	if($GLOBALS['phpgw_info']['server']['captcha']==1)
   {
      session_start();
   }
-include(personalize_include_path('phpgwapi','login'));
+	include(personalize_include_path('phpgwapi','login'));
 ?>
 
