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
142
143
144
145
146
147
148
149
150
151
152
153
|
# File '../../src/include/security/users.rb', line 43
def AdduserDialog
caption = _("User Addition")
help = Ops.get_string(@HELPS, "adduser", "")
contents = VBox(
VSeparator(),
XFrame(
1.8,
0.5,
_("User ID Limitations"),
HBox(
settings2widget("UID_MIN"),
HSpacing(1.5),
settings2widget("UID_MAX")
)
),
VSpacing(0.7),
XFrame(
1.8,
0.5,
_("Group ID Limitations"),
HBox(
settings2widget("GID_MIN"),
HSpacing(1.5),
settings2widget("GID_MAX")
)
),
VSpacing(1.7)
)
contents = HVCenter(
HVSquash(
HBox(
HSpacing(5),
VBox(VSpacing(2), ReplacePoint(Id(:rp_main), contents), VSpacing(2)),
HSpacing(5)
)
)
)
Wizard.SetContentsButtons(
caption,
contents,
help,
Label.BackButton,
Label.OKButton
)
Wizard.HideBackButton
Wizard.SetAbortButton(:abort, Label.CancelButton)
Wizard.SelectTreeItem("users")
ret = nil
while true
ret = UI.UserInput
if ret == :abort || ret == :cancel
if ReallyAbort()
break
else
next
end
elsif ret == :back
break
elsif ret == :next || Builtins.contains(@tree_dialogs, ret)
if ret == "users"
Wizard.SelectTreeItem("users") if Wizard.QueryTreeItem != "users"
next
end
if checkMinMax("UID_MIN", "UID_MAX") != true
Popup.Error(
_("The minimum user ID cannot be larger than the maximum.")
)
next
end
if checkMinMax("GID_MIN", "GID_MAX") != true
Popup.Error(
_("The minimum group ID cannot be larger than the\nmaximum.")
)
next
end
break
else
Builtins.y2error("Unexpected return code: %1", ret)
next
end
end
if ret == :next || Builtins.contains(@tree_dialogs, ret)
widget2settings("GID_MIN")
widget2settings("GID_MAX")
widget2settings("UID_MIN")
widget2settings("UID_MAX")
end
deep_copy(ret)
end
|