connect($url['host'], $port); if( PEAR::isError( $res )) { return $res; } $res = $GLOBALS['FTPCONNECTION']->login( $ssh2_user, $ssh2_pass ); if( PEAR::isError( $res )) { return $res; } $_SESSION['credentials_ssh2']['username'] = $ssh2_user; $_SESSION['credentials_ssh2']['password'] = $ssh2_pass; $_SESSION['ssh2_host'] = $ssh2_host; $_SESSION['file_mode'] = 'ssh2'; return true; } return false; } function onShowLoginForm() { ?> { xtype: "form", renderTo: "adminForm", id: "simpleform", labelWidth: 125, url:"", dialogtitle: "", title: "", frame: true, keys: { key: Ext.EventObject.ENTER, fn : function(){ if (Ext.getCmp("simpleform").getForm().isValid()) { statusBarMessage( '', true ); Ext.getCmp("simpleform").getForm().submit({ reset: false, success: function(form, action) { location.href = '?ssh2' }, failure: function(form, action) { if( !action.result ) return; msgbox = Ext.Msg.alert('', action.result.error); msgbox.setIcon( Ext.MessageBox.ERROR ); statusBarMessage( action.result.error, false, false ); }, scope: Ext.getCmp("simpleform").getForm(), params: { option: "com_extplorer", action: "ssh2_authentication" } }); } else { return false; } } }, items: [{ xtype: "textfield", fieldLabel: "", name: "username", width:175, allowBlank:false },{ xtype: "textfield", fieldLabel: "", name: "password", inputType: "password", width:175, allowBlank:false },{ xtype: "combo", fieldLabel: "", name: "ssh2_host", value: "", store: [""], width:175, triggerAction: "all", editable: false, forceSelection: true, allowBlank:false }, { xtype: "displayfield", id: "statusBar" }], buttons: [{ text: "", type: "submit", handler: function() { Ext.get( 'statusBar').update( '' ); Ext.getCmp("simpleform").getForm().submit({ reset: false, success: function(form, action) { location.reload() }, failure: function(form, action) { if( !action.result ) return; msgbox = Ext.Msg.alert('', action.result.error); msgbox.setIcon( Ext.MessageBox.ERROR ); Ext.get( 'statusBar').update( action.result.error ); }, scope: Ext.getCmp("simpleform").getForm(), params: { option: "com_extplorer", action: "login", type : "ssh2" } }); } }, { text: '', handler: function() { simple.getForm().reset(); } } { text: "", handler: function() { Ext.getCmp("dialog").destroy(); } } ] }