connect(); if( PEAR::isError( $res )) { ext_Result::sendResult('ftp_authentication', false, ext_Lang::msg('ftp_connection_failed').' ('.$url['host'].')' ); } else { $res = $GLOBALS['FTPCONNECTION']->login( $ftp_login, $ftp_pass ); if( PEAR::isError( $res )) { ext_Result::sendResult('ftp_authentication', false, ext_Lang::msg('ftp_login_failed') ); } $_SESSION['credentials_ftp']['username'] = $ftp_login; $_SESSION['credentials_ftp']['password'] = $ftp_pass; $_SESSION['ftp_host'] = $ftp_host; $_SESSION['file_mode'] = 'ftp'; $_SESSION['ftp_login'] = $ftp_login; 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()) { 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; Ext.Msg.alert('', action.result.error); Ext.get( 'statusBar').update( action.result.error ); }, scope: Ext.getCmp("simpleform").getForm(), params: { option: "com_extplorer", action: "login", type: "ftp", file_mode: "ftp" } }); } 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: "", hiddenName: "ftp_host", triggerAction: "all", value: "", store: [""], width:175, 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; Ext.Msg.alert('', action.result.error); Ext.get( 'statusBar').update( action.result.error ); }, scope: Ext.getCmp("simpleform").getForm(), params: { option: "com_extplorer", action: "login", type: "ftp", file_mode: "ftp" } }); } }, { text: '', handler: function() { simple.getForm().reset(); } } { text: "", handler: function() { Ext.getCmp("dialog").destroy(); } } ] }