2
0
잉여개발기 (SPDV) 3 жил өмнө
parent
commit
1dce3b8b4d

+ 16 - 12
lang/en-US.json

@@ -383,19 +383,23 @@
             "180_day" : "180 days",
             "360_day" : "360 days",
         "_comment_2.6_" : "ACL",
-            "admin_acl" : "Administrators only",
-            "member_acl" : "Members only",
-            "50_edit_acl" : "Only members with 50 or more document edits",
-            "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",
-            "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",
+            "_comment_" : "Set data",
+                "admin_acl" : "Administrators, owners",
+                "member_acl" : "Members",
+                "50_edit_acl" : "Members with 50 or more document edits, administrators, owners",
+                "all_acl" : "All users exclude blocked users",
+                "email_acl" : "Members with email, administrators, owners",
+                "owner_acl" : "Owners",
+                "before_acl" : "Those who have edited this document before, administrators, owners",
+                "ban_acl" : "All users include blocked users",
+                "ban_admin_acl" : "Blocked users, administrators, owners",
+                "30_day_acl" : "Members 30 days after sign up, administrators, owners",
+                "not_all_acl" : "All prohibited",
+            "_comment_" : "Set name",
                 "document_acl" : "Document ACL",
+                "document_edit_acl" : "Document edit ACL",
+                "document_move_acl" : "Document move ACL",
+                "document_delete_acl" : "Document delete ACL",
                 "discussion_acl" : "Discussion(s) ACL",
                 "thread_acl" : "Thread ACL",
                 "view_acl" : "Reading ACL",

+ 15 - 12
lang/ko-KR.json

@@ -46,7 +46,6 @@
     "state": "상태",
     "authorize": "권한 부여",
     "check_user": "사용자 검사",
-    "email_acl": "이메일 인증을 받은 사용자만",
     "email_error": "해당 이메일을 가진 사용자가 존재하지 않습니다.",
     "version": "버전",
     "open": "열기",
@@ -64,7 +63,6 @@
     "no_login_error": "비로그인 상태입니다.",
     "upload": "파일 올리기",
     "user_name": "사용자 이름",
-    "member_acl": "가입자만",
     "search": "검색",
     "etc": "기타",
     "edit_filter": "편집 필터",
@@ -81,7 +79,6 @@
     "password_diffrent_error": "입력한 비밀번호와 비밀번호 확인이 서로 다릅니다.",
     "180_day": "180일",
     "markup_enabled": "문법 사용 가능",
-    "all_acl": "모든 사용자",
     "send": "전송",
     "not_sure": "확실하지 않음",
     "file_name_error": "파일명에는 알파벳, 한글, 공백, 밑줄 및 빼기 기호만 사용할 수 있습니다.",
@@ -145,7 +142,6 @@
     "host": "호스트",
     "email_text": "이메일 내용",
     "recent": "최근",
-    "admin_acl": "관리자만",
     "wiki_host": "위키 호스트",
     "error_404": "존재하지 않는 문서 문구",
     "member_list": "사용자 목록",
@@ -274,7 +270,6 @@
     "hide_release": "숨김 해제",
     "360_day": "360일",
     "inter_error": "내부 오류.",
-    "50_edit_acl": "기여 횟수가 50회 이상인 가입자만",
     "tool": "도구",
     "adsense_enable": "애드센스 사용",
     "list": "목록",
@@ -291,7 +286,6 @@
     "acl_record": "ACL 기록",
     "main_bottom_body": "본문 하단",
     "reference": "참고",
-    "owner_acl": "소유자만",
     "last_edit_time": "최근 수정 시각",
     "link": "링크",
     "icon": "아이콘",
@@ -345,8 +339,6 @@
     "extension_filter_list": "확장자 필터 목록",
     "extension_filter_add": "확장자 필터 추가",
     "extension": "확장자",
-    "ban_acl": "차단된 사용자 포함",
-    "ban_admin_acl": "차단된 사용자 및 관리자",
     "topic_name_change": "토론 제목 변경",
     "topic_acl_setting": "토론 ACL 설정",
     "topic_acl": "토론 ACL",
@@ -366,8 +358,6 @@
     "same_ip_exist": "동일한 아이피가 존재합니다.",
     "restart_fail_error": "재시작이 실패했습니다. 수동 재시작을 이용해주세요.",
     "domain": "도메인",
-    "before_acl": "이 문서를 이전에 편집한 적 있는 사람만",
-    "30_day_acl": "가입 후 30일이 지난 가입자만",
     "simple_check": "간편 검사",
     "add_user": "계정 추가",
     "result": "결과",
@@ -445,7 +435,6 @@
     "title_topic_max_length": "토론 제목 최대 길이",
     "error_title_length_too_long": "문서 제목이나 토론 제목의 길이가 너무 깁니다. 최대 글자 수 : ",
     "thread_acl": "스레드 ACL",
-    "not_all_acl": "전부 금지",
     "password_min_length": "비밀번호 최소 길이",
     "error_password_length_too_short": "비밀번호 길이가 너무 짧습니다. 최소 글자 수 : ",
     "phrase_user_page_admin": "관리자인 사용자 문서 문구",
@@ -462,5 +451,19 @@
     "stiemap_exclude_file_page": "파일 문서 제외",
     "stiemap_exclude_category_page": "분류 문서 제외",
     "search_document_name": "문서명 검색",
-    "search_document_data": "문서 내용 검색"
+    "search_document_data": "문서 내용 검색",
+    "admin_acl": "관리자, 소유자",
+    "member_acl": "가입자",
+    "50_edit_acl": "기여 횟수가 50회 이상인 가입자, 관리자, 소유자",
+    "all_acl": "전체 사용자 (차단자 제외)",
+    "email_acl": "이메일을 등록한 가입자, 관리자, 소유자",
+    "owner_acl": "소유자",
+    "before_acl": "전에 이 문서를 편집한 적 있는 사람, 관리자, 가입자",
+    "ban_acl": "전체 사용자 (차단자 포함)",
+    "ban_admin_acl": "차단자, 관리자, 소유자",
+    "30_day_acl": "가입 후 30일이 지난 가입자, 관리자, 소유자",
+    "not_all_acl": "전부 금지",
+    "document_move_acl": "문서 이동 ACL",
+    "document_delete_acl": "문서 삭제 ACL",
+    "document_edit_acl" : "문서 편집 ACL"
 }

+ 1 - 1
route/edit.py

@@ -5,7 +5,7 @@ def edit(name = 'Test', section = 0, do_type = ''):
         curs = conn.cursor()
     
         ip = ip_check()
-        if acl_check(name) == 1:
+        if acl_check(name, 'document_edit') == 1:
             return redirect('/raw_acl/' + url_pas(name))
         
         if do_title_length_check(name) == 1:

+ 2 - 2
route/edit_delete.py

@@ -5,7 +5,7 @@ def edit_delete(name):
         curs = conn.cursor()
 
         ip = ip_check()
-        if acl_check(name) == 1:
+        if acl_check(name, 'document_delete') == 1:
             return re_error('/ban')
 
         curs.execute(db_change("select title from data where title = ?"), [name])
@@ -64,7 +64,7 @@ def edit_delete(name):
                 imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('delete') + ')', 0])],
                 data = '''
                     <form method="post">
-                        <input placeholder="''' + load_lang('why') + '''" name="send" type="text">
+                        <input placeholder="''' + load_lang('why') + '''" name="send">
                         <hr class="main_hr">
                         ''' + captcha_get() + ip_warning() + get_edit_text_bottom_check_box() + get_edit_text_bottom() + '''
                         <button type="submit">''' + load_lang('delete') + '''</button>

+ 1 - 1
route/edit_move.py

@@ -4,7 +4,7 @@ def edit_move(name):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if acl_check(name) == 1:
+        if acl_check(name, 'document_move') == 1:
             return re_error('/ban')
         
         if do_title_length_check(name) == 1:

+ 1 - 1
route/edit_revert.py

@@ -8,7 +8,7 @@ def edit_revert(name, num):
         if curs.fetchall() and admin_check(6) != 1:
             return re_error('/error/3')
 
-        if acl_check(name) == 1:
+        if acl_check(name, 'document_edit') == 1:
             return re_error('/ban')
         
         curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])

+ 13 - 7
route/give_acl.py

@@ -32,6 +32,9 @@ def give_acl_2(name):
 
         if flask.request.method == 'POST':
             acl_data = [['decu', flask.request.form.get('decu', '')]]
+            acl_data += [['document_edit_acl', flask.request.form.get('document_edit_acl', '')]]
+            acl_data += [['document_move_acl', flask.request.form.get('document_move_acl', '')]]
+            acl_data += [['document_delete_acl', flask.request.form.get('document_delete_acl', '')]]
             acl_data += [['dis', flask.request.form.get('dis', '')]]
             acl_data += [['view', flask.request.form.get('view', '')]]
             acl_data += [['why', flask.request.form.get('why', '')]]
@@ -45,7 +48,7 @@ def give_acl_2(name):
                     curs.execute(db_change("insert into acl (title, data, type) values (?, ?, ?)"), [name, i[1], i[0]])
 
             all_d = ''
-            for i in ['decu', 'dis', 'view']:
+            for i in ['decu', 'document_edit_acl', 'document_move_acl', 'document_delete_acl', 'dis', 'view']:
                 if flask.request.form.get(i, '') == '':
                     all_d += 'normal'
                     if i != 'view':
@@ -65,18 +68,21 @@ def give_acl_2(name):
             acl_list = get_acl_list('user') if re.search(r'^user:', name) else get_acl_list()
             if not re.search(r'^user:', name):
                 acl_get_list = [
-                    [load_lang('document_acl'), 'decu'], 
-                    [load_lang('discussion_acl'), 'dis'], 
-                    [load_lang('view_acl'), 'view']
+                    [load_lang('view_acl'), 'view', '2', '1.'],
+                    [load_lang('document_acl'), 'decu', '3', '1.1.'],
+                    [load_lang('document_edit_acl'), 'document_edit_acl', '4', '1.1.1.'],
+                    [load_lang('document_move_acl'), 'document_move_acl', '4', '1.1.2.'],
+                    [load_lang('document_delete_acl'), 'document_delete_acl', '4', '1.1.3.'],
+                    [load_lang('discussion_acl'), 'dis', '2', '2.'],
                 ]
             else:
                 acl_get_list = [
-                    [load_lang('document_acl'), 'decu']
+                    [load_lang('document_acl'), 'decu', '2', '1.']
                 ]
 
             for i in acl_get_list:
                 data += '' + \
-                    '<h2>' + i[0] + '</h2>' + \
+                    '<h' + i[2] + '>' + i[3] + ' ' + i[0] + (' (' + load_lang('beta') + ')' if i[2] == '4' else '') + '</h' + i[2] + '>' + \
                     '<hr class="main_hr">' + \
                     '<select name="' + i[1] + '" ' + check_ok + '>' + \
                 ''
@@ -95,7 +101,7 @@ def give_acl_2(name):
             acl_why = html.escape(acl_data[0][0]) if acl_data else ''
             data += '' + \
                 '<hr class="main_hr">' + \
-                '<input value="' + acl_why + '" placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>' + \
+                '<input value="' + acl_why + '" placeholder="' + load_lang('why') + '" name="why" ' + check_ok + '>' + \
             ''
 
             data += '''

+ 22 - 1
route/tool/func.py

@@ -1457,7 +1457,7 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
     get_ban = ban_check()
     
     if tool == '' and name:
-        if tool == '' and acl_check(name, 'render') == 1:
+        if acl_check(name, 'render') == 1:
             return 1
         
         user_page = re.search(r"^user:((?:(?!\/).)*)", name)
@@ -1482,6 +1482,9 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
             if ip == user_page and not ip_or_user(ip) == 1:
                 return 0
     
+            return 1
+    elif tool == 'document_edit' or tool == 'document_move' or tool == 'document_delete':
+        if acl_check(name, '') == 1:
             return 1
     elif tool == 'topic':
         curs.execute(db_change("select title from rd where code = ?"), [topic_num])
@@ -1512,6 +1515,24 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
                     'select data from other where name = "edit"'
                 ))
 
+            num = 5
+        elif tool == 'document_move':
+            curs.execute(db_change(
+                "select data from acl where title = ? and type = 'document_move_acl'"
+            ), [name])
+
+            num = 5
+        elif tool == 'document_edit':
+            curs.execute(db_change(
+                "select data from acl where title = ? and type = 'document_edit_acl'"
+            ), [name])
+
+            num = 5
+        elif tool == 'document_delete':
+            curs.execute(db_change(
+                "select data from acl where title = ? and type = 'document_delete_acl'"
+            ), [name])
+
             num = 5
         elif tool == 'topic':
             if i == 0:

+ 4 - 1
route/view_read.py

@@ -35,7 +35,10 @@ def view_read(name = 'Test', doc_rev = 0, doc_from = '', do_type = ''):
                 if data[0].startswith('category:'):
                     category_sub += '<li><a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a></li>'
                 else:
-                    category_doc += '<li><a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a> <a id="inside" href="/xref/' + url_pas(data[0]) + '">(' + load_lang('backlink') + ')</a></li>'
+                    category_doc += '' + \
+                        '<li><a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a> ' + \
+                        '<a id="inside" href="/xref/' + url_pas(data[0]) + '">(' + load_lang('backlink') + ')</a></li>' + \
+                    ''
 
             if category_doc != '':
                 category_doc = '<h2 id="cate_normal">' + load_lang('category_title') + '</h2><ul class="inside_ul">' + category_doc + '</ul>'