summary refs log tree commit diff
path: root/gnu/installer/newt/user.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-25 11:43:44 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-25 12:23:54 +0200
commit187122b90261088e264f2530df224e613cbcfb55 (patch)
tree25eebb4f976c313a01897d0d6a3f80ffdfac1a72 /gnu/installer/newt/user.scm
parent8f2b7e3cb469e3e484547bb9f4ba3d0e3a7e9ed7 (diff)
downloadguix-187122b90261088e264f2530df224e613cbcfb55.tar.gz
installer: Ask for confirmation of the user passwords.
* gnu/installer/newt/user.scm (run-user-add-page): Add #:name and
 #:home-directory and honor them.  Add call to 'confirm-password'.
Diffstat (limited to 'gnu/installer/newt/user.scm')
-rw-r--r--gnu/installer/newt/user.scm18
1 files changed, 14 insertions, 4 deletions
diff --git a/gnu/installer/newt/user.scm b/gnu/installer/newt/user.scm
index 7493edf85e..617d2d0bca 100644
--- a/gnu/installer/newt/user.scm
+++ b/gnu/installer/newt/user.scm
@@ -29,7 +29,9 @@
   #:use-module (srfi srfi-26)
   #:export (run-user-page))
 
-(define (run-user-add-page)
+(define* (run-user-add-page #:key (name "") (home-directory ""))
+  "Run a form to enter the user name, home directory, and password.  Use NAME
+and HOME-DIRECTORY as the initial values in the form."
   (define (pad-label label)
     (string-pad-right label 20))
 
@@ -40,8 +42,10 @@
          (label-password
           (make-label -1 -1 (pad-label (G_ "Password"))))
          (entry-width 30)
-         (entry-name (make-entry -1 -1 entry-width))
-         (entry-home-directory (make-entry -1 -1 entry-width))
+         (entry-name (make-entry -1 -1 entry-width
+                                 #:initial-value name))
+         (entry-home-directory (make-entry -1 -1 entry-width
+                                           #:initial-value home-directory))
          (entry-password (make-entry -1 -1 entry-width
                                      #:flags FLAG-PASSWORD))
          (entry-grid (make-grid 3 4))
@@ -100,7 +104,13 @@
                       (user
                        (name name)
                        (home-directory home-directory)
-                       (password password))))))))
+                       (password
+                        (confirm-password password
+                                          (lambda ()
+                                            (run-user-add-page
+                                             #:name name
+                                             #:home-directory
+                                             home-directory)))))))))))
           (lambda ()
             (destroy-form-and-pop form)))))))