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'.
This commit is contained in:
Ludovic Courtès 2019-04-25 11:43:44 +02:00
parent 8f2b7e3cb4
commit 187122b902
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 14 additions and 4 deletions

View File

@ -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)))))))