2du 4 years ago
parent
commit
23ac24c6b4
7 changed files with 42 additions and 15 deletions
  1. 2 0
      lang/en-US.json
  2. 3 1
      lang/ko-KR.json
  3. 11 7
      route/main_error_404.py
  4. 1 1
      route/main_func_upload.py
  5. 4 1
      route/tool/func.py
  6. 19 3
      route/topic_tool_acl.py
  7. 2 2
      version.json

+ 2 - 0
lang/en-US.json

@@ -377,9 +377,11 @@
             "ban_acl" : "Include blocked users",
             "ban_admin_acl" : "Blocked users and administrators",
             "30_day_acl" : "Only members 30 days after sign up",
+            "not_all_acl" : "All prohibited",
             "_comment_2.6_1_" : "Set",
                 "document_acl" : "Document ACL",
                 "discussion_acl" : "Discussion(s) ACL",
+                "thread_acl" : "Thread ACL",
                 "view_acl" : "Reading ACL",
                 "user_document_acl" : "User document ACL",
                 "upload_acl" : "Upload ACL",

+ 3 - 1
lang/ko-KR.json

@@ -443,5 +443,7 @@
     "tls_method": "TLS 방식",
     "title_max_length": "문서 제목 최대 길이",
     "title_topic_max_length": "토론 제목 최대 길이",
-    "error_title_length_too_long": "문서 제목이나 토론 제목의 길이가 너무 깁니다. 최대 글자 수 : "
+    "error_title_length_too_long": "문서 제목이나 토론 제목의 길이가 너무 깁니다. 최대 글자 수 : ",
+    "thread_acl": "스레드 ACL",
+    "not_all_acl": "전부 금지"
 }

+ 11 - 7
route/main_error_404.py

@@ -1,10 +1,14 @@
 from .tool.func import *
 
 def main_error_404(e = ''):
-    if os.path.exists('404.html') and flask.request.path != '/':
-        return open('404.html', encoding = 'utf8').read(), 404
-    else:
-        curs.execute(db_change('select data from other where name = "frontpage"'))
-        db_data = curs.fetchall()
-        db_data = db_data[0][0] if db_data and db_data[0][0] != '' else 'FrontPage'
-        return redirect('/w/' + db_data)
+    with get_db_connect() as conn:
+        curs = conn.cursor()
+        
+        if os.path.exists('404.html') and flask.request.path != '/':
+            return open('404.html', encoding = 'utf8').read(), 404
+        else:
+            curs.execute(db_change('select data from other where name = "frontpage"'))
+            db_data = curs.fetchall()
+            db_data = db_data[0][0] if db_data and db_data[0][0] != '' else 'FrontPage'
+            
+            return redirect('/w/' + db_data)

+ 1 - 1
route/main_func_upload.py

@@ -9,7 +9,7 @@ def main_func_upload():
         
         curs.execute(db_change('select data from other where name = "upload"'))
         db_data = curs.fetchall()
-        file_max = int(number_check(db_data[0][0]) if db_data and db_data[0][0] != '' else '2'
+        file_max = int(number_check(db_data[0][0])) if db_data and db_data[0][0] != '' else '2'
 
         if flask.request.method == 'POST':
             if captcha_post(flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:

+ 4 - 1
route/tool/func.py

@@ -369,6 +369,8 @@ def get_db_table_list():
     create_data['back'] = ['title', 'link', 'type']
 
     # 폐지 예정 (topic_set으로 통합) [가장 시급]
+    create_data['topic_set'] = ['thread_code', 'set_name', 'set_id', 'set_data']
+
     create_data['rd'] = ['title', 'sub', 'code', 'date', 'band', 'stop', 'agree', 'acl']
     create_data['topic'] = ['id', 'data', 'date', 'ip', 'block', 'top', 'code']
 
@@ -2115,7 +2117,8 @@ def re_error(data):
         elif num == 17:
             curs.execute(db_change('select data from other where name = "upload"'))
             db_data = curs.fetchall()
-            file_max = int(number_check(db_data[0][0]) if db_data and db_data[0][0] != '' else '2'
+            file_max = int(number_check(db_data[0][0])) if db_data and db_data[0][0] != '' else '2'
+
             data = load_lang('file_capacity_error') + file_max
         elif num == 18:
             data = load_lang('email_send_error')

+ 19 - 3
route/topic_tool_acl.py

@@ -23,6 +23,7 @@ def topic_tool_acl(topic_num = 1):
             topic_check = curs.fetchall()
             if topic_check:
                 acl_data = flask.request.form.get('acl', '')
+                acl_data_view = flask.request.form.get('acl_view', '')
 
                 curs.execute(db_change("update rd set acl = ? where code = ?"), [
                     acl_data,
@@ -43,6 +44,7 @@ def topic_tool_acl(topic_num = 1):
         else:
             acl_list = get_acl_list()
             acl_html_list = ''
+            acl_html_list_view = ''
 
             curs.execute(db_change("select acl from rd where code = ?"), [topic_num])
             topic_acl_get = curs.fetchall()
@@ -54,16 +56,30 @@ def topic_tool_acl(topic_num = 1):
 
                 acl_html_list += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
 
+            curs.execute(db_change("select set_data from topic_set where thread_code = ? and set_name = 'thread_view_acl'"), [topic_num])
+            db_data = curs.fetchall()
+            for data_list in acl_list:
+                if db_data and db_data[0][0] == data_list:
+                    check = 'selected="selected"'
+                else:
+                    check = ''
+
+                acl_html_list_view += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
+
             return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('topic_acl_setting'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
                 data = '''
                     <form method="post">
                         <a href="/acl/TEST#exp">(''' + load_lang('reference') + ''')</a>
-                        <hr>
+                        <h2>''' + load_lang('thread_acl') + '''</h2>
                         <select name="acl">
-                        ''' + acl_html_list + '''
+                            ''' + acl_html_list + '''
+                        </select>
+                        <h2>''' + load_lang('view_acl') + '''</h2>
+                        <select name="acl_view">
+                            ''' + acl_html_list_view + '''
                         </select>
-                        <hr class=\"main_hr\">
+                        <hr class="main_hr">
                         <button type="submit">''' + load_lang('save') + '''</button>
                     </form>
                 ''',

+ 2 - 2
version.json

@@ -1,7 +1,7 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.5 (stable2) (beta3) (dev15)",
-        "c_ver" : "3500107",
+        "r_ver" : "v3.4.5 (stable2) (beta3) (dev16)",
+        "c_ver" : "3500108",
         "s_ver" : "3500110"
     }
 }