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
142
143
144
145
146
147
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
200
201
202
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
238
239
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
|
# File '../../src/include/nis_server/master.rb', line 58
def MasterDialog
pwd_chfn = NisServer.pwd_chfn
pwd_chsh = NisServer.pwd_chsh
start_yppasswdd = NisServer.start_yppasswdd
domain = NisServer.domain
start_ypbind = NisServer.start_ypbind
nopush = NisServer.nopush
start_ypxfrd = NisServer.start_ypxfrd
firewall_widget = GetFirewallWidget()
firewall_layout = Ops.get_term(firewall_widget, "custom_widget", VBox())
helptext = _(
"<p>Enter a NIS <b>domain</b>. If this host is also a NIS client using this machine as a server, check\nthe corresponding option.</p>\n"
)
helptext = Ops.add(
helptext,
_(
"<p>For slave servers to cooperate with this master, check\n" +
"<i>Active Slave NIS server exists</i>. If you check\n" +
"<i>Fast Map distribution</i>, it will speed up the transfer of maps to the\n" +
"slaves.</p>\n"
)
)
helptext = Ops.add(
helptext,
_(
"<p><i>Allow changes to passwords</i> lets the users change their\n" +
"passwords in the presence of NIS. Buttons to allow\n" +
"changing the login shell or GECOS (full name and related information) can\n" +
"be used to set up these more specific options.</p>\n"
)
)
helptext = Ops.add(helptext, Ops.get_string(firewall_widget, "help", ""))
pass_yes_buttons = HBox(
HSpacing(3),
VBox(
Left(
CheckBox(
Id(:allow_gecos),
_("Allow changes to &GECOS field"),
pwd_chfn
)
),
Left(
CheckBox(
Id(:allow_shell),
_("Allow changes to login &shell"),
pwd_chsh
)
)
)
)
pass_buttons = HBox(
HSpacing(),
VBox(
VSpacing(0.3),
Left(
CheckBox(
Id(:change_passwords),
Opt(:notify),
_("Allow changes to &passwords"),
start_yppasswdd
)
),
VSpacing(0.3),
pass_yes_buttons,
VSpacing(0.3)
)
)
domain_frame = HBox(
HSpacing(),
VBox(
VSpacing(0.3),
InputField(Id(:domain), Opt(:hstretch), "", domain),
VSpacing(0.3),
Left(
CheckBox(
Id(:also_client),
_("This host is also a NIS &client"),
start_ypbind
)
),
VSpacing(0.3)
),
HSpacing(4)
)
contents = HBox(
HSpacing(4),
VBox(
VSpacing(0.5),
Frame(_("NIS &Domain Name"), domain_frame),
VSpacing(0.5),
Left(
CheckBox(
Id(:have_slave),
_("Active Slave NIS server &exists"),
!nopush
)
),
VSpacing(0.5),
Left(
CheckBox(
Id(:fast_map),
_("&Fast Map distribution (rpc.ypxfrd)"),
start_ypxfrd
)
),
VSpacing(0.5),
Frame(_("Changing of passwords"), pass_buttons),
VSpacing(0.5),
firewall_layout,
VSpacing(0.5),
PushButton(
Id(:details),
Opt(:key_F7),
_("&Other global settings ...")
)
),
HSpacing(6)
)
Wizard.SetContents(
_("Master Server Setup"),
contents,
helptext,
true,
true
)
UI.ChangeWidget(Id(:allow_shell), :Enabled, start_yppasswdd)
UI.ChangeWidget(Id(:allow_gecos), :Enabled, start_yppasswdd)
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 == :change_passwords
start_yppasswdd = Convert.to_boolean(
UI.QueryWidget(Id(:change_passwords), :Value)
)
UI.ChangeWidget(Id(:allow_shell), :Enabled, start_yppasswdd)
UI.ChangeWidget(Id(:allow_gecos), :Enabled, start_yppasswdd)
end
if ui == :details || ui == :next
domainname = Convert.to_string(UI.QueryWidget(Id(:domain), :Value))
if !Nis.check_nisdomainname(domainname)
UI.SetFocus(Id(:domain))
Popup.Error(Nis.valid_nisdomainname)
ui = :again
next
end
domain = domainname
start_ypbind = Convert.to_boolean(
UI.QueryWidget(Id(:also_client), :Value)
)
nopush = !Convert.to_boolean(UI.QueryWidget(Id(:have_slave), :Value))
pwd_chfn = Convert.to_boolean(
UI.QueryWidget(Id(:allow_gecos), :Value)
)
pwd_chsh = Convert.to_boolean(
UI.QueryWidget(Id(:allow_shell), :Value)
)
start_yppasswdd = Convert.to_boolean(
UI.QueryWidget(Id(:change_passwords), :Value)
)
start_ypxfrd = Convert.to_boolean(
UI.QueryWidget(Id(:fast_map), :Value)
)
CheckForDHCPClient(domainname)
CWMFirewallInterfaces.OpenFirewallStore(firewall_widget, "", event)
if NisServer.modified || domain != NisServer.domain ||
start_ypbind != NisServer.start_ypbind ||
nopush != NisServer.nopush ||
pwd_chfn != NisServer.pwd_chfn ||
pwd_chsh != NisServer.pwd_chsh ||
start_yppasswdd != NisServer.start_yppasswdd ||
start_ypxfrd != NisServer.start_ypxfrd
NisServer.modified = true
NisServer.domain = domain
NisServer.start_ypbind = start_ypbind
NisServer.nopush = nopush
NisServer.pwd_chfn = pwd_chfn
NisServer.pwd_chsh = pwd_chsh
NisServer.start_yppasswdd = start_yppasswdd
NisServer.start_ypxfrd = start_ypxfrd
end
end
ui = :again if ui == :abort && !Popup.ReallyAbort(NisServer.modified)
end until Ops.is_symbol?(ui) &&
Builtins.contains(
[:next, :back, :abort, :details],
Convert.to_symbol(ui)
)
Convert.to_symbol(ui)
end
|