Author: juhliarik
Date: Wed Jul 25 10:08:54 2007
New Revision: 39647
URL: http://svn.opensuse.org/viewcvs/yast?rev=39647&view=rev
Log:
reimplementation dialogs, helps and functions for handling widgets
- CWN clear implementation
Removed:
trunk/ftp-server/src/uiforms.ycp
Modified:
trunk/ftp-server/src/dialogs.ycp
trunk/ftp-server/src/helps.ycp
trunk/ftp-server/src/wid_functions.ycp
Modified: trunk/ftp-server/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/dialogs.ycp?rev=39647&r1=39646&r2=39647&view=diff
==============================================================================
--- trunk/ftp-server/src/dialogs.ycp (original)
+++ trunk/ftp-server/src/dialogs.ycp Wed Jul 25 10:08:54 2007
@@ -152,6 +152,32 @@
return result;
}
+
+
+/**
+ * Init function where are added UI hadle functions
+ * Start widget radiobuttons for switching daemons
+ *
+ * @return map map for start-stop widget
+ */
+
+map RBVsftpdPureftpd () {
+ map result = $[];
+ result["label"] = _("Selected Service");
+ result["widget"] = `radio_buttons;
+ result["items"] = [
+ [ "vs_item", _("&vsftpd") ],
+ [ "pure_item", _("p&ure-ftpd") ]
+ ];
+ result["init"] = InitRBVsPure;
+ result["handle"] = HandleRBVsPure;
+ result["help"] = DialogHelpText("selected_services");
+
+ return result;
+}
+
+
+
/**
* Init function where are added UI hadle functions
* special hack widget where is handlig disable back button
@@ -172,11 +198,17 @@
/**
+ *-----------================= GENERAL SCREEN =============----------
+ *
+ */
+
+
+/*
* Init function where are added UI hadle functions
* General Settings widget
*
* @return map map for General Settings widget
- */
+
map GenSettings () {
map result = $[];
@@ -192,35 +224,370 @@
return result;
}
+*/
+
+/**
+ * Wellcome Message for vsftpd
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+map Banner () {
+ map result = $[];
+
+ result["label"] = _("&Welcome message");
+ result["widget"] = `textentry;
+ result["init"] = InitBanner;
+ result["store"] = StoreBanner;
+ result["help"] = DialogHelpText("Banner");
+
+ return result;
+}
+
+/**
+ * Chroot Everyone
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+map ChrootEnable () {
+ map result = $[];
+
+ result["label"] = _("&Chroot Everyone");
+ result["widget"] = `checkbox;
+ result["init"] = InitChrootEnable;
+ result["store"] = StoreChrootEnable;
+ result["help"] = DialogHelpText("ChrootEnable");
+
+ return result;
+}
+
+/**
+ * Verbos Logging
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+map VerboseLogging() {
+ map result = $[];
+
+ result["label"] = _("&Verbose Logging");
+ result["widget"] = `checkbox;
+ result["init"] = InitVerboseLogging;
+ result["store"] = StoreVerboseLogging;
+ result["help"] = DialogHelpText("VerboseLogging");
+
+ return result;
+}
+
+/**
+ * Umask (umask files:umask dirs) only pure-ftpd
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+
+map Umask () {
+ map result = $[];
+
+ result["label"] = _("&Umask (umask files:umask dirs)");
+ result["widget"] = `textentry;
+ result["init"] = InitUmask;
+ result["store"] = StoreUmask;
+ result["validate_type"] = `function;
+ result["validate_function"] = ValidUmask;
+ result["help"] = DialogHelpText("Umask");
+
+ return result;
+}
+
+/**
+ * Umask for Anonynous for vsftpd
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+
+map UmaskAnon () {
+ map result = $[];
+
+ result["label"] = _("&Umask for Anonymous");
+ result["widget"] = `textentry;
+ result["init"] = InitUmaskAnon;
+ result["store"] = StoreUmaskAnon;
+ result["help"] = DialogHelpText("UmaskAnon");
+
+ return result;
+}
+
+
+
+
+/**
+ * Umask for Authenticated Users for vsftpd
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+
+map UmaskLocal () {
+ map result = $[];
+
+ result["label"] = _("Uma&sk for Authenticated Users");
+ result["widget"] = `textentry;
+ result["init"] = InitUmaskLocal;
+ result["store"] = StoreUmaskLocal;
+ result["help"] = DialogHelpText("UmaskLocal");
+
+ return result;
+}
+
+/**
+ * Ftp Directory for Anonymous Users
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+
+map FtpDirAnon () {
+ map result = $[];
+
+ result["label"] = _("Ftp Directory for Anon&ymous Users");
+ result["widget"] = `textentry;
+ result["init"] = InitFtpDirAnon;
+ result["validate_type"] = `function;
+ result["validate_function"] = ValidFtpDirAnon;
+ result["store"] = StoreFtpDirAnon;
+ result["help"] = DialogHelpText("FtpDirAnon");
+
+ return result;
+}
+
+
+/**
+ * "Browse" button for FTP Dir Anon
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+
+map BrowseAnon () {
+ map result = $[];
+
+ result["label"] = _("Brows&e");
+ result["widget"] = `push_button;
+ result["handle"] = HandleBrowseAnon;
+ result["help"] = _(" ");
+
+ return result;
+}
+
/**
+ * Ftp Directory for Authenticated Users
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+
+map FtpDirLocal () {
+ map result = $[];
+
+ result["label"] = _("&Ftp Directory for Authenticated Users");
+ result["widget"] = `textentry;
+ result["init"] = InitFtpDirLocal;
+ result["store"] = StoreFtpDirLocal;
+ result["help"] = DialogHelpText("FtpDirLocal");
+
+ return result;
+}
+
+
+/**
+ * "Browse" button for FTP Dir Local/Authenticated
+ * General Settings widget
+ *
+ * @return map map for General screen
+ */
+
+
+map BrowseLocal () {
+ map result = $[];
+
+ result["label"] = _("Br&owse");
+ result["widget"] = `push_button;
+ result["handle"] = HandleBrowseLocal;
+ result["help"] = _(" ");
+
+ return result;
+}
+
+
+/**
+ *-----------================= PERFORMANCE SCREEN =============----------
+ *
+ */
+
+
+
+/*
* Init function where are added UI hadle functions
- * Start widget radiobuttons for switching daemons
+ * Perform Settings widget
*
- * @return map map for start-stop widget
+ * @return map map for Perform Settings widget
+
+
+map PerformSettings () {
+ map result = $[];
+
+ result["widget"] = `custom;
+ result["custom_widget"] =`VBox();
+ result["init"] = InitPerSettings;
+ result["store"] = StorePerforSettings;
+ result["help"] = DialogHelpText("per_settings");
+
+ return result;
+
+}
+*/
+
+
+/**
+ * Max Idle Time [minutes]
+ * Performance Settings widget
+ *
+ * @return map map for Performance screen
*/
-map RBVsftpdPureftpd () {
+
+map MaxIdleTime () {
map result = $[];
- result["label"] = _("Selected Service");
- result["widget"] = `radio_buttons;
- result["items"] = [
- [ "vs_item", _("&vsftpd") ],
- [ "pure_item", _("p&ure-ftpd") ]
- ];
- result["init"] = InitRBVsPure;
- result["handle"] = HandleRBVsPure;
- result["help"] = DialogHelpText("selected_services");
+
+ result["label"] = _("&Max Idle Time [minutes]");
+ result["widget"] = `intfield;
+ result["minimum"] = 0;
+ result["maximum"] = 1440;
+ result["init"] = InitMaxIdleTime;
+ result["store"] = StoreMaxIdleTime;
+ result["help"] = DialogHelpText("MaxIdleTime");
+
+ return result;
+}
+
+
+
+/**
+ * Max Clients for One IP
+ * Performance Settings widget
+ *
+ * @return map map for Performance screen
+ */
+
+
+map MaxClientsPerIP () {
+ map result = $[];
+
+ result["label"] = _("Max Cli&ents for One IP");
+ result["widget"] = `intfield;
+ result["minimum"] = 0;
+ result["maximum"] = 50;
+ result["init"] = InitMaxClientsPerIP;
+ result["store"] = StoreMaxClientsPerIP;
+ result["help"] = DialogHelpText("MaxClientsPerIP");
+
+ return result;
+}
+
+
+/**
+ * Max Clients
+ * Performance Settings widget
+ *
+ * @return map map for Performance screen
+ */
+
+
+map MaxClientsNumber () {
+ map result = $[];
+
+ result["label"] = _("Ma&x Clients");
+ result["widget"] = `intfield;
+ result["minimum"] = 0;
+ result["maximum"] = 9999;
+ result["init"] = InitMaxClientsNumber;
+ result["store"] = StoreMaxClientsNumber;
+ result["help"] = DialogHelpText("MaxClientsNumber");
+
+ return result;
+}
+
+
+/**
+ * Local Max Rate [KB/s]
+ * Performance Settings widget
+ *
+ * @return map map for Performance screen
+ */
+
+
+map LocalMaxRate () {
+ map result = $[];
+
+ result["label"] = _("&Local Max Rate [KB/s]");
+ result["widget"] = `intfield;
+ result["minimum"] = 0;
+ result["maximum"] = 10000000;
+ result["init"] = InitLocalMaxRate;
+ result["store"] = StoreLocalMaxRate;
+ result["help"] = DialogHelpText("LocalMaxRate");
return result;
}
+
/**
+ * Anonymous Max Rate [KB/s]
+ * Performance Settings widget
+ *
+ * @return map map for Performance screen
+ */
+
+
+map AnonMaxRate () {
+ map result = $[];
+
+ result["label"] = _("Anonymous Max &Rate [KB/s]");
+ result["widget"] = `intfield;
+ result["minimum"] = 0;
+ result["maximum"] = 10000000;
+ result["init"] = InitAnonMaxRate;
+ result["store"] = StoreAnonMaxRate;
+ result["help"] = DialogHelpText("AnonMaxRate");
+
+ return result;
+}
+
+/**
+ *-----------================= Authentication SCREEN =============----------
+ *
+ */
+
+
+/*
* Init function where are added UI hadle functions
* Anonymous Settings widget
*
* @return map map for Anonymous Settings widget
- */
+
map AnonSettings () {
map result = $[];
@@ -234,14 +601,112 @@
return result;
}
+*/
+
+/**
+ * Enable/Disable Anonymous and Local Users
+ * Authentication Settings widget
+ *
+ * @return map map for Performance screen
+ */
+map AnonAuthen () {
+ map result = $[];
+
+ result["label"] = _("Enable/Disable Anonymous and Local Users");
+ result["widget"] = `radio_buttons;
+ result["items"] = [
+ ["anon_only", _("Anonymo&us Only")],
+ ["local_only", _("Aut&henticated Users Only")],
+ ["both", _("&Both")],
+ ];
+ result["init"] = InitAnonAuthen;
+ result["store"] = StoreAnonAuthen;
+ result["help"] = DialogHelpText("AnonAuthen");
+
+ return result;
+}
+
/**
+ * Enable Upload
+ * Authentication Settings widget
+ *
+ * @return map map for Performance screen
+ */
+
+map EnableUpload () {
+ map result = $[];
+
+ result["label"] = _("&Enable Upload");
+ result["widget"] = `checkbox;
+ result["init"] = InitEnableUpload;
+ result["handle"] = HandleEnableUpload;
+ result["store"] = StoreEnableUpload;
+ result["help"] = DialogHelpText("EnableUpload");
+
+ return result;
+}
+
+
+/**
+ * Anonymous Can Upload
+ * Authentication Settings widget
+ *
+ * @return map map for Performance screen
+ */
+
+map AnonReadOnly () {
+ map result = $[];
+
+ result["label"] = _("Anon&ymous Can Upload");
+ result["widget"] = `checkbox;
+ result["init"] = InitAnonReadOnly;
+ result["store"] = StoreAnonReadOnly;
+ result["help"] = DialogHelpText("AnonReadOnly");
+
+ return result;
+}
+
+
+
+/**
+ * Anonymous Can Create Directories
+ * Authentication Settings widget
+ *
+ * @return map map for Performance screen
+ */
+
+map AnonCreatDirs () {
+ map result = $[];
+
+ result["label"] = _("Anonymou&s Can Create Directories");
+ result["widget"] = `checkbox;
+ result["init"] = InitAnonCreatDirs;
+ result["store"] = StoreAnonCreatDirs;
+ result["help"] = DialogHelpText("AnonCreatDirs");
+
+ return result;
+}
+
+
+
+
+
+
+
+/**
+ *-----------================= EXPERT SETTINGS SCREEN =============----------
+ *
+ */
+
+
+/*
* Init function where are added UI hadle functions
* Expert Settings widget (vsftpd)
*
* @return map map for Expert Settings widget
- */
+
map VSFTPDSettings () {
map result = $[];
@@ -258,12 +723,273 @@
return result;
}
+*/
+
+/**
+ * Enable Pass&ive Mode
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map PassiveMode () {
+ map result = $[];
+
+ result["label"] = _("Enable Pass&ive Mode");
+ result["widget"] = `checkbox;
+ result["init"] = InitPassiveMode;
+ result["store"] = StorePassiveMode;
+ result["handle"] = HandlePassiveMode;
+ result["help"] = DialogHelpText("PassiveMode");
+
+ return result;
+}
+
+
+
+/**
+ * Min Port for Pas. Mode
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map PasMinPort () {
+ map result = $[];
+
+ result["label"] = _("&Min Port for Pas. Mode");
+ result["widget"] = `intfield;
+ result["minimum"] = 1024;
+ result["maximum"] = 65535;
+ result["init"] = InitPasMinPort;
+ result["store"] = StorePasMinPort;
+ result["help"] = DialogHelpText("PasMinPort");
+
+ return result;
+}
+
+
+
+/**
+ * Max Port for Pas. Mode
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map PasMaxPort () {
+ map result = $[];
+
+ result["label"] = _("Max P&ort for Pas. Mode");
+ result["widget"] = `intfield;
+ result["minimum"] = 1024;
+ result["maximum"] = 65535;
+ result["init"] = InitPasMaxPort;
+ result["store"] = StorePasMaxPort;
+ result["validate_type"] = `function;
+ result["validate_function"] = ValidPasMaxPort;
+ result["help"] = DialogHelpText("PasMaxPort");
+
+ return result;
+}
+
+
+
+/**
+ * Enable SSL
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map SSLEnable () {
+ map result = $[];
+
+ result["label"] = _("Enab&le SSL");
+ result["widget"] = `checkbox;
+ result["init"] = InitSSLEnable;
+ result["store"] = StoreSSLEnable;
+ result["handle"] = HandleSSLEnable;
+ result["help"] = DialogHelpText("SSLEnable");
+
+ return result;
+}
+
+
+
+
/**
+ * Enable SSL v2
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map SSLv2 () {
+ map result = $[];
+
+ result["label"] = _("&Enable SSL v2");
+ result["widget"] = `checkbox;
+ result["init"] = InitSSLv2;
+ result["store"] = StoreSSLv2;
+ result["help"] = DialogHelpText("SSLv2");
+
+ return result;
+}
+
+
+/**
+ * Enable SSL v3
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map SSLv3 () {
+ map result = $[];
+
+ result["label"] = _("Enable SSL &v2");
+ result["widget"] = `checkbox;
+ result["init"] = InitSSLv3;
+ result["store"] = StoreSSLv3;
+ result["help"] = DialogHelpText("SSLv3");
+
+ return result;
+}
+
+
+/**
+ * Enable TLS
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map TLS () {
+ map result = $[];
+
+ result["label"] = _("Enable &TLS");
+ result["widget"] = `checkbox;
+ result["init"] = InitTLS;
+ result["store"] = StoreTLS;
+ result["help"] = DialogHelpText("TLS");
+
+ return result;
+}
+
+
+/**
+ * DSA Certificate to Use for SSL Encrypted Connections
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map CertFile () {
+ map result = $[];
+
+ result["label"] = _("D&SA Certificate to Use for SSL Encrypted Connections");
+ result["widget"] = `textentry;
+ result["init"] = InitCertFile;
+ result["validate_type"] = `function;
+ result["validate_function"] = ValidCertFile;
+ result["store"] = StoreCertFile;
+ result["help"] = DialogHelpText("CertFile");
+
+ return result;
+}
+
+
+/**
+ * "Browse" button for DSA Certificate
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map BrowseCertFile () {
+ map result = $[];
+
+ result["label"] = _("Br&owse");
+ result["widget"] = `push_button;
+ result["handle"] = HandleBrowseCertFile;
+ result["help"] = _(" ");
+
+ return result;
+}
+
+
+
+
+/**
+ * Disable Downloading Unvalidated Data
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map AntiWarez () {
+ map result = $[];
+
+ result["label"] = _("Disable Downloading &Unvalidated Data");
+ result["widget"] = `checkbox;
+ result["init"] = InitAntiWarez;
+ result["store"] = StoreAntiWarez;
+ result["help"] = DialogHelpText("AntiWarez");
+
+ return result;
+}
+
+
+/**
+ * Security Settings
+ * Expert Settings widget
+ *
+ * @return map map for Expert screen
+ */
+
+
+map SSL () {
+ map result = $[];
+
+ result["label"] = _("Security Settings");
+ result["widget"] = `radio_buttons;
+ result["items"] = [
+ ["disable", _("Disable SSL/&TLS")],
+ ["accept", _("Accept &SSL and TLS")],
+ ["refuse", _("&Refuse Conections Without SSL/TLS")],
+ ];
+ result["init"] = InitSSL;
+ result["validate_type"] = `function;
+ result["validate_function"] = ValidSSL;
+ result["store"] = StoreSSL;
+ result["help"] = DialogHelpText("SSL");
+
+ return result;
+}
+
+/**
+ *-----------================= SCREENS OF FTP_SERVER =============----------
+ *
+ */
+
+
+/*
* Init function where are added UI hadle functions
* Expert Settings widget (pure-ftpd)
*
* @return map map for Expert Settings widget
- */
+ *
map PUREFTPDAddSettings () {
map result = $[];
@@ -279,6 +1005,10 @@
return result;
}
+*/
+
+
+
/**
* Init function where are added UI hadle functions
@@ -293,14 +1023,14 @@
map result = $[];
result["contents"] = `VBox (
- "StartMode",
- `VSpacing(1),
- // disabling start/stop buttons when it doesn't make sense
- (Mode::normal() ? "StartStop":`Empty()),
- `VSpacing(1),
- "RBVsPureFTPd",
- `VStretch ()
- );
+ "StartMode",
+ `VSpacing(1),
+ // disabling start/stop buttons when it doesn't make sense
+ (Mode::normal() ? "StartStop":`Empty()),
+ `VSpacing(1),
+ "RBVsPureFTPd",
+ `VStretch ()
+ );
// TRANSLATORS: part of dialog caption
result["caption"] = _("FTP Start-Up");
// TRANSLATORS: tree menu item
@@ -322,13 +1052,42 @@
map result = $[];
result["contents"] = `VBox (
- FTPGenSettingsVsftpd()
- );
+ `Frame ( _("General Settings"),`HBox(`HSpacing(1),`VBox(
+ `Left("Banner"),
+ `Left("ChrootEnable"),
+ `Left("VerboseLogging"),
+ `Left(`HBox (
+ `Left("UmaskAnon"),
+ `Left("UmaskLocal")
+ ))
+ ))),
+ `VSpacing(1),
+ `Frame ( _("FTP Directories"),`HBox(`HSpacing(1),`VBox(
+ `Left(`HBox(`HSpacing(1),
+ `Left("FtpDirAnon"),
+ `VBox(
+ `Left(`Label("")),
+ `Left("BrowseAnon")
+ )
+ )),
+ `Left(`HBox(`HSpacing(1),
+ `Left("FtpDirLocal"),
+ `VBox(
+ `Left(`Label("")),
+ `Left("BrowseLocal")
+ )
+ ))
+ ))),
+ `VStretch ()
+ );
// TRANSLATORS: part of dialog caption
result["caption"] = _("FTP General Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("General");
- result["widget_names"] = [ "DisBackButton", "GenSettings"];
+ result["widget_names"] = [ "DisBackButton", "Banner",
+ "ChrootEnable", "VerboseLogging", "UmaskAnon",
+ "UmaskLocal", "BrowseAnon", "BrowseLocal",
+ "FtpDirAnon", "FtpDirLocal"];
return result;
}
@@ -345,13 +1104,29 @@
map result = $[];
result["contents"] = `VBox (
- FTPGenSettingsPureftpd()
- );
+ `Frame ( _("General Settings"),`HBox(`HSpacing(1),`VBox(
+ `Left("ChrootEnable"),
+ `Left("VerboseLogging"),
+ `Left("Umask")
+ ))),
+ `VSpacing(1),
+ `Frame ( _("FTP Directories"),`HBox(`HSpacing(1),`VBox(
+ `Left(`HBox(`HSpacing(1),
+ `Left("FtpDirAnon"),
+ `VBox(
+ `Left(`Label("")),
+ `Left("BrowseAnon")
+ )
+ ))
+ ))),
+ `VStretch ()
+ );
// TRANSLATORS: part of dialog caption
result["caption"] = _("FTP General Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("General");
- result["widget_names"] = [ "DisBackButton", "GenSettings"];
+ result["widget_names"] = [ "DisBackButton", "ChrootEnable", "VerboseLogging",
+ "Umask", "FtpDirAnon", "BrowseAnon",];
return result;
}
@@ -368,14 +1143,25 @@
map perfor_settings () {
map result = $[];
- result["contents"] = `VBox (
- FTPPerforSettings()
- );
+ result["contents"] = `VBox (
+ `Frame ( _("General Settings"),`HBox(`HSpacing(1),`VBox(
+ `Left(`MinWidth(20,"MaxIdleTime")),
+ `Left(`MinWidth(20,"MaxClientsPerIP")),
+ `Left(`MinWidth(20,"MaxClientsNumber"))
+ ))),
+ `VSpacing(1),
+ `Frame ( _("FTP Directories"),`HBox(`HSpacing(1),`VBox(
+ `Left(`MinWidth(20,"LocalMaxRate")),
+ `Left(`MinWidth(20,"AnonMaxRate"))
+ ))),
+ `VStretch ()
+ );
// TRANSLATORS: part of dialog caption
result["caption"] = _("FTP Performance Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Performance");
- result["widget_names"] = [ "DisBackButton", "PerforSettings"];
+ result["widget_names"] = [ "DisBackButton", "MaxClientsPerIP", "MaxIdleTime",
+ "AnonMaxRate", "LocalMaxRate", "MaxClientsNumber",];
return result;
}
@@ -426,13 +1212,20 @@
map result = $[];
result["contents"] = `VBox (
- FTPAnonSettings()
- );
+ "AnonAuthen",
+ `VSpacing(1),
+ `Frame ( _("Uploading"),`HBox(`HSpacing(1),`VBox(
+ `Left("AnonReadOnly"),
+ `Left("AnonCreatDirs")
+ ))),
+ `VStretch ()
+ );
// TRANSLATORS: part of dialog caption
result["caption"] = _("FTP Anonymous Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Authentication");
- result["widget_names"] = [ "DisBackButton", "AnonSettings"];
+ result["widget_names"] = [ "DisBackButton", "AnonAuthen",
+ "AnonReadOnly", "AnonCreatDirs"];
return result;
}
@@ -449,13 +1242,23 @@
map result = $[];
result["contents"] = `VBox (
- VsftpdAnonSettings()
- );
+ "AnonAuthen",
+ `VSpacing(1),
+ `Frame ( _("Uploading"),`HBox(`HSpacing(1),`VBox(
+ `Left("EnableUpload"),
+ `HBox(`HSpacing(2),`VBox(
+ `Left("AnonReadOnly"),
+ `Left("AnonCreatDirs")
+ ))
+ ))),
+ `VStretch ()
+ );
// TRANSLATORS: part of dialog caption
result["caption"] = _("FTP Anonymous Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Authentication");
- result["widget_names"] = [ "DisBackButton", "AnonSettings"];
+ result["widget_names"] = [ "DisBackButton", "AnonAuthen", "EnableUpload",
+ "AnonReadOnly", "AnonCreatDirs"];
return result;
}
@@ -471,19 +1274,48 @@
map result = $[];
result["contents"] = `VBox (
- VSFTPDAddSettings(),
- `VSpacing(1),
- `Frame ( _("SUSEfirewall Settings"),
- `HBox(`HSpacing(1),
- "Firewall"
- )),
- `VStretch()
- );
+ `Frame ( _("Passive Mode"),
+ `HBox(`HSpacing(1), `VBox(
+ `Left("PassiveMode"),
+ `HBox(`HSpacing(2), `Left(`HSquash(`HBox(
+ "PasMinPort",
+ "PasMaxPort",
+ `HStretch()
+ ))))
+ ))
+ ), //end of `Frame ( "Passiv Mode Settings"
+ `VSpacing(1),
+ `Frame(_("Enab&le SSL"),
+ //`CheckBoxFrame(`id("SSLEnable"), _("Enab&le SSL"), true,
+ `HBox(`HSpacing(1),`VBox (
+ `Left("SSLEnable"),
+ `HBox(`HSpacing(2),`VBox (
+ `Left("SSLv2"),
+ `Left("SSLv3"),
+ `Left("TLS"),
+ `Left(`HBox(
+ "CertFile",
+ `VBox ( `Label(""),
+ "BrowseCertFile"
+ )
+ )) // end of `Left(`HBox(
+ )) // end of `HBox(`HSpacing(1),`VBox (
+ )) // end of `HBox(`HSpacing(1),`VBox (
+ ), //end of `CheckBoxFrame(`id("SSLEnable"), "Sec&urity Settings", true
+ `VSpacing(1),
+ `Frame ( _("SUSEfirewall Settings"),
+ `HBox(`HSpacing(1),
+ "Firewall"
+ )),
+ `VStretch()
+ );
// TRANSLATORS: part of dialog caption
result["caption"] = _("FTP Expert Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Expert Settings");
- result["widget_names"] = [ "DisBackButton", "VSFTPDAddSettings", "Firewall"];
+ result["widget_names"] = [ "DisBackButton", "Firewall", "PasMinPort", "PasMaxPort",
+ "SSLv2", "SSLv3", "TLS", "CertFile", "BrowseCertFile",
+ "PassiveMode", "SSLEnable" ];
return result;
}
@@ -499,19 +1331,35 @@
map result = $[];
result["contents"] = `VBox (
- PUREFTPDSecSettings(),
- `VSpacing(1),
- `Frame ( _("SUSEfirewall Settings"),
- `HBox(`HSpacing(1),
- "Firewall"
- )),
- `VStretch()
- );
+ `Frame ( _("Passive Mode"),
+ `HBox(`HSpacing(1), `Left(`HSquash(`HBox(
+ "PasMinPort",
+ "PasMaxPort",
+ `HStretch()
+ ))))
+ ),
+ `VSpacing(1),
+ `Frame ( _("Additional Settings"),
+ `HBox(`HSpacing(1),`VBox (
+ `Left("AntiWarez")
+ ))
+ ), //end of `Frame ( _("Additional Settings")
+ `VSpacing(1),
+ "SSL",
+ `VSpacing(1),
+ `Frame ( _("SUSEfirewall Settings"),
+ `HBox(`HSpacing(1),
+ "Firewall"
+ )
+ ),
+ `VStretch()
+ );
// TRANSLATORS: part of dialog caption
result["caption"] = _("FTP Expert Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Expert Settings");
- result["widget_names"] = [ "DisBackButton", "PUREFTPDAddSettings", "Firewall"];
+ result["widget_names"] = [ "DisBackButton", "Firewall", "PasMinPort",
+ "PasMaxPort", "AntiWarez", "SSL",];
return result;
}
@@ -530,25 +1378,42 @@
map > wid_handling_vsftpd = $[
"StartMode" : CWMServiceStart::CreateAutoStartWidget ( StartMode ()),
-
"StartStop" : CWMServiceStart::CreateStartStopWidget (StartStop ()),
-
"DisBackButton" : DisBackButton (),
-
- "GenSettings" : GenSettings(),
-
- "PerforSettings" : PerformSettings (),
-
- "AnonSettings" : AnonSettings (),
-
- "VSFTPDAddSettings": VSFTPDSettings(),
-
- //"PUREFTPDAddSettings": PUREFTPDAddSettings (),
-
"RBVsPureFTPd" : RBVsftpdPureftpd (),
+ "Banner" : Banner(),
+ "ChrootEnable" : ChrootEnable (),
+ "VerboseLogging" : VerboseLogging(),
+ "UmaskAnon" : UmaskAnon(),
+ "UmaskLocal" : UmaskLocal(),
+ "FtpDirAnon" : FtpDirAnon (),
+ "BrowseAnon" : BrowseAnon (),
+ "FtpDirLocal" : FtpDirLocal (),
+ "BrowseLocal" : BrowseLocal (),
+
+ "MaxIdleTime" : MaxIdleTime (),
+ "MaxClientsPerIP" : MaxClientsPerIP (),
+ "MaxClientsNumber" : MaxClientsNumber (),
+ "LocalMaxRate" : LocalMaxRate (),
+ "AnonMaxRate" : AnonMaxRate (),
+
+ "AnonAuthen" : AnonAuthen (),
+ "EnableUpload" : EnableUpload (),
+ "AnonReadOnly" : AnonReadOnly (),
+ "AnonCreatDirs" : AnonCreatDirs (),
+
+ "PassiveMode" : PassiveMode (),
+ "PasMinPort" : PasMinPort (),
+ "PasMaxPort" : PasMaxPort (),
+ "SSLEnable" : SSLEnable (),
+ "SSLv2" : SSLv2 (),
+ "SSLv3" : SSLv3 (),
+ "TLS" : TLS (),
+ "CertFile" : CertFile (),
+ "BrowseCertFile" : BrowseCertFile (),
"Firewall" : CWMFirewallInterfaces::CreateOpenFirewallWidget (FirewallSettingsVs()),
-
+
];
@@ -562,13 +1427,9 @@
map > tabs_vsftpd = $[
"start_up" : start_up (),
-
"gen_settings" : gen_settings (),
-
"perfor_settings" :perfor_settings (),
-
"anon_settings" : vsftpd_anon_settings (),
-
"addit_settings" : addit_settings (),
];
@@ -616,23 +1477,33 @@
*/
map > wid_handling_pureftpd = $[
-
- "StartMode" : CWMServiceStart::CreateAutoStartWidget (StartMode ()),
-
- "StartStop" : CWMServiceStart::CreateStartStopWidget (StartStopPure ()),
"DisBackButton" : DisBackButton (),
- "GenSettings" : GenSettings(),
-
- "PerforSettings" : PerformSettings (),
-
- "AnonSettings" : AnonSettings (),
-
- "PUREFTPDAddSettings": PUREFTPDAddSettings (),
-
+ "StartMode" : CWMServiceStart::CreateAutoStartWidget (StartMode ()),
+ "StartStop" : CWMServiceStart::CreateStartStopWidget (StartStopPure ()),
"RBVsPureFTPd" : RBVsftpdPureftpd (),
+ "ChrootEnable" : ChrootEnable (),
+ "VerboseLogging" : VerboseLogging(),
+ "Umask" : Umask (),
+ "FtpDirAnon" : FtpDirAnon (),
+ "BrowseAnon" : BrowseAnon (),
+
+ "MaxIdleTime" : MaxIdleTime (),
+ "MaxClientsPerIP" : MaxClientsPerIP (),
+ "MaxClientsNumber" : MaxClientsNumber (),
+ "LocalMaxRate" : LocalMaxRate (),
+ "AnonMaxRate" : AnonMaxRate (),
+
+ "AnonAuthen" : AnonAuthen (),
+ "AnonReadOnly" : AnonReadOnly (),
+ "AnonCreatDirs" : AnonCreatDirs (),
+
+ "PasMinPort" : PasMinPort (),
+ "PasMaxPort" : PasMaxPort (),
+ "AntiWarez" : AntiWarez (),
+ "SSL" : SSL (),
"Firewall" : CWMFirewallInterfaces::CreateOpenFirewallWidget (FirewallSettingsPure()),
];
@@ -682,6 +1553,5 @@
-
/* EOF */
}
Modified: trunk/ftp-server/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/helps.ycp?rev=39647&r1=39646&r2=39647&view=diff
==============================================================================
--- trunk/ftp-server/src/helps.ycp (original)
+++ trunk/ftp-server/src/helps.ycp Wed Jul 25 10:08:54 2007
@@ -39,213 +39,216 @@
</p>
"),
-/*Start widget switching daemons help 1/1 */
-"selected_services": _("<p><b><big>Selected Daemon</b><br>
- Frame show you which daemon is currently configured: <b>vsftpd, pure-ftpd,
- </b>. If you have installed both daemons you can switch between them.
-</p>
-"),
+/**
+ *-----------================= START_UP SCREEN =============----------
+ *
+ */
+/*Start widget switching daemons help 1/1 */
+"selected_services": _("<p><b>Selected Service</b><br>
+ Frame shows which daemon is currently configured: <b>vsftpd, pure-ftpd,
+ </b>. If you have installed both daemons you can switch between them.
+</p>"),
- /* general settings dialog help 1/6 */
- "gen_settings" : _("<p><b><big>General settings</b><br>
- General settings of FTP where you can specify: <b>Chroot, Logging,
- Umask, FTP Directory</b> and <b>Ports for Passive Mode</b>.
-</p>
-")+
+/**
+ *-----------================= GENERAL SCREEN =============----------
+ *
+ */
-/* general settings welcome message dialog help 2/6 */
-_("<p><b>Welcome message</b><br>
+/* general welcome message help 1/1 */
+"Banner": _("<p><b>Welcome message</b><br>
This option is the name of a file containing
-text to display when someone connects to the server.</p>
-")+
+text to display when someone connects to the server.
+</p>"),
- /* general settings chroot dialog help 3/6 */
-_("<p><b>Chroot:</b><br>
+/* general chroot help 1/1 */
+"ChrootEnable": _("<p><b>Chroot:</b><br>
When enabled, local users will be (by default) placed in a
chroot() jail in their home directory after login.
-<b>Warning:</b> This option has security implications,
+<i>Warning:</i> This option has security implications,
especially if the users have upload permission,
-or shell access. Only enable if you know what you are doing.</p>
-")+
-
-
- /* general settings logging dialog help 4/6 */
-_("<p><b>Verbose logging:</b><br>
-When enabled, all FTP requests and responses are logged.</p>
-")+
-
- /* general settings umask dialog help 5/6 */
-_("<p><b>Umask:</b><br>
-File creation mask. e.g. 177:077</p>
-")+
-
- /* general settings FTP dir dialog help 6/6 */
-_("<p><b>FTP Directory:</b><br>
-FTP Directory is directory which is used for FTP users.</p>
-"),
+or shell access. Only enable if you know what you are doing.
+</p>"),
- /* performance settings dialog help 1/6 */
- "per_settings" : _("<p><b><big>Perfomance settings</b><br>
- Performance settings of FTP. </p>
-")+
+/* general logging help 1/1 */
+"VerboseLogging": _("<p><b>Verbose logging:</b><br>
+When enabled, all FTP requests and responses are logged.
+</p>"),
+
+/* general umask help - only pure-ftpd 1/1 */
+"Umask" : _("<p><b>Umask:</b><br>
+File creation mask. (umask for files):(umask for dirs).
+177:077 if you feel paranoid.
+</p>"),
+
+/* general umask for anonymous help - only vsftpd 1/1 */
+"UmaskAnon": _("<p><b>Umask for Anonymous:</b><br>
+The value that the umask for file creation is set to for anonymous users.
+If you want to specify octal values, remember the \"0\" prefix otherwise
+the value will be treated as a base 10 integer.
+</p>"),
+
+/* general umask for authenticated users help - only vsftpd 1/1 */
+"UmaskLocal": _("<p><b>Umask for Authenticated Users:</b><br>
+The value that the umask for file creation is set to for local users.
+If you want to specify octal values, remember the \"0\" prefix otherwise
+the value will be treated as a base 10 integer.
+</p>"),
+
+/* general FTP dir for anonymous help 1/1 */
+"FtpDirAnon": _("<p><b>Ftp Directory for Anonymous Users:</b><br>
+You can specify directory which is used for FTP anonymous users.
+By pressing <i>Browse</i> you can select directory from local filesystem.
+</p>"),
+
+
+/* general FTP dir for authenticated help 1/1 */
+"FtpDirLocal": _("<p><b>Ftp Directory for Authenticated Users:</b><br>
+You can specify directory which is used for FTP authenticated users.
+By pressing <i>Browse</i> you can select directory from local filesystem.
+</p>"),
+
+
+/**
+ *-----------================= PERFORMANCE SCREEN =============----------
+ *
+ */
-/* performance settings Max Idle Time dialog help 2/6 */
-_("<p><b>Max Idle Time:</b><br>
+/* performance Max Idle Time help 1/1 */
+"MaxIdleTime": _("<p><b>Max Idle Time:</b><br>
The timeout which is the maximum time a remote client
-may spend between FTP commands. </p>
-")+
+may spend between FTP commands.
+</p>"),
-/* performance settings max clients per IP dialog help 3/6 */
-_("<p><b>Max Clients for One IP:</b><br>
+/* performance max clients per IP help 1/1 */
+"MaxClientsPerIP": _("<p><b>Max Clients for One IP:</b><br>
This is the maximum number of clients which may be connected
-from the same source internet address. </p>
-")+
+from the same source internet address.
+</p>"),
-/* performance settings max clients dialog help 4/6 */
-_("<p><b>Max Clients:</b><br>
+
+/* performance max clients help 1/1 */
+"MaxClientsNumber": _("<p><b>Max Clients:</b><br>
This is the maximum number of clients which may be connected.
-Any additional clients connecting will get an error message.</p>
-")+
+Any additional clients connecting will get an error message.
+</p>"),
+
+/* performance local max rate help 1/1 */
+"LocalMaxRate": _("<p><b>Local Max Rate:</b><br>
+The maximum data transfer rate permitted for local authenticated users.
+</p>"),
-/* performance settings local max rate dialog help 5/6 */
-_("<p><b>Local Max Rate:</b><br>
-The maximum data transfer rate permitted for local authenticated users.</p>
-")+
-/* performance settings anonymous max rate dialog help 6/6 */
-_("<p><b>Anonymous Max Rate:</b><br>
+/* performance anonymous max rate help 1/1 */
+"AnonMaxRate": _("<p><b>Anonymous Max Rate:</b><br>
The maximum data transfer rate permitted for anonymous clients.</p>
"),
+/**
+ *-----------================= Authentication SCREEN =============----------
+ *
+ */
+
+/* authentication Enable/Disable Anonymous and Local help 1/1 */
+"AnonAuthen": _("<p><b>Enable/Disable Anonymous and Local Users</b><br>
+<i>Anonymous Only</i> If enabled only anonymous logins are permitted.
+<i>Authenticated Users Only</i> If enabled only authenticated users are permitted.
+<i>Both</i> If enabled authenticated users and anonymous are permitted.
+</p>"),
- /* anonymous settings dialog help 1/6 */
- "anon_settings" : _("<p><b><big>Anonymous settings</b><br>
- Anonymous settings - there you can specify
-settings for anonymous/authenticated users. </p>
-")+
-
-/* anonymous settings anonymous only dialog help 2/6 */
-_("<p><b>Anonymous Only</b><br>
-If enabled only anonymous logins are permitted.</p>
-")+
-
-/* anonymous settings authenticated users only dialog help 3/6 */
-_("<p><b>Authenticated Users Only</b><br>
-If enabled only authenticated users are permitted.</p>
-")+
-
-/* anonymous settings both dialog help 4/6 */
-_("<p><b>Both</b><br>
-If enabled authenticated users and anonymous are permitted.</p>
-")+
+/* authentication Enable Upload help 1/1 */
+"EnableUpload": _("<p><b>Enable Upload</b><br>
+If enable ftp users can upload. Anonymous users need to allow
+ \"Anonymous Can Upload\" for enabling upload.
+</p>"),
-/* anonymous settings anonymous can't upload dialog help 5/6 */
-_("<p><b>Anonymous Can Upload</b><br>
+/* authentication Anonymous Can Upload help 1/1 */
+"AnonReadOnly": _("<p><b>Anonymous Can Upload</b><br>
If enabled anonymous users will be permitted to upload.
<i>vsftpd only: </i>If you want that anonymous users can upload you
-need existing directory with allowed writing in home directory after login.</p>
-")+
+need existing directory with allowed writing in home directory after login.
+</p>"),
-/* anonymous settings anonymous can create dirs dialog help 6/6 */
-_("<p><b>Anonymous Can Create Dirs</b><br>
+/* authentication Anonymous Can Create Dirs help 1/1 */
+"AnonCreatDirs": _("<p><b>Anonymous Can Create Dirs</b><br>
If enabled anonymous users can create directories.
<i>vsftpd only: </i>If you want that anonymous users can create directories you
need existing directory with allowed writing in home directory after login.</p>
-")+
-
-/* anonymous settings anonymous can create dirs dialog help 6/6 */
-_("<p><b>Enable Upload <i>(vsftpd only)</i></b><br>
-If enable ftp users can upload. Anonymous users need to allow
- \"Anonymous Can Upload\" for enabling upload.</p>
"),
+/**
+ *-----------================= EXPERT SETTINGS SCREEN =============----------
+ *
+ */
+
+
+/* expert settings Enable Passive Mode help 1/1 */
+"PassiveMode": _("<p><b>Enable Passive Mode</b><br>
+If enabled ftp server allowe passive mode for connection.
+</p>"),
+
+/* expert settings Min Port for Pas. Mode help 1/1 */
+"PasMinPort":_("<p><b>Min Port for Pas. Mode</b><br>
+Minimal value for port range for passive connection replies.
+- for firewalling
+</p>"),
+
+/* expert settings Max Port for Pas. Mode help 1/1 */
+"PasMaxPort": _("<p><b>Max Port for Pas. Mode</b><br>
+Maximal value for port range for passive connection replies.
+- for firewalling
+</p>"),
+
+/* expert settings Enable SSL help 1/1 */
+"SSLEnable": _("<p><b>Enable SSL</b><br>
+If enabled SSL connections are allowed.
+</p>"),
+
+/* expert settings Enable SSL v2 help 1/1 */
+"SSLv2": _("<p><b>Enable SSL v2</b><br>
+If enabled SSL version 2 connections are allowed.
+</p>"),
+
+/* expert settings Enable SSL v3 help 1/1 */
+"SSLv3": _("<p><b>Enable SSL v3</b><br>
+If enabled SSL version 3 connections are allowed.
+</p>"),
+
+/* expert settings Enable TLS help 1/1 */
+"TLS": _("<p><b>Enable TLS</b><br>
+If enabled TLS connections are allowed.
+</p>"),
- /* expert settings dialog help 1/6 */
- "vsftpd_settings" : _("<p><b><big>Expert Settings</b><br>
- Expert settings - security and firewall settings.</p>
-")+
-
-
-
-/* expert settings security settings dialog help 3/6 */
-_("<p><b>Security settings</b><br>
-If enabled, and vsftpd was compiled against OpenSSL,
-vsftpd will support secure connections via SSL.</p>
-")+
-
-/* expert settings security settings dialog help 4/6 */
-_("<p><b>Select version of SSL</b><br>
-<b>Enable SSL v2:</b> If enabled, this option will permit SSL v2
-protocol connections.
-<b>Disable SSL v2:</b> If disabled, this option will NOT permit SSL v2
-protocol connections.
-<b>Enable SSL v3:</b> If enabled, this option will permit SSL v3
-protocol connections.
-<b>Disable SSL v3:</b> If disabled, this option will NOT permit SSL v3
-protocol connections.
-<b>Enable SSL v2 & v3:</b> If enabled, this option will permit
-SSL v2 and v3 protocol connections.
-<b>Disable SSL v2 & v3:</b> If disabled, this option will NOT permit
-SSL v2 and v3 protocol connections.
-</p>
-")+
-/* expert settings security settings dialog help 5/6 */
-_("<p><b>Enable TLS</b><br>
-If enabled, this option will permit TLS v1 protocol connections.
-</p>
-")+
-
-_("<p><b>DSA Certificate</b><br>
+/* expert settings DSA Certificate to Use for SSL Encrypted Connections help 1/1 */
+"CertFile": _("<p><b>DSA Certificate to Use for SSL Encrypted Connections</b><br>
This option specifies the location of the DSA certificate to
-use for SSL encrypted connections.
-</p>
-")+
-
-/* expert settings ports dialog help 6/6 */
-_("<p><b>Ports for Passive Mode:</b><br>
-Port range for passive connection replies. - for firewalling </p>
-"),
+use for SSL encrypted connections. You can select file by pressing <i>Browse</i>
+</p>"),
- /* additional settings dialog help 1/5 */
- "pureftpd_settings" : _("<p><b><big>Expert Settings</b><br>
- Expert settings - security and firewall settings.</p>
-")+
-
-/* additional settings Disable Downloading
-Unvalidated Datae dialog help 2/5 */
-_("<p><b>Disable Downloading Unvalidated Data</b><br>
+/* expert settings Disable Downloading Unvalidated Data help 1/1 */
+"AntiWarez": _("<p><b>Disable Downloading Unvalidated Data</b><br>
Disallow downloading of files that were uploaded
-but not validated by a local admin.</p>
-")+
-
+but not validated by a local admin
+</p>"),
-/* additional settings Disable SSL/TLS dialog help 3/5 */
-_("<p><b>Disable SSL/TLS</b><br>
-Disable SSL/TLS encryption layer (default)</p>
-")+
-
-/* additional settings Accept SSL and TLS dialog help 4/5 */
-_("<p><b>Accept SSL and TLS</b><br>
-Accept both traditional and encrypted sessions.</p>
-")+
-
-/* additional settings refuse without SSL and TLS dialog help 4/5 */
-_("<p><b>Refuse Connection without SSL/TLS</b><br>
-Refuse connections that don't use SSL/TLS security
-mechanisms, including anonymous sessions.</p>
-")+
-
-/* expert settings ports dialog help 6/6 */
-_("<p><b>Ports for Passive Mode:</b><br>
-Port range for passive connection replies. - for firewalling </p>
-"),
+/* expert settings Security Settings help 1/1 */
+"SSL": _("<p><b>Security Settings</b><br>
+<i>Disable SSL/TLS</i> Disable SSL/TLS encryption layer.
+<i>Accept SSL and TLS</i> Accept both traditional and encrypted sessions.
+<i>Refuse Conections Without SSL/TLS</i> Refuse connections that don't use
+SSL/TLS security mechanisms, including anonymous sessions.
+</p>"),
+
+/**
+ *-----------================= SUMMARY =============----------
+ *
+ */
/* Summary dialog help 1/3 */
Modified: trunk/ftp-server/src/wid_functions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/wid_functions.ycp?rev=39647&r1=39646&r2=39647&view=diff
==============================================================================
--- trunk/ftp-server/src/wid_functions.ycp (original)
+++ trunk/ftp-server/src/wid_functions.ycp Wed Jul 25 10:08:54 2007
@@ -186,40 +186,7 @@
Popup::Message("This is not supported via xinetd now!");
else {
Popup::Message("This is not supported via xinetd now!");
- /*
- if ((Service::Status("xinetd") != 0) &&
- (FtpServer::EDIT_SETTINGS["StartXinetd"]:nil == "NO")) {
- if (Mode::normal()) {
- UI::OpenDialog(
- `VBox(
- `Label("Xinetd is not started!"),
- `Label("Do you want to start it?"),
- `HBox(
- `PushButton(`id(`accept), "&Start"),
- `PushButton(`id(`cancel), "Canc&el")
- )
- ) // end of `VBox(
- ); // end of UI::OpenDialog(
- while (true) {
- any ret = UI::UserInput();
- if ( ret == `accept ) {
- FtpServer::EDIT_SETTINGS["StartXinetd"] = "YES";
- FtpServer::start_xinetd = true;
- break;
- } else if (ret == `cancel) {
- //FtpServer::EDIT_SETTINGS["StartXinetd"] = "NO";
- FtpServer::start_xinetd = false;
- break;
- }
- };
- UI::CloseDialog();
- } // end of if (Mode::normal()) {
- } // end of if ((Service::Status("xinetd") != 0)...
- }
- FtpServer::WriteSettings ();
- FtpServer::WriteUpload ();
- result = FtpServer::WriteXinetd ();
- */
+
}
} else {
FtpServer::WriteSettings ();
@@ -248,40 +215,6 @@
Popup::Message("This is not supported via xinetd now!");
else {
Popup::Message("This is not supported via xinetd now!");
- /*
- if ((Service::Status("xinetd") != 0) &&
- (FtpServer::EDIT_SETTINGS["StartXinetd"]:nil == "NO")) {
- if (Mode::normal()) {
- UI::OpenDialog(
- `VBox(
- `Label("Xinetd is not started!"),
- `Label("Do you want to start it?"),
- `HBox(
- `PushButton(`id(`accept), "&Start"),
- `PushButton(`id(`cancel), "Canc&el")
- )
- ) // end of `VBox(
- ); // end of UI::OpenDialog(
- while (true) {
- any ret = UI::UserInput();
- if ( ret == `accept ) {
- FtpServer::EDIT_SETTINGS["StartXinetd"] = "YES";
- FtpServer::start_xinetd = true;
- break;
- } else if (ret == `cancel) {
- //FtpServer::EDIT_SETTINGS["StartXinetd"] = "NO";
- FtpServer::start_xinetd = false;
- break;
- }
- };
- UI::CloseDialog();
- } // end of if (Mode::normal()) {
- } // end of if ((Service::Status("xinetd") != 0)...
- }
- //FtpServer::WriteSettings ();
- result = FtpServer::WriteXinetd ();
- y2milestone("[ftp-server] (StopNowPure) command for start pure-ftpd via xinetd");
- */
}
} else {
string command = "rcpure-ftpd start";
@@ -330,41 +263,7 @@
Popup::Message("This is not supported via xinetd now!");
else {
Popup::Message("This is not supported via xinetd now!");
- /*
- if ((Service::Status("xinetd") != 0) &&
- (FtpServer::EDIT_SETTINGS["StartXinetd"]:nil == "NO")) {
- if (Mode::normal()) {
- UI::OpenDialog(
- `VBox(
- `Label("Xinetd is not started!"),
- `Label("Do you want to start it?"),
- `HBox(
- `PushButton(`id(`accept), "&Start"),
- `PushButton(`id(`cancel), "Canc&el")
- )
- ) // end of `VBox(
- ); // end of UI::OpenDialog(
- while (true) {
- any ret = UI::UserInput();
- if ( ret == `accept ) {
- FtpServer::EDIT_SETTINGS["StartXinetd"] = "YES";
- FtpServer::start_xinetd = true;
- break;
- } else if (ret == `cancel) {
- //FtpServer::EDIT_SETTINGS["StartXinetd"] = "NO";
- FtpServer::start_xinetd = false;
- break;
- }
- };
- UI::CloseDialog();
- } // end of if (Mode::normal()) {
- } // end of if ((Service::Status("xinetd") != 0)...
-
- }
- FtpServer::WriteSettings ();
- result = FtpServer::WriteXinetd ();
- y2milestone("[ftp-server] (StopNowPure) command for save and restart pure-ftpd via xinetd");
- */
+
}
} else {
FtpServer::WriteSettings ();
@@ -380,127 +279,6 @@
}
-
-/**
- * Init function for general settings
- * change ValidChars for textentry
- */
-void InitGenSettings(string key) {
- if (!FtpServer::vsftpd_edit) {
- UI::ChangeWidget(`id( "Umask" ), `ValidChars, "01234567:");
- UI::ChangeWidget(`id( "Umask" ), `Value, FtpServer::ValueUIEdit("Umask"));
- if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "YES") {
- UI::ChangeWidget(`id( "FtpDirAnon" ), `Enabled, false);
- UI::ChangeWidget(`id ( "SelectDirAnon" ),`Enabled, false);
- }
- } else {
- UI::ChangeWidget(`id( "UmaskAnon" ), `ValidChars, "01234567");
- UI::ChangeWidget(`id( "UmaskLocal" ),`ValidChars, "01234567");
- UI::ChangeWidget(`id("Banner"), `Value, FtpServer::ValueUIEdit("Banner"));
- UI::ChangeWidget(`id( "UmaskAnon" ), `Value, FtpServer::ValueUIEdit("UmaskAnon"));
- UI::ChangeWidget(`id( "UmaskLocal" ), `Value, FtpServer::ValueUIEdit("UmaskLocal"));
- UI::ChangeWidget(`id( "FtpDirLocal" ), `Value, FtpServer::ValueUIEdit("FtpDirLocal"));
-
- }
- if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO")
- UI::ChangeWidget(`id( "FtpDirAnon" ), `Value, FtpServer::ValueUIEdit("FtpDirAnon"));
- UI::ChangeWidget(`id( "ChrootEnable" ), `Value, (FtpServer::ValueUIEdit("ChrootEnable") == "YES"));
- UI::ChangeWidget(`id( "VerboseLogging" ), `Value, (FtpServer::ValueUIEdit("VerboseLogging") == "YES"));
-
-}
-
-
-/**
- * Handle function for general settings
- * handling started via Xinetd
- */
-
-symbol HandleGenSettings(string key, map event) {
- any button = event["ID"]:nil;
- if (FtpServer::vsftpd_edit) {
- if (button == "SelectDirLocal") {
- string val = UI::AskForExistingDirectory ("/","Please select directory...");
- UI::ChangeWidget(`id( "FtpDirLocal" ), `Value, val);
- }
- } // end of if (FtpServer::vsftpd_edit)
- if (button == "SelectDirAnon") {
- string val = UI::AskForExistingDirectory ("/","Please select directory...");
- UI::ChangeWidget(`id( "FtpDirAnon" ), `Value, val);
- }
-} // end of symbol HandleGenSettings(string key, map event) {
-
-/**
- * Validate function for general settings
- * checks values from textentry
- */
-boolean GenValid (string key, map event) {
-
- if (!FtpServer::vsftpd_edit) {
- string new_umask = (string)UI::QueryWidget (`id("Umask"), `Value);
-
- if (size(new_umask) > 0) {
- list <string> l = splitstring (new_umask, ":");
- l = filter (string s, l, ``(s != ""));
- if (size(l) < 2) {
- Popup::Message ("It is not valid umask!");
- UI::SetFocus(`id("Umask"));
- return false;
- }
-
- }
- if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO") {
- string AnonHomeDir = (string)UI::QueryWidget (`id("FtpDirAnon"), `Value);
- //checking correct homedir for anonymous user
- if ((AnonHomeDir != "") && (Mode::normal())) {
- if (AnonHomeDir != FtpServer::anon_homedir) {
- string error = Users::EditUser($["homedirectory":AnonHomeDir]);
- if ((error != nil) && (error != "")) {
- Popup::Error(error);
- UI::SetFocus(`id("FtpDirAnon"));
- return false;
- }
- integer uid = FtpServer::anon_uid;
- boolean failed = false;
- map ui_map = $[];
- map error_map = $[];
- do {
- error_map = Users::CheckHomeUI (uid, AnonHomeDir, ui_map);
- if (error_map != $[]) {
- if (!Popup::YesNo (error_map ["question"]:""))
- failed = true;
- else
- ui_map[ error_map["question_id"]:"" ] = 1;
- }
- } while (error_map != $[] && !failed);
- } //end of if (AnonHomeDir != FtpServer::anon_homedir) {
- } //end of if ((AnonHomeDir != "") && (Mode::normal())) {
- } //end of if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil != "NO") {
- } //end of if (!FtpServer::vsftpd_edit) {
- return true;
-}
-
-/**
- * Store function for general settings
- * save values to temporary structure
- */
-
-void StoreGenSettings (string key, map event) {
- foreach(string key, ["ChrootEnable", "VerboseLogging"],{
- FtpServer::WriteToEditMap(key, (((boolean) UI::QueryWidget(`id(key), `Value) == true) ? "YES":"NO"));
- });
- if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO")
- FtpServer::WriteToEditMap("FtpDirAnon", (string) UI::QueryWidget(`id("FtpDirAnon"), `Value));
- if (!FtpServer::vsftpd_edit) {
- FtpServer::WriteToEditMap("Umask", (string) UI::QueryWidget(`id("Umask"), `Value));
- } else {
- foreach(string key, ["UmaskAnon", "UmaskLocal", "FtpDirLocal", "Banner"],{
- FtpServer::WriteToEditMap(key, (string) UI::QueryWidget(`id(key), `Value));
- });
-
- }
-
-}
-
/**
* Init function for general settings
* save values to temporary structure
@@ -549,156 +327,950 @@
}
}
+
+
/**
- * Init function for performance settings
- * change ValidChars from textentry
+ *-----------================= GENERAL SCREEN =============----------
+ *
*/
-void InitPerSettings (string key) {
- foreach(string key, ["MaxIdleTime", "MaxClientsPerIP", "MaxClientsNumber",
- "LocalMaxRate", "AnonMaxRate"],{
- //UI::ChangeWidget(`id(key), `ValidChars, "0123456789");
- UI::ChangeWidget(`id(key), `Value, tointeger(FtpServer::ValueUIEdit(key)));
- });
-}
+
/**
- * Store function for performance settings
- * save values to temporary structure
+ * Init function for general settings
+ * change ValidChars for textentry
*/
-void StorePerforSettings (string key, map event) {
- foreach(string key, ["MaxIdleTime", "MaxClientsPerIP", "MaxClientsNumber",
- "LocalMaxRate", "AnonMaxRate"],{
- FtpServer::WriteToEditMap(key, tostring(UI::QueryWidget(`id(key), `Value)));
- });
+void InitGenSettings(string key) {
+ if (!FtpServer::vsftpd_edit) {
+ UI::ChangeWidget(`id( "Umask" ), `ValidChars, "01234567:");
+ UI::ChangeWidget(`id( "Umask" ), `Value, FtpServer::ValueUIEdit("Umask"));
+ if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "YES") {
+ UI::ChangeWidget(`id( "FtpDirAnon" ), `Enabled, false);
+ UI::ChangeWidget(`id ( "SelectDirAnon" ),`Enabled, false);
+ }
+ } //else {
+ // UI::ChangeWidget(`id( "FtpDirLocal" ), `Value, FtpServer::ValueUIEdit("FtpDirLocal"));
+
+ //}
+
+ //if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO")
+ // UI::ChangeWidget(`id( "FtpDirAnon" ), `Value, FtpServer::ValueUIEdit("FtpDirAnon"));
+
+
+}
+/**
+ * Init function "Wellcome Message" for general settings
+ * change ValidChars for textentry
+ * only vsftpd
+ */
+void InitBanner(string key) {
+ UI::ChangeWidget(`id("Banner"), `Value, FtpServer::ValueUIEdit("Banner"));
}
/**
- * Init function for anon settings
- * change ValidChars from textentry
+ * Store function of "Wellcome Message"
+ * save values to temporary structure
+ * only vsftpd
*/
-void InitAnonSettings(string key) {
- integer current = (integer) UI::QueryWidget(`id("AnonAuthen"), `CurrentButton);
- integer val = tointeger(FtpServer::ValueUIEdit("AnonAuthen"));
- UI::ChangeWidget(`id("AnonAuthen"), `CurrentButton, val);
- UI::ChangeWidget(`id( "AnonReadOnly" ), `Value,
- (FtpServer::ValueUIEdit("AnonReadOnly") == "NO"));
- UI::ChangeWidget(`id( "AnonCreatDirs" ), `Value,
- (FtpServer::ValueUIEdit("AnonCreatDirs") == "YES"));
- if (FtpServer::vsftpd_edit) {
- UI::ChangeWidget(`id( "EnableUpload" ), `Value,
- (FtpServer::ValueUIEdit("EnableUpload") == "YES"));
- if (!((boolean) UI::QueryWidget(`id("EnableUpload"), `Value))) {
- UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, false);
- UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, false);
- }
- }
+
+
+void StoreBanner (string key, map event) {
+ FtpServer::WriteToEditMap("Banner", tostring(UI::QueryWidget(`id("Banner"), `Value)));
}
+/**
+ * Init function "Chroot Everyone" for general settings
+ * check_box
+ */
+
+void InitChrootEnable (string key) {
+ UI::ChangeWidget(`id( "ChrootEnable" ), `Value, (FtpServer::ValueUIEdit("ChrootEnable") == "YES"));
+}
/**
- * Store function for anon settings
+ * Store function of "Chroot Everyone"
* save values to temporary structure
*/
-void StoreAnonSettings (string key, map event) {
- FtpServer::WriteToEditMap("AnonAuthen", tostring(UI::QueryWidget(`id("AnonAuthen"), `CurrentButton)));
- foreach(string key, ["AnonCreatDirs"],{
- FtpServer::WriteToEditMap(key, (((boolean) UI::QueryWidget(`id(key), `Value) == true) ? "YES":"NO"));
- });
- FtpServer::WriteToEditMap("AnonReadOnly", (((boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value) == true) ? "NO":"YES"));
- if (FtpServer::vsftpd_edit)
- FtpServer::WriteToEditMap("EnableUpload", (((boolean) UI::QueryWidget(`id("EnableUpload"), `Value) == true) ? "YES":"NO"));
-
+void StoreChrootEnable (string key, map event) {
+ FtpServer::WriteToEditMap("ChrootEnable", (((boolean) UI::QueryWidget(`id("ChrootEnable"), `Value) == true) ? "YES":"NO"));
+
}
+
+
/**
- * Handle function for anon settings
- * save values to temporary structure
+ * Init function "Verbose Logging" for general settings
+ * check_box
*/
-symbol HandleAnonSettings(string key, map event) {
- if (FtpServer::vsftpd_edit) {
- any button = event["ID"]:nil;
- boolean anon_upload = false;
- boolean anon_create_dirs = false;
- string yesno_comment ="";
- string yesno_question ="";
- boolean check_upload = (boolean) UI::QueryWidget(`id("EnableUpload"), `Value);
- if (button == "EnableUpload") {
- if (check_upload) {
- UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, true);
- UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, true);
- } else {
- UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, false);
- UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, false);
- }
- } // end of if (button == "EnableUpload") {
- anon_upload = (boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value);
- anon_create_dirs = (boolean) UI::QueryWidget(`id("AnonCreatDirs"), `Value);
+void InitVerboseLogging (string key) {
+ UI::ChangeWidget(`id( "VerboseLogging" ), `Value, (FtpServer::ValueUIEdit("VerboseLogging") == "YES"));
+}
- if (((button == "AnonReadOnly") || (anon_upload) && (check_upload)) && (ask_again)) {
- if (!FtpServer::create_upload_dir) {
- yesno_question ="Do you want to create directory\n" + FtpServer::anon_homedir +"upload with allowed writing?";
- yesno_comment = "If you want that \"anonymous\" users can upload\n you need to create directory with allowed writing.\n\n";
- yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
- FtpServer::create_upload_dir = Popup::YesNoHeadline(yesno_question, yesno_comment);
- ask_again = FtpServer::create_upload_dir;
- FtpServer::upload_good_permission = true;
- } else if (!FtpServer::upload_good_permission) {
- yesno_question ="Do you want to change permission\nfor" + FtpServer::anon_homedir +"upload (allow writing)?";
- yesno_comment = "If you want that \"anonymous\" users can upload\n you need directory with allowed writing.\n\n";
- yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
- FtpServer::upload_good_permission = Popup::YesNoHeadline(yesno_question, yesno_comment);
- ask_again = FtpServer::upload_good_permission;
- }
-
- }
+/**
+ * Store function of "Verbose Logging"
+ * save values to temporary structure
+ */
+
+void StoreVerboseLogging (string key, map event) {
+ FtpServer::WriteToEditMap("VerboseLogging", (((boolean) UI::QueryWidget(`id("VerboseLogging"), `Value) == true) ? "YES":"NO"));
- if (((button == "AnonCreatDirs") || (anon_create_dirs) && (check_upload)) && (ask_again)) {
- if (!FtpServer::create_upload_dir) {
- yesno_question ="Do you want to create directory\n" + FtpServer::anon_homedir +"upload with allowed writing?";
- yesno_comment = "If you want that \"anonymous\" users can create directories\n you need to create directory with allowed writing.\n\n";
- yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
- FtpServer::create_upload_dir = Popup::YesNoHeadline(yesno_question, yesno_comment);
- ask_again = FtpServer::create_upload_dir;
- FtpServer::upload_good_permission = true;
- } else if (!FtpServer::upload_good_permission) {
- yesno_question ="Do you want to change permission\nfor" + FtpServer::anon_homedir +"upload (allow writing)?";
- yesno_comment = "If you want that \"anonymous\" users can create directories\n you need directory with allowed writing.\n\n";
- yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
- FtpServer::upload_good_permission = Popup::YesNoHeadline(yesno_question, yesno_comment);
- ask_again = FtpServer::upload_good_permission;
- }
- }
- } // end of if (FtpServer::vsftpd_edit) {
}
+
/**
- * Init function for pure-ftp-server add settings
- * change values a display correct widget
+ * Init function "Umask (umask files:umask dirs)" for general settings
+ * change ValidChars for textentry
+ * only pure-ftpd
*/
-void InitPUREFTPTAddSettings (string key) {
- UI::ChangeWidget(`id( "AntiWarez" ), `Value,
- (FtpServer::ValueUIEdit("AntiWarez") == "YES"));
- integer current = (integer) UI::QueryWidget(`id("SSL"), `CurrentButton);
- UI::ChangeWidget(`id("SSL"), `CurrentButton, tointeger(FtpServer::ValueUIEdit("SSL")));
- foreach(string key, ["PasMinPort", "PasMaxPort"],{
- UI::ChangeWidget(`id(key), `Value, tointeger(FtpServer::ValueUIEdit(key)));
+
+void InitUmask (string key) {
+ UI::ChangeWidget(`id("Umask"), `ValidChars, "01234567:");
+ UI::ChangeWidget(`id("Umask"), `Value, FtpServer::ValueUIEdit("Umask"));
+}
+
+/**
+ * Valid function of "Umask (umask files:umask dirs)"
+ * check value of textentry
+ * only pure-ftpd
+ */
+
+boolean ValidUmask (string key, map event) {
+
+ string new_umask = (string)UI::QueryWidget (`id("Umask"), `Value);
+ if (size(new_umask) > 0) {
+ list <string> l = splitstring (new_umask, ":");
+ l = filter (string s, l, ``(s != ""));
+ if (size(l) < 2) {
+ Popup::Message ("It is not valid umask!");
+ UI::SetFocus(`id("Umask"));
+ return false;
+ }
+ }
+ return true;
+}
+/**
+ * Store function of "Umask (umask files:umask dirs)"
+ * save values to temporary structure
+ * only pure-ftpd
+ */
+
+
+void StoreUmask (string key, map event) {
+ FtpServer::WriteToEditMap("Umask", tostring(UI::QueryWidget(`id("Umask"), `Value)));
+}
+
+
+
+
+
+
+
+/**
+ * Init function "Umask for Anonymous" for general settings
+ * change ValidChars for textentry
+ * only vsftpd
+ */
+
+void InitUmaskAnon (string key) {
+ UI::ChangeWidget(`id( "UmaskAnon" ), `ValidChars, "01234567");
+ UI::ChangeWidget(`id( "UmaskAnon" ), `Value, FtpServer::ValueUIEdit("UmaskAnon"));
+}
+
+/**
+ * Store function of "Umask for Anonymous"
+ * save values to temporary structure
+ * only vsftpd
+ */
+
+
+void StoreUmaskAnon (string key, map event) {
+ FtpServer::WriteToEditMap("UmaskAnon", tostring(UI::QueryWidget(`id("UmaskAnon"), `Value)));
+}
+
+
+/**
+ * Init function "Umask for Authenticated Users" for general settings
+ * change ValidChars for textentry
+ * only vsftpd
+ */
+
+void InitUmaskLocal (string key) {
+ UI::ChangeWidget(`id( "UmaskLocal" ),`ValidChars, "01234567");
+ UI::ChangeWidget(`id( "UmaskLocal" ), `Value, FtpServer::ValueUIEdit("UmaskLocal"));
+}
+
+/**
+ * Store function of "Umask for Authenticated Users"
+ * save values to temporary structure
+ * only vsftpd
+ */
+
+
+void StoreUmaskLocal (string key, map event) {
+ FtpServer::WriteToEditMap("UmaskLocal", tostring(UI::QueryWidget(`id("UmaskLocal"), `Value)));
+}
+
+
+
+
+/**
+ * Init function of "Ftp Directory for Anonymous Users"
+ * textentry
+ *
+ */
+
+void InitFtpDirAnon (string key) {
+ if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "YES") {
+ UI::ChangeWidget(`id("FtpDirAnon"), `Enabled, false);
+ UI::ChangeWidget(`id ("BrowseAnon"),`Enabled, false);
+ } else {
+ UI::ChangeWidget(`id("FtpDirAnon"), `Value, FtpServer::ValueUIEdit("FtpDirAnon"));
+ }
+}
+
+
+/**
+ * Valid function of "Umask for Anonymous Users"
+ * check value of textentry
+ *
+ */
+
+boolean ValidFtpDirAnon (string key, map event) {
+ if (!FtpServer::vsftpd_edit) {
+ if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO") {
+ string AnonHomeDir = (string)UI::QueryWidget (`id("FtpDirAnon"), `Value);
+ //checking correct homedir for anonymous user
+ if ((AnonHomeDir != "") && (Mode::normal())) {
+ if (AnonHomeDir != FtpServer::anon_homedir) {
+ string error = Users::EditUser($["homedirectory":AnonHomeDir]);
+ if ((error != nil) && (error != "")) {
+ Popup::Error(error);
+ UI::SetFocus(`id("FtpDirAnon"));
+ return false;
+ }
+ integer uid = FtpServer::anon_uid;
+ boolean failed = false;
+ map ui_map = $[];
+ map error_map = $[];
+ do {
+ error_map = Users::CheckHomeUI (uid, AnonHomeDir, ui_map);
+ if (error_map != $[]) {
+ if (!Popup::YesNo (error_map ["question"]:""))
+ failed = true;
+ else
+ ui_map[ error_map["question_id"]:"" ] = 1;
+ }
+ } while (error_map != $[] && !failed);
+ } //end of if (AnonHomeDir != FtpServer::anon_homedir) {
+ } //end of if ((AnonHomeDir != "") && (Mode::normal())) {
+ } //end of if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil != "NO") {
+ } //end of if (!FtpServer::vsftpd_edit) {
+ return true;
+
+}
+
+
+/**
+ * Store function of "Umask for Anonynmous Users"
+ * save values to temporary structure
+ *
+ */
+
+
+void StoreFtpDirAnon (string key, map event) {
+ if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO")
+ FtpServer::WriteToEditMap("FtpDirAnon", tostring(UI::QueryWidget(`id("FtpDirAnon"), `Value)));
+
+}
+
+
+/**
+ * Handle function of "Browse"
+ * handling value in textentry of "Umask for Anonynmous Users"
+ */
+
+symbol HandleBrowseAnon (string key, map event) {
+ any button = event["ID"]:nil;
+ if (button == "BrowseAnon") {
+ string val = UI::AskForExistingDirectory ("/","Please select directory...");
+ UI::ChangeWidget(`id( "FtpDirAnon" ), `Value, val);
+ }
+ return nil;
+}
+
+
+
+/**
+ * Init function of "Ftp Directory for Authenticated Users"
+ * textentry
+ *
+ */
+
+void InitFtpDirLocal (string key) {
+ UI::ChangeWidget(`id( "FtpDirLocal" ), `Value, FtpServer::ValueUIEdit("FtpDirLocal"));
+}
+
+
+
+/**
+ * Store function of "Umask for Authenticated Users"
+ * save values to temporary structure
+ *
+ */
+
+
+void StoreFtpDirLocal (string key, map event) {
+ FtpServer::WriteToEditMap("FtpDirLocal", tostring(UI::QueryWidget(`id("FtpDirLocal"), `Value)));
+}
+
+
+
+
+
+/**
+ * Handle function of "Browse"
+ * handling value in textentry of "Umask for Authenticated Users"
+ */
+
+symbol HandleBrowseLocal (string key, map event) {
+ any button = event["ID"]:nil;
+ if (button == "BrowseLocal") {
+ string val = UI::AskForExistingDirectory ("/","Please select directory...");
+ UI::ChangeWidget(`id( "FtpDirLocal" ), `Value, val);
+ }
+ return nil;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+/**
+ * Handle function for general settings
+ * handling started via Xinetd
+ */
+
+symbol HandleGenSettings(string key, map event) {
+
+ any button = event["ID"]:nil;
+ if (FtpServer::vsftpd_edit) {
+ if (button == "SelectDirLocal") {
+ string val = UI::AskForExistingDirectory ("/","Please select directory...");
+ UI::ChangeWidget(`id( "FtpDirLocal" ), `Value, val);
+ }
+ } // end of if (FtpServer::vsftpd_edit)
+ if (button == "SelectDirAnon") {
+ string val = UI::AskForExistingDirectory ("/","Please select directory...");
+ UI::ChangeWidget(`id( "FtpDirAnon" ), `Value, val);
+ }
+} // end of symbol HandleGenSettings(string key, map event) {
+
+/**
+ * Validate function for general settings
+ * checks values from textentry
+ */
+boolean GenValid (string key, map event) {
+
+ if (!FtpServer::vsftpd_edit) {
+ string new_umask = (string)UI::QueryWidget (`id("Umask"), `Value);
+
+ if (size(new_umask) > 0) {
+ list <string> l = splitstring (new_umask, ":");
+ l = filter (string s, l, ``(s != ""));
+ if (size(l) < 2) {
+ Popup::Message ("It is not valid umask!");
+ UI::SetFocus(`id("Umask"));
+ return false;
+ }
+
+ }
+ if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO") {
+ string AnonHomeDir = (string)UI::QueryWidget (`id("FtpDirAnon"), `Value);
+ //checking correct homedir for anonymous user
+ if ((AnonHomeDir != "") && (Mode::normal())) {
+ if (AnonHomeDir != FtpServer::anon_homedir) {
+ string error = Users::EditUser($["homedirectory":AnonHomeDir]);
+ if ((error != nil) && (error != "")) {
+ Popup::Error(error);
+ UI::SetFocus(`id("FtpDirAnon"));
+ return false;
+ }
+ integer uid = FtpServer::anon_uid;
+ boolean failed = false;
+ map ui_map = $[];
+ map error_map = $[];
+ do {
+ error_map = Users::CheckHomeUI (uid, AnonHomeDir, ui_map);
+ if (error_map != $[]) {
+ if (!Popup::YesNo (error_map ["question"]:""))
+ failed = true;
+ else
+ ui_map[ error_map["question_id"]:"" ] = 1;
+ }
+ } while (error_map != $[] && !failed);
+ } //end of if (AnonHomeDir != FtpServer::anon_homedir) {
+ } //end of if ((AnonHomeDir != "") && (Mode::normal())) {
+ } //end of if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil != "NO") {
+ } //end of if (!FtpServer::vsftpd_edit) {
+ return true;
+}
+
+/**
+ * Store function for general settings
+ * save values to temporary structure
+ */
+
+void StoreGenSettings (string key, map event) {
+
+ if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO")
+ FtpServer::WriteToEditMap("FtpDirAnon", (string) UI::QueryWidget(`id("FtpDirAnon"), `Value));
+ if (!FtpServer::vsftpd_edit) {
+ FtpServer::WriteToEditMap("Umask", (string) UI::QueryWidget(`id("Umask"), `Value));
+ } else {
+ foreach(string key, ["FtpDirLocal"],{
+ FtpServer::WriteToEditMap(key, (string) UI::QueryWidget(`id(key), `Value));
+ });
+
+ }
+
+}
+
+
+/**
+ *-----------================= PERFORMANCE SCREEN =============----------
+ *
+ */
+
+
+/**
+ * Init function of "Max Idle Time [minutes]"
+ * intfield
+ *
+ */
+
+void InitMaxIdleTime (string key) {
+ UI::ChangeWidget(`id("MaxIdleTime"), `Value, tointeger(FtpServer::ValueUIEdit("MaxIdleTime")));
+}
+
+/**
+ * Store function of "Max Idle Time [minutes]"
+ * save values to temporary structure
+ *
+ */
+
+void StoreMaxIdleTime (string key, map event) {
+ FtpServer::WriteToEditMap("MaxIdleTime", tostring(UI::QueryWidget(`id("MaxIdleTime"), `Value)));
+}
+
+
+/**
+ * Init function of "Max Clients for One IP"
+ * intfield
+ *
+ */
+
+void InitMaxClientsPerIP (string key) {
+ UI::ChangeWidget(`id("MaxClientsPerIP"), `Value, tointeger(FtpServer::ValueUIEdit("MaxClientsPerIP")));
+}
+
+/**
+ * Store function of "Max Clients for One IP"
+ * save values to temporary structure
+ *
+ */
+
+void StoreMaxClientsPerIP (string key, map event) {
+ FtpServer::WriteToEditMap("MaxClientsPerIP", tostring(UI::QueryWidget(`id("MaxClientsPerIP"), `Value)));
+}
+
+
+/**
+ * Init function of "Max Clients"
+ * intfield
+ *
+ */
+
+void InitMaxClientsNumber (string key) {
+ UI::ChangeWidget(`id("MaxClientsNumber"), `Value, tointeger(FtpServer::ValueUIEdit("MaxClientsNumber")));
+}
+
+/**
+ * Store function of "Max Clients"
+ * save values to temporary structure
+ *
+ */
+
+void StoreMaxClientsNumber (string key, map event) {
+ FtpServer::WriteToEditMap("MaxClientsNumber", tostring(UI::QueryWidget(`id("MaxClientsNumber"), `Value)));
+}
+
+
+/**
+ * Init function of "Local Max Rate [KB/s]"
+ * intfield
+ *
+ */
+
+void InitLocalMaxRate (string key) {
+ UI::ChangeWidget(`id("LocalMaxRate"), `Value, tointeger(FtpServer::ValueUIEdit("LocalMaxRate")));
+}
+
+/**
+ * Store function of "Local Max Rate [KB/s]"
+ * save values to temporary structure
+ *
+ */
+
+void StoreLocalMaxRate (string key, map event) {
+ FtpServer::WriteToEditMap("LocalMaxRate", tostring(UI::QueryWidget(`id("LocalMaxRate"), `Value)));
+}
+
+
+/**
+ * Init function of "Anonymous Max Rate [KB/s]"
+ * intfield
+ *
+ */
+
+void InitAnonMaxRate (string key) {
+ UI::ChangeWidget(`id("AnonMaxRate"), `Value, tointeger(FtpServer::ValueUIEdit("AnonMaxRate")));
+}
+
+/**
+ * Store function of "Anonymous Max Rate [KB/s]"
+ * save values to temporary structure
+ *
+ */
+
+void StoreAnonMaxRate (string key, map event) {
+ FtpServer::WriteToEditMap("AnonMaxRate", tostring(UI::QueryWidget(`id("AnonMaxRate"), `Value)));
+}
+
+
+
+/**
+ * Init function for performance settings
+ * change ValidChars from textentry
+ */
+void InitPerSettings (string key) {
+
+ foreach(string key, ["MaxIdleTime", "MaxClientsPerIP", "MaxClientsNumber",
+ "LocalMaxRate", "AnonMaxRate"],{
+ //UI::ChangeWidget(`id(key), `ValidChars, "0123456789");
+ UI::ChangeWidget(`id(key), `Value, tointeger(FtpServer::ValueUIEdit(key)));
+ });
+}
+
+/**
+ * Store function for performance settings
+ * save values to temporary structure
+ */
+void StorePerforSettings (string key, map event) {
+ foreach(string key, ["MaxIdleTime", "MaxClientsPerIP", "MaxClientsNumber",
+ "LocalMaxRate", "AnonMaxRate"],{
+ FtpServer::WriteToEditMap(key, tostring(UI::QueryWidget(`id(key), `Value)));
+ });
+}
+
+/**
+ *-----------================= Authentication SCREEN =============----------
+ *
+ */
+
+
+
+/**
+ * Init function of "Enable/Disable Anonymous and Local Users"
+ * radiobuttongroup
+ *
+ */
+
+void InitAnonAuthen (string key) {
+ integer authentication = tointeger(FtpServer::ValueUIEdit("AnonAuthen"));
+ if (authentication == 0) { // anonymous only
+ UI::ChangeWidget(`id("AnonAuthen"), `Value, "anon_only");
+ } else if (authentication == 1) { //authenticated only
+ UI::ChangeWidget(`id("AnonAuthen"), `Value, "local_only");
+ } else { //both
+ UI::ChangeWidget(`id("AnonAuthen"), `Value, "both");
+ }
+}
+
+
+
+/**
+ * Store function of "Enable/Disable Anonymous and Local Users"
+ * save value to temporary structure
+ *
+ */
+
+void StoreAnonAuthen (string key, map event) {
+ string radiobut = (string) UI::QueryWidget(`id("AnonAuthen"), `Value);
+ if (radiobut == "anon_only") {
+ FtpServer::WriteToEditMap("AnonAuthen", "0");
+ } else if (radiobut == "local_only") {
+ FtpServer::WriteToEditMap("AnonAuthen", "1");
+ } else {
+ FtpServer::WriteToEditMap("AnonAuthen", "2");
+ }
+}
+
+
+/**
+ * Init function of "Enable Upload"
+ * checkbox
+ *
+ */
+
+void InitEnableUpload (string key) {
+ UI::ChangeWidget(`id( "EnableUpload" ), `Notify, true);
+ if (FtpServer::ValueUIEdit("EnableUpload") == "YES") {
+ UI::ChangeWidget(`id( "EnableUpload" ), `Value, true);
+ UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, true);
+ UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, true);
+ } else {
+ UI::ChangeWidget(`id( "EnableUpload" ), `Value, false);
+ UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, false);
+ UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, false);
+ }
+}
+
+
+/**
+ * Handle function of "Enable Upload"
+ * handling value and ask for creation upload directory
+ * function also disable/enable "Anon&ymous Can Upload" and
+ * "Anonymou&s Can Create Directories"
+ */
+
+symbol HandleEnableUpload (string key, map event) {
+ any button = event["ID"]:nil;
+ //Popup::Message("Hello world");
+ if (Mode::normal()) {
+ boolean anon_upload = false;
+ boolean anon_create_dirs = false;
+ string yesno_comment ="";
+ string yesno_question ="";
+ boolean check_upload = (boolean) UI::QueryWidget(`id("EnableUpload"), `Value);
+ if (button == "EnableUpload") {
+ if (check_upload) {
+ UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, true);
+ UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, true);
+ } else {
+ UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, false);
+ UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, false);
+ }
+ } // end of if (button == "EnableUpload") {
+
+ anon_upload = (boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value);
+ anon_create_dirs = (boolean) UI::QueryWidget(`id("AnonCreatDirs"), `Value);
+
+ if (((button == "AnonReadOnly") || (anon_upload) && (check_upload)) && (ask_again)) {
+ if (!FtpServer::create_upload_dir) {
+ yesno_question ="Do you want to create directory\n" + FtpServer::anon_homedir +"upload with allowed writing?";
+ yesno_comment = "If you want that \"anonymous\" users can upload\n you need to create directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
+ FtpServer::create_upload_dir = Popup::YesNoHeadline(yesno_question, yesno_comment);
+ ask_again = FtpServer::create_upload_dir;
+ FtpServer::upload_good_permission = true;
+ } else if (!FtpServer::upload_good_permission) {
+ yesno_question ="Do you want to change permission\nfor" + FtpServer::anon_homedir +"upload (allow writing)?";
+ yesno_comment = "If you want that \"anonymous\" users can upload\n you need directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
+ FtpServer::upload_good_permission = Popup::YesNoHeadline(yesno_question, yesno_comment);
+ ask_again = FtpServer::upload_good_permission;
+ }
+
+ }
+
+ if (((button == "AnonCreatDirs") || (anon_create_dirs) && (check_upload)) && (ask_again)) {
+ if (!FtpServer::create_upload_dir) {
+ yesno_question ="Do you want to create directory\n" + FtpServer::anon_homedir +"upload with allowed writing?";
+ yesno_comment = "If you want that \"anonymous\" users can create directories\n you need to create directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
+ FtpServer::create_upload_dir = Popup::YesNoHeadline(yesno_question, yesno_comment);
+ ask_again = FtpServer::create_upload_dir;
+ FtpServer::upload_good_permission = true;
+ } else if (!FtpServer::upload_good_permission) {
+ yesno_question ="Do you want to change permission\nfor" + FtpServer::anon_homedir +"upload (allow writing)?";
+ yesno_comment = "If you want that \"anonymous\" users can create directories\n you need directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
+ FtpServer::upload_good_permission = Popup::YesNoHeadline(yesno_question, yesno_comment);
+ ask_again = FtpServer::upload_good_permission;
+ }
+ }
+ } // end of if (Mode::normal()) {
+}
+
+/**
+ * Store function of "Enable Upload"
+ * save value to temporary structure
+ *
+ */
+
+void StoreEnableUpload (string key, map event) {
+ FtpServer::WriteToEditMap("EnableUpload",
+ (((boolean) UI::QueryWidget(`id("EnableUpload"), `Value) == true) ? "YES":"NO"));
+}
+
+
+
+/**
+ * Init function of "Anonymous Can Upload"
+ * checkbox
+ *
+ */
+
+void InitAnonReadOnly (string key) {
+ UI::ChangeWidget(`id( "AnonReadOnly" ), `Value,
+ (FtpServer::ValueUIEdit("AnonReadOnly") == "NO"));
+}
+
+/**
+ * Store function of "Anonymous Can Upload"
+ * save value to temporary structure
+ *
+ */
+void StoreAnonReadOnly (string key, map event) {
+ FtpServer::WriteToEditMap("AnonReadOnly",
+ (((boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value) == true) ? "NO":"YES"));
+}
+
+
+/**
+ * Init function of "Anonymous Can Create Directories"
+ * checkbox
+ *
+ */
+
+void InitAnonCreatDirs (string key) {
+ UI::ChangeWidget(`id( "AnonCreatDirs" ), `Value,
+ (FtpServer::ValueUIEdit("AnonCreatDirs") == "YES"));
+}
+
+
+
+/**
+ * Store function of "Anonymous Can Create Directories"
+ * save value to temporary structure
+ *
+ */
+void StoreAnonCreatDirs (string key, map event) {
+ FtpServer::WriteToEditMap("AnonCreatDirs",
+ (((boolean) UI::QueryWidget(`id("AnonCreatDirs"), `Value) == true) ? "YES":"NO"));
+}
+
+
+
+/**
+ * Init function for anon settings
+ * change ValidChars from textentry
+ */
+void InitAnonSettings(string key) {
+ integer current = (integer) UI::QueryWidget(`id("AnonAuthen"), `CurrentButton);
+ integer val = tointeger(FtpServer::ValueUIEdit("AnonAuthen"));
+ UI::ChangeWidget(`id("AnonAuthen"), `CurrentButton, val);
+ UI::ChangeWidget(`id( "AnonReadOnly" ), `Value,
+ (FtpServer::ValueUIEdit("AnonReadOnly") == "NO"));
+ UI::ChangeWidget(`id( "AnonCreatDirs" ), `Value,
+ (FtpServer::ValueUIEdit("AnonCreatDirs") == "YES"));
+ if (FtpServer::vsftpd_edit) {
+ UI::ChangeWidget(`id( "EnableUpload" ), `Value,
+ (FtpServer::ValueUIEdit("EnableUpload") == "YES"));
+ if (!((boolean) UI::QueryWidget(`id("EnableUpload"), `Value))) {
+ UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, false);
+ UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, false);
+ }
+ }
+}
+
+
+/**
+ * Store function for anon settings
+ * save values to temporary structure
+ */
+void StoreAnonSettings (string key, map event) {
+ FtpServer::WriteToEditMap("AnonAuthen", tostring(UI::QueryWidget(`id("AnonAuthen"), `CurrentButton)));
+ foreach(string key, ["AnonCreatDirs"],{
+ FtpServer::WriteToEditMap(key, (((boolean) UI::QueryWidget(`id(key), `Value) == true) ? "YES":"NO"));
});
+
+ FtpServer::WriteToEditMap("AnonReadOnly", (((boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value) == true) ? "NO":"YES"));
+ if (FtpServer::vsftpd_edit)
+ FtpServer::WriteToEditMap("EnableUpload", (((boolean) UI::QueryWidget(`id("EnableUpload"), `Value) == true) ? "YES":"NO"));
+
+}
+
+/**
+ * Handle function for anon settings
+ * save values to temporary structure
+ */
+
+symbol HandleAnonSettings(string key, map event) {
+ if (FtpServer::vsftpd_edit) {
+ any button = event["ID"]:nil;
+ boolean anon_upload = false;
+ boolean anon_create_dirs = false;
+ string yesno_comment ="";
+ string yesno_question ="";
+ boolean check_upload = (boolean) UI::QueryWidget(`id("EnableUpload"), `Value);
+ if (button == "EnableUpload") {
+ if (check_upload) {
+ UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, true);
+ UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, true);
+ } else {
+ UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, false);
+ UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, false);
+ }
+ } // end of if (button == "EnableUpload") {
+
+ anon_upload = (boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value);
+ anon_create_dirs = (boolean) UI::QueryWidget(`id("AnonCreatDirs"), `Value);
+
+ if (((button == "AnonReadOnly") || (anon_upload) && (check_upload)) && (ask_again)) {
+ if (!FtpServer::create_upload_dir) {
+ yesno_question ="Do you want to create directory\n" + FtpServer::anon_homedir +"upload with allowed writing?";
+ yesno_comment = "If you want that \"anonymous\" users can upload\n you need to create directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
+ FtpServer::create_upload_dir = Popup::YesNoHeadline(yesno_question, yesno_comment);
+ ask_again = FtpServer::create_upload_dir;
+ FtpServer::upload_good_permission = true;
+ } else if (!FtpServer::upload_good_permission) {
+ yesno_question ="Do you want to change permission\nfor" + FtpServer::anon_homedir +"upload (allow writing)?";
+ yesno_comment = "If you want that \"anonymous\" users can upload\n you need directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
+ FtpServer::upload_good_permission = Popup::YesNoHeadline(yesno_question, yesno_comment);
+ ask_again = FtpServer::upload_good_permission;
+ }
+
+ }
+
+ if (((button == "AnonCreatDirs") || (anon_create_dirs) && (check_upload)) && (ask_again)) {
+ if (!FtpServer::create_upload_dir) {
+ yesno_question ="Do you want to create directory\n" + FtpServer::anon_homedir +"upload with allowed writing?";
+ yesno_comment = "If you want that \"anonymous\" users can create directories\n you need to create directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
+ FtpServer::create_upload_dir = Popup::YesNoHeadline(yesno_question, yesno_comment);
+ ask_again = FtpServer::create_upload_dir;
+ FtpServer::upload_good_permission = true;
+ } else if (!FtpServer::upload_good_permission) {
+ yesno_question ="Do you want to change permission\nfor" + FtpServer::anon_homedir +"upload (allow writing)?";
+ yesno_comment = "If you want that \"anonymous\" users can create directories\n you need directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after login of \"anonymous\" users.";
+ FtpServer::upload_good_permission = Popup::YesNoHeadline(yesno_question, yesno_comment);
+ ask_again = FtpServer::upload_good_permission;
+ }
+ }
+ } // end of if (FtpServer::vsftpd_edit) {
}
+
/**
- * Validate function for Expert settings (pure-ftpd)
- *
+ *-----------================= EXPERT SETTINGS SCREEN =============----------
+ *
*/
- boolean ValidPUREFTPExpSettings(string key, map event) {
+
+/**
+ * Init function of "Enable Passive Mode"
+ * checkbox
+ *
+ * also include handling enable/disable Min and Max Ports
+ * handling intfields
+ */
+
+void InitPassiveMode (string key) {
+ UI::ChangeWidget(`id("PassiveMode"), `Notify, true);
+ UI::ChangeWidget(`id("PassiveMode"), `Value, (FtpServer::ValueUIEdit("PassiveMode") == "YES"));
+}
+
+
+/**
+ * Handle function of "Enable Passive Mode"
+ * handling enable/disable widgets
+ */
+
+symbol HandlePassiveMode (string key, map event) {
+ boolean value = (boolean) UI::QueryWidget(`id("PassiveMode"), `Value);
+ if (value) {
+ UI::ChangeWidget(`id("PasMinPort"), `Enabled, true);
+ UI::ChangeWidget(`id("PasMaxPort"), `Enabled, true);
+ } else {
+ UI::ChangeWidget(`id("PasMinPort"), `Enabled, false);
+ UI::ChangeWidget(`id("PasMaxPort"), `Enabled, false);
+ }
+}
+
+
+/**
+ * Store function of "Enable Passive Mode"
+ * save values to temporary structure
+ *
+ */
+void StorePassiveMode (string key, map event) {
+ FtpServer::WriteToEditMap("PassiveMode", (((boolean) UI::QueryWidget(`id("PassiveMode"), `Value) == true) ? "YES":"NO"));
+
+}
+
+
+
+
+/**
+ * Init function of "Min Port for Pas. Mode"
+ * intfield
+ *
+ */
+
+void InitPasMinPort (string key) {
+ UI::ChangeWidget(`id("PasMinPort"), `Value, tointeger(FtpServer::ValueUIEdit("PasMinPort")));
+}
+
+/**
+ * Store function of "Min Port for Pas. Mode"
+ * save values to temporary structure
+ *
+ */
+void StorePasMinPort (string key, map event) {
+ FtpServer::WriteToEditMap("PasMinPort", tostring(UI::QueryWidget(`id("PasMinPort"), `Value)));
+ FtpServer::WriteToEditMap("PassiveMode", (((boolean) UI::QueryWidget(`id("PassiveMode"), `Value) == true) ? "YES":"NO"));
+}
+
+
+
+/**
+ * Init function of "Max Port for Pas. Mode"
+ * intfield
+ *
+ */
+
+void InitPasMaxPort (string key) {
+ UI::ChangeWidget(`id("PasMaxPort"), `Value, tointeger(FtpServer::ValueUIEdit("PasMaxPort")));
+
+}
+
+
+/**
+ * Valid function of "Max Port for Pas. Mode"
+ * check values Max Port >= Min Port
+ *
+ */
+
+boolean ValidPasMaxPort (string key, map event) {
integer min_port = tointeger(UI::QueryWidget (`id("PasMinPort"), `Value));
integer max_port = tointeger(UI::QueryWidget (`id("PasMaxPort"), `Value));
@@ -707,11 +1279,165 @@
UI::SetFocus(`id("PasMinPort"));
return false;
}
+ return true;
+}
+
+
+
+/**
+ * Store function of "Max Port for Pas. Mode"
+ * save values to temporary structure
+ *
+ */
+void StorePasMaxPort (string key, map event) {
+ FtpServer::WriteToEditMap("PasMaxPort", tostring(UI::QueryWidget(`id("PasMaxPort"), `Value)));
+}
+
+
+
+
+/**
+ * Init function of "Enable SSL"
+ * checkbox
+ *
+ * also include handling enable/disable SSL v2/3/TLS and Certificate
+ * handling checkboxes and textentry
+ */
+
+void InitSSLEnable (string key) {
+ UI::ChangeWidget(`id("SSLEnable"), `Notify, true);
+ UI::ChangeWidget(`id("SSLEnable"), `Value, (FtpServer::ValueUIEdit("SSLEnable") == "YES"));
+}
+
+
+/**
+ * Handle function of "Enable SSL"
+ * handling enable/disable widgets"
+ */
+
+symbol HandleSSLEnable (string key, map event) {
+ boolean value = (boolean) UI::QueryWidget(`id("SSLEnable"), `Value);
+ if (value) {
+ UI::ChangeWidget(`id("SSLv2"), `Enabled, true);
+ UI::ChangeWidget(`id("SSLv3"), `Enabled, true);
+ UI::ChangeWidget(`id("TLS"), `Enabled, true);
+ UI::ChangeWidget(`id("CertFile"), `Enabled, true);
+ UI::ChangeWidget(`id("BrowseCertFile"), `Enabled, true);
+ } else {
+ UI::ChangeWidget(`id("SSLv2"), `Enabled, false);
+ UI::ChangeWidget(`id("SSLv3"), `Enabled, false);
+ UI::ChangeWidget(`id("TLS"), `Enabled, false);
+ UI::ChangeWidget(`id("CertFile"), `Enabled, false);
+ UI::ChangeWidget(`id("BrowseCertFile"), `Enabled, false);
+ }
+}
+
+
+/**
+ * Store function of "Enable SSL"
+ * save values to temporary structure
+ *
+ */
+void StoreSSLEnable (string key, map event) {
+ FtpServer::WriteToEditMap("SSLEnable", (((boolean) UI::QueryWidget(`id("SSLEnable"), `Value) == true) ? "YES":"NO"));
- integer current = (integer) UI::QueryWidget(`id("SSL"), `CurrentButton);
+}
- if ((!FileUtils::Exists("/etc/ssl/private/pure-ftpd.pem")) && (current > 0)) {
- Popup::Error("Certificate /etc/ssl/private/pure-ftpd.pem for SSL connection is missing.");
+
+
+
+/**
+ * Init function of "Enable SSL v2"
+ * intfield
+ *
+ * also include handling enable/disable SSL
+ * handling checkboxframe
+ */
+
+void InitSSLv2 (string key) {
+ UI::ChangeWidget(`id("SSLv2"), `Value, (FtpServer::ValueUIEdit("SSLv2") == "YES"));
+ UI::ChangeWidget(`id("SSLEnable"), `Value, (FtpServer::ValueUIEdit("SSLEnable") == "YES"));
+}
+
+/**
+ * Store function of "Enable SSL v2"
+ * save values to temporary structure
+ *
+ * also include handling value enable/disable passive mode
+ */
+void StoreSSLv2 (string key, map event) {
+ FtpServer::WriteToEditMap("SSLv2",
+ (((boolean) UI::QueryWidget(`id("SSLv2"), `Value) == true) ? "YES":"NO"));
+ FtpServer::WriteToEditMap("SSLEnable",
+ (((boolean) UI::QueryWidget(`id("SSLEnable"), `Value) == true) ? "YES":"NO"));
+
+}
+
+
+
+
+/**
+ * Init function of "Enable SSL v3"
+ * intfield
+ *
+ */
+
+void InitSSLv3 (string key) {
+ UI::ChangeWidget(`id("SSLv3"), `Value, (FtpServer::ValueUIEdit("SSLv3") == "YES"));
+}
+
+/**
+ * Store function of "Enable SSL v3"
+ * save value to temporary structure
+ *
+ */
+void StoreSSLv3 (string key, map event) {
+ FtpServer::WriteToEditMap("SSLv3",
+ (((boolean) UI::QueryWidget(`id("SSLv3"), `Value) == true) ? "YES":"NO"));
+}
+/**
+ * Init function of "Enable TLS"
+ * intfield
+ *
+ */
+
+void InitTLS (string key) {
+ UI::ChangeWidget(`id("TLS"), `Value, (FtpServer::ValueUIEdit("TLS") == "YES"));
+}
+
+/**
+ * Store function of "Enable TLS"
+ * save value to temporary structure
+ *
+ */
+void StoreTLS (string key, map event) {
+ FtpServer::WriteToEditMap("TLS",
+ (((boolean) UI::QueryWidget(`id("TLS"), `Value) == true) ? "YES":"NO"));
+}
+
+/**
+ * Init function of "DSA Certificate to Use for SSL Encrypted Connections"
+ * intfield
+ *
+ */
+
+void InitCertFile (string key) {
+ UI::ChangeWidget(`id( "CertFile" ), `Value, FtpServer::ValueUIEdit("CertFile"));
+}
+
+/**
+ * Valid function of "DSA Certificate to Use for SSL Encrypted Connections"
+ * check value if user enable SSL Certificate (textentry) doesn't be empty
+ *
+ */
+
+boolean ValidCertFile (string key, map event) {
+ string rsa_cert = tostring(UI::QueryWidget(`id("CertFile"), `Value));
+ boolean ssl_enable = (boolean) UI::QueryWidget(`id("SSLEnable"), `Value);
+
+ if (((rsa_cert == "")||(rsa_cert ==nil)) && (ssl_enable)) {
+ Popup::Error("DSA certificate is missing.");
+ UI::SetFocus(`id("CertFile"));
return false;
}
@@ -719,23 +1445,106 @@
}
+/**
+ * Store function of "DSA Certificate to Use for SSL Encrypted Connections"
+ * save value to temporary structure
+ *
+ */
+void StoreCertFile (string key, map event) {
+ FtpServer::WriteToEditMap("CertFile", tostring(UI::QueryWidget(`id("CertFile"), `Value)));
+}
+
+
+
/**
- * Store function for pure-ftp-server add settings
- * save values to temporary structure
+ * Handle function of "Browse"
+ * handling value in textentry of "DSA Certificate to Use for SSL Encrypted Connections"
*/
-void StorePUREFTPDSettings (string key, map event) {
- FtpServer::WriteToEditMap("AntiWarez", (((boolean) UI::QueryWidget(`id("AntiWarez"), `Value) == true) ? "YES":"NO"));
- FtpServer::WriteToEditMap("SSL", tostring(UI::QueryWidget(`id("SSL"), `CurrentButton)));
- //FtpServer::WriteToEditMap("CertFile", tostring(UI::QueryWidget(`id("CertFile"), `Value)));
- foreach(string key, ["PasMinPort", "PasMaxPort"],{
- FtpServer::WriteToEditMap(key, tostring(UI::QueryWidget(`id(key), `Value)));
- });
- //y2milestone("-------------EDIT_SETTINGS-------------------");
- //y2milestone("Pure-ftpd configuration has been read: %1", FtpServer::EDIT_SETTINGS);
- //y2milestone("---------------------------------------------");
+symbol HandleBrowseCertFile (string key, map event) {
+ any button = event["ID"]:nil;
+ if (button == "BrowseCertFile") {
+ string val = UI::AskForExistingFile ("/","*.*","Please Select File");
+ UI::ChangeWidget(`id( "CertFile" ), `Value, val);
+ }
+}
+
+
+
+/**
+ * Init function of "Disable Downloading Unvalidated Data"
+ * checkbox
+ *
+ */
+
+void InitAntiWarez (string key) {
+ UI::ChangeWidget(`id( "AntiWarez" ), `Value,
+ (FtpServer::ValueUIEdit("AntiWarez") == "YES"));
+}
+
+
+/**
+ * Store function of "Disable Downloading Unvalidated Data"
+ * save value to temporary structure
+ *
+ */
+void StoreAntiWarez (string key, map event) {
+ FtpServer::WriteToEditMap("AntiWarez",
+ (((boolean) UI::QueryWidget(`id("AntiWarez"), `Value) == true) ? "YES":"NO"));
+}
+
+
+/**
+ * Init function of "Security Settings"
+ * checkbox
+ *
+ */
+
+void InitSSL (string key) {
+ integer security = tointeger(FtpServer::ValueUIEdit("SSL"));
+ if (security == 0) { // anonymous only
+ UI::ChangeWidget(`id("SSL"), `Value, "disable");
+ } else if (security == 1) { //authenticated only
+ UI::ChangeWidget(`id("SSL"), `Value, "accept");
+ } else { //both
+ UI::ChangeWidget(`id("SSL"), `Value, "refuse");
+ }
+}
+
+
+/**
+ * Valid function of "Security Settings"
+ * check of existing certificate
+ *
+ */
+
+boolean ValidSSL (string key, map event) {
+ string current = (string) UI::QueryWidget(`id("SSL"), `Value);
+ if ((!FileUtils::Exists("/etc/ssl/private/pure-ftpd.pem")) &&
+ ((current == "accept") || (current == "refuse"))) {
+ Popup::Error("Certificate /etc/ssl/private/pure-ftpd.pem for SSL connection is missing.");
+ return false;
+ }
+ return true;
}
+/**
+ * Store function of "Security Settings"
+ * save value to temporary structure
+ *
+ */
+void StoreSSL (string key, map event) {
+ string radiobut = (string) UI::QueryWidget(`id("SSL"), `Value);
+ if (radiobut == "disable") {
+ FtpServer::WriteToEditMap("SSL", "0");
+ } else if (radiobut == "accept") {
+ FtpServer::WriteToEditMap("SSL", "1");
+ } else {
+ FtpServer::WriteToEditMap("SSL", "2");
+ }
+}
+
+
/**
@@ -821,4 +1630,69 @@
}
+
+/**
+ * Init function for pure-ftp-server add settings
+ * change values a display correct widget
+ */
+void InitPUREFTPTAddSettings (string key) {
+ UI::ChangeWidget(`id( "AntiWarez" ), `Value,
+ (FtpServer::ValueUIEdit("AntiWarez") == "YES"));
+ integer current = (integer) UI::QueryWidget(`id("SSL"), `CurrentButton);
+ UI::ChangeWidget(`id("SSL"), `CurrentButton, tointeger(FtpServer::ValueUIEdit("SSL")));
+ foreach(string key, ["PasMinPort", "PasMaxPort"],{
+ UI::ChangeWidget(`id(key), `Value, tointeger(FtpServer::ValueUIEdit(key)));
+ });
+}
+
+/**
+ * Validate function for Expert settings (pure-ftpd)
+ *
+ */
+
+ boolean ValidPUREFTPExpSettings(string key, map event) {
+ integer min_port = tointeger(UI::QueryWidget (`id("PasMinPort"), `Value));
+ integer max_port = tointeger(UI::QueryWidget (`id("PasMaxPort"), `Value));
+
+ if (min_port > max_port) {
+ Popup::Message ("Condition for ports is max port > min port.");
+ UI::SetFocus(`id("PasMinPort"));
+ return false;
+ }
+
+ integer current = (integer) UI::QueryWidget(`id("SSL"), `CurrentButton);
+
+ if ((!FileUtils::Exists("/etc/ssl/private/pure-ftpd.pem")) && (current > 0)) {
+ Popup::Error("Certificate /etc/ssl/private/pure-ftpd.pem for SSL connection is missing.");
+ return false;
+ }
+
+ return true;
+
+}
+
+
+/**
+ * Store function for pure-ftp-server add settings
+ * save values to temporary structure
+ */
+void StorePUREFTPDSettings (string key, map event) {
+ FtpServer::WriteToEditMap("AntiWarez", (((boolean) UI::QueryWidget(`id("AntiWarez"), `Value) == true) ? "YES":"NO"));
+ FtpServer::WriteToEditMap("SSL", tostring(UI::QueryWidget(`id("SSL"), `CurrentButton)));
+
+ //FtpServer::WriteToEditMap("CertFile", tostring(UI::QueryWidget(`id("CertFile"), `Value)));
+ foreach(string key, ["PasMinPort", "PasMaxPort"],{
+ FtpServer::WriteToEditMap(key, tostring(UI::QueryWidget(`id(key), `Value)));
+ });
+ //y2milestone("-------------EDIT_SETTINGS-------------------");
+ //y2milestone("Pure-ftpd configuration has been read: %1", FtpServer::EDIT_SETTINGS);
+ //y2milestone("---------------------------------------------");
+}
+
+
+
+
+
+
+
}
\ No newline at end of file
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org