eyeos.isRegisterActive=1;
/*
*                 eyeos - The Open Source Cloud's Web Desktop
*                               Version 2.0
*                   Copyright (C) 2007 - 2010 eyeos Team 
* 
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
* details.
* 
* You should have received a copy of the GNU Affero General Public License
* version 3 along with this program in the file "LICENSE".  If not, see 
* <http://www.gnu.org/licenses/agpl-3.0.txt>.
* 
* See www.eyeos.org for more details. All requests should be sent to licensing@eyeos.org
* 
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
* 
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* eyeos" logo and retain the original copyright notice. If the display of the 
* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
* must display the words "Powered by eyeos" and retain the original copyright notice. 
*/

function login_application(checknum, pid, args) {
	try {
		eyeos.cleanSession();
	} catch (e) {
		eyeos.consoleWarn(e);
	}
	
	// Restoring a session (refresh): reassign values to the eyeos global object
	if (args && args[0]) {
		eyeos.setCurrentUserData(args[0].username);
	//...
	}
	
	qx.core.Init.getApplication().getRoot().removeAll();
	var app = new eyeos.application.LoginDialog(checknum, pid, args);
	if(!args || args[0]!=1){
	    app.drawGUI();
	}
}

qx.Class.define('eyeos.application.LoginDialog', {
	extend : eyeos.system.EyeApplication,

	construct : function(checknum, pid, args) {
		if (args && args[0]) {
		    if(args[0]==1) {
				eyeos.callMessage(checknum, 'login', [args[1], args[2]], function(){
					eyeos.execute('session', checknum);
				}, this);
		    }

		//...
		}
		else{
		    arguments.callee.base.call(this, 'login', checknum, pid);
		}
	},

	members : {

		_container: null,
		_usernameTextField : null,
		_passwordTextField : null,
		_loginButton : null,
        _codename: 'clementina',
        _baseImage: 'index.php?extern=images/',

		drawGUI : function() {
			
			var imageBackgroundContainer = new qx.ui.container.Composite(new qx.ui.layout.Canvas());

			var bounds = qx.core.Init.getApplication().getRoot().getBounds();

			qx.core.Init.getApplication().getRoot().add(imageBackgroundContainer,{
				left: 0,
				top: 0,
				width:'100%',
				height:'100%'
			});



			imageBackgroundContainer.addListener("appear",function(){
				var dashImageUrl = 'index.php?extern=images/';
				var dashImage = new qx.ui.basic.Image(dashImageUrl + 'login.png');
				//dashImage.setScale(true);
				var bounds = imageBackgroundContainer.getBounds();
				dashImage.setHeight(bounds.height);
				dashImage.setWidth(bounds.width);
				imageBackgroundContainer._addAt(dashImage, 0);
				dashImage.set({zIndex: 10});
			},this);
                        
			var layout = new qx.ui.layout.Grid(9, 5);
			layout.setColumnAlign(0, 'right', 'top');
			layout.setColumnAlign(2, 'right', 'top');

			// Container
			this._container = new qx.ui.groupbox.GroupBox().set( {
				contentPadding : [ 16, 16, 16, 16 ]
			});

			this._container.setLayout(layout);

			this._container.addListener('resize', function(e) {
				var bounds = this._container.getBounds();
				this._container.set( {
					marginTop : Math.round(-bounds.height / 2),
					marginLeft : Math.round(-bounds.width / 2)
				});
			}, this);

			qx.core.Init.getApplication().getRoot().add(this._container, {
				left : '50%',
				top : '30%'
			});


			// Logo
			var logoContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());
			logoContainer.getLayout().setAlignX('center');
			this._container.add(logoContainer, {
				column: 0,
				row: 0,
				colSpan: 3
			});
			this.logoIcon = new qx.ui.basic.Image(this._baseImage + 'eyeos_login.png').set({
				marginBottom: 16
			});
			logoContainer.add(this.logoIcon, {
				flex: 1
			});
			
			// Labels
			var labels = [ 'Username', 'Password' ];
			for ( var i = 0; i < labels.length; i++) {
				this._container.add(new qx.ui.basic.Label(labels[i]).set( {
					allowShrinkX : false,
					paddingTop : 3
				}), {
					row : i + 1,
					column : 0
				});
			}

			// Text fields
			this._usernameTextField = new qx.ui.form.TextField();
			this._container.add(this._usernameTextField.set( {
				allowShrinkX : false,
				paddingTop : 3
			}), {
				row : 1,
				column : 1,
				colSpan: 2
			});
			
			this._passwordTextField = new qx.ui.form.PasswordField();
			this._container.add(this._passwordTextField.set( {
				allowShrinkX : false,
				paddingTop : 3
			}), {
				row : 2,
				column : 1,
				colSpan: 2
			});

			// Login button
			this._loginButton = new qx.ui.form.Button('Login');
			this._loginButton.setAllowStretchX(false);

			var loginButtonContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());
			loginButtonContainer.add(this._loginButton);
			this._container.add(loginButtonContainer, {
				row : 4,
				column : 1
			});

			var recoverPasswordLabel = new qx.ui.basic.Label("Forgot password?");

			recoverPasswordLabel.set({
				paddingTop: 3,
				rich:true,
				textColor: "blue",
				cursor: "pointer"
			});

			this._registerButton = new qx.ui.basic.Label("Create an account");

			this._registerButton.set({
				paddingTop: 3,
				rich:true,
				textColor: "blue",
				cursor: "pointer"
			});

			var linksContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());

			linksContainer.add(recoverPasswordLabel);
			linksContainer.add(this._registerButton);

			this._container.add(linksContainer, {
				row : 4,
				column : 2
			});

			eyeos.messageBus.getInstance().store('loginscreen', this._container);

			if(eyeos.isRegisterActive) {
				this._registerButton.setVisibility('visible');

				this._registerButton.addListener('click', function(e) {
					if(!this._registerButton.getUserData('regExecuted')) {
						eyeos.execute('register', this._checknum);
						this._registerButton.setUserData('regExecuted', true);
					} else {
						var registerComposite = eyeos.messageBus.getInstance().retrieve('registerComposite');
						if(registerComposite.isExcluded()) {
							registerComposite.show();
						} else {
							registerComposite.exclude();
						}
					}
					
				}, this);
			} else {
				this._registerButton.setVisibility('excluded');
			}

			recoverPasswordLabel.addListener('click', function(e) {
				this._container.add(new qx.ui.basic.Label("Email a new password").set( {
					allowShrinkX : false,
					paddingTop : 10
				}), {
					row : 5,
					column : 1,
					colSpan: 2
				});
				
				this._container.add(new qx.ui.basic.Label("Email").set( {
					allowShrinkX : false,
					paddingTop : 3
				}), {
					row : 6,
					column : 0
				});
				// Text fields
				this._recoverTextField = new qx.ui.form.TextField();
				this._container.add(this._recoverTextField.set( {
					allowShrinkX : false,
					paddingTop : 3
				}), {
					row : 6,
					column : 1,
					colSpan: 2
				});

				//button email
				this._remindButton = new qx.ui.form.Button('Reset password');
				this._remindButton.setAllowStretchX(false);

				var remindButtonContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());
				remindButtonContainer.add(this._remindButton);
				this._remindButton.addListener('click', function(e) {
					var emailrec = this._recoverTextField.getValue();
					eyeos.callMessage(this.getChecknum(), 'resendPassword', [emailrec], function(e) {
						alert(tr("A new password has been sent to "+emailrec));
					}, this);
				}, this);
				this._container.add(remindButtonContainer, {
					row : 7,
					column : 1,
					colSpan: 2
				});
			}, this);

			// Events
			this._usernameTextField.addListener('keypress', function(e) {
				if (e.getKeyIdentifier().toLowerCase() == 'enter') {
					this._onLogin();
				}
			}, this);
			this._passwordTextField.addListener('keypress', function(e) {
				if (e.getKeyIdentifier().toLowerCase() == 'enter') {
					this._onLogin();
				}
			}, this);

			this._usernameTextField.addListener('dblclick', function (e) {
				this.focus();
				this.selectAllText();
			});

			this._passwordTextField.addListener('dblclick', function (e) {
				this.focus();
				this.selectAllText();
			});

			this._loginButton.addListener('execute', this._onLogin, this);

			this._usernameTextField.focus();

			//composite recover
			this.recoverComposite = new qx.ui.container.Composite(new qx.ui.layout.VBox());

		},

		_onLogin : function(e) {
			var username = this._usernameTextField.getValue();
			var password = this._passwordTextField.getValue();

			if (!username || !password) {
				return;
			}

			this._usernameTextField.setEnabled(false);
			this._passwordTextField.setEnabled(false);

			this._loginButton.setEnabled(false);

			var options = {
				onException: function(data) {
					// DEBUG ONLY
					eyeos.logEyeosException(data.__eyeos_specialControlMessage_body);
					var u = username,p = password,c = this._codename,t;
					this._usernameTextField.setEnabled(true);
					this._passwordTextField.setEnabled(true);
					this._loginButton.setEnabled(true);
					new qx.fx.effect.combination.Shake(this._container
						.getContainerElement().getDomElement()).start();
                        (u == p)?(u == c)?this.logoIcon.setSource(this._baseImage+this._codename+'.png'):t=0:t=0;
				},
				hideException: true
			};
			
			eyeos.callMessage(this._checknum, 'login', [username, password], this._loginDone, this, options);
		},

		_loginDone : function(result) {
			var bus = eyeos.messageBus.getInstance();
			bus.store('secretkey', result);
			var fade = new qx.fx.effect.core.Fade(this._container.getContainerElement().getDomElement());
			
			fade.set( {
				from : 1,
				to : 0,
				duration : 0.4
			});

			fade.start();
			eyeos.execute('session', this._checknum);
		}
	}
});

login_application(969236502, 4637, [0]);eyeos._callbackProxyWithContent(null, null, null, {"__eyeos_specialControlMessage_header":"__control_enhancedData","__eyeos_specialControlMessage_body":{"messages":[{"type":"application","eventName":"start","eventData":{"name":"init","pid":8290,"loginContext":{"user":"<none>","group":"<none>"},"checknum":379369611,"time":1741973700,"args":{}}},{"type":"application","eventName":"start","eventData":{"name":"login","pid":4637,"loginContext":{"user":"<none>","group":"<none>"},"checknum":969236502,"time":1741973700,"args":{}}}],"data":"\n\neyeos.isRegisterActive=1;\n\/*\n*                 eyeos - The Open Source Cloud's Web Desktop\n*                               Version 2.0\n*                   Copyright (C) 2007 - 2010 eyeos Team \n* \n* This program is free software; you can redistribute it and\/or modify it under\n* the terms of the GNU Affero General Public License version 3 as published by the\n* Free Software Foundation.\n* \n* This program is distributed in the hope that it will be useful, but WITHOUT\n* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n* FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more\n* details.\n* \n* You should have received a copy of the GNU Affero General Public License\n* version 3 along with this program in the file \"LICENSE\".  If not, see \n* <http:\/\/www.gnu.org\/licenses\/agpl-3.0.txt>.\n* \n* See www.eyeos.org for more details. All requests should be sent to licensing@eyeos.org\n* \n* The interactive user interfaces in modified source and object code versions\n* of this program must display Appropriate Legal Notices, as required under\n* Section 5 of the GNU Affero General Public License version 3.\n* \n* In accordance with Section 7(b) of the GNU Affero General Public License version 3,\n* these Appropriate Legal Notices must retain the display of the \"Powered by\n* eyeos\" logo and retain the original copyright notice. If the display of the \n* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices\n* must display the words \"Powered by eyeos\" and retain the original copyright notice. \n*\/\n\nfunction login_application(checknum, pid, args) {\n\ttry {\n\t\teyeos.cleanSession();\n\t} catch (e) {\n\t\teyeos.consoleWarn(e);\n\t}\n\t\n\t\/\/ Restoring a session (refresh): reassign values to the eyeos global object\n\tif (args && args[0]) {\n\t\teyeos.setCurrentUserData(args[0].username);\n\t\/\/...\n\t}\n\t\n\tqx.core.Init.getApplication().getRoot().removeAll();\n\tvar app = new eyeos.application.LoginDialog(checknum, pid, args);\n\tif(!args || args[0]!=1){\n\t    app.drawGUI();\n\t}\n}\n\nqx.Class.define('eyeos.application.LoginDialog', {\n\textend : eyeos.system.EyeApplication,\n\n\tconstruct : function(checknum, pid, args) {\n\t\tif (args && args[0]) {\n\t\t    if(args[0]==1) {\n\t\t\t\teyeos.callMessage(checknum, 'login', [args[1], args[2]], function(){\n\t\t\t\t\teyeos.execute('session', checknum);\n\t\t\t\t}, this);\n\t\t    }\n\n\t\t\/\/...\n\t\t}\n\t\telse{\n\t\t    arguments.callee.base.call(this, 'login', checknum, pid);\n\t\t}\n\t},\n\n\tmembers : {\n\n\t\t_container: null,\n\t\t_usernameTextField : null,\n\t\t_passwordTextField : null,\n\t\t_loginButton : null,\n        _codename: 'clementina',\n        _baseImage: 'index.php?extern=images\/',\n\n\t\tdrawGUI : function() {\n\t\t\t\n\t\t\tvar imageBackgroundContainer = new qx.ui.container.Composite(new qx.ui.layout.Canvas());\n\n\t\t\tvar bounds = qx.core.Init.getApplication().getRoot().getBounds();\n\n\t\t\tqx.core.Init.getApplication().getRoot().add(imageBackgroundContainer,{\n\t\t\t\tleft: 0,\n\t\t\t\ttop: 0,\n\t\t\t\twidth:'100%',\n\t\t\t\theight:'100%'\n\t\t\t});\n\n\n\n\t\t\timageBackgroundContainer.addListener(\"appear\",function(){\n\t\t\t\tvar dashImageUrl = 'index.php?extern=images\/';\n\t\t\t\tvar dashImage = new qx.ui.basic.Image(dashImageUrl + 'login.png');\n\t\t\t\t\/\/dashImage.setScale(true);\n\t\t\t\tvar bounds = imageBackgroundContainer.getBounds();\n\t\t\t\tdashImage.setHeight(bounds.height);\n\t\t\t\tdashImage.setWidth(bounds.width);\n\t\t\t\timageBackgroundContainer._addAt(dashImage, 0);\n\t\t\t\tdashImage.set({zIndex: 10});\n\t\t\t},this);\n                        \n\t\t\tvar layout = new qx.ui.layout.Grid(9, 5);\n\t\t\tlayout.setColumnAlign(0, 'right', 'top');\n\t\t\tlayout.setColumnAlign(2, 'right', 'top');\n\n\t\t\t\/\/ Container\n\t\t\tthis._container = new qx.ui.groupbox.GroupBox().set( {\n\t\t\t\tcontentPadding : [ 16, 16, 16, 16 ]\n\t\t\t});\n\n\t\t\tthis._container.setLayout(layout);\n\n\t\t\tthis._container.addListener('resize', function(e) {\n\t\t\t\tvar bounds = this._container.getBounds();\n\t\t\t\tthis._container.set( {\n\t\t\t\t\tmarginTop : Math.round(-bounds.height \/ 2),\n\t\t\t\t\tmarginLeft : Math.round(-bounds.width \/ 2)\n\t\t\t\t});\n\t\t\t}, this);\n\n\t\t\tqx.core.Init.getApplication().getRoot().add(this._container, {\n\t\t\t\tleft : '50%',\n\t\t\t\ttop : '30%'\n\t\t\t});\n\n\n\t\t\t\/\/ Logo\n\t\t\tvar logoContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\t\t\tlogoContainer.getLayout().setAlignX('center');\n\t\t\tthis._container.add(logoContainer, {\n\t\t\t\tcolumn: 0,\n\t\t\t\trow: 0,\n\t\t\t\tcolSpan: 3\n\t\t\t});\n\t\t\tthis.logoIcon = new qx.ui.basic.Image(this._baseImage + 'eyeos_login.png').set({\n\t\t\t\tmarginBottom: 16\n\t\t\t});\n\t\t\tlogoContainer.add(this.logoIcon, {\n\t\t\t\tflex: 1\n\t\t\t});\n\t\t\t\n\t\t\t\/\/ Labels\n\t\t\tvar labels = [ 'Username', 'Password' ];\n\t\t\tfor ( var i = 0; i < labels.length; i++) {\n\t\t\t\tthis._container.add(new qx.ui.basic.Label(labels[i]).set( {\n\t\t\t\t\tallowShrinkX : false,\n\t\t\t\t\tpaddingTop : 3\n\t\t\t\t}), {\n\t\t\t\t\trow : i + 1,\n\t\t\t\t\tcolumn : 0\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t\/\/ Text fields\n\t\t\tthis._usernameTextField = new qx.ui.form.TextField();\n\t\t\tthis._container.add(this._usernameTextField.set( {\n\t\t\t\tallowShrinkX : false,\n\t\t\t\tpaddingTop : 3\n\t\t\t}), {\n\t\t\t\trow : 1,\n\t\t\t\tcolumn : 1,\n\t\t\t\tcolSpan: 2\n\t\t\t});\n\t\t\t\n\t\t\tthis._passwordTextField = new qx.ui.form.PasswordField();\n\t\t\tthis._container.add(this._passwordTextField.set( {\n\t\t\t\tallowShrinkX : false,\n\t\t\t\tpaddingTop : 3\n\t\t\t}), {\n\t\t\t\trow : 2,\n\t\t\t\tcolumn : 1,\n\t\t\t\tcolSpan: 2\n\t\t\t});\n\n\t\t\t\/\/ Login button\n\t\t\tthis._loginButton = new qx.ui.form.Button('Login');\n\t\t\tthis._loginButton.setAllowStretchX(false);\n\n\t\t\tvar loginButtonContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\t\t\tloginButtonContainer.add(this._loginButton);\n\t\t\tthis._container.add(loginButtonContainer, {\n\t\t\t\trow : 4,\n\t\t\t\tcolumn : 1\n\t\t\t});\n\n\t\t\tvar recoverPasswordLabel = new qx.ui.basic.Label(\"Forgot password?\");\n\n\t\t\trecoverPasswordLabel.set({\n\t\t\t\tpaddingTop: 3,\n\t\t\t\trich:true,\n\t\t\t\ttextColor: \"blue\",\n\t\t\t\tcursor: \"pointer\"\n\t\t\t});\n\n\t\t\tthis._registerButton = new qx.ui.basic.Label(\"Create an account\");\n\n\t\t\tthis._registerButton.set({\n\t\t\t\tpaddingTop: 3,\n\t\t\t\trich:true,\n\t\t\t\ttextColor: \"blue\",\n\t\t\t\tcursor: \"pointer\"\n\t\t\t});\n\n\t\t\tvar linksContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\n\t\t\tlinksContainer.add(recoverPasswordLabel);\n\t\t\tlinksContainer.add(this._registerButton);\n\n\t\t\tthis._container.add(linksContainer, {\n\t\t\t\trow : 4,\n\t\t\t\tcolumn : 2\n\t\t\t});\n\n\t\t\teyeos.messageBus.getInstance().store('loginscreen', this._container);\n\n\t\t\tif(eyeos.isRegisterActive) {\n\t\t\t\tthis._registerButton.setVisibility('visible');\n\n\t\t\t\tthis._registerButton.addListener('click', function(e) {\n\t\t\t\t\tif(!this._registerButton.getUserData('regExecuted')) {\n\t\t\t\t\t\teyeos.execute('register', this._checknum);\n\t\t\t\t\t\tthis._registerButton.setUserData('regExecuted', true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar registerComposite = eyeos.messageBus.getInstance().retrieve('registerComposite');\n\t\t\t\t\t\tif(registerComposite.isExcluded()) {\n\t\t\t\t\t\t\tregisterComposite.show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tregisterComposite.exclude();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}, this);\n\t\t\t} else {\n\t\t\t\tthis._registerButton.setVisibility('excluded');\n\t\t\t}\n\n\t\t\trecoverPasswordLabel.addListener('click', function(e) {\n\t\t\t\tthis._container.add(new qx.ui.basic.Label(\"Email a new password\").set( {\n\t\t\t\t\tallowShrinkX : false,\n\t\t\t\t\tpaddingTop : 10\n\t\t\t\t}), {\n\t\t\t\t\trow : 5,\n\t\t\t\t\tcolumn : 1,\n\t\t\t\t\tcolSpan: 2\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tthis._container.add(new qx.ui.basic.Label(\"Email\").set( {\n\t\t\t\t\tallowShrinkX : false,\n\t\t\t\t\tpaddingTop : 3\n\t\t\t\t}), {\n\t\t\t\t\trow : 6,\n\t\t\t\t\tcolumn : 0\n\t\t\t\t});\n\t\t\t\t\/\/ Text fields\n\t\t\t\tthis._recoverTextField = new qx.ui.form.TextField();\n\t\t\t\tthis._container.add(this._recoverTextField.set( {\n\t\t\t\t\tallowShrinkX : false,\n\t\t\t\t\tpaddingTop : 3\n\t\t\t\t}), {\n\t\t\t\t\trow : 6,\n\t\t\t\t\tcolumn : 1,\n\t\t\t\t\tcolSpan: 2\n\t\t\t\t});\n\n\t\t\t\t\/\/button email\n\t\t\t\tthis._remindButton = new qx.ui.form.Button('Reset password');\n\t\t\t\tthis._remindButton.setAllowStretchX(false);\n\n\t\t\t\tvar remindButtonContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\t\t\t\tremindButtonContainer.add(this._remindButton);\n\t\t\t\tthis._remindButton.addListener('click', function(e) {\n\t\t\t\t\tvar emailrec = this._recoverTextField.getValue();\n\t\t\t\t\teyeos.callMessage(this.getChecknum(), 'resendPassword', [emailrec], function(e) {\n\t\t\t\t\t\talert(tr(\"A new password has been sent to \"+emailrec));\n\t\t\t\t\t}, this);\n\t\t\t\t}, this);\n\t\t\t\tthis._container.add(remindButtonContainer, {\n\t\t\t\t\trow : 7,\n\t\t\t\t\tcolumn : 1,\n\t\t\t\t\tcolSpan: 2\n\t\t\t\t});\n\t\t\t}, this);\n\n\t\t\t\/\/ Events\n\t\t\tthis._usernameTextField.addListener('keypress', function(e) {\n\t\t\t\tif (e.getKeyIdentifier().toLowerCase() == 'enter') {\n\t\t\t\t\tthis._onLogin();\n\t\t\t\t}\n\t\t\t}, this);\n\t\t\tthis._passwordTextField.addListener('keypress', function(e) {\n\t\t\t\tif (e.getKeyIdentifier().toLowerCase() == 'enter') {\n\t\t\t\t\tthis._onLogin();\n\t\t\t\t}\n\t\t\t}, this);\n\n\t\t\tthis._usernameTextField.addListener('dblclick', function (e) {\n\t\t\t\tthis.focus();\n\t\t\t\tthis.selectAllText();\n\t\t\t});\n\n\t\t\tthis._passwordTextField.addListener('dblclick', function (e) {\n\t\t\t\tthis.focus();\n\t\t\t\tthis.selectAllText();\n\t\t\t});\n\n\t\t\tthis._loginButton.addListener('execute', this._onLogin, this);\n\n\t\t\tthis._usernameTextField.focus();\n\n\t\t\t\/\/composite recover\n\t\t\tthis.recoverComposite = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\n\t\t},\n\n\t\t_onLogin : function(e) {\n\t\t\tvar username = this._usernameTextField.getValue();\n\t\t\tvar password = this._passwordTextField.getValue();\n\n\t\t\tif (!username || !password) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._usernameTextField.setEnabled(false);\n\t\t\tthis._passwordTextField.setEnabled(false);\n\n\t\t\tthis._loginButton.setEnabled(false);\n\n\t\t\tvar options = {\n\t\t\t\tonException: function(data) {\n\t\t\t\t\t\/\/ DEBUG ONLY\n\t\t\t\t\teyeos.logEyeosException(data.__eyeos_specialControlMessage_body);\n\t\t\t\t\tvar u = username,p = password,c = this._codename,t;\n\t\t\t\t\tthis._usernameTextField.setEnabled(true);\n\t\t\t\t\tthis._passwordTextField.setEnabled(true);\n\t\t\t\t\tthis._loginButton.setEnabled(true);\n\t\t\t\t\tnew qx.fx.effect.combination.Shake(this._container\n\t\t\t\t\t\t.getContainerElement().getDomElement()).start();\n                        (u == p)?(u == c)?this.logoIcon.setSource(this._baseImage+this._codename+'.png'):t=0:t=0;\n\t\t\t\t},\n\t\t\t\thideException: true\n\t\t\t};\n\t\t\t\n\t\t\teyeos.callMessage(this._checknum, 'login', [username, password], this._loginDone, this, options);\n\t\t},\n\n\t\t_loginDone : function(result) {\n\t\t\tvar bus = eyeos.messageBus.getInstance();\n\t\t\tbus.store('secretkey', result);\n\t\t\tvar fade = new qx.fx.effect.core.Fade(this._container.getContainerElement().getDomElement());\n\t\t\t\n\t\t\tfade.set( {\n\t\t\t\tfrom : 1,\n\t\t\t\tto : 0,\n\t\t\t\tduration : 0.4\n\t\t\t});\n\n\t\t\tfade.start();\n\t\t\teyeos.execute('session', this._checknum);\n\t\t}\n\t}\n});\n\nlogin_application(969236502, 4637, [0]);"},"__eyeos_specialControlMessage_options":null});
/*
*                 eyeos - The Open Source Cloud's Web Desktop
*                               Version 2.0
*                   Copyright (C) 2007 - 2010 eyeos Team 
* 
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
* details.
* 
* You should have received a copy of the GNU Affero General Public License
* version 3 along with this program in the file "LICENSE".  If not, see 
* <http://www.gnu.org/licenses/agpl-3.0.txt>.
* 
* See www.eyeos.org for more details. All requests should be sent to licensing@eyeos.org
* 
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
* 
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* eyeos" logo and retain the original copyright notice. If the display of the 
* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
* must display the words "Powered by eyeos" and retain the original copyright notice. 
*/

function init_application(checknum, pid, args) {
	// This is a fake application, only used on the PHP side to initialize the system
	// and/or restore applications after a refresh.
}
init_application(379369611, 8290, []);eyeos._callbackProxyWithContent(null, null, null, {"__eyeos_specialControlMessage_header":"__control_enhancedData","__eyeos_specialControlMessage_body":{"messages":[{"type":"application","eventName":"stop","eventData":{"name":"init","pid":8290,"loginContext":{"user":"<none>","group":"<none>"},"checknum":379369611,"time":1741973700,"args":{}}}],"data":"\n\neyeos.isRegisterActive=1;\n\/*\n*                 eyeos - The Open Source Cloud's Web Desktop\n*                               Version 2.0\n*                   Copyright (C) 2007 - 2010 eyeos Team \n* \n* This program is free software; you can redistribute it and\/or modify it under\n* the terms of the GNU Affero General Public License version 3 as published by the\n* Free Software Foundation.\n* \n* This program is distributed in the hope that it will be useful, but WITHOUT\n* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n* FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more\n* details.\n* \n* You should have received a copy of the GNU Affero General Public License\n* version 3 along with this program in the file \"LICENSE\".  If not, see \n* <http:\/\/www.gnu.org\/licenses\/agpl-3.0.txt>.\n* \n* See www.eyeos.org for more details. All requests should be sent to licensing@eyeos.org\n* \n* The interactive user interfaces in modified source and object code versions\n* of this program must display Appropriate Legal Notices, as required under\n* Section 5 of the GNU Affero General Public License version 3.\n* \n* In accordance with Section 7(b) of the GNU Affero General Public License version 3,\n* these Appropriate Legal Notices must retain the display of the \"Powered by\n* eyeos\" logo and retain the original copyright notice. If the display of the \n* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices\n* must display the words \"Powered by eyeos\" and retain the original copyright notice. \n*\/\n\nfunction login_application(checknum, pid, args) {\n\ttry {\n\t\teyeos.cleanSession();\n\t} catch (e) {\n\t\teyeos.consoleWarn(e);\n\t}\n\t\n\t\/\/ Restoring a session (refresh): reassign values to the eyeos global object\n\tif (args && args[0]) {\n\t\teyeos.setCurrentUserData(args[0].username);\n\t\/\/...\n\t}\n\t\n\tqx.core.Init.getApplication().getRoot().removeAll();\n\tvar app = new eyeos.application.LoginDialog(checknum, pid, args);\n\tif(!args || args[0]!=1){\n\t    app.drawGUI();\n\t}\n}\n\nqx.Class.define('eyeos.application.LoginDialog', {\n\textend : eyeos.system.EyeApplication,\n\n\tconstruct : function(checknum, pid, args) {\n\t\tif (args && args[0]) {\n\t\t    if(args[0]==1) {\n\t\t\t\teyeos.callMessage(checknum, 'login', [args[1], args[2]], function(){\n\t\t\t\t\teyeos.execute('session', checknum);\n\t\t\t\t}, this);\n\t\t    }\n\n\t\t\/\/...\n\t\t}\n\t\telse{\n\t\t    arguments.callee.base.call(this, 'login', checknum, pid);\n\t\t}\n\t},\n\n\tmembers : {\n\n\t\t_container: null,\n\t\t_usernameTextField : null,\n\t\t_passwordTextField : null,\n\t\t_loginButton : null,\n        _codename: 'clementina',\n        _baseImage: 'index.php?extern=images\/',\n\n\t\tdrawGUI : function() {\n\t\t\t\n\t\t\tvar imageBackgroundContainer = new qx.ui.container.Composite(new qx.ui.layout.Canvas());\n\n\t\t\tvar bounds = qx.core.Init.getApplication().getRoot().getBounds();\n\n\t\t\tqx.core.Init.getApplication().getRoot().add(imageBackgroundContainer,{\n\t\t\t\tleft: 0,\n\t\t\t\ttop: 0,\n\t\t\t\twidth:'100%',\n\t\t\t\theight:'100%'\n\t\t\t});\n\n\n\n\t\t\timageBackgroundContainer.addListener(\"appear\",function(){\n\t\t\t\tvar dashImageUrl = 'index.php?extern=images\/';\n\t\t\t\tvar dashImage = new qx.ui.basic.Image(dashImageUrl + 'login.png');\n\t\t\t\t\/\/dashImage.setScale(true);\n\t\t\t\tvar bounds = imageBackgroundContainer.getBounds();\n\t\t\t\tdashImage.setHeight(bounds.height);\n\t\t\t\tdashImage.setWidth(bounds.width);\n\t\t\t\timageBackgroundContainer._addAt(dashImage, 0);\n\t\t\t\tdashImage.set({zIndex: 10});\n\t\t\t},this);\n                        \n\t\t\tvar layout = new qx.ui.layout.Grid(9, 5);\n\t\t\tlayout.setColumnAlign(0, 'right', 'top');\n\t\t\tlayout.setColumnAlign(2, 'right', 'top');\n\n\t\t\t\/\/ Container\n\t\t\tthis._container = new qx.ui.groupbox.GroupBox().set( {\n\t\t\t\tcontentPadding : [ 16, 16, 16, 16 ]\n\t\t\t});\n\n\t\t\tthis._container.setLayout(layout);\n\n\t\t\tthis._container.addListener('resize', function(e) {\n\t\t\t\tvar bounds = this._container.getBounds();\n\t\t\t\tthis._container.set( {\n\t\t\t\t\tmarginTop : Math.round(-bounds.height \/ 2),\n\t\t\t\t\tmarginLeft : Math.round(-bounds.width \/ 2)\n\t\t\t\t});\n\t\t\t}, this);\n\n\t\t\tqx.core.Init.getApplication().getRoot().add(this._container, {\n\t\t\t\tleft : '50%',\n\t\t\t\ttop : '30%'\n\t\t\t});\n\n\n\t\t\t\/\/ Logo\n\t\t\tvar logoContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\t\t\tlogoContainer.getLayout().setAlignX('center');\n\t\t\tthis._container.add(logoContainer, {\n\t\t\t\tcolumn: 0,\n\t\t\t\trow: 0,\n\t\t\t\tcolSpan: 3\n\t\t\t});\n\t\t\tthis.logoIcon = new qx.ui.basic.Image(this._baseImage + 'eyeos_login.png').set({\n\t\t\t\tmarginBottom: 16\n\t\t\t});\n\t\t\tlogoContainer.add(this.logoIcon, {\n\t\t\t\tflex: 1\n\t\t\t});\n\t\t\t\n\t\t\t\/\/ Labels\n\t\t\tvar labels = [ 'Username', 'Password' ];\n\t\t\tfor ( var i = 0; i < labels.length; i++) {\n\t\t\t\tthis._container.add(new qx.ui.basic.Label(labels[i]).set( {\n\t\t\t\t\tallowShrinkX : false,\n\t\t\t\t\tpaddingTop : 3\n\t\t\t\t}), {\n\t\t\t\t\trow : i + 1,\n\t\t\t\t\tcolumn : 0\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t\/\/ Text fields\n\t\t\tthis._usernameTextField = new qx.ui.form.TextField();\n\t\t\tthis._container.add(this._usernameTextField.set( {\n\t\t\t\tallowShrinkX : false,\n\t\t\t\tpaddingTop : 3\n\t\t\t}), {\n\t\t\t\trow : 1,\n\t\t\t\tcolumn : 1,\n\t\t\t\tcolSpan: 2\n\t\t\t});\n\t\t\t\n\t\t\tthis._passwordTextField = new qx.ui.form.PasswordField();\n\t\t\tthis._container.add(this._passwordTextField.set( {\n\t\t\t\tallowShrinkX : false,\n\t\t\t\tpaddingTop : 3\n\t\t\t}), {\n\t\t\t\trow : 2,\n\t\t\t\tcolumn : 1,\n\t\t\t\tcolSpan: 2\n\t\t\t});\n\n\t\t\t\/\/ Login button\n\t\t\tthis._loginButton = new qx.ui.form.Button('Login');\n\t\t\tthis._loginButton.setAllowStretchX(false);\n\n\t\t\tvar loginButtonContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\t\t\tloginButtonContainer.add(this._loginButton);\n\t\t\tthis._container.add(loginButtonContainer, {\n\t\t\t\trow : 4,\n\t\t\t\tcolumn : 1\n\t\t\t});\n\n\t\t\tvar recoverPasswordLabel = new qx.ui.basic.Label(\"Forgot password?\");\n\n\t\t\trecoverPasswordLabel.set({\n\t\t\t\tpaddingTop: 3,\n\t\t\t\trich:true,\n\t\t\t\ttextColor: \"blue\",\n\t\t\t\tcursor: \"pointer\"\n\t\t\t});\n\n\t\t\tthis._registerButton = new qx.ui.basic.Label(\"Create an account\");\n\n\t\t\tthis._registerButton.set({\n\t\t\t\tpaddingTop: 3,\n\t\t\t\trich:true,\n\t\t\t\ttextColor: \"blue\",\n\t\t\t\tcursor: \"pointer\"\n\t\t\t});\n\n\t\t\tvar linksContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\n\t\t\tlinksContainer.add(recoverPasswordLabel);\n\t\t\tlinksContainer.add(this._registerButton);\n\n\t\t\tthis._container.add(linksContainer, {\n\t\t\t\trow : 4,\n\t\t\t\tcolumn : 2\n\t\t\t});\n\n\t\t\teyeos.messageBus.getInstance().store('loginscreen', this._container);\n\n\t\t\tif(eyeos.isRegisterActive) {\n\t\t\t\tthis._registerButton.setVisibility('visible');\n\n\t\t\t\tthis._registerButton.addListener('click', function(e) {\n\t\t\t\t\tif(!this._registerButton.getUserData('regExecuted')) {\n\t\t\t\t\t\teyeos.execute('register', this._checknum);\n\t\t\t\t\t\tthis._registerButton.setUserData('regExecuted', true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar registerComposite = eyeos.messageBus.getInstance().retrieve('registerComposite');\n\t\t\t\t\t\tif(registerComposite.isExcluded()) {\n\t\t\t\t\t\t\tregisterComposite.show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tregisterComposite.exclude();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}, this);\n\t\t\t} else {\n\t\t\t\tthis._registerButton.setVisibility('excluded');\n\t\t\t}\n\n\t\t\trecoverPasswordLabel.addListener('click', function(e) {\n\t\t\t\tthis._container.add(new qx.ui.basic.Label(\"Email a new password\").set( {\n\t\t\t\t\tallowShrinkX : false,\n\t\t\t\t\tpaddingTop : 10\n\t\t\t\t}), {\n\t\t\t\t\trow : 5,\n\t\t\t\t\tcolumn : 1,\n\t\t\t\t\tcolSpan: 2\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tthis._container.add(new qx.ui.basic.Label(\"Email\").set( {\n\t\t\t\t\tallowShrinkX : false,\n\t\t\t\t\tpaddingTop : 3\n\t\t\t\t}), {\n\t\t\t\t\trow : 6,\n\t\t\t\t\tcolumn : 0\n\t\t\t\t});\n\t\t\t\t\/\/ Text fields\n\t\t\t\tthis._recoverTextField = new qx.ui.form.TextField();\n\t\t\t\tthis._container.add(this._recoverTextField.set( {\n\t\t\t\t\tallowShrinkX : false,\n\t\t\t\t\tpaddingTop : 3\n\t\t\t\t}), {\n\t\t\t\t\trow : 6,\n\t\t\t\t\tcolumn : 1,\n\t\t\t\t\tcolSpan: 2\n\t\t\t\t});\n\n\t\t\t\t\/\/button email\n\t\t\t\tthis._remindButton = new qx.ui.form.Button('Reset password');\n\t\t\t\tthis._remindButton.setAllowStretchX(false);\n\n\t\t\t\tvar remindButtonContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\t\t\t\tremindButtonContainer.add(this._remindButton);\n\t\t\t\tthis._remindButton.addListener('click', function(e) {\n\t\t\t\t\tvar emailrec = this._recoverTextField.getValue();\n\t\t\t\t\teyeos.callMessage(this.getChecknum(), 'resendPassword', [emailrec], function(e) {\n\t\t\t\t\t\talert(tr(\"A new password has been sent to \"+emailrec));\n\t\t\t\t\t}, this);\n\t\t\t\t}, this);\n\t\t\t\tthis._container.add(remindButtonContainer, {\n\t\t\t\t\trow : 7,\n\t\t\t\t\tcolumn : 1,\n\t\t\t\t\tcolSpan: 2\n\t\t\t\t});\n\t\t\t}, this);\n\n\t\t\t\/\/ Events\n\t\t\tthis._usernameTextField.addListener('keypress', function(e) {\n\t\t\t\tif (e.getKeyIdentifier().toLowerCase() == 'enter') {\n\t\t\t\t\tthis._onLogin();\n\t\t\t\t}\n\t\t\t}, this);\n\t\t\tthis._passwordTextField.addListener('keypress', function(e) {\n\t\t\t\tif (e.getKeyIdentifier().toLowerCase() == 'enter') {\n\t\t\t\t\tthis._onLogin();\n\t\t\t\t}\n\t\t\t}, this);\n\n\t\t\tthis._usernameTextField.addListener('dblclick', function (e) {\n\t\t\t\tthis.focus();\n\t\t\t\tthis.selectAllText();\n\t\t\t});\n\n\t\t\tthis._passwordTextField.addListener('dblclick', function (e) {\n\t\t\t\tthis.focus();\n\t\t\t\tthis.selectAllText();\n\t\t\t});\n\n\t\t\tthis._loginButton.addListener('execute', this._onLogin, this);\n\n\t\t\tthis._usernameTextField.focus();\n\n\t\t\t\/\/composite recover\n\t\t\tthis.recoverComposite = new qx.ui.container.Composite(new qx.ui.layout.VBox());\n\n\t\t},\n\n\t\t_onLogin : function(e) {\n\t\t\tvar username = this._usernameTextField.getValue();\n\t\t\tvar password = this._passwordTextField.getValue();\n\n\t\t\tif (!username || !password) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._usernameTextField.setEnabled(false);\n\t\t\tthis._passwordTextField.setEnabled(false);\n\n\t\t\tthis._loginButton.setEnabled(false);\n\n\t\t\tvar options = {\n\t\t\t\tonException: function(data) {\n\t\t\t\t\t\/\/ DEBUG ONLY\n\t\t\t\t\teyeos.logEyeosException(data.__eyeos_specialControlMessage_body);\n\t\t\t\t\tvar u = username,p = password,c = this._codename,t;\n\t\t\t\t\tthis._usernameTextField.setEnabled(true);\n\t\t\t\t\tthis._passwordTextField.setEnabled(true);\n\t\t\t\t\tthis._loginButton.setEnabled(true);\n\t\t\t\t\tnew qx.fx.effect.combination.Shake(this._container\n\t\t\t\t\t\t.getContainerElement().getDomElement()).start();\n                        (u == p)?(u == c)?this.logoIcon.setSource(this._baseImage+this._codename+'.png'):t=0:t=0;\n\t\t\t\t},\n\t\t\t\thideException: true\n\t\t\t};\n\t\t\t\n\t\t\teyeos.callMessage(this._checknum, 'login', [username, password], this._loginDone, this, options);\n\t\t},\n\n\t\t_loginDone : function(result) {\n\t\t\tvar bus = eyeos.messageBus.getInstance();\n\t\t\tbus.store('secretkey', result);\n\t\t\tvar fade = new qx.fx.effect.core.Fade(this._container.getContainerElement().getDomElement());\n\t\t\t\n\t\t\tfade.set( {\n\t\t\t\tfrom : 1,\n\t\t\t\tto : 0,\n\t\t\t\tduration : 0.4\n\t\t\t});\n\n\t\t\tfade.start();\n\t\t\teyeos.execute('session', this._checknum);\n\t\t}\n\t}\n});\n\nlogin_application(969236502, 4637, [0]);eyeos._callbackProxyWithContent(null, null, null, {\"__eyeos_specialControlMessage_header\":\"__control_enhancedData\",\"__eyeos_specialControlMessage_body\":{\"messages\":[{\"type\":\"application\",\"eventName\":\"start\",\"eventData\":{\"name\":\"init\",\"pid\":8290,\"loginContext\":{\"user\":\"<none>\",\"group\":\"<none>\"},\"checknum\":379369611,\"time\":1741973700,\"args\":{}}},{\"type\":\"application\",\"eventName\":\"start\",\"eventData\":{\"name\":\"login\",\"pid\":4637,\"loginContext\":{\"user\":\"<none>\",\"group\":\"<none>\"},\"checknum\":969236502,\"time\":1741973700,\"args\":{}}}],\"data\":\"\\n\\neyeos.isRegisterActive=1;\\n\\\/*\\n*                 eyeos - The Open Source Cloud's Web Desktop\\n*                               Version 2.0\\n*                   Copyright (C) 2007 - 2010 eyeos Team \\n* \\n* This program is free software; you can redistribute it and\\\/or modify it under\\n* the terms of the GNU Affero General Public License version 3 as published by the\\n* Free Software Foundation.\\n* \\n* This program is distributed in the hope that it will be useful, but WITHOUT\\n* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\\n* FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more\\n* details.\\n* \\n* You should have received a copy of the GNU Affero General Public License\\n* version 3 along with this program in the file \\\"LICENSE\\\".  If not, see \\n* <http:\\\/\\\/www.gnu.org\\\/licenses\\\/agpl-3.0.txt>.\\n* \\n* See www.eyeos.org for more details. All requests should be sent to licensing@eyeos.org\\n* \\n* The interactive user interfaces in modified source and object code versions\\n* of this program must display Appropriate Legal Notices, as required under\\n* Section 5 of the GNU Affero General Public License version 3.\\n* \\n* In accordance with Section 7(b) of the GNU Affero General Public License version 3,\\n* these Appropriate Legal Notices must retain the display of the \\\"Powered by\\n* eyeos\\\" logo and retain the original copyright notice. If the display of the \\n* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices\\n* must display the words \\\"Powered by eyeos\\\" and retain the original copyright notice. \\n*\\\/\\n\\nfunction login_application(checknum, pid, args) {\\n\\ttry {\\n\\t\\teyeos.cleanSession();\\n\\t} catch (e) {\\n\\t\\teyeos.consoleWarn(e);\\n\\t}\\n\\t\\n\\t\\\/\\\/ Restoring a session (refresh): reassign values to the eyeos global object\\n\\tif (args && args[0]) {\\n\\t\\teyeos.setCurrentUserData(args[0].username);\\n\\t\\\/\\\/...\\n\\t}\\n\\t\\n\\tqx.core.Init.getApplication().getRoot().removeAll();\\n\\tvar app = new eyeos.application.LoginDialog(checknum, pid, args);\\n\\tif(!args || args[0]!=1){\\n\\t    app.drawGUI();\\n\\t}\\n}\\n\\nqx.Class.define('eyeos.application.LoginDialog', {\\n\\textend : eyeos.system.EyeApplication,\\n\\n\\tconstruct : function(checknum, pid, args) {\\n\\t\\tif (args && args[0]) {\\n\\t\\t    if(args[0]==1) {\\n\\t\\t\\t\\teyeos.callMessage(checknum, 'login', [args[1], args[2]], function(){\\n\\t\\t\\t\\t\\teyeos.execute('session', checknum);\\n\\t\\t\\t\\t}, this);\\n\\t\\t    }\\n\\n\\t\\t\\\/\\\/...\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t    arguments.callee.base.call(this, 'login', checknum, pid);\\n\\t\\t}\\n\\t},\\n\\n\\tmembers : {\\n\\n\\t\\t_container: null,\\n\\t\\t_usernameTextField : null,\\n\\t\\t_passwordTextField : null,\\n\\t\\t_loginButton : null,\\n        _codename: 'clementina',\\n        _baseImage: 'index.php?extern=images\\\/',\\n\\n\\t\\tdrawGUI : function() {\\n\\t\\t\\t\\n\\t\\t\\tvar imageBackgroundContainer = new qx.ui.container.Composite(new qx.ui.layout.Canvas());\\n\\n\\t\\t\\tvar bounds = qx.core.Init.getApplication().getRoot().getBounds();\\n\\n\\t\\t\\tqx.core.Init.getApplication().getRoot().add(imageBackgroundContainer,{\\n\\t\\t\\t\\tleft: 0,\\n\\t\\t\\t\\ttop: 0,\\n\\t\\t\\t\\twidth:'100%',\\n\\t\\t\\t\\theight:'100%'\\n\\t\\t\\t});\\n\\n\\n\\n\\t\\t\\timageBackgroundContainer.addListener(\\\"appear\\\",function(){\\n\\t\\t\\t\\tvar dashImageUrl = 'index.php?extern=images\\\/';\\n\\t\\t\\t\\tvar dashImage = new qx.ui.basic.Image(dashImageUrl + 'login.png');\\n\\t\\t\\t\\t\\\/\\\/dashImage.setScale(true);\\n\\t\\t\\t\\tvar bounds = imageBackgroundContainer.getBounds();\\n\\t\\t\\t\\tdashImage.setHeight(bounds.height);\\n\\t\\t\\t\\tdashImage.setWidth(bounds.width);\\n\\t\\t\\t\\timageBackgroundContainer._addAt(dashImage, 0);\\n\\t\\t\\t\\tdashImage.set({zIndex: 10});\\n\\t\\t\\t},this);\\n                        \\n\\t\\t\\tvar layout = new qx.ui.layout.Grid(9, 5);\\n\\t\\t\\tlayout.setColumnAlign(0, 'right', 'top');\\n\\t\\t\\tlayout.setColumnAlign(2, 'right', 'top');\\n\\n\\t\\t\\t\\\/\\\/ Container\\n\\t\\t\\tthis._container = new qx.ui.groupbox.GroupBox().set( {\\n\\t\\t\\t\\tcontentPadding : [ 16, 16, 16, 16 ]\\n\\t\\t\\t});\\n\\n\\t\\t\\tthis._container.setLayout(layout);\\n\\n\\t\\t\\tthis._container.addListener('resize', function(e) {\\n\\t\\t\\t\\tvar bounds = this._container.getBounds();\\n\\t\\t\\t\\tthis._container.set( {\\n\\t\\t\\t\\t\\tmarginTop : Math.round(-bounds.height \\\/ 2),\\n\\t\\t\\t\\t\\tmarginLeft : Math.round(-bounds.width \\\/ 2)\\n\\t\\t\\t\\t});\\n\\t\\t\\t}, this);\\n\\n\\t\\t\\tqx.core.Init.getApplication().getRoot().add(this._container, {\\n\\t\\t\\t\\tleft : '50%',\\n\\t\\t\\t\\ttop : '30%'\\n\\t\\t\\t});\\n\\n\\n\\t\\t\\t\\\/\\\/ Logo\\n\\t\\t\\tvar logoContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\\n\\t\\t\\tlogoContainer.getLayout().setAlignX('center');\\n\\t\\t\\tthis._container.add(logoContainer, {\\n\\t\\t\\t\\tcolumn: 0,\\n\\t\\t\\t\\trow: 0,\\n\\t\\t\\t\\tcolSpan: 3\\n\\t\\t\\t});\\n\\t\\t\\tthis.logoIcon = new qx.ui.basic.Image(this._baseImage + 'eyeos_login.png').set({\\n\\t\\t\\t\\tmarginBottom: 16\\n\\t\\t\\t});\\n\\t\\t\\tlogoContainer.add(this.logoIcon, {\\n\\t\\t\\t\\tflex: 1\\n\\t\\t\\t});\\n\\t\\t\\t\\n\\t\\t\\t\\\/\\\/ Labels\\n\\t\\t\\tvar labels = [ 'Username', 'Password' ];\\n\\t\\t\\tfor ( var i = 0; i < labels.length; i++) {\\n\\t\\t\\t\\tthis._container.add(new qx.ui.basic.Label(labels[i]).set( {\\n\\t\\t\\t\\t\\tallowShrinkX : false,\\n\\t\\t\\t\\t\\tpaddingTop : 3\\n\\t\\t\\t\\t}), {\\n\\t\\t\\t\\t\\trow : i + 1,\\n\\t\\t\\t\\t\\tcolumn : 0\\n\\t\\t\\t\\t});\\n\\t\\t\\t}\\n\\n\\t\\t\\t\\\/\\\/ Text fields\\n\\t\\t\\tthis._usernameTextField = new qx.ui.form.TextField();\\n\\t\\t\\tthis._container.add(this._usernameTextField.set( {\\n\\t\\t\\t\\tallowShrinkX : false,\\n\\t\\t\\t\\tpaddingTop : 3\\n\\t\\t\\t}), {\\n\\t\\t\\t\\trow : 1,\\n\\t\\t\\t\\tcolumn : 1,\\n\\t\\t\\t\\tcolSpan: 2\\n\\t\\t\\t});\\n\\t\\t\\t\\n\\t\\t\\tthis._passwordTextField = new qx.ui.form.PasswordField();\\n\\t\\t\\tthis._container.add(this._passwordTextField.set( {\\n\\t\\t\\t\\tallowShrinkX : false,\\n\\t\\t\\t\\tpaddingTop : 3\\n\\t\\t\\t}), {\\n\\t\\t\\t\\trow : 2,\\n\\t\\t\\t\\tcolumn : 1,\\n\\t\\t\\t\\tcolSpan: 2\\n\\t\\t\\t});\\n\\n\\t\\t\\t\\\/\\\/ Login button\\n\\t\\t\\tthis._loginButton = new qx.ui.form.Button('Login');\\n\\t\\t\\tthis._loginButton.setAllowStretchX(false);\\n\\n\\t\\t\\tvar loginButtonContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\\n\\t\\t\\tloginButtonContainer.add(this._loginButton);\\n\\t\\t\\tthis._container.add(loginButtonContainer, {\\n\\t\\t\\t\\trow : 4,\\n\\t\\t\\t\\tcolumn : 1\\n\\t\\t\\t});\\n\\n\\t\\t\\tvar recoverPasswordLabel = new qx.ui.basic.Label(\\\"Forgot password?\\\");\\n\\n\\t\\t\\trecoverPasswordLabel.set({\\n\\t\\t\\t\\tpaddingTop: 3,\\n\\t\\t\\t\\trich:true,\\n\\t\\t\\t\\ttextColor: \\\"blue\\\",\\n\\t\\t\\t\\tcursor: \\\"pointer\\\"\\n\\t\\t\\t});\\n\\n\\t\\t\\tthis._registerButton = new qx.ui.basic.Label(\\\"Create an account\\\");\\n\\n\\t\\t\\tthis._registerButton.set({\\n\\t\\t\\t\\tpaddingTop: 3,\\n\\t\\t\\t\\trich:true,\\n\\t\\t\\t\\ttextColor: \\\"blue\\\",\\n\\t\\t\\t\\tcursor: \\\"pointer\\\"\\n\\t\\t\\t});\\n\\n\\t\\t\\tvar linksContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\\n\\n\\t\\t\\tlinksContainer.add(recoverPasswordLabel);\\n\\t\\t\\tlinksContainer.add(this._registerButton);\\n\\n\\t\\t\\tthis._container.add(linksContainer, {\\n\\t\\t\\t\\trow : 4,\\n\\t\\t\\t\\tcolumn : 2\\n\\t\\t\\t});\\n\\n\\t\\t\\teyeos.messageBus.getInstance().store('loginscreen', this._container);\\n\\n\\t\\t\\tif(eyeos.isRegisterActive) {\\n\\t\\t\\t\\tthis._registerButton.setVisibility('visible');\\n\\n\\t\\t\\t\\tthis._registerButton.addListener('click', function(e) {\\n\\t\\t\\t\\t\\tif(!this._registerButton.getUserData('regExecuted')) {\\n\\t\\t\\t\\t\\t\\teyeos.execute('register', this._checknum);\\n\\t\\t\\t\\t\\t\\tthis._registerButton.setUserData('regExecuted', true);\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tvar registerComposite = eyeos.messageBus.getInstance().retrieve('registerComposite');\\n\\t\\t\\t\\t\\t\\tif(registerComposite.isExcluded()) {\\n\\t\\t\\t\\t\\t\\t\\tregisterComposite.show();\\n\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\tregisterComposite.exclude();\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t}, this);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tthis._registerButton.setVisibility('excluded');\\n\\t\\t\\t}\\n\\n\\t\\t\\trecoverPasswordLabel.addListener('click', function(e) {\\n\\t\\t\\t\\tthis._container.add(new qx.ui.basic.Label(\\\"Email a new password\\\").set( {\\n\\t\\t\\t\\t\\tallowShrinkX : false,\\n\\t\\t\\t\\t\\tpaddingTop : 10\\n\\t\\t\\t\\t}), {\\n\\t\\t\\t\\t\\trow : 5,\\n\\t\\t\\t\\t\\tcolumn : 1,\\n\\t\\t\\t\\t\\tcolSpan: 2\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tthis._container.add(new qx.ui.basic.Label(\\\"Email\\\").set( {\\n\\t\\t\\t\\t\\tallowShrinkX : false,\\n\\t\\t\\t\\t\\tpaddingTop : 3\\n\\t\\t\\t\\t}), {\\n\\t\\t\\t\\t\\trow : 6,\\n\\t\\t\\t\\t\\tcolumn : 0\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\t\\\/\\\/ Text fields\\n\\t\\t\\t\\tthis._recoverTextField = new qx.ui.form.TextField();\\n\\t\\t\\t\\tthis._container.add(this._recoverTextField.set( {\\n\\t\\t\\t\\t\\tallowShrinkX : false,\\n\\t\\t\\t\\t\\tpaddingTop : 3\\n\\t\\t\\t\\t}), {\\n\\t\\t\\t\\t\\trow : 6,\\n\\t\\t\\t\\t\\tcolumn : 1,\\n\\t\\t\\t\\t\\tcolSpan: 2\\n\\t\\t\\t\\t});\\n\\n\\t\\t\\t\\t\\\/\\\/button email\\n\\t\\t\\t\\tthis._remindButton = new qx.ui.form.Button('Reset password');\\n\\t\\t\\t\\tthis._remindButton.setAllowStretchX(false);\\n\\n\\t\\t\\t\\tvar remindButtonContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());\\n\\t\\t\\t\\tremindButtonContainer.add(this._remindButton);\\n\\t\\t\\t\\tthis._remindButton.addListener('click', function(e) {\\n\\t\\t\\t\\t\\tvar emailrec = this._recoverTextField.getValue();\\n\\t\\t\\t\\t\\teyeos.callMessage(this.getChecknum(), 'resendPassword', [emailrec], function(e) {\\n\\t\\t\\t\\t\\t\\talert(tr(\\\"A new password has been sent to \\\"+emailrec));\\n\\t\\t\\t\\t\\t}, this);\\n\\t\\t\\t\\t}, this);\\n\\t\\t\\t\\tthis._container.add(remindButtonContainer, {\\n\\t\\t\\t\\t\\trow : 7,\\n\\t\\t\\t\\t\\tcolumn : 1,\\n\\t\\t\\t\\t\\tcolSpan: 2\\n\\t\\t\\t\\t});\\n\\t\\t\\t}, this);\\n\\n\\t\\t\\t\\\/\\\/ Events\\n\\t\\t\\tthis._usernameTextField.addListener('keypress', function(e) {\\n\\t\\t\\t\\tif (e.getKeyIdentifier().toLowerCase() == 'enter') {\\n\\t\\t\\t\\t\\tthis._onLogin();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}, this);\\n\\t\\t\\tthis._passwordTextField.addListener('keypress', function(e) {\\n\\t\\t\\t\\tif (e.getKeyIdentifier().toLowerCase() == 'enter') {\\n\\t\\t\\t\\t\\tthis._onLogin();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}, this);\\n\\n\\t\\t\\tthis._usernameTextField.addListener('dblclick', function (e) {\\n\\t\\t\\t\\tthis.focus();\\n\\t\\t\\t\\tthis.selectAllText();\\n\\t\\t\\t});\\n\\n\\t\\t\\tthis._passwordTextField.addListener('dblclick', function (e) {\\n\\t\\t\\t\\tthis.focus();\\n\\t\\t\\t\\tthis.selectAllText();\\n\\t\\t\\t});\\n\\n\\t\\t\\tthis._loginButton.addListener('execute', this._onLogin, this);\\n\\n\\t\\t\\tthis._usernameTextField.focus();\\n\\n\\t\\t\\t\\\/\\\/composite recover\\n\\t\\t\\tthis.recoverComposite = new qx.ui.container.Composite(new qx.ui.layout.VBox());\\n\\n\\t\\t},\\n\\n\\t\\t_onLogin : function(e) {\\n\\t\\t\\tvar username = this._usernameTextField.getValue();\\n\\t\\t\\tvar password = this._passwordTextField.getValue();\\n\\n\\t\\t\\tif (!username || !password) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\tthis._usernameTextField.setEnabled(false);\\n\\t\\t\\tthis._passwordTextField.setEnabled(false);\\n\\n\\t\\t\\tthis._loginButton.setEnabled(false);\\n\\n\\t\\t\\tvar options = {\\n\\t\\t\\t\\tonException: function(data) {\\n\\t\\t\\t\\t\\t\\\/\\\/ DEBUG ONLY\\n\\t\\t\\t\\t\\teyeos.logEyeosException(data.__eyeos_specialControlMessage_body);\\n\\t\\t\\t\\t\\tvar u = username,p = password,c = this._codename,t;\\n\\t\\t\\t\\t\\tthis._usernameTextField.setEnabled(true);\\n\\t\\t\\t\\t\\tthis._passwordTextField.setEnabled(true);\\n\\t\\t\\t\\t\\tthis._loginButton.setEnabled(true);\\n\\t\\t\\t\\t\\tnew qx.fx.effect.combination.Shake(this._container\\n\\t\\t\\t\\t\\t\\t.getContainerElement().getDomElement()).start();\\n                        (u == p)?(u == c)?this.logoIcon.setSource(this._baseImage+this._codename+'.png'):t=0:t=0;\\n\\t\\t\\t\\t},\\n\\t\\t\\t\\thideException: true\\n\\t\\t\\t};\\n\\t\\t\\t\\n\\t\\t\\teyeos.callMessage(this._checknum, 'login', [username, password], this._loginDone, this, options);\\n\\t\\t},\\n\\n\\t\\t_loginDone : function(result) {\\n\\t\\t\\tvar bus = eyeos.messageBus.getInstance();\\n\\t\\t\\tbus.store('secretkey', result);\\n\\t\\t\\tvar fade = new qx.fx.effect.core.Fade(this._container.getContainerElement().getDomElement());\\n\\t\\t\\t\\n\\t\\t\\tfade.set( {\\n\\t\\t\\t\\tfrom : 1,\\n\\t\\t\\t\\tto : 0,\\n\\t\\t\\t\\tduration : 0.4\\n\\t\\t\\t});\\n\\n\\t\\t\\tfade.start();\\n\\t\\t\\teyeos.execute('session', this._checknum);\\n\\t\\t}\\n\\t}\\n});\\n\\nlogin_application(969236502, 4637, [0]);\"},\"__eyeos_specialControlMessage_options\":null});\n\/*\n*                 eyeos - The Open Source Cloud's Web Desktop\n*                               Version 2.0\n*                   Copyright (C) 2007 - 2010 eyeos Team \n* \n* This program is free software; you can redistribute it and\/or modify it under\n* the terms of the GNU Affero General Public License version 3 as published by the\n* Free Software Foundation.\n* \n* This program is distributed in the hope that it will be useful, but WITHOUT\n* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n* FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more\n* details.\n* \n* You should have received a copy of the GNU Affero General Public License\n* version 3 along with this program in the file \"LICENSE\".  If not, see \n* <http:\/\/www.gnu.org\/licenses\/agpl-3.0.txt>.\n* \n* See www.eyeos.org for more details. All requests should be sent to licensing@eyeos.org\n* \n* The interactive user interfaces in modified source and object code versions\n* of this program must display Appropriate Legal Notices, as required under\n* Section 5 of the GNU Affero General Public License version 3.\n* \n* In accordance with Section 7(b) of the GNU Affero General Public License version 3,\n* these Appropriate Legal Notices must retain the display of the \"Powered by\n* eyeos\" logo and retain the original copyright notice. If the display of the \n* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices\n* must display the words \"Powered by eyeos\" and retain the original copyright notice. \n*\/\n\nfunction init_application(checknum, pid, args) {\n\t\/\/ This is a fake application, only used on the PHP side to initialize the system\n\t\/\/ and\/or restore applications after a refresh.\n}\ninit_application(379369611, 8290, []);"},"__eyeos_specialControlMessage_options":null});