Module: Yast::FtpServerDialogsInclude

Defined in:
../../src/include/ftp-server/dialogs.rb

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) AbortDialog

Returns whether user confirmed aborting the configuration.

Returns:

  • (Boolean)

    result



146
147
148
149
150
151
152
153
154
155
156
157
# File '../../src/include/ftp-server/dialogs.rb', line 146

def AbortDialog
  if FtpServer.GetModified
    return Popup.YesNoHeadline(
      # TRANSLATORS: popup headline
      _("Aborting FTP Configuration"),
      # TRANSLATORS: popup message
      _("All changes will be lost. Really abort configuration?")
    )
  else
    return true
  end
end

- (Hash{String => Object}) addit_settings

Init function where are added UI hadle functions Expert Settings widget (vsftpd) define for tabs_vsftpd necessary later in screens (CWNTree)

Returns:

  • (Hash{String => Object})

    map for Expert Settings widget



1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
# File '../../src/include/ftp-server/dialogs.rb', line 1630

def addit_settings
  result = {}

  Ops.set(
    result,
    "contents",
    VBox(
      Frame(
        _("Passive Mode"),
        HBox(
          HSpacing(1),
          VBox(
            Left("PassiveMode"),
            HBox(
              HSpacing(2),
              Left(HSquash(HBox("PasMinPort", "PasMaxPort", HStretch())))
            )
          )
        )
      ), #end of `Frame ( "Passiv Mode Settings"
      VSpacing(1),
      Frame(
        _("Enab&le SSL"), # end of `HBox(`HSpacing(1),`VBox (
        #`CheckBoxFrame(`id("SSLEnable"), _("Enab&le SSL"), true,
        HBox(
          HSpacing(1),
          VBox(
            Left("SSLEnable"), # end of `HBox(`HSpacing(1),`VBox (
            HBox(
              HSpacing(2),
              VBox(
                Left("SSLv2"), # end of `Left(`HBox(
                Left("SSLv3"),
                Left("TLS"),
                Left(HBox("CertFile", VBox(Label(""), "BrowseCertFile")))
              )
            )
          )
        )
      ), #end of `CheckBoxFrame(`id("SSLEnable"), "Sec&urity Settings", true
      VSpacing(1),
      Frame(_("SUSEfirewall Settings"), HBox(HSpacing(1), "Firewall")),
      VStretch()
    )
  )
  # TRANSLATORS: part of dialog caption
  Ops.set(result, "caption", _("FTP Expert Settings"))
  # TRANSLATORS: tree menu item
  Ops.set(result, "tree_item_label", _("Expert Settings"))
  Ops.set(
    result,
    "widget_names",
    [
      "Firewall",
      "PasMinPort",
      "PasMaxPort",
      "SSLv2",
      "SSLv3",
      "TLS",
      "CertFile",
      "BrowseCertFile",
      "PassiveMode",
      "SSLEnable"
    ]
  )

  deep_copy(result)
end

- (Hash{String => Object}) addit_settings_pure

Init function where are added UI hadle functions Expert Settings widget (pure-ftpd) define for tabs_pureftpd necessary later in screens (CWNTree)

Returns:

  • (Hash{String => Object})

    map for Expert Settings widget



1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
# File '../../src/include/ftp-server/dialogs.rb', line 1704

def addit_settings_pure
  result = {}

  Ops.set(
    result,
    "contents",
    VBox(
      Frame(
        _("Passive Mode"),
        HBox(
          HSpacing(1),
          Left(HSquash(HBox("PasMinPort", "PasMaxPort", HStretch())))
        )
      ),
      VSpacing(1),
      Frame(
        _("Additional Settings"),
        HBox(HSpacing(1), VBox(Left("AntiWarez")))
      ), #end of `Frame ( _("Additional Settings")
      VSpacing(1),
      "SSL",
      VSpacing(1),
      Frame(_("SUSEfirewall Settings"), HBox(HSpacing(1), "Firewall")),
      VStretch()
    )
  )
  # TRANSLATORS: part of dialog caption
  Ops.set(result, "caption", _("FTP Expert Settings"))
  # TRANSLATORS: tree menu item
  Ops.set(result, "tree_item_label", _("Expert Settings"))
  Ops.set(
    result,
    "widget_names",
    ["Firewall", "PasMinPort", "PasMaxPort", "AntiWarez", "SSL"]
  )

  deep_copy(result)
end

- (Hash{String => Object}) anon_settings

Init function where are added UI hadle functions Anonymous Settings widget define for tabs_vsftpd/tabs_pureftpd necessary later in screens (CWNTree)

Returns:

  • (Hash{String => Object})

    map for Anonymous Settings widget



1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
# File '../../src/include/ftp-server/dialogs.rb', line 1552

def anon_settings
  result = {}

  Ops.set(
    result,
    "contents",
    VBox(
      "AnonAuthen",
      VSpacing(1),
      Frame(
        _("Uploading"),
        HBox(HSpacing(1), VBox(Left("AnonReadOnly"), Left("AnonCreatDirs")))
      ),
      VStretch()
    )
  )
  # TRANSLATORS: part of dialog caption
  Ops.set(result, "caption", _("FTP Anonymous Settings"))
  # TRANSLATORS: tree menu item
  Ops.set(result, "tree_item_label", _("Authentication"))
  Ops.set(
    result,
    "widget_names",
    ["AnonAuthen", "AnonReadOnly", "AnonCreatDirs"]
  )

  deep_copy(result)
end

- (Object) AnonAuthen



833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
# File '../../src/include/ftp-server/dialogs.rb', line 833

def AnonAuthen
  result = {}

  Ops.set(result, "label", _("Enable/Disable Anonymous and Local Users"))
  Ops.set(result, "widget", :radio_buttons)
  Ops.set(
    result,
    "items",
    [
      ["anon_only", _("Anonymo&us Only")],
      ["local_only", _("Aut&henticated Users Only")],
      ["both", _("&Both")]
    ]
  )
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitAnonAuthen), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreAnonAuthen), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("AnonAuthen"))

  deep_copy(result)
end

- (Hash{String => Object}) AnonCreatDirs

Anonymous Can Create Directories Authentication Settings widget

Returns:

  • (Hash{String => Object})

    map for Performance screen



932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
# File '../../src/include/ftp-server/dialogs.rb', line 932

def AnonCreatDirs
  result = {}

  Ops.set(result, "label", _("Anonymou&s Can Create Directories"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitAnonCreatDirs), "void (string)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreAnonCreatDirs), "void (string, map)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleAnonCreatDirs), "symbol (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("AnonCreatDirs"))

  deep_copy(result)
end

- (Hash{String => Object}) AnonMaxRate

Anonymous Max Rate [KB/s] Performance Settings widget

Returns:

  • (Hash{String => Object})

    map for Performance screen



795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
# File '../../src/include/ftp-server/dialogs.rb', line 795

def AnonMaxRate
  result = {}

  Ops.set(result, "label", _("Anonymous Max &Rate [KB/s]"))
  Ops.set(result, "widget", :intfield)
  Ops.set(result, "minimum", 0)
  Ops.set(result, "maximum", 10000000)
  Ops.set(result, "opt", [:notify])
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitAnonMaxRate), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreAnonMaxRate), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("AnonMaxRate"))

  deep_copy(result)
end

- (Hash{String => Object}) AnonReadOnly

Anonymous Can Upload Authentication Settings widget

Returns:

  • (Hash{String => Object})

    map for Performance screen



900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
# File '../../src/include/ftp-server/dialogs.rb', line 900

def AnonReadOnly
  result = {}

  Ops.set(result, "label", _("Anon&ymous Can Upload"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitAnonReadOnly), "void (string)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreAnonReadOnly), "void (string, map)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleAnonReadOnly), "symbol (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("AnonReadOnly"))

  deep_copy(result)
end

- (Object) AntiWarez



1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
# File '../../src/include/ftp-server/dialogs.rb', line 1234

def AntiWarez
  result = {}

  Ops.set(result, "label", _("Disable Downloading &Unvalidated Data"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitAntiWarez), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreAntiWarez), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("AntiWarez"))

  deep_copy(result)
end

Wellcome Message for vsftpd General Settings widget

Returns:

  • (Hash{String => Object})

    map for General screen



361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File '../../src/include/ftp-server/dialogs.rb', line 361

def Banner
  result = {}

  Ops.set(result, "label", _("&Welcome message"))
  Ops.set(result, "widget", :textentry)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitBanner), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreBanner), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("Banner"))

  deep_copy(result)
end

- (Object) BrowseAnon



579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File '../../src/include/ftp-server/dialogs.rb', line 579

def BrowseAnon
  result = {}

  Ops.set(result, "label", _("Brows&e"))
  Ops.set(result, "widget", :push_button)
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleBrowseAnon), "symbol (string, map)")
  )
  Ops.set(result, "help", _(" "))

  deep_copy(result)
end

- (Object) BrowseCertFile



1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
# File '../../src/include/ftp-server/dialogs.rb', line 1210

def BrowseCertFile
  result = {}

  Ops.set(result, "label", _("Br&owse"))
  Ops.set(result, "widget", :push_button)
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleBrowseCertFile), "symbol (string, map)")
  )
  Ops.set(result, "help", _(" "))

  deep_copy(result)
end

- (Object) BrowseLocal



634
635
636
637
638
639
640
641
642
643
644
645
646
647
# File '../../src/include/ftp-server/dialogs.rb', line 634

def BrowseLocal
  result = {}

  Ops.set(result, "label", _("Br&owse"))
  Ops.set(result, "widget", :push_button)
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleBrowseLocal), "symbol (string, map)")
  )
  Ops.set(result, "help", _(" "))

  deep_copy(result)
end

- (Object) CertFile



1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File '../../src/include/ftp-server/dialogs.rb', line 1177

def CertFile
  result = {}

  Ops.set(
    result,
    "label",
    _("D&SA Certificate to Use for SSL-encrypted Connections")
  )
  Ops.set(result, "widget", :textentry)
  Ops.set(result, "init", fun_ref(method(:InitCertFile), "void (string)"))
  Ops.set(result, "validate_type", :function)
  Ops.set(
    result,
    "validate_function",
    fun_ref(method(:ValidCertFile), "boolean (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreCertFile), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("CertFile"))

  deep_copy(result)
end

- (Hash{String => Object}) ChrootEnable

Chroot Everyone General Settings widget

Returns:

  • (Hash{String => Object})

    map for General screen



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
# File '../../src/include/ftp-server/dialogs.rb', line 388

def ChrootEnable
  result = {}

  Ops.set(result, "label", _("&Chroot Everyone"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(result, "opt", [:notify])
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitChrootEnable), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreChrootEnable), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("ChrootEnable"))

  deep_copy(result)
end

- (Hash{String => Object}) EnableUpload

Enable Upload Authentication Settings widget

Returns:

  • (Hash{String => Object})

    map for Performance screen



869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
# File '../../src/include/ftp-server/dialogs.rb', line 869

def EnableUpload
  result = {}

  Ops.set(result, "label", _("&Enable Upload"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitEnableUpload), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleEnableUpload), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreEnableUpload), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("EnableUpload"))

  deep_copy(result)
end

- (Object) FirewallSettingsPure



1522
1523
1524
1525
1526
1527
1528
1529
# File '../../src/include/ftp-server/dialogs.rb', line 1522

def FirewallSettingsPure
  result = {}

  Ops.set(result, "services", ["service:pure-ftpd"])
  Ops.set(result, "display_details", true)

  deep_copy(result)
end

- (Object) FirewallSettingsVs



1536
1537
1538
1539
1540
1541
1542
1543
# File '../../src/include/ftp-server/dialogs.rb', line 1536

def FirewallSettingsVs
  result = {}

  Ops.set(result, "services", ["service:vsftpd"])
  Ops.set(result, "display_details", true)

  deep_copy(result)
end

- (Object) FtpDirAnon



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# File '../../src/include/ftp-server/dialogs.rb', line 544

def FtpDirAnon
  result = {}

  Ops.set(result, "label", _("FTP Directory for Anon&ymous Users"))
  Ops.set(result, "widget", :textentry)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitFtpDirAnon), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(result, "validate_type", :function)
  Ops.set(
    result,
    "validate_function",
    fun_ref(method(:ValidFtpDirAnon), "boolean (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreFtpDirAnon), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("FtpDirAnon"))

  deep_copy(result)
end

- (Object) FtpDirLocal



601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File '../../src/include/ftp-server/dialogs.rb', line 601

def FtpDirLocal
  result = {}

  Ops.set(result, "label", _("&FTP Directory for Authenticated Users"))
  Ops.set(result, "widget", :textentry)
  Ops.set(result, "opt", [:notify])
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitFtpDirLocal), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreFtpDirLocal), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("FtpDirLocal"))

  deep_copy(result)
end

- (Hash{String => Object}) gen_settings

Init function where are added UI hadle functions General Settings widget (vsftpd) define for tabs_vsftpd necessary later in screens (CWNTree)

Returns:

  • (Hash{String => Object})

    map for General Settings widget



1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
# File '../../src/include/ftp-server/dialogs.rb', line 1338

def gen_settings
  result = {}

  Ops.set(
    result,
    "contents",
    VBox(
      Frame(
        _("General Settings"),
        HBox(
          HSpacing(1),
          VBox(
            Left("Banner"),
            Left("ChrootEnable"),
            Left("VerboseLogging"),
            Left(HBox(Left("UmaskAnon"), Left("UmaskLocal")))
          )
        )
      ),
      VSpacing(1),
      Frame(
        _("FTP Directories"),
        HBox(
          HSpacing(1),
          VBox(
            Left(
              HBox(
                HSpacing(1),
                Left("FtpDirAnon"),
                VBox(Left(Label("")), Left("BrowseAnon"))
              )
            ),
            Left(
              HBox(
                HSpacing(1),
                Left("FtpDirLocal"),
                VBox(Left(Label("")), Left("BrowseLocal"))
              )
            )
          )
        )
      ),
      VStretch()
    )
  )
  # TRANSLATORS: part of dialog caption
  Ops.set(result, "caption", _("FTP General Settings"))
  # TRANSLATORS: tree menu item
  Ops.set(result, "tree_item_label", _("General"))
  Ops.set(
    result,
    "widget_names",
    [
      "Banner",
      "ChrootEnable",
      "VerboseLogging",
      "UmaskAnon",
      "UmaskLocal",
      "BrowseAnon",
      "BrowseLocal",
      "FtpDirAnon",
      "FtpDirLocal"
    ]
  )

  deep_copy(result)
end

- (Hash{String => Object}) gen_settings_pure

Init function where are added UI hadle functions General Settings widget (pure-ftpd) define for tabs_pureftpd necessary later in screens (CWNTree)

Returns:

  • (Hash{String => Object})

    map for General Settings widget



1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
# File '../../src/include/ftp-server/dialogs.rb', line 1412

def gen_settings_pure
  result = {}

  Ops.set(
    result,
    "contents",
    VBox(
      Frame(
        _("General Settings"),
        HBox(
          HSpacing(1),
          VBox(Left("ChrootEnable"), Left("VerboseLogging"), Left("Umask"))
        )
      ),
      VSpacing(1),
      Frame(
        _("FTP Directories"),
        HBox(
          HSpacing(1),
          VBox(
            Left(
              HBox(
                HSpacing(1),
                Left("FtpDirAnon"),
                VBox(Left(Label("")), Left("BrowseAnon"))
              )
            )
          )
        )
      ),
      VStretch()
    )
  )
  # TRANSLATORS: part of dialog caption
  Ops.set(result, "caption", _("FTP General Settings"))
  # TRANSLATORS: tree menu item
  Ops.set(result, "tree_item_label", _("General"))
  Ops.set(
    result,
    "widget_names",
    ["ChrootEnable", "VerboseLogging", "Umask", "FtpDirAnon", "BrowseAnon"]
  )

  deep_copy(result)
end

- (Object) initialize_ftp_server_dialogs(include_target)



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File '../../src/include/ftp-server/dialogs.rb', line 11

def initialize_ftp_server_dialogs(include_target)
  Yast.import "UI"

  textdomain "ftp-server"

  Yast.import "CWM"
  Yast.import "CWMServiceStart"
  Yast.import "DialogTree"
  Yast.import "Label"
  Yast.import "Wizard"
  Yast.import "FtpServer"
  Yast.import "Popup"
  Yast.import "CWMFirewallInterfaces"

  Yast.include include_target, "ftp-server/helps.rb"
  Yast.include include_target, "ftp-server/wid_functions.rb"





  # map for description of widget later in CWNTree
  # widget_descr (vsftpd)
  #
  # @return [Hash{String,map<String => Object>}]

  @wid_handling_vsftpd = {
    "StartMode"        => CWMServiceStart.CreateAutoStartWidget(StartMode()),
    "StartStop"        => CWMServiceStart.CreateStartStopWidget(StartStop()),
    "RBVsPureFTPd"     => RBVsftpdPureftpd(),
    "StartStopRestart" => StartStopRestart(),
    "Banner"           => Banner(),
    "ChrootEnable"     => ChrootEnable(),
    "VerboseLogging"   => VerboseLogging(),
    "UmaskAnon"        => UmaskAnon(),
    "UmaskLocal"       => UmaskLocal(),
    "FtpDirAnon"       => FtpDirAnon(),
    "BrowseAnon"       => BrowseAnon(),
    "FtpDirLocal"      => FtpDirLocal(),
    "BrowseLocal"      => BrowseLocal(),
    "MaxIdleTime"      => MaxIdleTime(),
    "MaxClientsPerIP"  => MaxClientsPerIP(),
    "MaxClientsNumber" => MaxClientsNumber(),
    "LocalMaxRate"     => LocalMaxRate(),
    "AnonMaxRate"      => AnonMaxRate(),
    "AnonAuthen"       => AnonAuthen(),
    "EnableUpload"     => EnableUpload(),
    "AnonReadOnly"     => AnonReadOnly(),
    "AnonCreatDirs"    => AnonCreatDirs(),
    "PassiveMode"      => PassiveMode(),
    "PasMinPort"       => PasMinPort(),
    "PasMaxPort"       => PasMaxPort(),
    "SSLEnable"        => SSLEnable(),
    "SSLv2"            => SSLv2(),
    "SSLv3"            => SSLv3(),
    "TLS"              => TLS(),
    "CertFile"         => CertFile(),
    "BrowseCertFile"   => BrowseCertFile(),
    "Firewall"         => CWMFirewallInterfaces.CreateOpenFirewallWidget(
      FirewallSettingsVs()
    )
  }


  # map for screens of widget later in CWNTree
  # screens (vsftpd)
  #
  # @return [Hash{String,map<String => Object>}]

  @tabs_vsftpd = {
    "start_up"        => start_up,
    "gen_settings"    => gen_settings,
    "perfor_settings" => perfor_settings,
    "anon_settings"   => vsftpd_anon_settings,
    "addit_settings"  => addit_settings
  }

  # function for running CWNTree
  #
  # abort functions for confirm abort
  #
  @functions = { :abort => fun_ref(method(:AbortDialog), "boolean ()") }

  # map for description of widget later in CWNTree
  # widget_descr (pure-ftpd)
  #
  # @return [Hash{String,map<String => Object>}]

  @wid_handling_pureftpd = {
    "StartStopRestart" => StartStopRestart(),
    "StartMode"        => CWMServiceStart.CreateAutoStartWidget(StartMode()),
    "StartStop"        => CWMServiceStart.CreateStartStopWidget(
      StartStopPure()
    ),
    "RBVsPureFTPd"     => RBVsftpdPureftpd(),
    "ChrootEnable"     => ChrootEnable(),
    "VerboseLogging"   => VerboseLogging(),
    "Umask"            => Umask(),
    "FtpDirAnon"       => FtpDirAnon(),
    "BrowseAnon"       => BrowseAnon(),
    "MaxIdleTime"      => MaxIdleTime(),
    "MaxClientsPerIP"  => MaxClientsPerIP(),
    "MaxClientsNumber" => MaxClientsNumber(),
    "LocalMaxRate"     => LocalMaxRate(),
    "AnonMaxRate"      => AnonMaxRate(),
    "AnonAuthen"       => AnonAuthen(),
    "AnonReadOnly"     => AnonReadOnly(),
    "AnonCreatDirs"    => AnonCreatDirs(),
    "PasMinPort"       => PasMinPort(),
    "PasMaxPort"       => PasMaxPort(),
    "AntiWarez"        => AntiWarez(),
    "SSL"              => SSL(),
    "Firewall"         => CWMFirewallInterfaces.CreateOpenFirewallWidget(
      FirewallSettingsPure()
    )
  }


  # map for screens of widget later in CWNTree
  # screens (pure-ftpd)
  #
  # @return [Hash{String,map<String => Object>}]

  @tabs_pureftpd = {
    "start_up"        => start_up,
    "gen_settings"    => gen_settings_pure,
    "perfor_settings" => perfor_settings,
    "anon_settings"   => anon_settings,
    "addit_settings"  => addit_settings_pure
  }
end

- (Hash{String => Object}) LocalMaxRate

Local Max Rate [KB/s] Performance Settings widget

Returns:

  • (Hash{String => Object})

    map for Performance screen



762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
# File '../../src/include/ftp-server/dialogs.rb', line 762

def LocalMaxRate
  result = {}

  Ops.set(result, "label", _("&Local Max Rate [KB/s]"))
  Ops.set(result, "widget", :intfield)
  Ops.set(result, "minimum", 0)
  Ops.set(result, "maximum", 10000000)
  Ops.set(result, "opt", [:notify])
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitLocalMaxRate), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreLocalMaxRate), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("LocalMaxRate"))

  deep_copy(result)
end

- (Hash{String => Object}) MaxClientsNumber

Max Clients Performance Settings widget

Returns:

  • (Hash{String => Object})

    map for Performance screen



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
# File '../../src/include/ftp-server/dialogs.rb', line 729

def MaxClientsNumber
  result = {}

  Ops.set(result, "label", _("Ma&x Clients"))
  Ops.set(result, "widget", :intfield)
  Ops.set(result, "minimum", 0)
  Ops.set(result, "maximum", 9999)
  Ops.set(result, "opt", [:notify])
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitMaxClientsNumber), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreMaxClientsNumber), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("MaxClientsNumber"))

  deep_copy(result)
end

- (Object) MaxClientsPerIP



696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File '../../src/include/ftp-server/dialogs.rb', line 696

def MaxClientsPerIP
  result = {}

  Ops.set(result, "label", _("Max Cli&ents for One IP"))
  Ops.set(result, "widget", :intfield)
  Ops.set(result, "minimum", 0)
  Ops.set(result, "maximum", 50)
  Ops.set(result, "opt", [:notify])
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitMaxClientsPerIP), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreMaxClientsPerIP), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("MaxClientsPerIP"))

  deep_copy(result)
end

- (Object) MaxIdleTime



660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
# File '../../src/include/ftp-server/dialogs.rb', line 660

def MaxIdleTime
  result = {}

  Ops.set(result, "label", _("&Max Idle Time [minutes]"))
  Ops.set(result, "widget", :intfield)
  Ops.set(result, "minimum", 0)
  Ops.set(result, "maximum", 1440)
  Ops.set(result, "opt", [:notify])
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitMaxIdleTime), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreMaxIdleTime), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("MaxIdleTime"))

  deep_copy(result)
end

- (Object) PasMaxPort



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
# File '../../src/include/ftp-server/dialogs.rb', line 1030

def PasMaxPort
  result = {}

  Ops.set(result, "label", _("Max P&ort for Pas. Mode"))
  Ops.set(result, "widget", :intfield)
  Ops.set(result, "minimum", 1024)
  Ops.set(result, "maximum", 65535)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitPasMaxPort), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StorePasMaxPort), "void (string, map)")
  )
  Ops.set(result, "validate_type", :function)
  Ops.set(
    result,
    "validate_function",
    fun_ref(method(:ValidPasMaxPort), "boolean (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("PasMaxPort"))

  deep_copy(result)
end

- (Hash{String => Object}) PasMinPort

Min Port for Pas. Mode Expert Settings widget

Returns:

  • (Hash{String => Object})

    map for Expert screen



998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
# File '../../src/include/ftp-server/dialogs.rb', line 998

def PasMinPort
  result = {}

  Ops.set(result, "label", _("&Min Port for Pas. Mode"))
  Ops.set(result, "widget", :intfield)
  Ops.set(result, "minimum", 1024)
  Ops.set(result, "maximum", 65535)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitPasMinPort), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StorePasMinPort), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("PasMinPort"))

  deep_copy(result)
end

- (Object) PassiveMode



967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
# File '../../src/include/ftp-server/dialogs.rb', line 967

def PassiveMode
  result = {}

  Ops.set(result, "label", _("Enable Pass&ive Mode"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitPassiveMode), "void (string)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StorePassiveMode), "void (string, map)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandlePassiveMode), "symbol (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("PassiveMode"))

  deep_copy(result)
end

- (Object) perfor_settings



1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
# File '../../src/include/ftp-server/dialogs.rb', line 1465

def perfor_settings
  result = {}

  Ops.set(
    result,
    "contents",
    VBox(
      Frame(
        _("General Settings"),
        HBox(
          HSpacing(1),
          VBox(
            Left(MinWidth(20, "MaxIdleTime")),
            Left(MinWidth(20, "MaxClientsPerIP")),
            Left(MinWidth(20, "MaxClientsNumber"))
          )
        )
      ),
      VSpacing(1),
      Frame(
        _("FTP Directories"),
        HBox(
          HSpacing(1),
          VBox(
            Left(MinWidth(20, "LocalMaxRate")),
            Left(MinWidth(20, "AnonMaxRate"))
          )
        )
      ),
      VStretch()
    )
  )
  # TRANSLATORS: part of dialog caption
  Ops.set(result, "caption", _("FTP Performance Settings"))
  # TRANSLATORS: tree menu item
  Ops.set(result, "tree_item_label", _("Performance"))
  Ops.set(
    result,
    "widget_names",
    [
      "MaxClientsPerIP",
      "MaxIdleTime",
      "AnonMaxRate",
      "LocalMaxRate",
      "MaxClientsNumber"
    ]
  )

  deep_copy(result)
end

- (Hash{String => Object}) RBVsftpdPureftpd

Init function where are added UI hadle functions Start widget radiobuttons for switching daemons

Returns:

  • (Hash{String => Object})

    map for start-stop widget



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File '../../src/include/ftp-server/dialogs.rb', line 308

def RBVsftpdPureftpd
  result = {}
  Ops.set(result, "label", _("Selected Service"))
  Ops.set(result, "widget", :radio_buttons)
  Ops.set(
    result,
    "items",
    [["vs_item", _("&vsftpd")], ["pure_item", _("p&ure-ftpd")]]
  )
  Ops.set(result, "init", fun_ref(method(:InitRBVsPure), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleRBVsPure), "symbol (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("selected_services"))

  deep_copy(result)
end

- (Symbol) RunFTPDialogsPureftpd

function for running CWNTree vsftpd

Returns:

  • (Symbol)

    return value of DialogTree::ShowAndRun



1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
# File '../../src/include/ftp-server/dialogs.rb', line 1779

def RunFTPDialogsPureftpd
  sim_dialogs = [
    "start_up",
    "gen_settings",
    "perfor_settings",
    "anon_settings",
    "addit_settings"
  ]

  DialogTree.ShowAndRun(
    {
      "ids_order"      => sim_dialogs,
      "initial_screen" => "start_up",
      "screens"        => @tabs_pureftpd,
      "widget_descr"   => @wid_handling_pureftpd,
      "back_button"    => "",
      "abort_button"   => Label.CancelButton,
      "next_button"    => Label.FinishButton,
      "functions"      => @functions
    }
  )
end

- (Object) RunFTPDialogsVsftpd



1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
# File '../../src/include/ftp-server/dialogs.rb', line 1751

def RunFTPDialogsVsftpd
  sim_dialogs = [
    "start_up",
    "gen_settings",
    "perfor_settings",
    "anon_settings",
    "addit_settings"
  ]

  DialogTree.ShowAndRun(
    {
      "ids_order"      => sim_dialogs,
      "initial_screen" => "start_up",
      "screens"        => @tabs_vsftpd,
      "widget_descr"   => @wid_handling_vsftpd,
      "back_button"    => "",
      "abort_button"   => Label.CancelButton,
      "next_button"    => Label.FinishButton,
      "functions"      => @functions
    }
  )
end

- (Hash{String => Object}) SSL

Security Settings Expert Settings widget

Returns:

  • (Hash{String => Object})

    map for Expert screen



1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
# File '../../src/include/ftp-server/dialogs.rb', line 1261

def SSL
  result = {}

  Ops.set(result, "label", _("Security Settings"))
  Ops.set(result, "widget", :radio_buttons)
  Ops.set(
    result,
    "items",
    [
      ["disable", _("Disable SSL/&TLS")],
      ["accept", _("Accept &SSL and TLS")],
      ["refuse", _("&Refuse Connections Without SSL/TLS")]
    ]
  )
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitSSL), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(result, "validate_type", :function)
  Ops.set(
    result,
    "validate_function",
    fun_ref(method(:ValidSSL), "boolean (string, map)")
  )
  Ops.set(result, "store", fun_ref(method(:StoreSSL), "void (string, map)"))
  Ops.set(result, "help", DialogHelpText("SSL"))

  deep_copy(result)
end

- (Object) SSLEnable



1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
# File '../../src/include/ftp-server/dialogs.rb', line 1068

def SSLEnable
  result = {}

  Ops.set(result, "label", _("Enab&le SSL"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(result, "init", fun_ref(method(:InitSSLEnable), "void (string)"))
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreSSLEnable), "void (string, map)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleSSLEnable), "symbol (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("SSLEnable"))

  deep_copy(result)
end

- (Hash{String => Object}) SSLv2

Enable SSL v2 Expert Settings widget

Returns:

  • (Hash{String => Object})

    map for Expert screen



1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
# File '../../src/include/ftp-server/dialogs.rb', line 1094

def SSLv2
  result = {}

  Ops.set(result, "label", _("&Enable SSL v2"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitSSLv2), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreSSLv2), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("SSLv2"))

  deep_copy(result)
end

- (Object) SSLv3



1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
# File '../../src/include/ftp-server/dialogs.rb', line 1123

def SSLv3
  result = {}

  Ops.set(result, "label", _("Enable SSL &v3"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitSSLv3), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreSSLv3), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("SSLv3"))

  deep_copy(result)
end

- (Hash{String => Object}) start_up

Init function where are added UI hadle functions Start widget define for tabs_vsftpd/tabs_pureftpd necessary later in screens (CWNTree)

Returns:

  • (Hash{String => Object})

    map for start_up widget



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
# File '../../src/include/ftp-server/dialogs.rb', line 1303

def start_up
  result = {}

  Ops.set(
    result,
    "contents",
    VBox(
      "StartMode",
      VSpacing(1),
      # disabling start/stop buttons when it doesn't make sense
      Mode.normal ? "StartStop" : Empty(),
      VSpacing(1),
      "RBVsPureFTPd",
      VStretch()
    )
  )
  # TRANSLATORS: part of dialog caption
  Ops.set(result, "caption", _("FTP Start-up"))
  # TRANSLATORS: tree menu item
  Ops.set(result, "tree_item_label", _("Start-Up"))
  Ops.set(
    result,
    "widget_names",
    ["StartMode", "StartStop", "RBVsPureFTPd", "StartStopRestart"]
  )

  deep_copy(result)
end

- (Object) StartMode



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
200
201
202
# File '../../src/include/ftp-server/dialogs.rb', line 165

def StartMode
  result = {}
  Ops.set(
    result,
    "get_service_auto_start",
    fun_ref(method(:GetEnableService), "boolean ()")
  )
  Ops.set(
    result,
    "set_service_auto_start",
    fun_ref(method(:SetEnableService), "void (boolean)")
  )
  Ops.set(
    result,
    "get_service_start_via_xinetd",
    fun_ref(method(:GetStartedViaXinetd), "boolean ()")
  )
  Ops.set(
    result,
    "set_service_start_via_xinetd",
    fun_ref(method(:SetStartedViaXinetd), "void (boolean)")
  )
  #TRANSLATORS: Radio selection
  Ops.set(result, "start_auto_button", _("&When booting"))
  Ops.set(result, "start_manual_button", _("&Manually"))
  Ops.set(result, "start_xinetd_button", _("Via &xinetd"))
  Ops.set(
    result,
    "help",
    Builtins.sformat(
      CWMServiceStart.AutoStartHelpXinetdTemplate,
      _("When Booting"),
      _("Manually"),
      _("Via xinetd")
    )
  )
  deep_copy(result)
end

- (Hash{String => Object}) StartStop

Init function where are added UI hadle functions Start widget

Returns:

  • (Hash{String => Object})

    map for start-stop widget



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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File '../../src/include/ftp-server/dialogs.rb', line 209

def StartStop
  result = {}
  Ops.set(result, "service_id", "vsftpd")
  Ops.set(result, "service_running_label", _("FTP is running"))
  Ops.set(result, "service_not_running_label", _("FTP is not running"))
  Ops.set(result, "start_now_button", _("&Start FTP Now"))
  Ops.set(result, "stop_now_button", _("S&top FTP Now"))
  Ops.set(
    result,
    "save_now_action",
    fun_ref(method(:SaveAndRestartVsftpd), "boolean ()")
  )
  Ops.set(
    result,
    "save_now_button",
    _("Sa&ve Settings and Restart FTP Now")
  )
  Ops.set(
    result,
    "start_now_action",
    fun_ref(method(:StartNowVsftpd), "boolean ()")
  )
  Ops.set(
    result,
    "stop_now_action",
    fun_ref(method(:StopNowVsftpd), "boolean ()")
  )
  Ops.set(
    result,
    "help",
    Builtins.sformat(
      CWMServiceStart.StartStopHelpTemplate(true),
      # part of help text - push button label, NO SHORTCUT!!!
      _("Start FTP Daemon Now"),
      # part of help text - push button label, NO SHORTCUT!!!
      _("Stop FTP Daemon Now"),
      # part of help text - push button label, NO SHORTCUT!!!
      _("Save Settings and Restart FTP Daemon Now")
    )
  )

  deep_copy(result)
end

- (Hash{String => Object}) StartStopPure

Init function where are added UI hadle functions Start widget (pure-ftpd)

Returns:

  • (Hash{String => Object})

    map for start-stop widget



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
289
290
291
292
293
294
295
296
297
298
299
300
# File '../../src/include/ftp-server/dialogs.rb', line 258

def StartStopPure
  result = {}
  Ops.set(result, "service_id", "pure-ftpd")
  Ops.set(result, "service_running_label", _("FTP is running"))
  Ops.set(result, "service_not_running_label", _("FTP is not running"))
  Ops.set(result, "start_now_button", _("&Start FTP Now"))
  Ops.set(result, "stop_now_button", _("S&top FTP Now"))
  Ops.set(
    result,
    "save_now_action",
    fun_ref(method(:SaveAndRestartPure), "boolean ()")
  )
  Ops.set(
    result,
    "save_now_button",
    _("Sa&ve Settings and Restart FTP Now")
  )
  Ops.set(
    result,
    "start_now_action",
    fun_ref(method(:StartNowPure), "boolean ()")
  )
  Ops.set(
    result,
    "stop_now_action",
    fun_ref(method(:StopNowPure), "boolean ()")
  )
  Ops.set(
    result,
    "help",
    Builtins.sformat(
      CWMServiceStart.StartStopHelpTemplate(true),
      # part of help text - push button label, NO SHORTCUT!!!
      _("Start FTP Daemon Now"),
      # part of help text - push button label, NO SHORTCUT!!!
      _("Stop FTP Daemon Now"),
      # part of help text - push button label, NO SHORTCUT!!!
      _("Save Settings and Restart FTP Daemon Now")
    )
  )

  deep_copy(result)
end

- (Hash{String => Object}) StartStopRestart

Init function where are added UI hadle functions special hack widget where is handlig Start/Stop button

Returns:

  • (Hash{String => Object})

    map for start-stop widget



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File '../../src/include/ftp-server/dialogs.rb', line 334

def StartStopRestart
  result = {}

  Ops.set(result, "widget", :custom)
  Ops.set(result, "custom_widget", Empty())
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitStartStopRestart), "void (string)")
  )
  Ops.set(result, "help", " ")



  deep_copy(result)
end

- (Object) TLS



1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
# File '../../src/include/ftp-server/dialogs.rb', line 1152

def TLS
  result = {}

  Ops.set(result, "label", _("Enable &TLS"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitTLS), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(result, "store", fun_ref(method(:StoreTLS), "void (string, map)"))
  Ops.set(result, "help", DialogHelpText("TLS"))

  deep_copy(result)
end

- (Object) Umask



451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File '../../src/include/ftp-server/dialogs.rb', line 451

def Umask
  result = {}

  Ops.set(result, "label", _("&Umask (umask files:umask dirs)"))
  Ops.set(result, "widget", :textentry)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitUmask), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreUmask), "void (string, map)")
  )
  Ops.set(result, "validate_type", :function)
  Ops.set(
    result,
    "validate_function",
    fun_ref(method(:ValidUmask), "boolean (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("Umask"))

  deep_copy(result)
end

- (Object) UmaskAnon



485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# File '../../src/include/ftp-server/dialogs.rb', line 485

def UmaskAnon
  result = {}

  Ops.set(result, "label", _("&Umask for Anonymous"))
  Ops.set(result, "widget", :textentry)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitUmaskAnon), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreUmaskAnon), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("UmaskAnon"))

  deep_copy(result)
end

- (Object) UmaskLocal



516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File '../../src/include/ftp-server/dialogs.rb', line 516

def UmaskLocal
  result = {}

  Ops.set(result, "label", _("Uma&sk for Authenticated Users"))
  Ops.set(result, "widget", :textentry)
  Ops.set(result, "opt", [:notify])
  Ops.set(result, "init", fun_ref(method(:InitUmaskLocal), "void (string)"))
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreUmaskLocal), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("UmaskLocal"))

  deep_copy(result)
end

- (Hash{String => Object}) VerboseLogging

Verbos Logging General Settings widget

Returns:

  • (Hash{String => Object})

    map for General screen



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File '../../src/include/ftp-server/dialogs.rb', line 419

def VerboseLogging
  result = {}

  Ops.set(result, "label", _("&Verbose Logging"))
  Ops.set(result, "widget", :checkbox)
  Ops.set(result, "opt", [:notify])
  Ops.set(
    result,
    "init",
    fun_ref(method(:InitVerboseLogging), "void (string)")
  )
  Ops.set(
    result,
    "handle",
    fun_ref(method(:HandleUniversal), "symbol (string, map)")
  )
  Ops.set(
    result,
    "store",
    fun_ref(method(:StoreVerboseLogging), "void (string, map)")
  )
  Ops.set(result, "help", DialogHelpText("VerboseLogging"))

  deep_copy(result)
end

- (Hash{String => Object}) vsftpd_anon_settings

Init function where are added UI hadle functions Anonymous Settings widget define for tabs_vsftpd/tabs_pureftpd necessary later in screens (CWNTree)

Returns:

  • (Hash{String => Object})

    map for Anonymous Settings widget



1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
# File '../../src/include/ftp-server/dialogs.rb', line 1587

def vsftpd_anon_settings
  result = {}

  Ops.set(
    result,
    "contents",
    VBox(
      "AnonAuthen",
      VSpacing(1),
      Frame(
        _("Uploading"),
        HBox(
          HSpacing(1),
          VBox(
            Left("EnableUpload"),
            HBox(
              HSpacing(2),
              VBox(Left("AnonReadOnly"), Left("AnonCreatDirs"))
            )
          )
        )
      ),
      VStretch()
    )
  )
  # TRANSLATORS: part of dialog caption
  Ops.set(result, "caption", _("FTP Anonymous Settings"))
  # TRANSLATORS: tree menu item
  Ops.set(result, "tree_item_label", _("Authentication"))
  Ops.set(
    result,
    "widget_names",
    ["AnonAuthen", "EnableUpload", "AnonReadOnly", "AnonCreatDirs"]
  )

  deep_copy(result)
end