Index: trunk/phpgwapi/inc/class.vfs_shared.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.vfs_shared.inc.php	(revision 2)
+++ trunk/phpgwapi/inc/class.vfs_shared.inc.php	(revision 5036)
@@ -419,4 +419,12 @@
 
 		/*!
+		* @function get_size_all
+		* @abstract Determine size of location
+		* @owner_id string	uid owner
+		*/
+		
+		function get_size_all($owner_id) { return 0; }
+		
+		/*!
 		 * @function get_size
 		 * @abstract Determine size of location
Index: trunk/phpgwapi/inc/class.vfs_sql.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.vfs_sql.inc.php	(revision 3743)
+++ trunk/phpgwapi/inc/class.vfs_sql.inc.php	(revision 5036)
@@ -2512,4 +2512,15 @@
 			return $size;
 		}
+		
+		function get_size_all($owner_id)
+		{
+			$query = $GLOBALS['phpgw']->db->query ("SELECT Sum(size) FROM phpgw_vfs WHERE owner_id = '".$owner_id."'" .
+													$this->extra_sql(array ('query_text' => VFS_SQL_SELECT)));
+			$GLOBALS['phpgw']->db->next_record ();
+			
+			$size = $GLOBALS['phpgw']->db->Record[0];			
+			
+			return $size;
+		}		
 
 		/*return the total number of files in path*/
Index: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php	(revision 3552)
+++ trunk/phpgwapi/inc/functions.inc.php	(revision 5036)
@@ -345,8 +345,31 @@
 				}
 			}
-			// this removes the sessiondata if its saved in the URL
-			$query = preg_replace('/[&]?sessionid(=|%3D)[^&]+&kp3(=|%3D)[^&]+&domain=.*$/','',$_SERVER['QUERY_STRING']);
-			Header('Location: '.$GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?cd=10&phpgw_forward='.urlencode($relpath.(!empty($query) ? '?'.$query : '')));
-			exit;
+
+			$ifMobile = false;
+			$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:
+					$ifMobile = true;						
+					break;
+			}
+			
+			if( $ifMobile )			
+			{
+				Header('Location: '.$GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?cd=66');
+				exit;
+			}
+			else
+			{
+				// this removes the sessiondata if its saved in the URL
+				$query = preg_replace('/[&]?sessionid(=|%3D)[^&]+&kp3(=|%3D)[^&]+&domain=.*$/','',$_SERVER['QUERY_STRING']);
+				Header('Location: '.$GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?cd=10&phpgw_forward='.urlencode($relpath.(!empty($query) ? '?'.$query : '')));
+				exit;
+			}
 		}
 
Index: trunk/phpgwapi/js/browser/browserDetect.js
===================================================================
--- trunk/phpgwapi/js/browser/browserDetect.js	(revision 5036)
+++ trunk/phpgwapi/js/browser/browserDetect.js	(revision 5036)
@@ -0,0 +1,227 @@
+(function()
+{		
+        // NAVIGATOR USER AGENT
+        var agt 		= navigator.userAgent.toLowerCase();
+        var appVer		= navigator.appVersion.toLowerCase();
+
+        var is_minor            = parseFloat(appVer);
+        var is_major            = parseInt(is_minor);
+
+        var iePos		= appVer.indexOf('msie');
+
+        if ( iePos != -1 )
+        {
+            is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
+            is_major = parseInt(is_minor);
+        }
+        
+        //Konqueror
+       
+        var is_konq = false;
+        var kqPos   = agt.indexOf('konqueror');
+        
+        if ( kqPos !=-1 )
+        {
+            is_konq  = true;
+            is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
+            is_major = parseInt(is_minor);
+        }
+
+        //Is_Khtml
+        var is_khtml 	= (((agt.indexOf('safari')!=-1) && (agt.indexOf('mac')!=-1)) && ( is_konq ));
+
+        //Is_Opera
+        var is_opera	= (agt.indexOf("opera") != -1 );
+
+        //Is_IE
+        var is_ie		= ((iePos!=-1) && (!is_opera) && (!is_khtml));
+
+        // Gecko
+        var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
+        var is_gver  = 0;
+        
+        if (is_gecko)
+            is_gver = navigator.productSub;
+
+        // Moz
+        var is_moz   = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
+                        (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
+                        (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
+                        (is_gecko) && ((navigator.vendor=="")||(navigator.vendor=="Mozilla")));
+
+        var _browser = [
+
+            // Chrome	
+            ['chrome8', ( agt.indexOf('chrome/8') != -1 ) ],
+            ['chrome11', ( agt.indexOf('chrome/11') != -1 ) ],
+
+            // EPIPHANY	
+            ['epiphany2', ( agt.indexOf('epiphany/2') != -1 ) ],
+
+            // FIREFOX
+            ['firefox1', ( agt.indexOf('firefox/1') != -1 ) ],
+            ['firefox2', ( agt.indexOf('firefox/2') != -1 ) ],
+            ['firefox3', ( agt.indexOf('firefox/3') != -1 ) ],
+            ['firefox4', ( agt.indexOf('firefox/4') != -1 ) ],
+            ['firefox5', ( agt.indexOf('firefox/5') != -1 ) ],
+            ['firefox6', ( agt.indexOf('firefox/6') != -1 ) ],
+
+            // ICEWEASEL
+            ['iceweasel3', (agt.indexOf('iceweasel/3') != -1 ) ],
+
+            // IE
+            ['ie3',	(((iePos!=-1) && (!is_opera) && (!is_khtml)) && (is_major < 4 )) ],
+            ['ie4', (((iePos!=-1) && (!is_opera) && (!is_khtml)) && (is_major == 4 )) ],
+            ['ie5', (((iePos!=-1) && (!is_opera) && (!is_khtml)) && (is_major == 5 )) ],
+            ['ie55', (((iePos!=-1) && (!is_opera) && (!is_khtml)) && (agt.indexOf("msie 5.5") !=-1 )) ], 
+            ['ie6', (((iePos!=-1) && (!is_opera) && (!is_khtml)) && (is_major == 6 )) ],
+            ['ie7', (((iePos!=-1) && (!is_opera) && (!is_khtml)) && (is_major == 7 )) ],
+            ['ie8', (((iePos!=-1) && (!is_opera) && (!is_khtml)) && (is_major == 8 )) ],
+
+            //IS?
+            ['is_ie', ((iePos!=-1) && (!is_opera) && (!is_khtml)) ],
+            ['is_gecko', is_gecko ],
+            ['is_opera', is_opera ],
+            ['is_khtml', is_khtml ],
+            ['is_moz', is_moz ],
+
+            // OPERA
+            ['is_opera', is_opera],
+            ['opera2', ( agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1) ],
+            ['opera3', ( agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1) ],
+            ['opera4', ( agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1) ],
+            ['opera5', ( agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1) ],
+            ['opera6', ( agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1) ],
+            ['opera7', ( agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1) ],
+            ['opera8', ( agt.indexOf("opera 8") != -1 || agt.indexOf("opera/8") != -1) ],
+            ['opera9', ( agt.indexOf("opera 9") != -1 || agt.indexOf("opera/9") != -1) ],
+
+            // IS SAFARI/KHTML
+            ['safari', ( agt.indexOf('safari') != -1 ) ],
+            ['khtml', is_khtml ]
+        ];
+
+        function isLoadApp()
+        {
+        	var Browser = new Array();
+
+        	// Chrome;
+        	Browser	=	[ 
+	        				// Chrome;
+	        				{navigator : "chrome11"},         	
+	        				// Epiphany
+	        				{navigator : "epiphany2"},         	
+	        				// Firefox;
+	        				{navigator : "firefox3"},			
+				        	{navigator : "firefox4"},
+				        	{navigator : "firefox5"},
+				        	{navigator : "firefox6"},
+				        	//IceWeasel
+				        	{navigator : "iceweasel3"},		
+				        	// IE;
+				        	{navigator : "ie8"},
+	        		    	// Safari;
+				        	{navigator : "safari"}
+			        	];
+    
+        	if( arguments.length > 0 )
+        	{
+        		for(var i = 0; i < Browser.length; i++)
+	        	{
+	        		if( Browser[i].navigator.indexOf(arguments[0]) > -1  )
+	        		{
+	        			if( isCompatible(Browser[i].navigator) )
+	        				return true;
+	        		}
+	        	}
+        		
+        		return false;
+        	}
+        	else
+        	{
+        		return isCompatible(Browser);
+        	}
+        }
+
+        function isCompatible()
+        {
+            if( arguments.length > 0 )
+            {
+            	var _args = ( typeof(arguments[0]) === 'object' ) ? arguments[0] : arguments;
+            	
+            	for( i = 0; i < _args.length; i++ )
+                {
+                    for( j = 0; j < _browser.length; j++ )
+                    {
+                    	var navigator = _args[i].toString().toLowerCase();
+                    	
+                    	if( typeof(_args[i]) === 'object' )
+                    		var navigator = _args[i].navigator.toLowerCase();  
+                    	
+                		if ( navigator === _browser[j][0] )    
+                			if( _browser[j][1] )
+                				return true;
+                    }	
+                }
+
+                return false;
+            }
+        }
+
+        function SnifferBrowser(){}
+
+        SnifferBrowser.prototype.isLoadApp 		= isLoadApp;
+        SnifferBrowser.prototype.isCompatible	= isCompatible;
+
+        window.SnifferBrowser = new SnifferBrowser;
+	
+})();
+
+/*  Script utilizado para detectar o browser
+
+	Variaveis Globais no Expresso:
+
+	OS 		-> retorna o Sistema Operacional
+	browser -> retorna o nome do Browser
+	version -> retorna a versão do Browser
+	isExplorer -> retorna true se Browser for Internet Explorer
+*/
+	var detect = navigator.userAgent.toLowerCase();
+	var OS,browser,version,total,thestring;
+	var isExplorer = false;
+
+	if (checkIt('konqueror'))
+	{
+		browser = "Konqueror";
+		OS = "Linux";
+	}
+	else if (checkIt('safari')) browser = "Safari"
+	else if (checkIt('omniweb')) browser = "OmniWeb"
+	else if (checkIt('opera')) browser = "Opera"
+	else if (checkIt('webtv')) browser = "WebTV";
+	else if (checkIt('icab')) browser = "iCab";
+	else if (checkIt('msie')) {browser = "Internet Explorer";isExplorer=true;}
+	else if (!checkIt('compatible'))
+	{
+		browser = "Netscape Navigator"
+		version = detect.charAt(8);
+	}
+	else browser = "An unknown browser";
+	
+	if (!version) version = detect.charAt(place + thestring.length);
+	
+	if (!OS)
+	{
+		if (checkIt('linux')) OS = "Linux";
+		else if (checkIt('x11')) OS = "Unix";
+		else if (checkIt('mac')) OS = "Mac"
+		else if (checkIt('win')) OS = "Windows"
+		else OS = "an unknown operating system";
+	}
+	
+	function checkIt(string)
+	{
+		place = detect.indexOf(string) + 1;
+		thestring = string;
+		return place;
+	}
Index: trunk/phpgwapi/js/x_tools/xtools.js
===================================================================
--- trunk/phpgwapi/js/x_tools/xtools.js	(revision 5036)
+++ trunk/phpgwapi/js/x_tools/xtools.js	(revision 5036)
@@ -0,0 +1,166 @@
+(function()
+{
+	var _FILES = [];
+
+	function _convert(pString)
+	{
+		if ( typeof pString != 'string' )
+			return false;
+
+		if ( window.ActiveXObject )
+		{
+			var _xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
+			_xmlDoc.async = "false";
+			_xmlDoc.loadXML(pString);
+		}
+		else
+		{
+			var parser = new DOMParser();
+			var _xmlDoc = parser.parseFromString(pString, "text/xml");
+		}
+
+		return _xmlDoc;
+	}
+
+	function _load(pFile)
+	{
+                if( pFile.indexOf("/") == -1 )
+                    pFile = this._PATH + 'xsl/' + pFile;
+                
+		if ( !(_FILES[pFile]) )
+		{
+			var _data = null;
+			
+			if ( document.implementation.createDocument )
+			{
+				var xmlHttp = new window.XMLHttpRequest();
+					xmlHttp.open("GET",pFile + '?' + Date.parse(new Date),false );
+					xmlHttp.send(null);
+				
+				_data = xmlHttp.responseXML.documentElement;
+			}
+			else
+			{
+				_data = new ActiveXObject( "Msxml2.FreeThreadedDOMDocument" );
+				_data.async = false;
+				_data.load( pFile + '?' + Date.parse(new Date) );
+			}
+
+			_FILES[pFile] = _data;
+		}
+		return _FILES[pFile];
+	}
+
+	function _parse()
+	{
+		if ( arguments.length == 1 )
+		{
+			pXML = _xml('root');
+			pXSL = arguments[0];
+		}
+		else
+		{
+			pXML = arguments[0];
+			pXSL = arguments[1];
+		}
+		switch ( typeof pXML )
+		{
+			case 'object' :
+			break;
+			case 'string' :
+				if ( pXML.indexOf('<') == 0 )
+					pXML = _convert(pXML);
+				else
+					pXML = _load.call(this, pXML);
+			break;
+			default :
+				return {'error':'invalid xml'}
+		}
+		switch ( typeof pXSL )
+		{
+			case 'object' :
+			break;
+			case 'string' :
+				pXSL = _load.call(this, pXSL);
+			break;
+			default :
+				return {'error':'invalid xsl'}
+		}
+
+		var fragment = null;
+		if ( window.XSLTProcessor )
+		{
+			var xslProc = new XSLTProcessor();
+			xslProc.importStylesheet(pXSL);
+
+			if ( (arguments.length == 3) && (typeof arguments[2] == 'object') )
+			{
+				var params = arguments[2];
+				for (var i in params )
+					if ( params[ i ] && params[ i ].constructor != Function )
+						xslProc.setParameter(null, String( i ), String( params[i] ) );
+			}
+
+			fragment = xslProc.transformToFragment(pXML, document);
+
+			var aux = document.createElement("div");
+			aux.appendChild(fragment);
+			fragment = aux.innerHTML;
+		}
+		else
+		{
+			var xslTemplate = new ActiveXObject("MSXML2.XSLTemplate");
+			xslTemplate.stylesheet = pXSL;
+	
+			var xslProc = xslTemplate.createProcessor();
+			xslProc.input = pXML;
+	
+			if ( (arguments.length == 3) && (typeof arguments[2] == 'object') )
+			{
+				var params = arguments[2];
+				for (var i in params )
+					if ( params[ i ] && params[ i ].constructor != Function )
+					{
+						xslProc.addParameter( String( i ), String( params[i] ), '');
+					}
+			}
+ 
+			xslProc.transform();
+			fragment = xslProc.output;
+		}
+		return fragment;
+	}
+
+	function _xml()
+	{
+		var a = false;
+		if ( document.implementation.createDocument )
+			a = document.implementation.createDocument("", "", null);
+		else if ( ActiveXObject )
+			a = new ActiveXObject("Msxml2.DOMDocument");
+
+		if ( arguments.length == 1 && typeof arguments[0] == 'string' )
+			a.appendChild(a.createElement(arguments[0]));
+		//with ( a )
+		//	appendChild(createProcessingInstruction("xml", "version='1.0'"));
+
+		return a;
+	}
+
+	function xtools()
+	{
+		var _argv = arguments;
+		this._PATH = ( _argv.length > 0 ) ? _argv[0] : '';
+
+		if ( this._PATH != '' && this._PATH.lastIndexOf('/') != (this._PATH.length - 1) )
+			this._PATH += '/';
+	}
+
+	xtools.prototype.convert	= _convert;
+	xtools.prototype.load		= _load;
+	xtools.prototype.parse		= _parse;
+	xtools.prototype.xml		= _xml;
+	
+	window.xtools = xtools;
+}
+)();
Index: trunk/phpgwapi/templates/default/login_default.php
===================================================================
--- trunk/phpgwapi/templates/default/login_default.php	(revision 4994)
+++ trunk/phpgwapi/templates/default/login_default.php	(revision 5036)
@@ -12,5 +12,5 @@
 	\**************************************************************************/
 
-function check_logoutcode($code)
+	function check_logoutcode($code)
 	{
 		switch($code)
@@ -35,8 +35,8 @@
 				
 			case 99:
-                                return '<font color="FF0000">' . lang('Blocked, too many attempts(%1)! Retry in %2 minute(s)',$GLOBALS['phpgw_info']['server']['num_unsuccessful_id'],$GLOBALS['phpgw_info']['server']['block_time']) . '</font>';
+				return '<font color="FF0000">' . lang('Blocked, too many attempts(%1)! Retry in %2 minute(s)',$GLOBALS['phpgw_info']['server']['num_unsuccessful_id'],$GLOBALS['phpgw_info']['server']['block_time']) . '</font>';
 			case 200:
                             //return '<font color="FF0000">' . lang('Invalid code') . '</font>';
-                            return '<font color="FF0000">' . lang('Bad login or password') . '</font>';
+                return '<font color="FF0000">' . lang('Bad login or password') . '</font>';
 			    break;
 			case 10:
@@ -180,11 +180,11 @@
 			$login .= '@'.$GLOBALS['phpgw_info']['server']['default_domain'];
 		}
-                If(!$_GET['cd'])
-		$GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u');
+		
+		If(!$_GET['cd'])
+			$GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u');
 
 		if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
 		{
-
-                       If(!$_GET['cd']) $_GET['cd'] = $GLOBALS['phpgw']->session->cd_reason;
+			If(!$_GET['cd']) $_GET['cd'] = $GLOBALS['phpgw']->session->cd_reason;
 		}
 		else
@@ -586,4 +586,5 @@
 
 	$tmpl->pfp('loginout','login_form');
+	}
 
 ?>
