Mercurial > hg > egg-tcls
changeset 536:1044fbacb8a7
weather: Use utl_valid_user instead of weather_valid_user.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 07 Jul 2020 14:42:40 +0300 |
parents | edbc0190e82a |
children | 210d22dac6d4 |
files | weather.tcl |
diffstat | 1 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/weather.tcl Tue Jul 07 14:41:46 2020 +0300 +++ b/weather.tcl Tue Jul 07 14:42:40 2020 +0300 @@ -69,14 +69,6 @@ } -proc weather_valid_user {uhand} { - if {$uhand != "" && $uhand != "{}" && $uhand != "*"} { - return 1 - } - return 0 -} - - #------------------------------------------------------------------------- proc weather_load_aliases {} { global weather_aliasfile weather_aliases @@ -407,7 +399,7 @@ # List or set the default weather station name patterns for this user # Access check - if {![weather_valid_user $uhand]} { + if {![utl_valid_user $uhand]} { weather_msg $upublic $unick $uchan $weather_msg_user_not_known return 0 } @@ -435,7 +427,7 @@ return 0 } elseif {$rcmd == "alias"} { # Alias a string to another, only certain users have access (+n flag) - if {![weather_valid_user $uhand] || ![matchattr $uhand n]} { + if {![utl_valid_user $uhand] || ![matchattr $uhand n]} { weather_msg $upublic $unick $uchan $weather_msg_no_access return 0 } @@ -456,7 +448,7 @@ return 0 } elseif {$rcmd == "unalias"} { # Remove one alias, only certain users have access (+n flag) - if {![weather_valid_user $uhand] || ![matchattr $uhand n]} { + if {![utl_valid_user $uhand] || ![matchattr $uhand n]} { weather_msg $upublic $unick $uchan $weather_msg_no_access return 0 }