Ask for securing the passport

This commit is contained in:
2025-12-07 21:39:45 +01:00
parent 35dd865b80
commit ea4760a81e

View File

@@ -323,6 +323,13 @@ function askReg() {
confirm=" Forename: $FNAME\n Surname: $SNAME\n Place: $PLANET"
ynBox "Security" "Secure this passport using security stickers?"
if [ $? -eq 0 ]; then
SECURE=true
else
SECURE=false
fi
ynBox "c3gov Stamp" "Does this entity want to have a c3gov stamp?"
if [ $? -eq 0 ]; then
STAMP=true
@@ -351,7 +358,7 @@ function enterSecurityCode() {
return 1
fi
SECURITYCODE=$(cat $TMP)
confirm "Security code" "$SECURITYCODE"
confirm "Security code" "Security code: $SECURITYCODE"
return $?
}
@@ -376,38 +383,9 @@ function printSecurePassport(){
rm $LOCKFILE
}
function menuFor() {
dialog --backtitle "$BT" \
--menu "Select purpose:" 14 40 3 \
1 "Registration" \
2 "c3gov Stamp" \
3 "GPG" \
8 "Secure Passport" \
9 "Back" 2> $TMP
choice=$(cat $TMP)
case $choice in
1) askReg "$1"
if [ $? -eq 0 ]; then
printReg "$1"
if [ "$STAMP" == "true" ]; then
printc3govStamp "$1"
fi
if [ -n "$FP" ]; then
printGPG "$1"
fi
fi
;;
2) printc3govStamp "$1"
;;
3) enterGPG
if [ $? -eq 0 ]; then
printGPG "$1"
fi
;;
8) if [ "$1" = "bounddipl" ]; then
diaBox "Error" "Passport not supported."
function enableSecurity() {
if [ "$1" = "bounddipl" ]; then
diaBox "Error" "Passport security: Passport not supported."
else
enterSecurityCode
if [ $? -eq 0 ]; then
@@ -424,7 +402,46 @@ function menuFor() {
esac
fi
fi
}
function menuFor() {
dialog --backtitle "$BT" \
--menu "Select purpose:" 14 40 3 \
1 "Registration" \
2 "c3gov Stamp" \
3 "GPG" \
8 "Secure Passport" \
9 "Back" 2> $TMP
choice=$(cat $TMP)
case $choice in
1) askReg "$1"
if [ $? -eq 0 ]; then
printReg "$1"
if [ "$SECURE" = "true" ]; then
enableSecurity "$1"
fi
if [ "$STAMP" = "true" ]; then
printc3govStamp "$1"
fi
if [ -n "$FP" ]; then
printGPG "$1"
fi
fi
;;
2) printc3govStamp "$1"
;;
3) enterGPG
if [ $? -eq 0 ]; then
printGPG "$1"
fi
;;
8) enableSecurity "$1"
;;
esac
unset FNAME
unset SNAME
unset PLANET