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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
# File '../../src/include/nis_server/slave.rb', line 59
def SlaveDialog
firewall_widget = GetFirewallWidget()
firewall_layout = Ops.get_term(firewall_widget, "custom_widget", VBox())
helptext = _(
"<p>Enter the NIS <b>domain</b> and the IP <b>address</b> or host name of the master NIS server.</p>"
)
helptext = Ops.add(
Ops.add(
helptext,
_(
"<p>If this host is also a NIS client using this machine as a server, check the corresponding option.</p>"
)
),
Ops.get_string(firewall_widget, "help", "")
)
contents = HVSquash(
VBox(
InputField(
Id(:domain),
Opt(:hstretch),
_("N&IS domain name:"),
NisServer.domain
),
VSpacing(0.5),
InputField(
Id(:master_ip),
Opt(:hstretch),
"NIS &master server:",
NisServer.ui_master_ip
),
VSpacing(),
Left(
CheckBox(
Id(:also_client),
_("This host is also a NIS &client"),
NisServer.start_ypbind
)
),
VSpacing(2),
firewall_layout
)
)
Wizard.SetContents(
_("Slave Server Setup"),
contents,
helptext,
true,
true
)
CWMFirewallInterfaces.OpenFirewallInit(firewall_widget, "")
event = {}
ui = nil
begin
event = UI.WaitForEvent
ui = Ops.get(event, "ID")
CWMFirewallInterfaces.OpenFirewallHandle(firewall_widget, "", event)
ui = :abort if ui == :cancel
if ui == :next
master_ip = Convert.to_string(UI.QueryWidget(Id(:master_ip), :Value))
domainname = Convert.to_string(UI.QueryWidget(Id(:domain), :Value))
start_ypbind = Convert.to_boolean(
UI.QueryWidget(Id(:also_client), :Value)
)
if !Address.Check4(master_ip)
UI.SetFocus(Id(:master_ip))
Popup.Error(Address.Valid4)
ui = :again
next
elsif !Nis.check_nisdomainname(domainname)
UI.SetFocus(Id(:domain))
Popup.Error(Nis.valid_nisdomainname)
ui = :again
next
end
if master_ip != NisServer.ui_master_ip ||
domainname != NisServer.domain ||
start_ypbind != NisServer.start_ypbind
NisServer.modified = true
end
CheckForDHCPClient(domainname)
CWMFirewallInterfaces.OpenFirewallStore(firewall_widget, "", event)
NisServer.start_ypbind = start_ypbind
NisServer.ui_master_ip = master_ip
NisServer.domain = domainname
end
ui = :again if ui == :abort && !Popup.ReallyAbort(NisServer.modified)
end until ui == :next || ui == :back || ui == :abort
Convert.to_symbol(ui)
end
|