Ask for securing the passport
This commit is contained in:
57
start_dialog
57
start_dialog
@@ -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,6 +383,27 @@ function printSecurePassport(){
|
||||
rm $LOCKFILE
|
||||
}
|
||||
|
||||
function enableSecurity() {
|
||||
if [ "$1" = "bounddipl" ]; then
|
||||
diaBox "Error" "Passport security: Passport not supported."
|
||||
else
|
||||
enterSecurityCode
|
||||
if [ $? -eq 0 ]; then
|
||||
case $1 in
|
||||
"bounddipl")
|
||||
;;
|
||||
"jhp")
|
||||
printSecurePassport "$1"
|
||||
;;
|
||||
*)
|
||||
printSecurePassportFirstPage "$1"
|
||||
printSecurePassport "$1"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function menuFor() {
|
||||
dialog --backtitle "$BT" \
|
||||
--menu "Select purpose:" 14 40 3 \
|
||||
@@ -391,7 +419,10 @@ function menuFor() {
|
||||
1) askReg "$1"
|
||||
if [ $? -eq 0 ]; then
|
||||
printReg "$1"
|
||||
if [ "$STAMP" == "true" ]; then
|
||||
if [ "$SECURE" = "true" ]; then
|
||||
enableSecurity "$1"
|
||||
fi
|
||||
if [ "$STAMP" = "true" ]; then
|
||||
printc3govStamp "$1"
|
||||
fi
|
||||
if [ -n "$FP" ]; then
|
||||
@@ -406,25 +437,11 @@ function menuFor() {
|
||||
printGPG "$1"
|
||||
fi
|
||||
;;
|
||||
8) if [ "$1" = "bounddipl" ]; then
|
||||
diaBox "Error" "Passport not supported."
|
||||
else
|
||||
enterSecurityCode
|
||||
if [ $? -eq 0 ]; then
|
||||
case $1 in
|
||||
"bounddipl")
|
||||
;;
|
||||
"jhp")
|
||||
printSecurePassport "$1"
|
||||
;;
|
||||
*)
|
||||
printSecurePassportFirstPage "$1"
|
||||
printSecurePassport "$1"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
8) enableSecurity "$1"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
unset FNAME
|
||||
unset SNAME
|
||||
unset PLANET
|
||||
|
||||
Reference in New Issue
Block a user