Parcourir la source

이메일 ACL과 편집, 보기 ACL 따로 분리

2du il y a 7 ans
Parent
commit
e7830e62bf
4 fichiers modifiés avec 74 ajouts et 67 suppressions
  1. 29 24
      language/en-US.json
  2. 29 24
      language/ko-KR.json
  3. 4 17
      route/give_acl.py
  4. 12 2
      route/tool/func.py

+ 29 - 24
language/en-US.json

@@ -152,10 +152,6 @@
         "user_document" : "User[s] document",
         "user_head" : "User[s] <head>",
         "user_document_acl" : "User[s] document ACL",
-        "admin_acl" : "Admin only",
-        "member_acl" : "Member only",
-        "50_edit_acl" : "Only members with 50 or more all document edits",
-        "all_acl" : "All Users",
         "encryption_method" : "Encryption method",
         "check_key" : "Check authentication key",
         "reset_user_ok" : "Check Success",
@@ -163,26 +159,6 @@
         "ban_period" : "Period to block",
         "not_sure" : "Not sure",
         "use_push_alarm" : "Enable Push Notification",
-        "topic_tool" : "Discussion tool",
-        "topic_state" : "Discussion status",
-        "topic_stop" : "Stop discussion",
-        "topic_close" : "Close discussion",
-        "topic_restart" : "Discussion restart",
-        "topic_open" : "Open discussion",
-        "topic_agreement" : "Discussion agreement",
-        "topic_destruction" : "Cancel discussion agreement",
-        "1_day" : "1 day",
-        "5_day" : "5 days",
-        "30_day" : "30 days",
-        "180_day" : "180 days",
-        "360_day" : "360 days",
-        "edit_button_link" : "Link",
-        "edit_button_footnote" : "Footnote",
-        "edit_button_macro" : "Macro",
-        "edit_button_color" : "Color",
-        "edit_button_bold" : "Bold",
-        "edit_button_strike" : "Strike",
-        "edit_button_big" : "Big",
         "edit_button_paragraph" : "Paragraph",
         "password_change" : "Password change",
         "email_change" : "Email change",
@@ -269,6 +245,35 @@
             "_comment_2.3.3_" : "Record",
                 "edit_record" : "Edit record",
                 "discussion_record" : "Discussion record",
+        "_comment_2.4_" : "Editing textarea",
+            "edit_button_link" : "Link",
+            "edit_button_footnote" : "Footnote",
+            "edit_button_macro" : "Macro",
+            "edit_button_color" : "Color",
+            "edit_button_bold" : "Bold",
+            "edit_button_strike" : "Strike",
+            "edit_button_big" : "Big",
+        "_comment_2.5_" : "Topic tool",
+            "topic_tool" : "Discussion tool",
+            "topic_state" : "Discussion status",
+            "topic_stop" : "Stop discussion",
+            "topic_close" : "Close discussion",
+            "topic_restart" : "Discussion restart",
+            "topic_open" : "Open discussion",
+            "topic_agreement" : "Discussion agreement",
+            "topic_destruction" : "Cancel discussion agreement",
+        "_comment_2.6_" : "Period",
+            "1_day" : "1 day",
+            "5_day" : "5 days",
+            "30_day" : "30 days",
+            "180_day" : "180 days",
+            "360_day" : "360 days",
+        "_comment_2.7_" : "ACL",
+            "admin_acl" : "Admin only",
+            "member_acl" : "Member only",
+            "50_edit_acl" : "Only members with 50 or more all document edits",
+            "all_acl" : "All Users",
+            "email_acl" : "Only users with email",
     "_comment_3_" : "Long",
         "ie_no_data_required" : "Operation cannot continue because all required data has not been collected.",
         "oauth_settings_not_found" : "Administrator has not provided any data about using this feature.",

+ 29 - 24
language/ko-KR.json

@@ -152,10 +152,6 @@
         "user_document" : "사용자 문서",
         "user_head" : "사용자 <head>",
         "user_document_acl" : "사용자 문서 ACL",
-        "admin_acl" : "관리자만",
-        "member_acl" : "가입자만",
-        "50_edit_acl" : "기여 횟수 총합 50회 이상 가입자만",
-        "all_acl" : "모든 사용자",
         "encryption_method" : "암호화 방식",
         "check_key" : "인증키 검사",
         "reset_user_ok" : "검사 성공",
@@ -163,26 +159,6 @@
         "ban_period" : "차단 기간",
         "not_sure" : "확실하지 않음",
         "use_push_alarm" : "푸쉬 알림 사용",
-        "topic_tool" : "토론 도구",
-        "topic_state" : "토론 상태",
-        "topic_stop" : "토론 중지",
-        "topic_close" : "토론 닫기",
-        "topic_restart" : "토론 중지 해제",
-        "topic_open" : "토론 열기",
-        "topic_agreement" : "토론 합의",
-        "topic_destruction" : "토론 합의 취소",
-        "1_day" : "1일",
-        "5_day" : "5일",
-        "30_day" : "30일",
-        "180_day" : "180일",
-        "360_day" : "360일",
-        "edit_button_link" : "링크",
-        "edit_button_footnote" : "각주",
-        "edit_button_macro" : "매크로",
-        "edit_button_color" : "색상",
-        "edit_button_bold" : "강조",
-        "edit_button_strike" : "취소선",
-        "edit_button_big" : "크게",
         "edit_button_paragraph" : "문단",
         "password_change" : "비밀번호 변경",
         "email_change" : "이메일 변경",
@@ -269,6 +245,35 @@
             "_comment_2.3.3_" : "기록",
                 "edit_record" : "편집 기록",
                 "discussion_record" : "토론 기록",
+        "_comment_2.4_" : "편집창",
+            "edit_button_link" : "링크",
+            "edit_button_footnote" : "각주",
+            "edit_button_macro" : "매크로",
+            "edit_button_color" : "색상",
+            "edit_button_bold" : "강조",
+            "edit_button_strike" : "취소선",
+            "edit_button_big" : "크게",
+        "_comment_2.5_" : "토론 도구",
+            "topic_tool" : "토론 도구",
+            "topic_state" : "토론 상태",
+            "topic_stop" : "토론 중지",
+            "topic_close" : "토론 닫기",
+            "topic_restart" : "토론 중지 해제",
+            "topic_open" : "토론 열기",
+            "topic_agreement" : "토론 합의",
+            "topic_destruction" : "토론 합의 취소",
+        "_comment_2.6_" : "기간",
+            "1_day" : "1일",
+            "5_day" : "5일",
+            "30_day" : "30일",
+            "180_day" : "180일",
+            "360_day" : "360일",
+        "_comment_2.7_" : "ACL",
+            "admin_acl" : "관리자만",
+            "member_acl" : "가입자만",
+            "50_edit_acl" : "기여 횟수 총합 50회 이상 가입자만",
+            "all_acl" : "모든 사용자",
+            "email_acl" : "이메일을 가진 유저만",
     "_comment_3_" : "장문",
         "ie_no_data_required" : "이 기능을 수행하는데 필요한 데이터가 제공되지 않았습니다.",
         "oauth_settings_not_found" : "관리자가 이 기능을 수행하는데 필요한 데이터를 제공하지 않았습니다.",

+ 4 - 17
route/give_acl.py

@@ -29,22 +29,8 @@ def give_acl_2(conn, name):
                 check_ok = 'disabled'
 
     if flask.request.method == 'POST':
-        if flask.request.form.get('view', None):
-            if flask.request.form.get('dec', '') != flask.request.form.get('view', ''):
-                dec = flask.request.form.get('view', '')
-                view = flask.request.form.get('view', '')
-
-                if view == 'normal':
-                    dec = flask.request.form.get('dec', '') 
-                elif view == 'user':
-                    if dec == 'admin':
-                        dec = flask.request.form.get('dec', '')
-            else:
-                dec = flask.request.form.get('dec', '')
-                view = flask.request.form.get('view', '')
-        else:
-            dec = flask.request.form.get('dec', '')
-            view = flask.request.form.get('view', '')
+        dec = flask.request.form.get('dec', '')
+        view = flask.request.form.get('view', '')
 
         curs.execute("select title from acl where title = ?", [name])
         if curs.fetchall():
@@ -68,7 +54,7 @@ def give_acl_2(conn, name):
         if re.search('^user:', name):
             acl_list = [['', 'normal'], ['user', 'member'], ['all', 'all']]
         else:
-            acl_list = [['', 'normal'], ['user', 'member'], ['admin', 'admin'], ['50_edit', '50 edit']]
+            acl_list = [['', 'normal'], ['user', 'member'], ['admin', 'admin'], ['50_edit', '50 edit'], ['email', 'email']]
         
         curs.execute("select dec from acl where title = ?", [name])
         acl_data = curs.fetchall()
@@ -115,6 +101,7 @@ def give_acl_2(conn, name):
                     <li>member : ''' + load_lang('member_acl') + '''</li>
                     <li>50 edit : ''' + load_lang('50_edit_acl') + '''</li>
                     <li>all : ''' + load_lang('all_acl') + '''</li>
+                    <li>all : ''' + load_lang('email_acl') + '''</li>
                 </ul>
             '''
                 

+ 12 - 2
route/tool/func.py

@@ -780,14 +780,14 @@ def acl_check(name, tool = ''):
                 if ip_or_user(ip) == 1:
                     return 1
 
-                if admin_check(5, 'topic send (' + name + ')') != 1:
+                if admin_check(5) != 1:
                     return 1
 
             if acl_data[0][0] == '50_edit':
                 if ip_or_user(ip) == 1:
                     return 1
                 
-                if admin_check(5, 'topic send (' + name + ')') != 1:
+                if admin_check(5) != 1:
                     curs.execute("select count(title) from history where ip = ?", [ip])
                     count = curs.fetchall()
                     if count:
@@ -798,6 +798,16 @@ def acl_check(name, tool = ''):
                     if count < 50:
                         return 1
 
+            if acl_data[0][0] == 'email':
+                if ip_or_user(ip) == 1:
+                    return 1
+                
+                if admin_check(5) != 1:
+                    curs.execute("select data from user_set where id = ? and name = 'email'", [ip])
+                    email = curs.fetchall()
+                    if not email:
+                        return 1
+
         curs.execute('select data from other where name = "edit"')
         set_data = curs.fetchall()
         if set_data: