diff options
author | rhatto <rhatto> | 2006-10-07 13:40:25 +0000 |
---|---|---|
committer | rhatto <rhatto> | 2006-10-07 13:40:25 +0000 |
commit | fa9915e4048726ae36dcbdddd346c59816f4d29c (patch) | |
tree | bdef5407f50f06201b8c05ee1d7e0464def2c2ef /firma | |
parent | 34041481029c4794c296987077d0e5e459f7ee67 (diff) | |
download | firma-fa9915e4048726ae36dcbdddd346c59816f4d29c.tar.gz firma-fa9915e4048726ae36dcbdddd346c59816f4d29c.tar.bz2 |
added pubkey information
Diffstat (limited to 'firma')
-rwxr-xr-x | firma | 48 |
1 files changed, 44 insertions, 4 deletions
@@ -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 <firma@sarava.org>" +Report bugs to <firma@sarava.org>, 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 |