فهرست منبع

버그 수정

Surplus_Up (2DU) 6 سال پیش
والد
کامیت
938fed2a9c
4فایلهای تغییر یافته به همراه13 افزوده شده و 4 حذف شده
  1. 9 1
      route/tool/func.py
  2. 2 1
      route/topic.py
  3. 1 1
      route/topic_close_list.py
  4. 1 1
      version.json

+ 9 - 1
route/tool/func.py

@@ -853,6 +853,14 @@ def acl_check(name = 'test', tool = '', topic_num = 'test'):
     if tool == '':
         end = 3
     elif tool == 'topic' or tool == 'render':
+        if not name:
+            curs.execute(db_change("select title from topic where code = ? and id = '1'"), [topic_num])
+            topic_data = curs.fetchall()
+            if topic_data:
+                name = topic_data[0][0]
+            else:
+                name = 'test'
+
         end = 2
     else:
         end = 1
@@ -937,7 +945,7 @@ def acl_check(name = 'test', tool = '', topic_num = 'test'):
                 if admin_check() != 1:
                     return 1
 
-        if tool == 'topic':
+        if tool == 'topic' and 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:

+ 2 - 1
route/topic.py

@@ -3,7 +3,6 @@ from .tool.func import *
 def topic_2(conn, topic_num):
     curs = conn.cursor()
 
-    ban = acl_check(None, 'topic', topic_num)
     admin = admin_check(3)
     topic_num = str(topic_num)
 
@@ -19,6 +18,8 @@ def topic_2(conn, topic_num):
         else:
             return redirect('/')
 
+    ban = acl_check(name, 'topic', topic_num)
+
     if flask.request.method == 'POST':
         if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1:
             return re_error('/error/13')

+ 1 - 1
route/topic_close_list.py

@@ -21,7 +21,7 @@ def topic_close_list_2(conn, name):
         sub = load_lang('discussion_list')
         menu = [['w/' + url_pas(name), load_lang('document')]]
 
-        if acl_check(None, 'topic', topic_num) == 1:
+        if acl_check(name, 'topic', None) == 1:
             display = 'display: none;'
         else:
             display = ''

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.7-master-04",
+        "r_ver" : "v3.1.7-master-05",
         "c_ver" : "3170400",
         "s_ver" : "7"
     }, "stable" : {