Surplus_Up (2DU) 6 лет назад
Родитель
Сommit
4ef63f9fa6
3 измененных файлов с 23 добавлено и 13 удалено
  1. 21 9
      route/tool/func.py
  2. 1 3
      route/topic.py
  3. 1 1
      route/topic_tool.py

+ 21 - 9
route/tool/func.py

@@ -801,11 +801,11 @@ def slow_edit_check():
 
     return 0
 
-def acl_check(name = 'test', tool = '', topic_num = 'test'):
+def acl_check(name = 'test', tool = '', topic_num = '1'):
     ip = ip_check()
     get_ban = ban_check()
+    
     acl_c = re.search("^user:((?:(?!\/).)*)", name)
-
     if tool == '' and name and acl_c:
         acl_n = acl_c.groups()
 
@@ -887,9 +887,12 @@ def acl_check(name = 'test', tool = '', topic_num = 'test'):
             num = 5
 
         acl_data = curs.fetchall()
-        if ((not acl_data and i == (end - 1)) or (acl_data and acl_data[0][0] != 'ban')) and get_ban == 1 and tool != 'render':
+        if (not acl_data and i == (end - 1)) and get_ban == 1 and tool != 'render':
             return 1
-        elif acl_data and acl_data[0][0] != 'normal':
+        elif acl_data and acl_data[0][0] != 'normal' and acl_data[0][0] != '':
+            if acl_data[0][0] != 'ban' and get_ban == 1 and tool != 'render':
+                return 1
+
             if acl_data[0][0] == 'all' or acl_data[0][0] == 'ban':
                 return 0
             elif acl_data[0][0] == 'user':
@@ -920,11 +923,20 @@ def acl_check(name = 'test', tool = '', topic_num = 'test'):
             elif acl_data[0][0] == 'owner':
                 if admin_check() == 1:
                     return 0
-
-        if tool == 'topic' and topic_num:
-            curs.execute(db_change("select title from rd where code = ? and stop != ''"), [topic_num])
-            if curs.fetchall() and admin_check(3, 'topic (code ' + topic_num + ')') == 1:
-                return 0
+        else:
+            if i == (end - 1):
+                if tool == 'topic':
+                    if topic_num:
+                        curs.execute(db_change("select title from rd where code = ? and stop != ''"), [topic_num])
+                        if curs.fetchall():
+                            if admin_check(3, 'topic (code ' + topic_num + ')') == 1:
+                                return 0
+                        else:
+                            return 0
+                    else:
+                        return 0
+                else:
+                    return 0
 
     return 1
 

+ 1 - 3
route/topic.py

@@ -97,9 +97,7 @@ def topic_2(conn, topic_num):
     else:
         data = ''
 
-        curs.execute(db_change("select stop from rd where code = ? and stop != ''"), [topic_num])
-        close_data = curs.fetchall()
-        if (close_data and admin != 1) or ban == 1:
+        if ban == 1:
             display = 'display: none;'
         else:
             display = ''

+ 1 - 1
route/topic_tool.py

@@ -33,7 +33,7 @@ def topic_tool_2(conn, topic_num):
         <h2>''' + load_lang('tool') + '''</h2>
         <ul>
             <li><a id="reload" href="javascript:void(0);" onclick="req_alarm();">''' + load_lang('use_push_alarm') + '''</a></li>
-            <li>''' + load_lang('topic_state') + ''' : ''' + t_state + '' + (' (Agree)' if close_data and (close_data[0][1] == 'O') else '') + '''</li>
+            <li>''' + load_lang('topic_state') + ''' : ''' + t_state + '' + (' (agree)' if close_data and (close_data[0][1] == 'O') else '') + '''</li>
             <li>''' + load_lang('topic_acl') + ''' : <a href="/acl/TEST#exp">''' + ('normal' if not topic_acl_get or (topic_acl_get[0][0] == '') else topic_acl_get[0][0]) + '''</a></li>
         </ul>
     '''