1 -- $Id: 100_set_root_password.lua,v 1.6 2005/03/29 18:00:18 den Exp $
5 local set_root_password = function()
11 name = _("Set Root Password"),
13 "Here you can set the super-user (root) password."
19 name = _("Root Password"),
20 short_desc = _("Enter the root password you would like to use"),
25 name = _("Re-type Root Password"),
26 short_desc = _("Enter the same password again to confirm"),
34 name = _("Accept and Set Password")
38 name = _("Return to Configure Menu")
43 { root_passwd_1 = "", root_passwd_2 = "" }
48 result = App.ui:present(form)
50 if result.action_id == "ok" then
51 form.datasets = result.datasets
54 -- Fetch form field values.
57 local root_passwd_1 = result.datasets[1].root_passwd_1
58 local root_passwd_2 = result.datasets[1].root_passwd_2
61 if (!assert_clean(a->c, _("Root Password"), root_passwd_1, PW_NOT_ALLOWED)) {
65 if root_passwd_1 == root_passwd_2 then
67 -- Passwords match, so set the root password.
70 App.state.target:cmds_set_password(cmds,
71 "root", root_passwd_1)
72 if cmds:execute() then
74 _("The root password has been changed.")
79 _("An error occurred when " ..
80 "setting the root password.")
86 -- Passwords don't match - tell the user, let them try again.
89 _("The passwords do not match.")
101 name = _("Set Root Password"),