Selaa lähdekoodia

다중 파일 업로드 ACL

Surplus_Up (2DU) 6 vuotta sitten
vanhempi
sitoutus
dde725a327
6 muutettua tiedostoa jossa 25 lisäystä ja 15 poistoa
  1. 1 0
      language/en-US.json
  2. 2 1
      language/ko-KR.json
  3. 3 0
      route/func_upload.py
  4. 14 13
      route/setting.py
  5. 4 0
      route/tool/func.py
  6. 1 1
      version.json

+ 1 - 0
language/en-US.json

@@ -324,6 +324,7 @@
                 "user_document_acl" : "User document ACL",
                 "upload_acl" : "Upload ACL",
                 "edit_req_acl" : "Edit request ACL",
+                "many_upload_acl" : "Upload multiple files ACL",
         "_comment_2.7_" : "Application list",
             "application_list": "Application list",
             "application_time": "Application time",

+ 2 - 1
language/ko-KR.json

@@ -358,5 +358,6 @@
     "topic_acl_setting" : "토론 ACL 설정",
     "topic_acl" : "토론 ACL",
     "main_skin_set" : "기본 스킨 설정",
-    "image_file_list" : "이미지 파일 목록"
+    "image_file_list" : "이미지 파일 목록",
+    "many_upload_acl" : "다중 파일 업로드 ACL"
 }

+ 3 - 0
route/func_upload.py

@@ -19,6 +19,9 @@ def func_upload_2(conn):
         if len(file_data) == 1:
             file_num = None
         else:
+            if acl_check(None, 'many_upload') == 1:
+                return re_error('/ban')
+
             file_num = 1
 
         for data in file_data:

+ 14 - 13
route/setting.py

@@ -560,20 +560,14 @@ def setting_2(conn, num):
             2 : 'discussion',
             3 : 'upload_acl',
             4 : 'all_view_acl',
-            5 : 'edit_req_acl'
-        }
-        n_list = {
-            1 : 'normal',
-            2 : 'normal',
-            3 : 'normal',
-            4 : 'normal',
-            5 : 'normal'
+            5 : 'edit_req_acl',
+            6 : 'many_upload_acl'
         }
 
         if flask.request.method == 'POST':
             for i in i_list:
                 curs.execute(db_change("update other set data = ? where name = ?"), [
-                    flask.request.form.get(i_list[i], n_list[i]),
+                    flask.request.form.get(i_list[i], 'normal'),
                     i_list[i]
                 ])
 
@@ -591,15 +585,18 @@ def setting_2(conn, num):
                 if sql_d:
                     d_list[i] = sql_d[0][0]
                 else:
-                    curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i_list[i], n_list[i]])
+                    curs.execute(db_change('insert into other (name, data) values (?, ?)'), [i_list[i], 'normal'])
 
-                    d_list[i] = n_list[i]
+                    d_list[i] = 'normal'
 
             conn.commit()
 
-            acl_div = ['', '', '', '', '']
+            acl_div = []
+            for i in range(0, len(i_list)):
+                acl_div += ['']
+
             acl_list = get_acl_list()
-            for i in range(0, 5):
+            for i in range(0, len(i_list)):
                 for data_list in acl_list:
                     if data_list == d_list[i + 1]:
                         check = 'selected="selected"'
@@ -633,7 +630,11 @@ def setting_2(conn, num):
                         <span>''' + load_lang('edit_req_acl') + '''</span>
                         <hr class=\"main_hr\">
                         <select name="edit_req_acl">''' + acl_div[4] + '''</select>
+                        <hr>
+                        <span>''' + load_lang('many_upload_acl') + '''</span>
                         <hr class=\"main_hr\">
+                        <select name="many_upload_acl">''' + acl_div[5] + '''</select>
+                        <hr>
                         <button id="save" type="submit">''' + load_lang('save') + '''</button>
                     </form>
                 ''',

+ 4 - 0
route/tool/func.py

@@ -908,6 +908,10 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
         elif tool == 'upload':
             curs.execute(db_change("select data from other where name = 'upload_acl'"))
 
+            num = 5
+        elif tool == 'many_upload':
+            curs.execute(db_change("select data from other where name = 'many_upload_acl'"))
+
             num = 5
         elif tool == 'edit_req':
             curs.execute(db_change("select data from other where name = 'edit_req_acl'"))

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.8-master-14",
+        "r_ver" : "v3.1.8-master-15",
         "c_ver" : "3180200",
         "s_ver" : "8"
     }, "stable" : {