Module: Yast::FtpServerWidFunctionsInclude
- Defined in:
- ../../src/include/ftp-server/wid_functions.rb
Instance Method Summary (collapse)
- - (Object) AskStartXinetd
-
- (Object) GetEnableService
CWMServiceStart function with no parameter returning boolean value that says if the service is started.
-
- (Object) GetStartedViaXinetd
CWMServiceStart function with no parameter returning boolean value that says if the service is started.
-
- (Object) HandleAnonCreatDirs(key, event)
Handle function of “Anonymous Can Create Directories” check permissions for upload dir.
-
- (Object) HandleAnonReadOnly(key, event)
Handle function of “Anonymous Can Upload” check permissions for upload dir.
-
- (Object) HandleBrowseAnon(key, event)
Handle function of “Browse” handling value in textentry of “Umask for Anonynmous Users”.
-
- (Object) HandleBrowseCertFile(key, event)
Handle function of “Browse” handling value in textentry of “DSA Certificate to Use for SSL Encrypted Connections”.
-
- (Object) HandleBrowseLocal(key, event)
Handle function of “Browse” handling value in textentry of “Umask for Authenticated Users”.
-
- (Object) HandleEnableUpload(key, event)
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”.
-
- (Object) HandlePassiveMode(key, event)
Handle function of “Enable Passive Mode” handling enable/disable widgets.
- - (Object) HandleRBVsPure(key, event)
-
- (Object) HandleSSLEnable(key, event)
Handle function of “Enable SSL” handling enable/disable widgets“.
-
- (Object) HandleUniversal(key, event)
Handle function only save info about changes.
-
- (Object) InitAnonAuthen(key)
Init function of “Enable/Disable Anonymous and Local Users” radiobuttongroup.
-
- (Object) InitAnonCreatDirs(key)
Init function of “Anonymous Can Create Directories” checkbox.
-
- (Object) InitAnonMaxRate(key)
Init function of “Anonymous Max Rate [KB/s]” intfield.
-
- (Object) InitAnonReadOnly(key)
Init function of “Anonymous Can Upload” checkbox.
-
- (Object) InitAntiWarez(key)
Init function of “Disable Downloading Unvalidated Data” checkbox.
-
- (Object) InitBanner(key)
Init function “Wellcome Message” for general settings change ValidChars for textentry only vsftpd.
-
- (Object) InitCertFile(key)
Init function of “DSA Certificate to Use for SSL Encrypted Connections” intfield.
-
- (Object) InitChrootEnable(key)
Init function “Chroot Everyone” for general settings check_box.
-
- (Object) InitEnableUpload(key)
Init function of “Enable Upload” checkbox.
-
- (Object) InitFtpDirAnon(key)
Init function of “Ftp Directory for Anonymous Users” textentry.
-
- (Object) InitFtpDirLocal(key)
Init function of “Ftp Directory for Authenticated Users” textentry.
- - (Object) initialize_ftp_server_wid_functions(include_target)
-
- (Object) InitLocalMaxRate(key)
Init function of “Local Max Rate [KB/s]” intfield.
-
- (Object) InitMaxClientsNumber(key)
Init function of “Max Clients” intfield.
-
- (Object) InitMaxClientsPerIP(key)
Init function of “Max Clients for One IP” intfield.
-
- (Object) InitMaxIdleTime(key)
Init function of “Max Idle Time [minutes]” intfield.
-
- (Object) InitPasMaxPort(key)
Init function of “Max Port for Pas.
-
- (Object) InitPasMinPort(key)
Init function of “Min Port for Pas.
-
- (Object) InitPassiveMode(key)
Init function of “Enable Passive Mode” checkbox.
-
- (Object) InitRBVsPure(key)
Init function for general settings save values to temporary structure.
-
- (Object) InitSSL(key)
Init function of “Security Settings” checkbox.
-
- (Object) InitSSLEnable(key)
Init function of “Enable SSL” checkbox.
-
- (Object) InitSSLv2(key)
Init function of “Enable SSL v2” intfield.
-
- (Object) InitSSLv3(key)
Init function of “Enable SSL v3” intfield.
-
- (Object) InitStartStopRestart(key)
Init function for start-up.
-
- (Object) InitTLS(key)
Init function of “Enable TLS” intfield.
-
- (Object) InitUmask(key)
Init function “Umask (umask files:umask dirs)” for general settings change ValidChars for textentry only pure-ftpd.
-
- (Object) InitUmaskAnon(key)
Init function “Umask for Anonymous” for general settings change ValidChars for textentry only vsftpd.
-
- (Object) InitUmaskLocal(key)
Init function “Umask for Authenticated Users” for general settings change ValidChars for textentry only vsftpd.
-
- (Object) InitVerboseLogging(key)
Init function “Verbose Logging” for general settings check_box.
-
- (Object) SaveAndRestartPure
Function saves configuration and restarts pure-ftpd.
-
- (Object) SaveAndRestartVsftpd
Function saves configuration and restarts vsftpd.
-
- (Object) SetEnableService(enable_service)
CWMServiceStart function with one boolean parameter returning boolean value that says if the service will be started at boot.
-
- (Object) SetStartedViaXinetd(enable_service)
CWMServiceStart function with one boolean parameter returning boolean value that says if the service will be started at boot.
-
- (Object) StartNowPure
Function start pure-ftpd.
-
- (Object) StartNowVsftpd
Function start vsftpd.
-
- (Object) StopNowPure
Function stop pure-ftpd.
-
- (Object) StopNowVsftpd
Function stop vsftpd.
-
- (Object) StoreAnonAuthen(key, event)
Store function of “Enable/Disable Anonymous and Local Users” save value to temporary structure.
-
- (Object) StoreAnonCreatDirs(key, event)
Store function of “Anonymous Can Create Directories” save value to temporary structure.
-
- (Object) StoreAnonMaxRate(key, event)
Store function of “Anonymous Max Rate [KB/s]” save values to temporary structure.
-
- (Object) StoreAnonReadOnly(key, event)
Store function of “Anonymous Can Upload” save value to temporary structure.
-
- (Object) StoreAntiWarez(key, event)
Store function of “Disable Downloading Unvalidated Data” save value to temporary structure.
-
- (Object) StoreBanner(key, event)
Store function of “Wellcome Message” save values to temporary structure only vsftpd.
-
- (Object) StoreCertFile(key, event)
Store function of “DSA Certificate to Use for SSL Encrypted Connections” save value to temporary structure.
-
- (Object) StoreChrootEnable(key, event)
Store function of “Chroot Everyone” save values to temporary structure.
-
- (Object) StoreEnableUpload(key, event)
Store function of “Enable Upload” save value to temporary structure.
-
- (Object) StoreFtpDirAnon(key, event)
Store function of “Ftp Directory for Anon&ymous Users” save values to temporary structure.
-
- (Object) StoreFtpDirLocal(key, event)
Store function of “Umask for Authenticated Users” save values to temporary structure.
-
- (Object) StoreLocalMaxRate(key, event)
Store function of “Local Max Rate [KB/s]” save values to temporary structure.
-
- (Object) StoreMaxClientsNumber(key, event)
Store function of “Max Clients” save values to temporary structure.
-
- (Object) StoreMaxClientsPerIP(key, event)
Store function of “Max Clients for One IP” save values to temporary structure.
-
- (Object) StoreMaxIdleTime(key, event)
Store function of “Max Idle Time [minutes]” save values to temporary structure.
-
- (Object) StorePasMaxPort(key, event)
Store function of “Max Port for Pas.
-
- (Object) StorePasMinPort(key, event)
Store function of “Min Port for Pas.
-
- (Object) StorePassiveMode(key, event)
Store function of “Enable Passive Mode” save values to temporary structure.
-
- (Object) StoreSSL(key, event)
Store function of “Security Settings” save value to temporary structure.
-
- (Object) StoreSSLEnable(key, event)
Store function of “Enable SSL” save values to temporary structure.
-
- (Object) StoreSSLv2(key, event)
Store function of “Enable SSL v2” save values to temporary structure.
-
- (Object) StoreSSLv3(key, event)
Store function of “Enable SSL v3” save value to temporary structure.
-
- (Object) StoreTLS(key, event)
Store function of “Enable TLS” save value to temporary structure.
-
- (Object) StoreUmask(key, event)
Store function of “Umask (umask files:umask dirs)” save values to temporary structure only pure-ftpd.
-
- (Object) StoreUmaskAnon(key, event)
Store function of “Umask for Anonymous” save values to temporary structure only vsftpd.
-
- (Object) StoreUmaskLocal(key, event)
Store function of “Umask for Authenticated Users” save values to temporary structure only vsftpd.
-
- (Object) StoreVerboseLogging(key, event)
Store function of “Verbose Logging” save values to temporary structure.
- - (Object) UpdateInfoAboutStartingFTP
-
- (Object) ValidCertFile(key, event)
Valid function of “DSA Certificate to Use for SSL Encrypted Connections” check value if user enable SSL Certificate (textentry) doesn't be empty.
-
- (Object) ValidFtpDirAnon(key, event)
Valid function of “Ftp Directory for Anon&ymous Users” check value of textentry.
-
- (Object) ValidPasMaxPort(key, event)
Valid function of “Max Port for Pas.
-
- (Object) ValidSSL(key, event)
Valid function of “Security Settings” check of existing certificate.
-
- (Object) ValidUmask(key, event)
Valid function of “Umask (umask files:umask dirs)” check value of textentry only pure-ftpd.
Instance Method Details
- (Object) AskStartXinetd
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File '../../src/include/ftp-server/wid_functions.rb', line 76 def AskStartXinetd result = false if Service.Status("xinetd") != 0 && Ops.get(FtpServer.EDIT_SETTINGS, "StartXinetd") == "NO" if Mode.normal UI.OpenDialog( VBox( Label(_("Xinetd is not running.")), Label(_("Start it now?")), ButtonBox( PushButton(Id(:accept), Label.OKButton), PushButton(Id(:cancel), Label.CancelButton) ) ) ) # end of UI::OpenDialog( while true ret = UI.UserInput if ret == :accept result = true break elsif ret == :cancel result = false break end end UI.CloseDialog end # end of if (Mode::normal()) { end # end of if ((Service::Status("xinetd") != 0)... result end |
- (Object) GetEnableService
CWMServiceStart function with no parameter returning boolean value that says if the service is started.
35 36 37 38 39 40 41 42 43 |
# File '../../src/include/ftp-server/wid_functions.rb', line 35 def GetEnableService result = false if Ops.get(FtpServer.EDIT_SETTINGS, "StartDaemon") == "1" result = true else result = false end result end |
- (Object) GetStartedViaXinetd
CWMServiceStart function with no parameter returning boolean value that says if the service is started.
63 64 65 66 67 68 69 70 71 72 73 |
# File '../../src/include/ftp-server/wid_functions.rb', line 63 def GetStartedViaXinetd result = false if Ops.get(FtpServer.EDIT_SETTINGS, "StartDaemon") == "2" result = true else result = false end result end |
- (Object) HandleAnonCreatDirs(key, event)
Handle function of “Anonymous Can Create Directories” check permissions for upload dir
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1279 def HandleAnonCreatDirs(key, event) event = deep_copy(event) yesno_comment = "" yesno_question = "" result = false enable = Convert.to_boolean(UI.QueryWidget(Id("AnonReadOnly"), :Value)) if enable if !FtpServer.vsftpd_edit if FtpServer.pure_ftp_allowed_permissios_upload == 0 yesno_question = Builtins.sformat( _("Change permissions of %1 ?\n"), FtpServer.anon_homedir ) yesno_comment = Builtins.sformat( _( "If you want to allow uploads for \"anonymous\" users, \nyou need a directory with write access for them." ) ) result = Popup.YesNoHeadline(yesno_question, yesno_comment) if result FtpServer.pure_ftp_allowed_permissios_upload = 1 FtpServer. = true else FtpServer.pure_ftp_allowed_permissios_upload = -1 FtpServer. = false end end #end of if (FtpServer::pure_ftp_allowed_permissios_upload == 0) else if FtpServer.pure_ftp_allowed_permissios_upload == 1 yesno_question = Builtins.sformat( _("Change permissions of %1 ?\n"), FtpServer.anon_homedir ) yesno_comment = Builtins.sformat( _( "For anonymous connections the home directory of an anonymous user should have no write access." ) ) result = Popup.YesNoHeadline(yesno_question, yesno_comment) if result FtpServer.pure_ftp_allowed_permissios_upload = 0 FtpServer. = true else FtpServer.pure_ftp_allowed_permissios_upload = -1 FtpServer. = false end end #end of if (FtpServer::pure_ftp_allowed_permissios_upload == 1) end #end else for if if (!FtpServer::vsftpd_edit) { end # end of if (enable) { # modified if Ops.get_string(event, "EventReason", "") == "ValueChanged" FtpServer.SetModified(true) end nil end |
- (Object) HandleAnonReadOnly(key, event)
Handle function of “Anonymous Can Upload” check permissions for upload dir
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1192 def HandleAnonReadOnly(key, event) event = deep_copy(event) yesno_comment = "" yesno_question = "" result = false enable = Convert.to_boolean(UI.QueryWidget(Id("AnonReadOnly"), :Value)) if enable if !FtpServer.vsftpd_edit if FtpServer.pure_ftp_allowed_permissios_upload == 0 yesno_question = Builtins.sformat( _("Change permissions of %1 ?\n"), FtpServer.anon_homedir ) yesno_comment = Builtins.sformat( _( "If you want to allow uploads for \"anonymous\" users, \nyou need a directory with write access for them." ) ) result = Popup.YesNoHeadline(yesno_question, yesno_comment) if result FtpServer.pure_ftp_allowed_permissios_upload = 1 FtpServer. = true else FtpServer.pure_ftp_allowed_permissios_upload = -1 FtpServer. = false end end #end of if (FtpServer::pure_ftp_allowed_permissios_upload == 0) else if FtpServer.pure_ftp_allowed_permissios_upload == 1 yesno_question = Builtins.sformat( _("Change permissions of %1 ?\n"), FtpServer.anon_homedir ) yesno_comment = Builtins.sformat( _( "For anonymous connections the home directory of an anonymous user should have no write access.\n" ) ) result = Popup.YesNoHeadline(yesno_question, yesno_comment) if result FtpServer.pure_ftp_allowed_permissios_upload = 0 FtpServer. = true else FtpServer.pure_ftp_allowed_permissios_upload = -1 FtpServer. = false end end #end of if (FtpServer::pure_ftp_allowed_permissios_upload == 1) end #end else for if if (!FtpServer::vsftpd_edit) { end # end of if (enable) { # modified if Ops.get_string(event, "EventReason", "") == "ValueChanged" FtpServer.SetModified(true) end nil end |
- (Object) HandleBrowseAnon(key, event)
Handle function of “Browse” handling value in textentry of “Umask for Anonynmous Users”
781 782 783 784 785 786 787 788 789 |
# File '../../src/include/ftp-server/wid_functions.rb', line 781 def HandleBrowseAnon(key, event) event = deep_copy(event) = Ops.get(event, "ID") if == "BrowseAnon" val = UI.AskForExistingDirectory("/", _("Select directory")) UI.ChangeWidget(Id("FtpDirAnon"), :Value, val) end nil end |
- (Object) HandleBrowseCertFile(key, event)
Handle function of “Browse” handling value in textentry of “DSA Certificate to Use for SSL Encrypted Connections”
1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1660 def HandleBrowseCertFile(key, event) event = deep_copy(event) = Ops.get(event, "ID") if == "BrowseCertFile" val = UI.AskForExistingFile("/", "*.*", _("Select File")) UI.ChangeWidget(Id("CertFile"), :Value, val) end nil end |
- (Object) HandleBrowseLocal(key, event)
Handle function of “Browse” handling value in textentry of “Umask for Authenticated Users”
819 820 821 822 823 824 825 826 827 |
# File '../../src/include/ftp-server/wid_functions.rb', line 819 def HandleBrowseLocal(key, event) event = deep_copy(event) = Ops.get(event, "ID") if == "BrowseLocal" val = UI.AskForExistingDirectory("/", _("Select directory")) UI.ChangeWidget(Id("FtpDirLocal"), :Value, val) end nil end |
- (Object) HandleEnableUpload(key, event)
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”
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1027 def HandleEnableUpload(key, event) event = deep_copy(event) = Ops.get(event, "ID") #Popup::Message("Hello world"); if Mode.normal anon_upload = false anon_create_dirs = false yesno_comment = "" yesno_question = "" check_upload = Convert.to_boolean( UI.QueryWidget(Id("EnableUpload"), :Value) ) if == "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 end # end of if (button == "EnableUpload") { anon_upload = Convert.to_boolean( UI.QueryWidget(Id("AnonReadOnly"), :Value) ) anon_create_dirs = Convert.to_boolean( UI.QueryWidget(Id("AnonCreatDirs"), :Value) ) if ( == "AnonReadOnly" || anon_upload && check_upload) && @ask_again if !FtpServer.create_upload_dir yesno_question = Builtins.sformat( _("Create the \"upload\" directory in %1\n"), FtpServer.anon_homedir ) yesno_question = Ops.add( yesno_question, _("and enable write access?\n") ) yesno_comment = _( "If you want anonymous users to be able to upload,\n" + " you need to create a directory with write access.\n" + "\n" ) yesno_comment = Ops.add( Ops.add(yesno_comment, FtpServer.anon_homedir), _(" is a home directory after the login of anonymous users.") ) FtpServer.create_upload_dir = Popup.YesNoHeadline( yesno_question, yesno_comment ) @ask_again = FtpServer.create_upload_dir FtpServer. = true elsif !FtpServer. yesno_question = Ops.add( Ops.add( _("Do you want to change permissions\nfor\n"), FtpServer.anon_homedir ), _("Upload (allow writing)?") ) yesno_comment = _( "To allow anonymous users to upload, you need a directory with write access.\n\n" ) yesno_comment = Ops.add( Ops.add(yesno_comment, FtpServer.anon_homedir), _(" is a home directory after the login of anonymous users.") ) FtpServer. = Popup.YesNoHeadline( yesno_question, yesno_comment ) @ask_again = FtpServer. end end if ( == "AnonCreatDirs" || anon_create_dirs && check_upload) && @ask_again if !FtpServer.create_upload_dir yesno_question = Ops.add( Ops.add( _("Do you want to create a directory?\n"), FtpServer.anon_homedir ), _("Upload with write access?") ) yesno_comment = _( "If you want to allow anonymous users to create directories,\n" + " you have to create a directory with write access.\n" + "\n" ) yesno_comment = Ops.add( Ops.add(yesno_comment, FtpServer.anon_homedir), _(" is a home directory after the login of anonymous users.") ) FtpServer.create_upload_dir = Popup.YesNoHeadline( yesno_question, yesno_comment ) @ask_again = FtpServer.create_upload_dir FtpServer. = true elsif !FtpServer. yesno_question = Ops.add( Ops.add( _("Do you want to change permissions\nfor\n"), FtpServer.anon_homedir ), _("Upload (allow writing)?") ) yesno_comment = _( "If you want anonymous users to be able to create directories,\n" + " you need a directory with write access.\n" + "\n" ) yesno_comment = Ops.add( Ops.add(yesno_comment, FtpServer.anon_homedir), _(" is a home directory after the login of anonymous users.") ) FtpServer. = Popup.YesNoHeadline( yesno_question, yesno_comment ) @ask_again = FtpServer. end end end # end of if (Mode::normal()) { # modified if Ops.get_string(event, "EventReason", "") == "ValueChanged" FtpServer.SetModified(true) end nil end |
- (Object) HandlePassiveMode(key, event)
Handle function of “Enable Passive Mode” handling enable/disable widgets
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1374 def HandlePassiveMode(key, event) event = deep_copy(event) value = Convert.to_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) end # modified if Ops.get_string(event, "EventReason", "") == "ValueChanged" FtpServer.SetModified(true) end nil end |
- (Object) HandleRBVsPure(key, event)
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
# File '../../src/include/ftp-server/wid_functions.rb', line 477 def HandleRBVsPure(key, event) event = deep_copy(event) if FtpServer.vsftpd_edit && Convert.to_boolean(UI.QueryWidget(Id("pure_item"), :Value)) && FtpServer.vsftpd_installed FtpServer.vsftpd_edit = false return :pureftpd end if !FtpServer.vsftpd_edit && Convert.to_boolean(UI.QueryWidget(Id("vs_item"), :Value)) && FtpServer.pureftpd_installed FtpServer.vsftpd_edit = true return :vsftpd end nil end |
- (Object) HandleSSLEnable(key, event)
Handle function of “Enable SSL” handling enable/disable widgets“
1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1495 def HandleSSLEnable(key, event) event = deep_copy(event) value = Convert.to_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) end # modified if Ops.get_string(event, "EventReason", "") == "ValueChanged" FtpServer.SetModified(true) end nil end |
- (Object) HandleUniversal(key, event)
Handle function only save info about changes
533 534 535 536 537 538 539 540 |
# File '../../src/include/ftp-server/wid_functions.rb', line 533 def HandleUniversal(key, event) event = deep_copy(event) # modified if Ops.get_string(event, "EventReason", "") == "ValueChanged" FtpServer.SetModified(true) end nil end |
- (Object) InitAnonAuthen(key)
Init function of “Enable/Disable Anonymous and Local Users” radiobuttongroup
973 974 975 976 977 978 979 980 981 982 983 984 |
# File '../../src/include/ftp-server/wid_functions.rb', line 973 def InitAnonAuthen(key) authentication = Builtins.tointeger(FtpServer.ValueUIEdit("AnonAuthen")) if authentication == 0 UI.ChangeWidget(Id("AnonAuthen"), :Value, "anon_only") elsif authentication == 1 UI.ChangeWidget(Id("AnonAuthen"), :Value, "local_only") else UI.ChangeWidget(Id("AnonAuthen"), :Value, "both") end nil end |
- (Object) InitAnonCreatDirs(key)
Init function of “Anonymous Can Create Directories” checkbox
1266 1267 1268 1269 1270 1271 1272 1273 1274 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1266 def InitAnonCreatDirs(key) UI.ChangeWidget( Id("AnonCreatDirs"), :Value, FtpServer.ValueUIEdit("AnonCreatDirs") == "YES" ) nil end |
- (Object) InitAnonMaxRate(key)
Init function of “Anonymous Max Rate [KB/s]” intfield
943 944 945 946 947 948 949 950 951 |
# File '../../src/include/ftp-server/wid_functions.rb', line 943 def InitAnonMaxRate(key) UI.ChangeWidget( Id("AnonMaxRate"), :Value, Builtins.tointeger(FtpServer.ValueUIEdit("AnonMaxRate")) ) nil end |
- (Object) InitAnonReadOnly(key)
Init function of “Anonymous Can Upload” checkbox
1179 1180 1181 1182 1183 1184 1185 1186 1187 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1179 def InitAnonReadOnly(key) UI.ChangeWidget( Id("AnonReadOnly"), :Value, FtpServer.ValueUIEdit("AnonReadOnly") == "NO" ) nil end |
- (Object) InitAntiWarez(key)
Init function of “Disable Downloading Unvalidated Data” checkbox
1674 1675 1676 1677 1678 1679 1680 1681 1682 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1674 def InitAntiWarez(key) UI.ChangeWidget( Id("AntiWarez"), :Value, FtpServer.ValueUIEdit("AntiWarez") == "YES" ) nil end |
- (Object) InitBanner(key)
Init function “Wellcome Message” for general settings change ValidChars for textentry only vsftpd
526 527 528 529 530 |
# File '../../src/include/ftp-server/wid_functions.rb', line 526 def InitBanner(key) UI.ChangeWidget(Id("Banner"), :Value, FtpServer.ValueUIEdit("Banner")) nil end |
- (Object) InitCertFile(key)
Init function of “DSA Certificate to Use for SSL Encrypted Connections” intfield
1622 1623 1624 1625 1626 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1622 def InitCertFile(key) UI.ChangeWidget(Id("CertFile"), :Value, FtpServer.ValueUIEdit("CertFile")) nil end |
- (Object) InitChrootEnable(key)
Init function “Chroot Everyone” for general settings check_box
557 558 559 560 561 562 563 564 565 |
# File '../../src/include/ftp-server/wid_functions.rb', line 557 def InitChrootEnable(key) UI.ChangeWidget( Id("ChrootEnable"), :Value, FtpServer.ValueUIEdit("ChrootEnable") == "YES" ) nil end |
- (Object) InitEnableUpload(key)
Init function of “Enable Upload” checkbox
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1007 def InitEnableUpload(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) end nil end |
- (Object) InitFtpDirAnon(key)
Init function of “Ftp Directory for Anonymous Users” textentry
704 705 706 707 708 709 710 711 712 713 714 715 716 717 |
# File '../../src/include/ftp-server/wid_functions.rb', line 704 def InitFtpDirAnon(key) if Ops.get(FtpServer.EDIT_SETTINGS, "VirtualUser") == "YES" UI.ChangeWidget(Id("FtpDirAnon"), :Enabled, false) UI.ChangeWidget(Id("BrowseAnon"), :Enabled, false) else UI.ChangeWidget( Id("FtpDirAnon"), :Value, FtpServer.ValueUIEdit("FtpDirAnon") ) end nil end |
- (Object) InitFtpDirLocal(key)
Init function of “Ftp Directory for Authenticated Users” textentry
794 795 796 797 798 799 800 801 802 |
# File '../../src/include/ftp-server/wid_functions.rb', line 794 def InitFtpDirLocal(key) UI.ChangeWidget( Id("FtpDirLocal"), :Value, FtpServer.ValueUIEdit("FtpDirLocal") ) nil end |
- (Object) initialize_ftp_server_wid_functions(include_target)
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File '../../src/include/ftp-server/wid_functions.rb', line 11 def initialize_ftp_server_wid_functions(include_target) Yast.import "UI" textdomain "ftp-server" Yast.import "Popup" Yast.import "Wizard" Yast.import "Service" Yast.import "Users" Yast.import "Mode" Yast.import "FileUtils" Yast.import "Label" Yast.import "FtpServer" # variable signifies repeat asking about upload file # only for vsftpd # # internal boolean variable @ask_again = true end |
- (Object) InitLocalMaxRate(key)
Init function of “Local Max Rate [KB/s]” intfield
917 918 919 920 921 922 923 924 925 |
# File '../../src/include/ftp-server/wid_functions.rb', line 917 def InitLocalMaxRate(key) UI.ChangeWidget( Id("LocalMaxRate"), :Value, Builtins.tointeger(FtpServer.ValueUIEdit("LocalMaxRate")) ) nil end |
- (Object) InitMaxClientsNumber(key)
Init function of “Max Clients” intfield
890 891 892 893 894 895 896 897 898 |
# File '../../src/include/ftp-server/wid_functions.rb', line 890 def InitMaxClientsNumber(key) UI.ChangeWidget( Id("MaxClientsNumber"), :Value, Builtins.tointeger(FtpServer.ValueUIEdit("MaxClientsNumber")) ) nil end |
- (Object) InitMaxClientsPerIP(key)
Init function of “Max Clients for One IP” intfield
863 864 865 866 867 868 869 870 871 |
# File '../../src/include/ftp-server/wid_functions.rb', line 863 def InitMaxClientsPerIP(key) UI.ChangeWidget( Id("MaxClientsPerIP"), :Value, Builtins.tointeger(FtpServer.ValueUIEdit("MaxClientsPerIP")) ) nil end |
- (Object) InitMaxIdleTime(key)
Init function of “Max Idle Time [minutes]” intfield
836 837 838 839 840 841 842 843 844 |
# File '../../src/include/ftp-server/wid_functions.rb', line 836 def InitMaxIdleTime(key) UI.ChangeWidget( Id("MaxIdleTime"), :Value, Builtins.tointeger(FtpServer.ValueUIEdit("MaxIdleTime")) ) nil end |
- (Object) InitPasMaxPort(key)
Init function of “Max Port for Pas. Mode” intfield
1438 1439 1440 1441 1442 1443 1444 1445 1446 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1438 def InitPasMaxPort(key) UI.ChangeWidget( Id("PasMaxPort"), :Value, Builtins.tointeger(FtpServer.ValueUIEdit("PasMaxPort")) ) nil end |
- (Object) InitPasMinPort(key)
Init function of “Min Port for Pas. Mode” intfield
1408 1409 1410 1411 1412 1413 1414 1415 1416 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1408 def InitPasMinPort(key) UI.ChangeWidget( Id("PasMinPort"), :Value, Builtins.tointeger(FtpServer.ValueUIEdit("PasMinPort")) ) nil end |
- (Object) InitPassiveMode(key)
Init function of “Enable Passive Mode” checkbox
also include handling enable/disable Min and Max Ports handling intfields
1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1360 def InitPassiveMode(key) UI.ChangeWidget(Id("PassiveMode"), :Notify, true) UI.ChangeWidget( Id("PassiveMode"), :Value, FtpServer.ValueUIEdit("PassiveMode") == "YES" ) nil end |
- (Object) InitRBVsPure(key)
Init function for general settings save values to temporary structure
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File '../../src/include/ftp-server/wid_functions.rb', line 439 def InitRBVsPure(key) if FtpServer.vsftpd_installed && FtpServer.pureftpd_installed if FtpServer.vsftpd_edit UI.ChangeWidget(Id("vs_item"), :Value, true) else UI.ChangeWidget(Id("pure_item"), :Value, true) end elsif FtpServer.vsftpd_installed && !FtpServer.pureftpd_installed UI.ChangeWidget(Id("vs_item"), :Value, true) UI.ChangeWidget(Id("pure_item"), :Enabled, false) UI.ChangeWidget(Id("vs_item"), :Enabled, false) elsif !FtpServer.vsftpd_installed && FtpServer.pureftpd_installed UI.ChangeWidget(Id("pure_item"), :Value, true) UI.ChangeWidget(Id("pure_item"), :Enabled, false) UI.ChangeWidget(Id("vs_item"), :Enabled, false) else UI.ChangeWidget(Id("pure_item"), :Enabled, false) UI.ChangeWidget(Id("vs_item"), :Enabled, false) end if !Mode.normal # Autoyast configuration module does not take care about installed # packages (installed ftp-servers). As we are using vsftpd # in autoyast (SLES) only, we are disabling the selection of # different ftp servers. (bnc#888212) if FtpServer.vsftpd_edit || Mode.config UI.ChangeWidget(Id("vs_item"), :Value, true) else UI.ChangeWidget(Id("pure_item"), :Value, true) end UI.ChangeWidget(Id("pure_item"), :Enabled, false) UI.ChangeWidget(Id("vs_item"), :Enabled, false) end nil end |
- (Object) InitSSL(key)
Init function of “Security Settings” checkbox
1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1700 def InitSSL(key) security = Builtins.tointeger(FtpServer.ValueUIEdit("SSL")) if security == 0 UI.ChangeWidget(Id("SSL"), :Value, "disable") elsif security == 1 UI.ChangeWidget(Id("SSL"), :Value, "accept") else UI.ChangeWidget(Id("SSL"), :Value, "refuse") end nil end |
- (Object) InitSSLEnable(key)
Init function of “Enable SSL” checkbox
also include handling enable/disable SSL v2/3/TLS and Certificate handling checkboxes and textentry
1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1482 def InitSSLEnable(key) UI.ChangeWidget(Id("SSLEnable"), :Notify, true) UI.ChangeWidget( Id("SSLEnable"), :Value, FtpServer.ValueUIEdit("SSLEnable") == "YES" ) nil end |
- (Object) InitSSLv2(key)
Init function of “Enable SSL v2” intfield
also include handling enable/disable SSL handling checkboxframe
1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1538 def InitSSLv2(key) UI.ChangeWidget( Id("SSLv2"), :Value, FtpServer.ValueUIEdit("SSLv2") == "YES" ) UI.ChangeWidget( Id("SSLEnable"), :Value, FtpServer.ValueUIEdit("SSLEnable") == "YES" ) nil end |
- (Object) InitSSLv3(key)
Init function of “Enable SSL v3” intfield
1574 1575 1576 1577 1578 1579 1580 1581 1582 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1574 def InitSSLv3(key) UI.ChangeWidget( Id("SSLv3"), :Value, FtpServer.ValueUIEdit("SSLv3") == "YES" ) nil end |
- (Object) InitStartStopRestart(key)
Init function for start-up
init starting via xinetd and update status
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
# File '../../src/include/ftp-server/wid_functions.rb', line 498 def InitStartStopRestart(key) if FtpServer.pure_ftp_xinetd_running && !FtpServer.vsftpd_edit UI.ReplaceWidget( Id("_cwm_service_status_rp"), Label(_("FTP is running")) ) UI.ChangeWidget(Id("_cwm_start_service_now"), :Enabled, false) UI.ChangeWidget(Id("_cwm_stop_service_now"), :Enabled, true) end if FtpServer.vsftp_xinetd_running && FtpServer.vsftpd_edit UI.ReplaceWidget( Id("_cwm_service_status_rp"), Label(_("FTP is running")) ) UI.ChangeWidget(Id("_cwm_start_service_now"), :Enabled, false) UI.ChangeWidget(Id("_cwm_stop_service_now"), :Enabled, true) end nil end |
- (Object) InitTLS(key)
Init function of “Enable TLS” intfield
1600 1601 1602 1603 1604 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1600 def InitTLS(key) UI.ChangeWidget(Id("TLS"), :Value, FtpServer.ValueUIEdit("TLS") == "YES") nil end |
- (Object) InitUmask(key)
Init function “Umask (umask files:umask dirs)” for general settings change ValidChars for textentry only pure-ftpd
606 607 608 609 610 611 |
# File '../../src/include/ftp-server/wid_functions.rb', line 606 def InitUmask(key) UI.ChangeWidget(Id("Umask"), :ValidChars, "01234567:") UI.ChangeWidget(Id("Umask"), :Value, FtpServer.ValueUIEdit("Umask")) nil end |
- (Object) InitUmaskAnon(key)
Init function “Umask for Anonymous” for general settings change ValidChars for textentry only vsftpd
648 649 650 651 652 653 654 655 656 657 |
# File '../../src/include/ftp-server/wid_functions.rb', line 648 def InitUmaskAnon(key) UI.ChangeWidget(Id("UmaskAnon"), :ValidChars, "01234567") UI.ChangeWidget( Id("UmaskAnon"), :Value, FtpServer.ValueUIEdit("UmaskAnon") ) nil end |
- (Object) InitUmaskLocal(key)
Init function “Umask for Authenticated Users” for general settings change ValidChars for textentry only vsftpd
677 678 679 680 681 682 683 684 685 686 |
# File '../../src/include/ftp-server/wid_functions.rb', line 677 def InitUmaskLocal(key) UI.ChangeWidget(Id("UmaskLocal"), :ValidChars, "01234567") UI.ChangeWidget( Id("UmaskLocal"), :Value, FtpServer.ValueUIEdit("UmaskLocal") ) nil end |
- (Object) InitVerboseLogging(key)
Init function “Verbose Logging” for general settings check_box
581 582 583 584 585 586 587 588 589 |
# File '../../src/include/ftp-server/wid_functions.rb', line 581 def InitVerboseLogging(key) UI.ChangeWidget( Id("VerboseLogging"), :Value, FtpServer.ValueUIEdit("VerboseLogging") == "YES" ) nil end |
- (Object) SaveAndRestartPure
Function saves configuration and restarts pure-ftpd
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File '../../src/include/ftp-server/wid_functions.rb', line 385 def SaveAndRestartPure result = false result = StopNowPure() UpdateInfoAboutStartingFTP() if Ops.get(FtpServer.EDIT_SETTINGS, "StartDaemon") == "2" && Service.Status("vsftpd") != 0 result = AskStartXinetd() #write settings to disk... FtpServer.WriteSettings if !result if Service.Status("xinetd") == 0 || Ops.get(FtpServer.EDIT_SETTINGS, "StartXinetd") == "YES" result = true end end FtpServer.stop_daemon_xinetd = false if FtpServer.WriteStartViaXinetd(true, false) && result FtpServer.pure_ftp_xinetd_running = true UI.ReplaceWidget( Id("_cwm_service_status_rp"), Label(_("FTP is running")) ) UI.ChangeWidget(Id("_cwm_start_service_now"), :Enabled, false) UI.ChangeWidget(Id("_cwm_stop_service_now"), :Enabled, true) result = true end else #write settings to disk... FtpServer.WriteSettings command = "rcpure-ftpd start" = Convert.to_map( SCR.Execute(path(".target.bash_output"), command) ) Builtins.y2milestone( "[ftp-server] (StopNowPure) command for save and restart pure-ftpd: %1 output: %2", command, ) if Ops.get(, "exit") == 0 result = true else result = false end end result = FtpServer.WriteUpload result end |
- (Object) SaveAndRestartVsftpd
Function saves configuration and restarts vsftpd
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File '../../src/include/ftp-server/wid_functions.rb', line 240 def SaveAndRestartVsftpd result = false result = StopNowVsftpd() UpdateInfoAboutStartingFTP() if Ops.get(FtpServer.EDIT_SETTINGS, "StartDaemon") == "2" && Service.Status("pure-ftpd") != 0 result = AskStartXinetd() #write settings to disk... FtpServer.WriteSettings if !result if Service.Status("xinetd") == 0 || Ops.get(FtpServer.EDIT_SETTINGS, "StartXinetd") == "YES" result = true end end FtpServer.stop_daemon_xinetd = false if FtpServer.WriteStartViaXinetd(true, false) && result FtpServer.vsftp_xinetd_running = true UI.ReplaceWidget( Id("_cwm_service_status_rp"), Label(_("FTP is running")) ) UI.ChangeWidget(Id("_cwm_start_service_now"), :Enabled, false) UI.ChangeWidget(Id("_cwm_stop_service_now"), :Enabled, true) result = true end else FtpServer.WriteSettings command = "rcvsftpd start" = Convert.to_map( SCR.Execute(path(".target.bash_output"), command) ) Builtins.y2milestone( "[ftp-server] (SaveAndRestartVsftpd) command for save and restart vsftpd: %1 output: %2", command, ) if Ops.get(, "exit") == 0 result = true else result = false end end FtpServer.WriteUpload result end |
- (Object) SetEnableService(enable_service)
CWMServiceStart function with one boolean parameter returning boolean value that says if the service will be started at boot.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File '../../src/include/ftp-server/wid_functions.rb', line 48 def SetEnableService(enable_service) if Builtins.size(FtpServer.EDIT_SETTINGS) == 0 FtpServer.EDIT_SETTINGS = deep_copy(FtpServer.DEFAULT_CONFIG) end if enable_service Ops.set(FtpServer.EDIT_SETTINGS, "StartDaemon", "1") Ops.set(FtpServer.EDIT_SETTINGS, "StartXinetd", "NO") end nil end |
- (Object) SetStartedViaXinetd(enable_service)
CWMServiceStart function with one boolean parameter returning boolean value that says if the service will be started at boot.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File '../../src/include/ftp-server/wid_functions.rb', line 111 def SetStartedViaXinetd(enable_service) result = true if enable_service Ops.set(FtpServer.EDIT_SETTINGS, "StartDaemon", "2") result = AskStartXinetd() result = true if Service.Status("xinetd") == 0 if !result if result Ops.set(FtpServer.EDIT_SETTINGS, "StartXinetd", "YES") else Ops.set(FtpServer.EDIT_SETTINGS, "StartXinetd", "NO") end else Ops.set(FtpServer.EDIT_SETTINGS, "StartDaemon", "0") Ops.set(FtpServer.EDIT_SETTINGS, "StartXinetd", "NO") end nil end |
- (Object) StartNowPure
Function start pure-ftpd
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
# File '../../src/include/ftp-server/wid_functions.rb', line 295 def StartNowPure result = false UpdateInfoAboutStartingFTP() if Ops.get(FtpServer.EDIT_SETTINGS, "StartDaemon") == "2" && Service.Status("vsftpd") != 0 FtpServer.stop_daemon_xinetd = false result = AskStartXinetd() if !result if Service.Status("xinetd") == 0 || Ops.get(FtpServer.EDIT_SETTINGS, "StartXinetd") == "YES" result = true end end if FtpServer.WriteStartViaXinetd(true, true) && result FtpServer.pure_ftp_xinetd_running = true FtpServer.vsftp_xinetd_running = false UI.ReplaceWidget( Id("_cwm_service_status_rp"), Label(_("FTP is running")) ) UI.ChangeWidget(Id("_cwm_start_service_now"), :Enabled, false) UI.ChangeWidget(Id("_cwm_stop_service_now"), :Enabled, true) result = true end else SCR.Write(Builtins.add(path(".pure-ftpd"), "Daemonize"), "YES") SCR.Write(path(".pure-ftpd"), nil) command = "rcpure-ftpd start" = Convert.to_map( SCR.Execute(path(".target.bash_output"), command) ) Builtins.y2milestone( "[ftp-server] (StartNowPure) command for start pure-ftpd: %1 output: %2", command, ) if Ops.get(, "exit") == 0 result = true else result = false end end result end |
- (Object) StartNowVsftpd
Function start vsftpd
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File '../../src/include/ftp-server/wid_functions.rb', line 148 def StartNowVsftpd result = false UpdateInfoAboutStartingFTP() if Ops.get(FtpServer.EDIT_SETTINGS, "StartDaemon") == "2" && Service.Status("pure-ftpd") != 0 SCR.Write(Builtins.add(path(".vsftpd"), "listen"), nil) SCR.Write(Builtins.add(path(".vsftpd"), "listen_ipv6"), nil) SCR.Write(path(".vsftpd"), nil) FtpServer.stop_daemon_xinetd = false result = AskStartXinetd() if !result if Service.Status("xinetd") == 0 || Ops.get(FtpServer.EDIT_SETTINGS, "StartXinetd") == "YES" result = true end end if FtpServer.WriteStartViaXinetd(true, true) && result FtpServer.vsftp_xinetd_running = true FtpServer.pure_ftp_xinetd_running = false UI.ReplaceWidget( Id("_cwm_service_status_rp"), Label(_("FTP is running")) ) UI.ChangeWidget(Id("_cwm_start_service_now"), :Enabled, false) UI.ChangeWidget(Id("_cwm_stop_service_now"), :Enabled, true) result = true end else SCR.Write(Builtins.add(path(".vsftpd"), "listen"), "YES") SCR.Write(Builtins.add(path(".vsftpd"), "listen_ipv6"), nil) SCR.Write(path(".vsftpd"), nil) command = "rcvsftpd start" = Convert.to_map( SCR.Execute(path(".target.bash_output"), command) ) Builtins.y2milestone( "[ftp-server] (StartNowVsftpd) command for starting vsftpd: %1 output: %2", command, ) if Ops.get(, "exit") == 0 result = true else result = false end end result end |
- (Object) StopNowPure
Function stop pure-ftpd
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File '../../src/include/ftp-server/wid_functions.rb', line 348 def StopNowPure result = false if FtpServer.pure_ftp_xinetd_running #Popup::Message(_("This is not supported via xinetd now.")); FtpServer.stop_daemon_xinetd = true if FtpServer.WriteStartViaXinetd(true, true) FtpServer.pure_ftp_xinetd_running = false UI.ReplaceWidget( Id("_cwm_service_status_rp"), Label(_("FTP is not running")) ) UI.ChangeWidget(Id("_cwm_start_service_now"), :Enabled, true) UI.ChangeWidget(Id("_cwm_stop_service_now"), :Enabled, false) result = true end else command = "rcpure-ftpd stop" = Convert.to_map( SCR.Execute(path(".target.bash_output"), command) ) Builtins.y2milestone( "[ftp-server] (StopNowPure) command for stop pure-ftpd: %1 output: %2", command, ) if Ops.get(, "exit") == 0 result = true else result = false end end result end |
- (Object) StopNowVsftpd
Function stop vsftpd
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File '../../src/include/ftp-server/wid_functions.rb', line 203 def StopNowVsftpd result = false #UpdateInfoAboutStartingFTP (); if FtpServer.vsftp_xinetd_running FtpServer.stop_daemon_xinetd = true if FtpServer.WriteStartViaXinetd(true, true) FtpServer.vsftp_xinetd_running = false UI.ReplaceWidget( Id("_cwm_service_status_rp"), Label(_("FTP is not running")) ) UI.ChangeWidget(Id("_cwm_start_service_now"), :Enabled, true) UI.ChangeWidget(Id("_cwm_stop_service_now"), :Enabled, false) result = true end else command = "rcvsftpd stop" = Convert.to_map( SCR.Execute(path(".target.bash_output"), command) ) Builtins.y2milestone( "[ftp-server] (StopNowVsftpd) command for stop vsftpd: %1 output: %2", command, ) if Ops.get(, "exit") == 0 result = true else result = false end end result end |
- (Object) StoreAnonAuthen(key, event)
Store function of “Enable/Disable Anonymous and Local Users” save value to temporary structure
989 990 991 992 993 994 995 996 997 998 999 1000 1001 |
# File '../../src/include/ftp-server/wid_functions.rb', line 989 def StoreAnonAuthen(key, event) event = deep_copy(event) radiobut = Convert.to_string(UI.QueryWidget(Id("AnonAuthen"), :Value)) if radiobut == "anon_only" FtpServer.WriteToEditMap("AnonAuthen", "0") elsif radiobut == "local_only" FtpServer.WriteToEditMap("AnonAuthen", "1") else FtpServer.WriteToEditMap("AnonAuthen", "2") end nil end |
- (Object) StoreAnonCreatDirs(key, event)
Store function of “Anonymous Can Create Directories” save value to temporary structure
1340 1341 1342 1343 1344 1345 1346 1347 1348 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1340 def StoreAnonCreatDirs(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "AnonCreatDirs", Convert.to_boolean(UI.QueryWidget(Id("AnonCreatDirs"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreAnonMaxRate(key, event)
Store function of “Anonymous Max Rate [KB/s]” save values to temporary structure
956 957 958 959 960 961 962 963 964 |
# File '../../src/include/ftp-server/wid_functions.rb', line 956 def StoreAnonMaxRate(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "AnonMaxRate", Builtins.tostring(UI.QueryWidget(Id("AnonMaxRate"), :Value)) ) nil end |
- (Object) StoreAnonReadOnly(key, event)
Store function of “Anonymous Can Upload” save value to temporary structure
1253 1254 1255 1256 1257 1258 1259 1260 1261 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1253 def StoreAnonReadOnly(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "AnonReadOnly", Convert.to_boolean(UI.QueryWidget(Id("AnonReadOnly"), :Value)) == true ? "NO" : "YES" ) nil end |
- (Object) StoreAntiWarez(key, event)
Store function of “Disable Downloading Unvalidated Data” save value to temporary structure
1687 1688 1689 1690 1691 1692 1693 1694 1695 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1687 def StoreAntiWarez(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "AntiWarez", Convert.to_boolean(UI.QueryWidget(Id("AntiWarez"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreBanner(key, event)
Store function of “Wellcome Message” save values to temporary structure only vsftpd
545 546 547 548 549 550 551 552 553 |
# File '../../src/include/ftp-server/wid_functions.rb', line 545 def StoreBanner(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "Banner", Builtins.tostring(UI.QueryWidget(Id("Banner"), :Value)) ) nil end |
- (Object) StoreCertFile(key, event)
Store function of “DSA Certificate to Use for SSL Encrypted Connections” save value to temporary structure
1648 1649 1650 1651 1652 1653 1654 1655 1656 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1648 def StoreCertFile(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "CertFile", Builtins.tostring(UI.QueryWidget(Id("CertFile"), :Value)) ) nil end |
- (Object) StoreChrootEnable(key, event)
Store function of “Chroot Everyone” save values to temporary structure
569 570 571 572 573 574 575 576 577 |
# File '../../src/include/ftp-server/wid_functions.rb', line 569 def StoreChrootEnable(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "ChrootEnable", Convert.to_boolean(UI.QueryWidget(Id("ChrootEnable"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreEnableUpload(key, event)
Store function of “Enable Upload” save value to temporary structure
1164 1165 1166 1167 1168 1169 1170 1171 1172 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1164 def StoreEnableUpload(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "EnableUpload", Convert.to_boolean(UI.QueryWidget(Id("EnableUpload"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreFtpDirAnon(key, event)
Store function of “Ftp Directory for Anon&ymous Users” save values to temporary structure
767 768 769 770 771 772 773 774 775 776 777 |
# File '../../src/include/ftp-server/wid_functions.rb', line 767 def StoreFtpDirAnon(key, event) event = deep_copy(event) if Ops.get(FtpServer.EDIT_SETTINGS, "VirtualUser") == "NO" FtpServer.WriteToEditMap( "FtpDirAnon", Builtins.tostring(UI.QueryWidget(Id("FtpDirAnon"), :Value)) ) end nil end |
- (Object) StoreFtpDirLocal(key, event)
Store function of “Umask for Authenticated Users” save values to temporary structure
807 808 809 810 811 812 813 814 815 |
# File '../../src/include/ftp-server/wid_functions.rb', line 807 def StoreFtpDirLocal(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "FtpDirLocal", Builtins.tostring(UI.QueryWidget(Id("FtpDirLocal"), :Value)) ) nil end |
- (Object) StoreLocalMaxRate(key, event)
Store function of “Local Max Rate [KB/s]” save values to temporary structure
930 931 932 933 934 935 936 937 938 |
# File '../../src/include/ftp-server/wid_functions.rb', line 930 def StoreLocalMaxRate(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "LocalMaxRate", Builtins.tostring(UI.QueryWidget(Id("LocalMaxRate"), :Value)) ) nil end |
- (Object) StoreMaxClientsNumber(key, event)
Store function of “Max Clients” save values to temporary structure
903 904 905 906 907 908 909 910 911 |
# File '../../src/include/ftp-server/wid_functions.rb', line 903 def StoreMaxClientsNumber(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "MaxClientsNumber", Builtins.tostring(UI.QueryWidget(Id("MaxClientsNumber"), :Value)) ) nil end |
- (Object) StoreMaxClientsPerIP(key, event)
Store function of “Max Clients for One IP” save values to temporary structure
876 877 878 879 880 881 882 883 884 |
# File '../../src/include/ftp-server/wid_functions.rb', line 876 def StoreMaxClientsPerIP(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "MaxClientsPerIP", Builtins.tostring(UI.QueryWidget(Id("MaxClientsPerIP"), :Value)) ) nil end |
- (Object) StoreMaxIdleTime(key, event)
Store function of “Max Idle Time [minutes]” save values to temporary structure
849 850 851 852 853 854 855 856 857 |
# File '../../src/include/ftp-server/wid_functions.rb', line 849 def StoreMaxIdleTime(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "MaxIdleTime", Builtins.tostring(UI.QueryWidget(Id("MaxIdleTime"), :Value)) ) nil end |
- (Object) StorePasMaxPort(key, event)
Store function of “Max Port for Pas. Mode” save values to temporary structure
1467 1468 1469 1470 1471 1472 1473 1474 1475 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1467 def StorePasMaxPort(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "PasMaxPort", Builtins.tostring(UI.QueryWidget(Id("PasMaxPort"), :Value)) ) nil end |
- (Object) StorePasMinPort(key, event)
Store function of “Min Port for Pas. Mode” save values to temporary structure
1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1421 def StorePasMinPort(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "PasMinPort", Builtins.tostring(UI.QueryWidget(Id("PasMinPort"), :Value)) ) FtpServer.WriteToEditMap( "PassiveMode", Convert.to_boolean(UI.QueryWidget(Id("PassiveMode"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StorePassiveMode(key, event)
Store function of “Enable Passive Mode” save values to temporary structure
1395 1396 1397 1398 1399 1400 1401 1402 1403 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1395 def StorePassiveMode(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "PassiveMode", Convert.to_boolean(UI.QueryWidget(Id("PassiveMode"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreSSL(key, event)
Store function of “Security Settings” save value to temporary structure
1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1734 def StoreSSL(key, event) event = deep_copy(event) radiobut = Convert.to_string(UI.QueryWidget(Id("SSL"), :Value)) if radiobut == "disable" FtpServer.WriteToEditMap("SSL", "0") elsif radiobut == "accept" FtpServer.WriteToEditMap("SSL", "1") else FtpServer.WriteToEditMap("SSL", "2") end nil end |
- (Object) StoreSSLEnable(key, event)
Store function of “Enable SSL” save values to temporary structure
1523 1524 1525 1526 1527 1528 1529 1530 1531 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1523 def StoreSSLEnable(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "SSLEnable", Convert.to_boolean(UI.QueryWidget(Id("SSLEnable"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreSSLv2(key, event)
Store function of “Enable SSL v2” save values to temporary structure
also include handling value enable/disable passive mode
1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1557 def StoreSSLv2(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "SSLv2", Convert.to_boolean(UI.QueryWidget(Id("SSLv2"), :Value)) == true ? "YES" : "NO" ) FtpServer.WriteToEditMap( "SSLEnable", Convert.to_boolean(UI.QueryWidget(Id("SSLEnable"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreSSLv3(key, event)
Store function of “Enable SSL v3” save value to temporary structure
1587 1588 1589 1590 1591 1592 1593 1594 1595 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1587 def StoreSSLv3(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "SSLv3", Convert.to_boolean(UI.QueryWidget(Id("SSLv3"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreTLS(key, event)
Store function of “Enable TLS” save value to temporary structure
1609 1610 1611 1612 1613 1614 1615 1616 1617 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1609 def StoreTLS(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "TLS", Convert.to_boolean(UI.QueryWidget(Id("TLS"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) StoreUmask(key, event)
Store function of “Umask (umask files:umask dirs)” save values to temporary structure only pure-ftpd
635 636 637 638 639 640 641 642 643 |
# File '../../src/include/ftp-server/wid_functions.rb', line 635 def StoreUmask(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "Umask", Builtins.tostring(UI.QueryWidget(Id("Umask"), :Value)) ) nil end |
- (Object) StoreUmaskAnon(key, event)
Store function of “Umask for Anonymous” save values to temporary structure only vsftpd
663 664 665 666 667 668 669 670 671 |
# File '../../src/include/ftp-server/wid_functions.rb', line 663 def StoreUmaskAnon(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "UmaskAnon", Builtins.tostring(UI.QueryWidget(Id("UmaskAnon"), :Value)) ) nil end |
- (Object) StoreUmaskLocal(key, event)
Store function of “Umask for Authenticated Users” save values to temporary structure only vsftpd
691 692 693 694 695 696 697 698 699 |
# File '../../src/include/ftp-server/wid_functions.rb', line 691 def StoreUmaskLocal(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "UmaskLocal", Builtins.tostring(UI.QueryWidget(Id("UmaskLocal"), :Value)) ) nil end |
- (Object) StoreVerboseLogging(key, event)
Store function of “Verbose Logging” save values to temporary structure
593 594 595 596 597 598 599 600 601 |
# File '../../src/include/ftp-server/wid_functions.rb', line 593 def StoreVerboseLogging(key, event) event = deep_copy(event) FtpServer.WriteToEditMap( "VerboseLogging", Convert.to_boolean(UI.QueryWidget(Id("VerboseLogging"), :Value)) == true ? "YES" : "NO" ) nil end |
- (Object) UpdateInfoAboutStartingFTP
131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File '../../src/include/ftp-server/wid_functions.rb', line 131 def UpdateInfoAboutStartingFTP #which radiobutton is selected for starting "when booting", "via xinetd" or "manually" value = UI.QueryWidget(Id("_cwm_service_startup"), :Value) if Builtins.tostring(value) == "_cwm_startup_manual" Ops.set(FtpServer.EDIT_SETTINGS, "StartDaemon", "0") elsif Builtins.tostring(value) == "_cwm_startup_auto" Ops.set(FtpServer.EDIT_SETTINGS, "StartDaemon", "1") else Ops.set(FtpServer.EDIT_SETTINGS, "StartDaemon", "2") end nil end |
- (Object) ValidCertFile(key, event)
Valid function of “DSA Certificate to Use for SSL Encrypted Connections” check value if user enable SSL Certificate (textentry) doesn't be empty
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1631 def ValidCertFile(key, event) event = deep_copy(event) rsa_cert = Builtins.tostring(UI.QueryWidget(Id("CertFile"), :Value)) ssl_enable = Convert.to_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 end true end |
- (Object) ValidFtpDirAnon(key, event)
Valid function of “Ftp Directory for Anon&ymous Users” check value of textentry
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 |
# File '../../src/include/ftp-server/wid_functions.rb', line 723 def ValidFtpDirAnon(key, event) event = deep_copy(event) if !FtpServer.vsftpd_edit if Ops.get(FtpServer.EDIT_SETTINGS, "VirtualUser") == "NO" _AnonHomeDir = Convert.to_string( UI.QueryWidget(Id("FtpDirAnon"), :Value) ) #checking correct homedir for anonymous user if _AnonHomeDir != "" && Mode.normal if _AnonHomeDir != FtpServer.anon_homedir error = Users.EditUser({ "homeDirectory" => _AnonHomeDir }) if error != nil && error != "" Popup.Error(error) UI.SetFocus(Id("FtpDirAnon")) return false end uid = FtpServer.anon_uid failed = false ui_map = {} error_map = {} begin error_map = Users.CheckHomeUI(uid, _AnonHomeDir, ui_map) if error_map != {} if !Popup.YesNo(Ops.get_string(error_map, "question", "")) failed = true else Ops.set( ui_map, Ops.get_string(error_map, "question_id", ""), _AnonHomeDir ) end end end while error_map != {} && !failed end #end of if (AnonHomeDir != FtpServer::anon_homedir) { end #end of if ((AnonHomeDir != "") && (Mode::normal())) { end #end of if (FtpServer::EDIT_SETTINGS["VirtualUser"]:nil != "NO") { end #end of if (!FtpServer::vsftpd_edit) { true end |
- (Object) ValidPasMaxPort(key, event)
Valid function of “Max Port for Pas. Mode” check values Max Port >= Min Port
1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1451 def ValidPasMaxPort(key, event) event = deep_copy(event) min_port = Builtins.tointeger(UI.QueryWidget(Id("PasMinPort"), :Value)) max_port = Builtins.tointeger(UI.QueryWidget(Id("PasMaxPort"), :Value)) if Ops.greater_than(min_port, max_port) Popup.Message(_("Condition for ports is max port > min port.")) UI.SetFocus(Id("PasMinPort")) return false end true end |
- (Object) ValidSSL(key, event)
Valid function of “Security Settings” check of existing certificate
1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1716 def ValidSSL(key, event) event = deep_copy(event) current = Convert.to_string(UI.QueryWidget(Id("SSL"), :Value)) if !FileUtils.Exists("/etc/ssl/private/pure-ftpd.pem") && (current == "accept" || current == "refuse") Popup.Error( _( "The <tt>/etc/ssl/private/pure-ftpd.pem</tt> certificate for the SSL connection is missing." ) ) return false end true end |
- (Object) ValidUmask(key, event)
Valid function of “Umask (umask files:umask dirs)” check value of textentry only pure-ftpd
616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File '../../src/include/ftp-server/wid_functions.rb', line 616 def ValidUmask(key, event) event = deep_copy(event) new_umask = Convert.to_string(UI.QueryWidget(Id("Umask"), :Value)) if Ops.greater_than(Builtins.size(new_umask), 0) l = Builtins.splitstring(new_umask, ":") l = Builtins.filter(l) { |s| s != "" } if Ops.less_than(Builtins.size(l), 2) Popup.Message(_("Not a valid umask.")) UI.SetFocus(Id("Umask")) return false end end true end |