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
1275 1276 1277 1278 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 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1275 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
1188 1189 1190 1191 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 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1188 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"
777 778 779 780 781 782 783 784 785 |
# File '../../src/include/ftp-server/wid_functions.rb', line 777 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"
1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1656 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"
815 816 817 818 819 820 821 822 823 |
# File '../../src/include/ftp-server/wid_functions.rb', line 815 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"
1023 1024 1025 1026 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 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1023 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
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1370 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)
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File '../../src/include/ftp-server/wid_functions.rb', line 473 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"
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1491 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
529 530 531 532 533 534 535 536 |
# File '../../src/include/ftp-server/wid_functions.rb', line 529 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
969 970 971 972 973 974 975 976 977 978 979 980 |
# File '../../src/include/ftp-server/wid_functions.rb', line 969 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
1262 1263 1264 1265 1266 1267 1268 1269 1270 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1262 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
939 940 941 942 943 944 945 946 947 |
# File '../../src/include/ftp-server/wid_functions.rb', line 939 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
1175 1176 1177 1178 1179 1180 1181 1182 1183 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1175 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
1670 1671 1672 1673 1674 1675 1676 1677 1678 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1670 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
522 523 524 525 526 |
# File '../../src/include/ftp-server/wid_functions.rb', line 522 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
1618 1619 1620 1621 1622 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1618 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
553 554 555 556 557 558 559 560 561 |
# File '../../src/include/ftp-server/wid_functions.rb', line 553 def InitChrootEnable(key) UI.ChangeWidget( Id("ChrootEnable"), :Value, FtpServer.ValueUIEdit("ChrootEnable") == "YES" ) nil end |
- (Object) InitEnableUpload(key)
Init function of “Enable Upload” checkbox
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1003 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
700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
# File '../../src/include/ftp-server/wid_functions.rb', line 700 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
790 791 792 793 794 795 796 797 798 |
# File '../../src/include/ftp-server/wid_functions.rb', line 790 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
913 914 915 916 917 918 919 920 921 |
# File '../../src/include/ftp-server/wid_functions.rb', line 913 def InitLocalMaxRate(key) UI.ChangeWidget( Id("LocalMaxRate"), :Value, Builtins.tointeger(FtpServer.ValueUIEdit("LocalMaxRate")) ) nil end |
- (Object) InitMaxClientsNumber(key)
Init function of “Max Clients” intfield
886 887 888 889 890 891 892 893 894 |
# File '../../src/include/ftp-server/wid_functions.rb', line 886 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
859 860 861 862 863 864 865 866 867 |
# File '../../src/include/ftp-server/wid_functions.rb', line 859 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
832 833 834 835 836 837 838 839 840 |
# File '../../src/include/ftp-server/wid_functions.rb', line 832 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
1434 1435 1436 1437 1438 1439 1440 1441 1442 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1434 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
1404 1405 1406 1407 1408 1409 1410 1411 1412 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1404 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
1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1356 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 |
# 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"), :Enable, false) UI.ChangeWidget(Id("vs_item"), :Enabled, false) end if !Mode.normal if FtpServer.vsftpd_edit UI.ChangeWidget(Id("vs_item"), :Value, true) else UI.ChangeWidget(Id("pure_item"), :Value, true) end UI.ChangeWidget(Id("pure_item"), :Enable, false) UI.ChangeWidget(Id("vs_item"), :Enabled, false) end nil end |
- (Object) InitSSL(key)
Init function of “Security Settings” checkbox
1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1696 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
1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1478 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
1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1534 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
1570 1571 1572 1573 1574 1575 1576 1577 1578 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1570 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
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 |
# File '../../src/include/ftp-server/wid_functions.rb', line 494 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
1596 1597 1598 1599 1600 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1596 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
602 603 604 605 606 607 |
# File '../../src/include/ftp-server/wid_functions.rb', line 602 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
644 645 646 647 648 649 650 651 652 653 |
# File '../../src/include/ftp-server/wid_functions.rb', line 644 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
673 674 675 676 677 678 679 680 681 682 |
# File '../../src/include/ftp-server/wid_functions.rb', line 673 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
577 578 579 580 581 582 583 584 585 |
# File '../../src/include/ftp-server/wid_functions.rb', line 577 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
985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File '../../src/include/ftp-server/wid_functions.rb', line 985 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
1336 1337 1338 1339 1340 1341 1342 1343 1344 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1336 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
952 953 954 955 956 957 958 959 960 |
# File '../../src/include/ftp-server/wid_functions.rb', line 952 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
1249 1250 1251 1252 1253 1254 1255 1256 1257 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1249 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
1683 1684 1685 1686 1687 1688 1689 1690 1691 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1683 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
541 542 543 544 545 546 547 548 549 |
# File '../../src/include/ftp-server/wid_functions.rb', line 541 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
1644 1645 1646 1647 1648 1649 1650 1651 1652 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1644 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
565 566 567 568 569 570 571 572 573 |
# File '../../src/include/ftp-server/wid_functions.rb', line 565 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
1160 1161 1162 1163 1164 1165 1166 1167 1168 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1160 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
763 764 765 766 767 768 769 770 771 772 773 |
# File '../../src/include/ftp-server/wid_functions.rb', line 763 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
803 804 805 806 807 808 809 810 811 |
# File '../../src/include/ftp-server/wid_functions.rb', line 803 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
926 927 928 929 930 931 932 933 934 |
# File '../../src/include/ftp-server/wid_functions.rb', line 926 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
899 900 901 902 903 904 905 906 907 |
# File '../../src/include/ftp-server/wid_functions.rb', line 899 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
872 873 874 875 876 877 878 879 880 |
# File '../../src/include/ftp-server/wid_functions.rb', line 872 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
845 846 847 848 849 850 851 852 853 |
# File '../../src/include/ftp-server/wid_functions.rb', line 845 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
1463 1464 1465 1466 1467 1468 1469 1470 1471 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1463 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
1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1417 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
1391 1392 1393 1394 1395 1396 1397 1398 1399 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1391 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
1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1730 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
1519 1520 1521 1522 1523 1524 1525 1526 1527 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1519 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
1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1553 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
1583 1584 1585 1586 1587 1588 1589 1590 1591 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1583 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
1605 1606 1607 1608 1609 1610 1611 1612 1613 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1605 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
631 632 633 634 635 636 637 638 639 |
# File '../../src/include/ftp-server/wid_functions.rb', line 631 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
659 660 661 662 663 664 665 666 667 |
# File '../../src/include/ftp-server/wid_functions.rb', line 659 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
687 688 689 690 691 692 693 694 695 |
# File '../../src/include/ftp-server/wid_functions.rb', line 687 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
589 590 591 592 593 594 595 596 597 |
# File '../../src/include/ftp-server/wid_functions.rb', line 589 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
1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1627 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
719 720 721 722 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 |
# File '../../src/include/ftp-server/wid_functions.rb', line 719 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
1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1447 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
1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 |
# File '../../src/include/ftp-server/wid_functions.rb', line 1712 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
612 613 614 615 616 617 618 619 620 621 622 623 624 625 |
# File '../../src/include/ftp-server/wid_functions.rb', line 612 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 |