Bladeren bron

Remove by key id

Bob Mottram 8 jaren geleden
bovenliggende
commit
63f8de0023
1 gewijzigde bestanden met toevoegingen van 9 en 4 verwijderingen
  1. 9
    4
      src/freedombone-controlpanel-user

+ 9
- 4
src/freedombone-controlpanel-user Bestand weergeven

@@ -469,7 +469,7 @@ function remove_gpg_key {
469 469
     trap "rm -f $data" 0 1 2 5 15
470 470
     dialog --title $"Remove someone's PGP/GPG key" \
471 471
            --backtitle $"Freedombone User Control Panel" \
472
-           --inputbox $"Enter their email address below" 8 60 2>$data
472
+           --inputbox $"Enter their email address or key ID below" 8 60 2>$data
473 473
     sel=$?
474 474
     case $sel in
475 475
         0)
@@ -485,9 +485,14 @@ function remove_gpg_key {
485 485
                                --msgbox $"It's not a good idea to remove your own encryption key" 6 65
486 486
                     fi
487 487
                 else
488
-                    dialog --title $"Unrecognised email address" \
489
-                           --backtitle $"Freedombone User Control Panel" \
490
-                           --msgbox $"This doesn't look like an email address" 6 50
488
+                    if [[ $REMOVE_EMAIL_ADDRESS == "0x"* ]]; then
489
+                        clear
490
+                        gpg --delete-key $REMOVE_EMAIL_ADDRESS
491
+                    else
492
+                        dialog --title $"Unrecognised email address" \
493
+                               --backtitle $"Freedombone User Control Panel" \
494
+                               --msgbox $"This doesn't look like an email address" 6 50
495
+                    fi
491 496
                 fi
492 497
             fi
493 498
             ;;