changeset 666:79b5d8944eea

feeds: Improve admin checks.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 20 Feb 2021 17:52:49 +0200
parents 4156adacdc31
children 88d0e2ba73ca
files feeds.tcl
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/feeds.tcl	Sat Feb 20 17:45:13 2021 +0200
+++ b/feeds.tcl	Sat Feb 20 17:52:49 2021 +0200
@@ -170,6 +170,8 @@
   set rarglist [::textutil::split::splitx $uargs {\s+}]
   set rcmd [lindex $rarglist 0]
   set rargs [lrange $rarglist 1 end]
+  set qadmin [matchattr $uhand n]
+#  set qadmin 0
 
   if {[feeds_cmd_match "help" $rcmd]} {
     # Show help
@@ -197,8 +199,9 @@
     }
   } elseif {[feeds_cmd_match "force" $rcmd]} {
     # Force check for new entries
-    if {![matchattr $uhand n]} {
+    if {!$qadmin} {
       feeds_msg $upublic $unick $uchan "no_access"
+      return 0
     }
 
     feeds_check_do 1 $upublic $unick $uchan
@@ -210,7 +213,7 @@
       # Long list
       set utext [string tolower [join [lrange $rargs 1 end] " "]]
 
-      if {$upublic && ![matchattr $uhand n]} {
+      if {$upublic && !$qadmin} {
         feeds_msg $upublic $unick $uchan "feed_list_long_denied" [list $rcmd $utext]
         return 0
       }
@@ -271,7 +274,7 @@
     }
 
     set utext [string tolower [join $rargs " "]]
-    if {$upublic && ![matchattr $uhand n]} {
+    if {$upublic && !$qadmin} {
       feeds_msg $upublic $unick $uchan "feed_list_long_denied" [list $rcmd $utext]
       return 0
     }