Author: juhliarik
Date: Wed Feb 11 14:45:25 2009
New Revision: 55415
URL: http://svn.opensuse.org/viewcvs/yast?rev=55415&view=rev
Log:
added fix for using Back button
added fix for popup question about really abort
new version 2.18.0
Modified:
trunk/ftp-server/VERSION
trunk/ftp-server/package/yast2-ftp-server.changes
trunk/ftp-server/src/FtpServer.ycp
trunk/ftp-server/src/dialogs.ycp
trunk/ftp-server/src/wid_functions.ycp
Modified: trunk/ftp-server/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/VERSION?rev=55415&r1=55414&r2=55415&view=diff
==============================================================================
--- trunk/ftp-server/VERSION (original)
+++ trunk/ftp-server/VERSION Wed Feb 11 14:45:25 2009
@@ -1 +1 @@
-2.17.3
+2.18.0
Modified: trunk/ftp-server/package/yast2-ftp-server.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/package/yast2-ftp-server.changes?rev=55415&r1=55414&r2=55415&view=diff
==============================================================================
--- trunk/ftp-server/package/yast2-ftp-server.changes (original)
+++ trunk/ftp-server/package/yast2-ftp-server.changes Wed Feb 11 14:45:25 2009
@@ -1,3 +1,11 @@
+-------------------------------------------------------------------
+Wed Feb 11 14:36:11 CET 2009 - juhliarik@suse.de
+
+- deleted unecessary Back button (bnc#440531)
+- using popup question about really abort only after some changes
+ (bnc#460154 )
+- 2.18.0
+
------------------------------------------------------------------
Tue Feb 03 15:12:18 CEST 2008 - juhliarik@suse.cz
Modified: trunk/ftp-server/src/FtpServer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/FtpServer.ycp?rev=55415&r1=55414&r2=55415&view=diff
==============================================================================
--- trunk/ftp-server/src/FtpServer.ycp (original)
+++ trunk/ftp-server/src/FtpServer.ycp Wed Feb 11 14:45:25 2009
@@ -32,6 +32,8 @@
/**
* Prototypes
*/
+global void SetModified(boolean set_modified);
+
global boolean Modified();
global boolean WriteToEditMap (string key, string value);
@@ -822,6 +824,16 @@
return modified;
}
+/**
+ * Function set modified variable.
+ *
+ * @param boolean modified
+ */
+global void SetModified(boolean set_modified) {
+ modified = set_modified;
+}
+
+
/**
* Returns a confirmation popup dialog whether user wants to really abort.
Modified: trunk/ftp-server/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/dialogs.ycp?rev=55415&r1=55414&r2=55415&view=diff
==============================================================================
--- trunk/ftp-server/src/dialogs.ycp (original)
+++ trunk/ftp-server/src/dialogs.ycp Wed Feb 11 14:45:25 2009
@@ -25,31 +25,21 @@
-
-/**
- * Function for disable back button
- * @param string key
- */
-
-void BackButton (string key) {
- Wizard::SetTitleIcon("yast-ftp-server");
- UI::ChangeWidget(`id(`back), `Enabled, false);
-}
-
-
-
-
/**
* Returns whether user confirmed aborting the configuration.
*
* @return boolean result
*/
define boolean AbortDialog () {
- return Popup::YesNoHeadline(
- // TRANSLATORS: popup headline
- _("Aborting FTP Configuration"),
- // TRANSLATORS: popup message
- _("All changes will be lost. Really abort configuration?"));
+
+ if (FtpServer::GetModified())
+ return Popup::YesNoHeadline(
+ // TRANSLATORS: popup headline
+ _("Aborting FTP Configuration"),
+ // TRANSLATORS: popup message
+ _("All changes will be lost. Really abort configuration?"));
+ else
+ return true;
}
/**
@@ -77,26 +67,6 @@
/**
* Init function where are added UI hadle functions
- * Perform Settings 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;
-
-}
-
-/**
- * Init function where are added UI hadle functions
* Start widget
*
* @return map map for start-stop widget
@@ -177,25 +147,6 @@
}
-
-/**
- * Init function where are added UI hadle functions
- * special hack widget where is handlig disable back button
- *
- * @return map map for start-stop widget
- */
-
-map DisBackButton () {
- map result = $[];
-
- result["widget"] = `custom;
- result["custom_widget"] =`Empty();
- result["init"] = BackButton;
- result["help"] = " ";
-
- return result;
-}
-
/**
* Init function where are added UI hadle functions
* special hack widget where is handlig Start/Stop button
@@ -223,29 +174,6 @@
*/
-/*
- * Init function where are added UI hadle functions
- * General Settings widget
- *
- * @return map map for General Settings widget
-
-
-map GenSettings () {
- map result = $[];
-
- result["widget"] = `custom;
- result["custom_widget"] = `VBox();
- result["init"] = InitGenSettings;
- result["handle"] = HandleGenSettings;
- result["store"] = StoreGenSettings;
- result["validate_type"] = `function;
- result["validate_function"] = GenValid;
- result["help"] = DialogHelpText("gen_settings");
-
- return result;
-}
-*/
-
/**
* Wellcome Message for vsftpd
* General Settings widget
@@ -258,7 +186,9 @@
result["label"] = _("&Welcome message");
result["widget"] = `textentry;
+ result["opt"] = [`notify];
result["init"] = InitBanner;
+ result["handle"] = HandleUniversal;
result["store"] = StoreBanner;
result["help"] = DialogHelpText("Banner");
@@ -277,7 +207,9 @@
result["label"] = _("&Chroot Everyone");
result["widget"] = `checkbox;
+ result["opt"] = [`notify];
result["init"] = InitChrootEnable;
+ result["handle"] = HandleUniversal;
result["store"] = StoreChrootEnable;
result["help"] = DialogHelpText("ChrootEnable");
@@ -296,7 +228,9 @@
result["label"] = _("&Verbose Logging");
result["widget"] = `checkbox;
+ result["opt"] = [`notify];
result["init"] = InitVerboseLogging;
+ result["handle"] = HandleUniversal;
result["store"] = StoreVerboseLogging;
result["help"] = DialogHelpText("VerboseLogging");
@@ -316,7 +250,9 @@
result["label"] = _("&Umask (umask files:umask dirs)");
result["widget"] = `textentry;
+ result["opt"] = [`notify];
result["init"] = InitUmask;
+ result["handle"] = HandleUniversal;
result["store"] = StoreUmask;
result["validate_type"] = `function;
result["validate_function"] = ValidUmask;
@@ -338,7 +274,9 @@
result["label"] = _("&Umask for Anonymous");
result["widget"] = `textentry;
+ result["opt"] = [`notify];
result["init"] = InitUmaskAnon;
+ result["handle"] = HandleUniversal;
result["store"] = StoreUmaskAnon;
result["help"] = DialogHelpText("UmaskAnon");
@@ -361,7 +299,9 @@
result["label"] = _("Uma&sk for Authenticated Users");
result["widget"] = `textentry;
+ result["opt"] = [`notify];
result["init"] = InitUmaskLocal;
+ result["handle"] = HandleUniversal;
result["store"] = StoreUmaskLocal;
result["help"] = DialogHelpText("UmaskLocal");
@@ -381,7 +321,9 @@
result["label"] = _("Ftp Directory for Anon&ymous Users");
result["widget"] = `textentry;
+ result["opt"] = [`notify];
result["init"] = InitFtpDirAnon;
+ result["handle"] = HandleUniversal;
result["validate_type"] = `function;
result["validate_function"] = ValidFtpDirAnon;
result["store"] = StoreFtpDirAnon;
@@ -424,7 +366,9 @@
result["label"] = _("&Ftp Directory for Authenticated Users");
result["widget"] = `textentry;
+ result["opt"] = [`notify];
result["init"] = InitFtpDirLocal;
+ result["handle"] = HandleUniversal;
result["store"] = StoreFtpDirLocal;
result["help"] = DialogHelpText("FtpDirLocal");
@@ -458,29 +402,6 @@
*/
-
-/*
- * Init function where are added UI hadle functions
- * Perform Settings 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
@@ -496,7 +417,9 @@
result["widget"] = `intfield;
result["minimum"] = 0;
result["maximum"] = 1440;
+ result["opt"] = [`notify];
result["init"] = InitMaxIdleTime;
+ result["handle"] = HandleUniversal;
result["store"] = StoreMaxIdleTime;
result["help"] = DialogHelpText("MaxIdleTime");
@@ -520,7 +443,9 @@
result["widget"] = `intfield;
result["minimum"] = 0;
result["maximum"] = 50;
+ result["opt"] = [`notify];
result["init"] = InitMaxClientsPerIP;
+ result["handle"] = HandleUniversal;
result["store"] = StoreMaxClientsPerIP;
result["help"] = DialogHelpText("MaxClientsPerIP");
@@ -534,8 +459,6 @@
*
* @return map map for Performance screen
*/
-
-
map MaxClientsNumber () {
map result = $[];
@@ -543,7 +466,9 @@
result["widget"] = `intfield;
result["minimum"] = 0;
result["maximum"] = 9999;
+ result["opt"] = [`notify];
result["init"] = InitMaxClientsNumber;
+ result["handle"] = HandleUniversal;
result["store"] = StoreMaxClientsNumber;
result["help"] = DialogHelpText("MaxClientsNumber");
@@ -557,8 +482,6 @@
*
* @return map map for Performance screen
*/
-
-
map LocalMaxRate () {
map result = $[];
@@ -566,7 +489,9 @@
result["widget"] = `intfield;
result["minimum"] = 0;
result["maximum"] = 10000000;
+ result["opt"] = [`notify];
result["init"] = InitLocalMaxRate;
+ result["handle"] = HandleUniversal;
result["store"] = StoreLocalMaxRate;
result["help"] = DialogHelpText("LocalMaxRate");
@@ -580,8 +505,6 @@
*
* @return map map for Performance screen
*/
-
-
map AnonMaxRate () {
map result = $[];
@@ -589,7 +512,9 @@
result["widget"] = `intfield;
result["minimum"] = 0;
result["maximum"] = 10000000;
+ result["opt"] = [`notify];
result["init"] = InitAnonMaxRate;
+ result["handle"] = HandleUniversal;
result["store"] = StoreAnonMaxRate;
result["help"] = DialogHelpText("AnonMaxRate");
@@ -620,7 +545,9 @@
["local_only", _("Aut&henticated Users Only")],
["both", _("&Both")],
];
+ result["opt"] = [`notify];
result["init"] = InitAnonAuthen;
+ result["handle"] = HandleUniversal;
result["store"] = StoreAnonAuthen;
result["help"] = DialogHelpText("AnonAuthen");
@@ -696,31 +623,6 @@
*
*/
-
-/*
- * Init function where are added UI hadle functions
- * Expert Settings widget (vsftpd)
- *
- * @return map map for Expert Settings widget
-
-
-map VSFTPDSettings () {
- map result = $[];
-
- result["widget"] = `custom;
- result["custom_widget"] = `VBox();
- result["init"] = InitVSFTPAddSettings;
- result["validate_type"] = `function;
- result["validate_function"] = ValidVSFTPExpSettings;
- result["store"] = StoreVSFTPDSettings;
- result["handle"] = HandleVSFTPExpertSettings;
- result["help"] = DialogHelpText("vsftpd_settings");
-
- return result;
-}
-
-*/
-
/**
* Enable Pass&ive Mode
* Expert Settings widget
@@ -750,8 +652,6 @@
*
* @return map map for Expert screen
*/
-
-
map PasMinPort () {
map result = $[];
@@ -759,7 +659,9 @@
result["widget"] = `intfield;
result["minimum"] = 1024;
result["maximum"] = 65535;
+ result["opt"] = [`notify];
result["init"] = InitPasMinPort;
+ result["handle"] = HandleUniversal;
result["store"] = StorePasMinPort;
result["help"] = DialogHelpText("PasMinPort");
@@ -783,7 +685,9 @@
result["widget"] = `intfield;
result["minimum"] = 1024;
result["maximum"] = 65535;
+ result["opt"] = [`notify];
result["init"] = InitPasMaxPort;
+ result["handle"] = HandleUniversal;
result["store"] = StorePasMaxPort;
result["validate_type"] = `function;
result["validate_function"] = ValidPasMaxPort;
@@ -816,22 +720,20 @@
}
-
-
/**
* 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["opt"] = [`notify];
result["init"] = InitSSLv2;
+ result["handle"] = HandleUniversal;
result["store"] = StoreSSLv2;
result["help"] = DialogHelpText("SSLv2");
@@ -852,7 +754,9 @@
result["label"] = _("Enable SSL &v3");
result["widget"] = `checkbox;
+ result["opt"] = [`notify];
result["init"] = InitSSLv3;
+ result["handle"] = HandleUniversal;
result["store"] = StoreSSLv3;
result["help"] = DialogHelpText("SSLv3");
@@ -873,7 +777,9 @@
result["label"] = _("Enable &TLS");
result["widget"] = `checkbox;
+ result["opt"] = [`notify];
result["init"] = InitTLS;
+ result["handle"] = HandleUniversal;
result["store"] = StoreTLS;
result["help"] = DialogHelpText("TLS");
@@ -939,7 +845,9 @@
result["label"] = _("Disable Downloading &Unvalidated Data");
result["widget"] = `checkbox;
+ result["opt"] = [`notify];
result["init"] = InitAntiWarez;
+ result["handle"] = HandleUniversal;
result["store"] = StoreAntiWarez;
result["help"] = DialogHelpText("AntiWarez");
@@ -953,8 +861,6 @@
*
* @return map map for Expert screen
*/
-
-
map SSL () {
map result = $[];
@@ -965,7 +871,9 @@
["accept", _("Accept &SSL and TLS")],
["refuse", _("&Refuse Conections Without SSL/TLS")],
];
+ result["opt"] = [`notify];
result["init"] = InitSSL;
+ result["handle"] = HandleUniversal;
result["validate_type"] = `function;
result["validate_function"] = ValidSSL;
result["store"] = StoreSSL;
@@ -980,32 +888,6 @@
*/
-/*
- * Init function where are added UI hadle functions
- * Expert Settings widget (pure-ftpd)
- *
- * @return map map for Expert Settings widget
- *
-
-map PUREFTPDAddSettings () {
- map result = $[];
-
- result["widget"] = `custom;
- result["custom_widget"] = `VBox();
- result["init"] = InitPUREFTPTAddSettings;
- result["validate_type"] = `function;
- result["validate_function"] = ValidPUREFTPExpSettings;
- result["store"] = StorePUREFTPDSettings;
- result["help"] = DialogHelpText("pureftpd_settings");
-
- return result;
-}
-
-*/
-
-
-
-
/**
* Init function where are added UI hadle functions
* Start widget
@@ -1013,8 +895,6 @@
*
* @return map map for start_up widget
*/
-
-
map start_up () {
map result = $[];
@@ -1031,7 +911,7 @@
result["caption"] = _("FTP Start-Up");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Start-Up");
- result["widget_names"] = [ "DisBackButton", "StartMode", "StartStop", "RBVsPureFTPd", "StartStopRestart"];
+ result["widget_names"] = ["StartMode", "StartStop", "RBVsPureFTPd", "StartStopRestart"];
return result;
}
@@ -1080,8 +960,7 @@
result["caption"] = _("FTP General Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("General");
- result["widget_names"] = [ "DisBackButton", "Banner",
- "ChrootEnable", "VerboseLogging", "UmaskAnon",
+ result["widget_names"] = [ "Banner", "ChrootEnable", "VerboseLogging", "UmaskAnon",
"UmaskLocal", "BrowseAnon", "BrowseLocal",
"FtpDirAnon", "FtpDirLocal"];
@@ -1121,7 +1000,7 @@
result["caption"] = _("FTP General Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("General");
- result["widget_names"] = [ "DisBackButton", "ChrootEnable", "VerboseLogging",
+ result["widget_names"] = [ "ChrootEnable", "VerboseLogging",
"Umask", "FtpDirAnon", "BrowseAnon"];
return result;
@@ -1156,7 +1035,7 @@
result["caption"] = _("FTP Performance Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Performance");
- result["widget_names"] = [ "DisBackButton", "MaxClientsPerIP", "MaxIdleTime",
+ result["widget_names"] = [ "MaxClientsPerIP", "MaxIdleTime",
"AnonMaxRate", "LocalMaxRate", "MaxClientsNumber",];
return result;
@@ -1220,7 +1099,7 @@
result["caption"] = _("FTP Anonymous Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Authentication");
- result["widget_names"] = [ "DisBackButton", "AnonAuthen",
+ result["widget_names"] = [ "AnonAuthen",
"AnonReadOnly", "AnonCreatDirs"];
return result;
@@ -1253,7 +1132,7 @@
result["caption"] = _("FTP Anonymous Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Authentication");
- result["widget_names"] = [ "DisBackButton", "AnonAuthen", "EnableUpload",
+ result["widget_names"] = [ "AnonAuthen", "EnableUpload",
"AnonReadOnly", "AnonCreatDirs"];
return result;
@@ -1309,7 +1188,7 @@
result["caption"] = _("FTP Expert Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Expert Settings");
- result["widget_names"] = [ "DisBackButton", "Firewall", "PasMinPort", "PasMaxPort",
+ result["widget_names"] = [ "Firewall", "PasMinPort", "PasMaxPort",
"SSLv2", "SSLv3", "TLS", "CertFile", "BrowseCertFile",
"PassiveMode", "SSLEnable" ];
@@ -1354,7 +1233,7 @@
result["caption"] = _("FTP Expert Settings");
// TRANSLATORS: tree menu item
result["tree_item_label"] = _("Expert Settings");
- result["widget_names"] = [ "DisBackButton", "Firewall", "PasMinPort",
+ result["widget_names"] = [ "Firewall", "PasMinPort",
"PasMaxPort", "AntiWarez", "SSL",];
return result;
@@ -1375,7 +1254,6 @@
"StartMode" : CWMServiceStart::CreateAutoStartWidget ( StartMode ()),
"StartStop" : CWMServiceStart::CreateStartStopWidget (StartStop ()),
- "DisBackButton" : DisBackButton (),
"RBVsPureFTPd" : RBVsftpdPureftpd (),
"StartStopRestart": StartStopRestart (),
@@ -1459,7 +1337,7 @@
"initial_screen": "start_up",
"screens" : tabs_vsftpd,
"widget_descr" : wid_handling_vsftpd,
- "back_button" : Label::BackButton(),
+ "back_button" : "",
"abort_button" : Label::CancelButton(),
"next_button" : Label::FinishButton(),
"functions" : functions,
@@ -1475,7 +1353,6 @@
map > wid_handling_pureftpd = $[
- "DisBackButton" : DisBackButton (),
"StartStopRestart": StartStopRestart (),
"StartMode" : CWMServiceStart::CreateAutoStartWidget (StartMode ()),
@@ -1542,7 +1419,7 @@
"initial_screen": "start_up",
"screens" : tabs_pureftpd,
"widget_descr" : wid_handling_pureftpd,
- "back_button" : Label::BackButton(),
+ "back_button" : "",
"abort_button" : Label::CancelButton(),
"next_button" : Label::FinishButton(),
"functions" : functions,
Modified: trunk/ftp-server/src/wid_functions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/wid_functions.ycp?rev=55415&r1=55414&r2=55415&view=diff
==============================================================================
--- trunk/ftp-server/src/wid_functions.ycp (original)
+++ trunk/ftp-server/src/wid_functions.ycp Wed Feb 11 14:45:25 2009
@@ -24,8 +24,6 @@
import "Label";
-
-
/**
* variable signifies repeat asking about upload file
* only for vsftpd
@@ -60,7 +58,6 @@
FtpServer::EDIT_SETTINGS["StartDaemon"] = "1";
FtpServer::EDIT_SETTINGS["StartXinetd"] = "NO";
}
-
}
/**
@@ -320,7 +317,6 @@
/**
* Function stop pure-ftpd
*/
-
boolean StopNowPure () {
boolean result = false;
@@ -444,7 +440,6 @@
*
* init starting via xinetd and update status
*/
-
void InitStartStopRestart (string key) {
if ((FtpServer::pure_ftp_xinetd_running) && (!FtpServer::vsftpd_edit)) {
@@ -461,39 +456,11 @@
}
}
-
-
-
-
/**
*-----------================= GENERAL SCREEN =============----------
*
*/
-
-
-/**
- * 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( "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
@@ -504,21 +471,28 @@
}
/**
+ * Handle function only save info about changes
+ */
+symbol HandleUniversal (string key, map event) {
+ // modified
+ if (event["EventReason"]:"" == "ValueChanged")
+ FtpServer::SetModified(true);
+ return nil;
+}
+
+/**
* Store function of "Wellcome Message"
* save values to temporary structure
* only vsftpd
*/
-
-
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"));
}
@@ -527,20 +501,15 @@
* Store function of "Chroot Everyone"
* save values to temporary structure
*/
-
void StoreChrootEnable (string key, map event) {
FtpServer::WriteToEditMap("ChrootEnable", (((boolean) UI::QueryWidget(`id("ChrootEnable"), `Value) == true) ? "YES":"NO"));
}
-
-
/**
* Init function "Verbose Logging" for general settings
* check_box
*/
-
-
void InitVerboseLogging (string key) {
UI::ChangeWidget(`id( "VerboseLogging" ), `Value, (FtpServer::ValueUIEdit("VerboseLogging") == "YES"));
}
@@ -549,23 +518,15 @@
* 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"));
-
}
-
-
-
-
-
/**
* Init function "Umask (umask files:umask dirs)" for general settings
* change ValidChars for textentry
* only pure-ftpd
*/
-
void InitUmask (string key) {
UI::ChangeWidget(`id("Umask"), `ValidChars, "01234567:");
UI::ChangeWidget(`id("Umask"), `Value, FtpServer::ValueUIEdit("Umask"));
@@ -576,7 +537,6 @@
* check value of textentry
* only pure-ftpd
*/
-
boolean ValidUmask (string key, map event) {
string new_umask = (string)UI::QueryWidget (`id("Umask"), `Value);
@@ -591,43 +551,37 @@
}
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)));
+
}
@@ -636,7 +590,6 @@
* change ValidChars for textentry
* only vsftpd
*/
-
void InitUmaskLocal (string key) {
UI::ChangeWidget(`id( "UmaskLocal" ),`ValidChars, "01234567");
UI::ChangeWidget(`id( "UmaskLocal" ), `Value, FtpServer::ValueUIEdit("UmaskLocal"));
@@ -647,21 +600,15 @@
* 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);
@@ -673,11 +620,10 @@
/**
- * Valid function of "Umask for Anonymous Users"
+ * Valid function of "Ftp Directory for Anon&ymous Users"
* check value of textentry
*
*/
-
boolean ValidFtpDirAnon (string key, map event) {
if (!FtpServer::vsftpd_edit) {
if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil == "NO") {
@@ -712,26 +658,20 @@
}
-
/**
- * Store function of "Umask for Anonynmous Users"
+ * Store function of "Ftp Directory for Anon&ymous 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") {
@@ -741,40 +681,28 @@
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") {
@@ -785,120 +713,16 @@
}
-
-
-
-
-
-
-
-
-
-
-
-/**
- * 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 (_("Not a 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")));
}
@@ -908,7 +732,6 @@
* save values to temporary structure
*
*/
-
void StoreMaxIdleTime (string key, map event) {
FtpServer::WriteToEditMap("MaxIdleTime", tostring(UI::QueryWidget(`id("MaxIdleTime"), `Value)));
}
@@ -919,7 +742,6 @@
* intfield
*
*/
-
void InitMaxClientsPerIP (string key) {
UI::ChangeWidget(`id("MaxClientsPerIP"), `Value, tointeger(FtpServer::ValueUIEdit("MaxClientsPerIP")));
}
@@ -929,7 +751,6 @@
* save values to temporary structure
*
*/
-
void StoreMaxClientsPerIP (string key, map event) {
FtpServer::WriteToEditMap("MaxClientsPerIP", tostring(UI::QueryWidget(`id("MaxClientsPerIP"), `Value)));
}
@@ -940,7 +761,6 @@
* intfield
*
*/
-
void InitMaxClientsNumber (string key) {
UI::ChangeWidget(`id("MaxClientsNumber"), `Value, tointeger(FtpServer::ValueUIEdit("MaxClientsNumber")));
}
@@ -950,7 +770,6 @@
* save values to temporary structure
*
*/
-
void StoreMaxClientsNumber (string key, map event) {
FtpServer::WriteToEditMap("MaxClientsNumber", tostring(UI::QueryWidget(`id("MaxClientsNumber"), `Value)));
}
@@ -961,7 +780,6 @@
* intfield
*
*/
-
void InitLocalMaxRate (string key) {
UI::ChangeWidget(`id("LocalMaxRate"), `Value, tointeger(FtpServer::ValueUIEdit("LocalMaxRate")));
}
@@ -971,18 +789,15 @@
* 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")));
}
@@ -992,50 +807,21 @@
* 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
@@ -1047,14 +833,11 @@
}
}
-
-
/**
* 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") {
@@ -1072,7 +855,6 @@
* checkbox
*
*/
-
void InitEnableUpload (string key) {
UI::ChangeWidget(`id( "EnableUpload" ), `Notify, true);
if (FtpServer::ValueUIEdit("EnableUpload") == "YES") {
@@ -1093,7 +875,6 @@
* 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");
@@ -1167,6 +948,9 @@
}
}
} // end of if (Mode::normal()) {
+ // modified
+ if (event["EventReason"]:"" == "ValueChanged")
+ FtpServer::SetModified(true);
}
/**
@@ -1174,7 +958,6 @@
* save value to temporary structure
*
*/
-
void StoreEnableUpload (string key, map event) {
FtpServer::WriteToEditMap("EnableUpload",
(((boolean) UI::QueryWidget(`id("EnableUpload"), `Value) == true) ? "YES":"NO"));
@@ -1187,7 +970,6 @@
* checkbox
*
*/
-
void InitAnonReadOnly (string key) {
UI::ChangeWidget(`id( "AnonReadOnly" ), `Value,
(FtpServer::ValueUIEdit("AnonReadOnly") == "NO"));
@@ -1198,7 +980,6 @@
* check permissions for upload dir
*
*/
-
symbol HandleAnonReadOnly (string key, map event) {
string yesno_comment ="";
string yesno_question ="";
@@ -1239,6 +1020,9 @@
} //end of if (FtpServer::pure_ftp_allowed_permissios_upload == 1)
} //end else for if if (!FtpServer::vsftpd_edit) {
} // end of if (enable) {
+ // modified
+ if (event["EventReason"]:"" == "ValueChanged")
+ FtpServer::SetModified(true);
}
/**
@@ -1251,26 +1035,21 @@
(((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"));
}
-
-
/**
* Handle function of "Anonymous Can Create Directories"
* check permissions for upload dir
*
*/
-
symbol HandleAnonCreatDirs (string key, map event) {
string yesno_comment ="";
string yesno_question ="";
@@ -1310,11 +1089,11 @@
} //end of if (FtpServer::pure_ftp_allowed_permissios_upload == 1)
} //end else for if if (!FtpServer::vsftpd_edit) {
} // end of if (enable) {
+ // modified
+ if (event["EventReason"]:"" == "ValueChanged")
+ FtpServer::SetModified(true);
}
-
-
-
/**
* Store function of "Anonymous Can Create Directories"
* save value to temporary structure
@@ -1339,7 +1118,6 @@
* 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"));
@@ -1350,7 +1128,6 @@
* 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) {
@@ -1360,9 +1137,11 @@
UI::ChangeWidget(`id("PasMinPort"), `Enabled, false);
UI::ChangeWidget(`id("PasMaxPort"), `Enabled, false);
}
+ // modified
+ if (event["EventReason"]:"" == "ValueChanged")
+ FtpServer::SetModified(true);
}
-
/**
* Store function of "Enable Passive Mode"
* save values to temporary structure
@@ -1373,15 +1152,11 @@
}
-
-
-
/**
* Init function of "Min Port for Pas. Mode"
* intfield
*
*/
-
void InitPasMinPort (string key) {
UI::ChangeWidget(`id("PasMinPort"), `Value, tointeger(FtpServer::ValueUIEdit("PasMinPort")));
}
@@ -1396,26 +1171,21 @@
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));
@@ -1428,8 +1198,6 @@
return true;
}
-
-
/**
* Store function of "Max Port for Pas. Mode"
* save values to temporary structure
@@ -1439,9 +1207,6 @@
FtpServer::WriteToEditMap("PasMaxPort", tostring(UI::QueryWidget(`id("PasMaxPort"), `Value)));
}
-
-
-
/**
* Init function of "Enable SSL"
* checkbox
@@ -1449,18 +1214,15 @@
* 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) {
@@ -1476,6 +1238,9 @@
UI::ChangeWidget(`id("CertFile"), `Enabled, false);
UI::ChangeWidget(`id("BrowseCertFile"), `Enabled, false);
}
+ // modified
+ if (event["EventReason"]:"" == "ValueChanged")
+ FtpServer::SetModified(true);
}
@@ -1489,9 +1254,6 @@
}
-
-
-
/**
* Init function of "Enable SSL v2"
* intfield
@@ -1499,7 +1261,6 @@
* 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"));
@@ -1519,15 +1280,11 @@
}
-
-
-
/**
* Init function of "Enable SSL v3"
* intfield
*
*/
-
void InitSSLv3 (string key) {
UI::ChangeWidget(`id("SSLv3"), `Value, (FtpServer::ValueUIEdit("SSLv3") == "YES"));
}
@@ -1541,12 +1298,12 @@
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"));
}
@@ -1566,7 +1323,6 @@
* intfield
*
*/
-
void InitCertFile (string key) {
UI::ChangeWidget(`id( "CertFile" ), `Value, FtpServer::ValueUIEdit("CertFile"));
}
@@ -1576,7 +1332,6 @@
* 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);
@@ -1600,14 +1355,10 @@
FtpServer::WriteToEditMap("CertFile", tostring(UI::QueryWidget(`id("CertFile"), `Value)));
}
-
-
-
/**
* Handle function of "Browse"
* handling value in textentry of "DSA Certificate to Use for SSL Encrypted Connections"
*/
-
symbol HandleBrowseCertFile (string key, map event) {
any button = event["ID"]:nil;
if (button == "BrowseCertFile") {
@@ -1616,20 +1367,16 @@
}
}
-
-
/**
* 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
@@ -1640,13 +1387,11 @@
(((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
@@ -1658,13 +1403,11 @@
}
}
-
/**
* 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")) &&
@@ -1674,6 +1417,7 @@
}
return true;
}
+
/**
* Store function of "Security Settings"
* save value to temporary structure
@@ -1690,155 +1434,4 @@
}
}
-
-
-
-/**
- * Init function for vsftpd add settings
- * change values a display correct widget
- */
-void InitVSFTPAddSettings (string key) {
-
- foreach(string key, ["SSLEnable", "TLS", "SSLv2", "SSLv3", "PassiveMode"],{
- UI::ChangeWidget(`id(key), `Value, (FtpServer::ValueUIEdit(key) == "YES"));
- });
- foreach(string key, ["PasMinPort", "PasMaxPort" ],{
- UI::ChangeWidget(`id(key), `Value, tointeger(FtpServer::ValueUIEdit(key)));
- });
-
- UI::ChangeWidget(`id( "CertFile" ), `Value, FtpServer::ValueUIEdit("CertFile"));
-}
-
-/**
- * Validate function for Expert settings (vsftpd)
- *
- */
-
- boolean ValidVSFTPExpSettings(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;
- }
-
- 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;
- }
-
- return true;
-
-}
-
-
-
-/**
- * Handle function for general settings
- * handling started via Xinetd
- */
-
-symbol HandleVSFTPExpertSettings(string key, map event) {
- any button = event["ID"]:nil;
- if (FtpServer::vsftpd_edit) {
- if (button == "SelectCertFile") {
- string val = UI::AskForExistingFile ("/","*.*",_("Please Select File"));
- UI::ChangeWidget(`id( "CertFile" ), `Value, val);
- }
- } // end of if (FtpServer::vsftpd_edit)
-} // end of symbol HandleGenSettings(string key, map event) {
-
-/**
- * Store function for vsftpd add settings
- * save values to temporary structure
- */
-
-void StoreVSFTPDSettings (string key, map event) {
-
- foreach(string key, ["SSLEnable", "TLS", "SSLv2", "SSLv3", "PassiveMode"],{
- FtpServer::WriteToEditMap(key, (((boolean) UI::QueryWidget(`id(key), `Value) == true) ? "YES":"NO"));
- });
-
- foreach(string key, ["PasMinPort", "PasMaxPort", "CertFile"],{
- FtpServer::WriteToEditMap(key, tostring(UI::QueryWidget(`id(key), `Value)));
- });
-
- //y2milestone("-------------EDIT_SETTINGS-------------------");
- //y2milestone("vsftpd configuration has been read: %1", FtpServer::EDIT_SETTINGS);
- //y2milestone("---------------------------------------------");
-
-}
-
-
-
-/**
- * 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(_("The <tt>/etc/ssl/private/pure-ftpd.pem</tt> certificate for the 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