From 187122b90261088e264f2530df224e613cbcfb55 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 25 Apr 2019 11:43:44 +0200 Subject: 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'. --- gnu/installer/newt/user.scm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gnu/installer') 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))))))) -- cgit 1.4.1