# HG changeset patch # User Matti Hamalainen # Date 1594122160 -10800 # Node ID 1044fbacb8a7ed247452f0233dcf2ed6a52334d0 # Parent edbc0190e82ab9b4a02a9c4964fcde73d6d3982a weather: Use utl_valid_user instead of weather_valid_user. diff -r edbc0190e82a -r 1044fbacb8a7 weather.tcl --- 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 }