ソースを参照

Merge branch 'master' of https://github.com/2DU/opennamu

Surplus_Up (2DU) 6 年 前
コミット
dce3169b59
4 ファイル変更14 行追加3 行削除
  1. 2 1
      language/en-US.json
  2. 2 1
      language/ko-KR.json
  3. 1 0
      route/give_acl.py
  4. 9 1
      route/tool/func.py

+ 2 - 1
language/en-US.json

@@ -198,7 +198,6 @@
         "blocked_user" : "Blocked user",
         "blocked_admin" : "Blocked administrator",
         "category_title" : "Documents under this category",
-        "ban_acl" : "Include blocked users",
         "topic_name_change" : "Change discussion name",
         "topic_acl_setting" : "Discussion ACL setting",
         "topic_acl" : "Discussion ACL",
@@ -325,6 +324,8 @@
             "all_acl" : "All users",
             "email_acl" : "Only users with email",
             "owner_acl" : "Owner only",
+            "before_acl" : "Only those who have edited this document before",
+            "ban_acl" : "Include blocked users",
             "_comment_2.6_1_" : "Set",
                 "document_acl" : "Document ACL",
                 "discussion_acl" : "Discussion(s) ACL",

+ 2 - 1
language/ko-KR.json

@@ -372,5 +372,6 @@
     "get_sitemap" : "sitemap.xml 만들거나 갱신하기",
     "same_ip_exist" : "동일한 아이피가 존재합니다.",
     "restart_fail_error" : "재시작이 실패했습니다. 수동 재시작을 이용해주세요.",
-    "domain" : "도메인"
+    "domain" : "도메인",
+    "before_acl" : "이 문서를 이전에 편집한 적 있는 사람만"
 }

+ 1 - 0
route/give_acl.py

@@ -122,6 +122,7 @@ def give_acl_2(conn, name):
                     <li>email : ''' + load_lang('email_acl') + '''</li>
                     <li>owner : ''' + load_lang('owner_acl') + '''</li>
                     <li>ban : ''' + load_lang('ban_acl') + '''</li>
+                    <li>before : ''' + load_lang('before_acl') + '''</li>
                 </ul>
             '''
 

+ 9 - 1
route/tool/func.py

@@ -1005,6 +1005,14 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
                         count = count[0][0] if count else 0
                         if count >= 50:
                             return 0
+            elif acl_data[0][0] == 'before':
+                if ip_or_user(ip) != 1:
+                    if admin_check(num) == 1:
+                        return 0
+                
+                curs.execute(db_change("select ip from history where title = ? and ip = ?"), [name, ip])
+                if curs.fetchall():
+                    return 0
             elif acl_data[0][0] == 'email':
                 if ip_or_user(ip) != 1:
                     if admin_check(num) == 1:
@@ -1207,7 +1215,7 @@ def redirect(data = '/'):
     return flask.redirect(data)
 
 def get_acl_list(type_d = None):
-    acl_data = ['', 'all', 'user', 'admin', 'owner', '50_edit', 'email', 'ban']
+    acl_data = ['', 'all', 'user', 'admin', 'owner', '50_edit', 'email', 'ban', 'before']
     if type_d:
         if type_d == 'user':
             acl_data = ['', 'user', 'all']