From fa9915e4048726ae36dcbdddd346c59816f4d29c Mon Sep 17 00:00:00 2001 From: rhatto Date: Sat, 7 Oct 2006 13:40:25 +0000 Subject: added pubkey information --- firma | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to 'firma') diff --git a/firma b/firma index d06a5c9..593d02e 100755 --- a/firma +++ b/firma @@ -107,7 +107,8 @@ Tasks can be one or more of the following: use EMAIL-ADDRESS use the given address for message delivery instead of the primary address on key -Report bugs to " +Report bugs to , encrypting the message using the pubkey +D68AFEDC available at keyserver.noreply.org." } @@ -943,6 +944,10 @@ function ListAdministration { echo >&2 "$1: missing arguments (try \"help\")" return_code=1 ;; + unsub) + echo >&2 "$1: missing arguments (try \"help\")" + return_code=1 + ;; *) echo >&2 "Command not found -- $1 (try \"help\")" return_code=1 @@ -953,11 +958,20 @@ function ListAdministration { case $1 in use) # check if argument is an email address - if ! echo $2 | grep -q '[^@]\+@[^@]\+'; then + if CheckValidEmail $2; then + ChooseUid $2 + else echo >&2 "$1: invalid argument -- $2 (try \"help\")" return_code=1 + fi + ;; + unsub) + # check if argument is an email address + if CheckValidEmail $2; then + UnsubscribeUser $2 else - ChooseUid $2 + echo >&2 "$1: invalid argument -- $2 (try \"help\")" + return_code=1 fi ;; help|quit) @@ -1122,6 +1136,31 @@ function CheckListPermissions { fi } + +function CheckValidEmail { + #------------------------------------------------------------- + # check if argument is a valid email address + # + # parameter(s): string + # depends on function(s): none + # returns: 0 if string represents a valid email address + # 1 if not + #------------------------------------------------------------- + + if ! echo $2 | grep -q '[^@]\+@[^@]\+'; then + return 1 + else + return 0 + fi +} + + +function UnsubscribeUser { + # TODO: usubscribe if $1 is subscriber + # always fix list folder permissions + true +} + #------------------------------------------------------------- # main() #------------------------------------------------------------- @@ -1183,7 +1222,8 @@ FUNCTIONS=" ListAdministration ChooseUid CheckPermission - CheckListPermissions" + CheckListPermissions + UnsubscribeUser" for VAR in $GLOBAL_VARS; do declare $VAR -- cgit v1.2.3