2du 4 лет назад
Родитель
Сommit
6c00045798

+ 8 - 1
lang/en-US.json

@@ -105,7 +105,9 @@
         "empty" : "Empty",
         "domain" : "Domain",
         "result" : "Result",
-        "incomplete" : "Incomplete",
+        "not_working" : "Not working",
+        "alpha" : "Alpha",
+        "beta" : "Beta",
         "example" : "Example",
         "_comment_1.1_" : "Time",
             "second" : "Second(s)",
@@ -287,6 +289,10 @@
                 "approval_question": "Registeration questions",
                 "backup_where" : "Backup location",
                 "ua_get_off" : "Turn off members information collection",
+                "edit_bottom_compulsion" : "Edit reason required",
+                "enable_comment_function" : "Using the comment function",
+                "enable_challenge_function" : "Using the challenge function",
+                "tls_method" : "TLS method",
             "_comment_2.2.3_" : "Text",
                 "register_text" : "Terms of sign-up",
                 "non_login_alert" : "Non-login alert",
@@ -450,6 +456,7 @@
             "restart_fail_error" : "Restart failed. Please try restarting manually.",
             "same_email_error" : "There are users using the same email.",
             "input_email_error" : "There is a problem with the input value.",
+            "error_edit_send_request" : "Entering a reason is required.",
         "_comment_3.2_" : "Warning",
             "http_warning" : "Warning: If you are not on HTTPS connection, your information can be leaked. The users themselves have responsibility to any problems that happen because of this.",
             "user_head_warning" : "User data will be deleted if you close the browser or when you sign in.",

+ 11 - 2
lang/ko-KR.json

@@ -415,7 +415,7 @@
     "key_change": "키 변경",
     "key_delete": "키 삭제",
     "email_delete": "이메일 삭제",
-    "incomplete": "미완성",
+    "not_working": "작동 안함",
     "topic_text": "토론 기본 문구",
     "hcaptcha": "hCAPTCHA",
     "captcha": "CAPTCHA",
@@ -430,5 +430,14 @@
     "challenge_title_thousandth_discussion": "나는 생각한다. 고로 존재한다.",
     "challenge_info_thousandth_discussion": "1000번째 토론 스레드를 올리세요.",
     "challenge": "도전과제",
-    "user_title": "칭호"
+    "user_title": "칭호",
+    "alpha": "알파",
+    "beta": "베타",
+    "example": "예시",
+    "communication_set": "커뮤니케이션 기능 설정",
+    "edit_bottom_compulsion": "편집 사유 필수",
+    "enable_comment_function": "댓글 기능 사용",
+    "enable_challenge_function": "도전과제 기능 사용",
+    "error_edit_send_request": "편집 사유가 필요합니다.",
+    "tls_method": "TLS 방식"
 }

+ 4 - 9
route/edit.py

@@ -31,6 +31,7 @@ def edit(name = 'Test', name_load = 0, section = 0):
             today = get_time()
             content = flask.request.form.get('content', '').replace('\r\n', '\n')
             send = flask.request.form.get('send', '')
+            agree = flask.request.form.get('copyright_agreement', '')
             
             if do_edit_filter(content) == 1:
                 return re_error('/error/21')
@@ -38,11 +39,8 @@ def edit(name = 'Test', name_load = 0, section = 0):
             if do_edit_send_check(send) == 1:
                 return re_error('/error/37')
 
-            curs.execute(db_change('select data from other where name = "copyright_checkbox_text"'))
-            db_data = curs.fetchall()
-            if db_data and db_data[0][0] != '':
-                if flask.request.form.get('copyright_agreement', '') != 'yes':
-                    return re_error('/error/29')
+            if do_edit_text_bottom_check_box_check(agree) == 1:
+                return re_error('/error/29')
             
             curs.execute(db_change("select data from data where title = ?"), [name])
             old = curs.fetchall()
@@ -122,9 +120,6 @@ def edit(name = 'Test', name_load = 0, section = 0):
                 '<hr class="main_hr">' + \
             ''
     
-            b_text = get_edit_text_bottom()
-            cccb_text = get_edit_text_bottom_check_box()
-    
             curs.execute(db_change('select data from other where name = "edit_help"'))
             sql_d = curs.fetchall()
             p_text = html.escape(sql_d[0][0]) if sql_d and sql_d[0][0] != '' else load_lang('default_edit_help')
@@ -200,7 +195,7 @@ def edit(name = 'Test', name_load = 0, section = 0):
                                 name="ver" 
                                 value="''' + doc_ver + '''">
                         <hr class="main_hr">
-                        ''' + captcha_get() + ip_warning() + cccb_text + b_text + '''
+                        ''' + captcha_get() + ip_warning() + get_edit_text_bottom_check_box() + get_edit_text_bottom() + '''
                         <button id="save"
                                 type="submit" 
                                 onclick="

+ 12 - 4
route/edit_delete.py

@@ -20,6 +20,15 @@ def edit_delete(name):
 
             if do_edit_slow_check() == 1:
                 return re_error('/error/24')
+            
+            send = flask.request.form.get('send', '')
+            agree = flask.request.form.get('copyright_agreement', '')
+            
+            if do_edit_send_check(send) == 1:
+                return re_error('/error/37')
+            
+            if do_edit_text_bottom_check_box_check(agree) == 1:
+                return re_error('/error/29')
 
             curs.execute(db_change("select data from data where title = ?"), [name])
             data = curs.fetchall()
@@ -32,7 +41,7 @@ def edit_delete(name):
                     '',
                     today,
                     ip,
-                    flask.request.form.get('send', ''),
+                    send,
                     leng,
                     t_check = 'delete',
                     mode = 'delete'
@@ -50,15 +59,14 @@ def edit_delete(name):
             curs.execute(db_change("update other set data = ? where name = 'count_all_title'"), [str(int(curs.fetchall()[0][0]) - 1)])
 
             return redirect('/w/' + url_pas(name))
-        else:
+        else:            
             return easy_minify(flask.render_template(skin_check(),
                 imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('delete') + ')', 0])],
                 data = '''
                     <form method="post">
-                        ''' + ip_warning() + '''
                         <input placeholder="''' + load_lang('why') + '''" name="send" type="text">
                         <hr class="main_hr">
-                        ''' + captcha_get() + '''
+                        ''' + captcha_get() + ip_warning() + get_edit_text_bottom_check_box() + get_edit_text_bottom() + '''
                         <button type="submit">''' + load_lang('delete') + '''</button>
                     </form>
                 ''',

+ 13 - 3
route/edit_delete_mutiple.py

@@ -10,9 +10,18 @@ def edit_delete_mutiple():
             return re_error('/ban')
 
         if flask.request.method == 'POST':
+            send = flask.request.form.get('send', '')
+            agree = flask.request.form.get('copyright_agreement', '')
+            
+            if do_edit_send_check(send) == 1:
+                return re_error('/error/37')
+            
+            if do_edit_text_bottom_check_box_check(agree) == 1:
+                return re_error('/error/29')
+            
             all_title = re.findall(r'([^\n]+)\n', flask.request.form.get('content', '').replace('\r\n', '\n') + '\n')
             for name in all_title:
-                edit_delete.edit_delete_2(conn, name)
+                edit_delete.edit_delete(name)
 
             return redirect('/recent_changes')
         else:
@@ -21,9 +30,10 @@ def edit_delete_mutiple():
                 data = '''
                     <form method="post">
                         <textarea rows="25" placeholder="''' + load_lang('many_delete_help') + '''" name="content"></textarea>
-                        <hr class=\"main_hr\">
+                        <hr class="main_hr">
                         <input placeholder="''' + load_lang('why') + '''" name="send" type="text">
-                        <hr class=\"main_hr\">
+                        <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>
                     </form>
                 ''',

+ 21 - 10
route/edit_move.py

@@ -19,6 +19,17 @@ def edit_move(name):
 
             if do_edit_slow_check() == 1:
                 return re_error('/error/24')
+            
+            send = flask.request.form.get('send', '')
+            agree = flask.request.form.get('copyright_agreement', '')
+            time = get_time()
+            ip = ip_check()
+            
+            if do_edit_send_check(send) == 1:
+                return re_error('/error/37')
+            
+            if do_edit_text_bottom_check_box_check(agree) == 1:
+                return re_error('/error/29')
 
             curs.execute(db_change("select title from history where title = ?"), [move_title])
             if curs.fetchall():
@@ -42,9 +53,9 @@ def edit_move(name):
                     history_plus(
                         name,
                         data_in,
-                        get_time(),
-                        ip_check(),
-                        flask.request.form.get('send', ''),
+                        time,
+                        ip,
+                        send,
                         '0',
                         t_check = 'merge <a>' + name + '</a> - <a>' + move_title + '</a> move',
                         mode = 'move'
@@ -110,9 +121,9 @@ def edit_move(name):
                         history_plus(
                             title_name[0],
                             data_in,
-                            get_time(),
-                            ip_check(),
-                            flask.request.form.get('send', ''),
+                            time,
+                            ip,
+                            send,
                             '0',
                             t_check = '<a>' + (title_name[0] if title_name[0] != 'test ' + str(i) else name) + '</a> - <a>' + title_name[1] + '</a> move',
                             mode = 'move'
@@ -139,9 +150,9 @@ def edit_move(name):
                 history_plus(
                     name,
                     data_in,
-                    get_time(),
-                    ip_check(),
-                    flask.request.form.get('send', ''),
+                    time,
+                    ip,
+                    send,
                     '0',
                     t_check = '<a>' + name + '</a> - <a>' + move_title + '</a> move',
                     mode = 'move'
@@ -171,7 +182,7 @@ def edit_move(name):
                             ''' + ('<option value="merge"> ' + load_lang('merge_move') + '</option>' if admin_check() == 1 else '') + '''
                         </select>
                         <hr class="main_hr">
-                        ''' + captcha_get() + '''
+                        ''' + captcha_get() + ip_warning() + get_edit_text_bottom_check_box() + get_edit_text_bottom() + '''
                         <button type="submit">''' + load_lang('move') + '''</button>
                     </form>
                 ''',

+ 18 - 15
route/edit_revert.py

@@ -12,6 +12,11 @@ def edit_revert(name):
 
         if acl_check(name) == 1:
             return re_error('/ban')
+        
+        curs.execute(db_change("select title from history where title = ? and id = ?"), [name, str(num)])
+        data = curs.fetchall()
+        if not data:
+            return redirect('/w/' + url_pas(name))
 
         if flask.request.method == 'POST':
             if captcha_post(flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
@@ -21,15 +26,20 @@ def edit_revert(name):
 
             if do_edit_slow_check() == 1:
                 return re_error('/error/24')
+            
+            send = flask.request.form.get('send', '')
+            agree = flask.request.form.get('copyright_agreement', '')
+            
+            if do_edit_send_check(send) == 1:
+                return re_error('/error/37')
+            
+            if do_edit_text_bottom_check_box_check(agree) == 1:
+                return re_error('/error/29')
 
-            curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])
-            data = curs.fetchall()
-            if data:
-                if do_edit_filter(data[0][0]) == 1:
-                    return re_error('/error/21')
+            if do_edit_filter(data[0][0]) == 1:
+                return re_error('/error/21')
 
             curs.execute(db_change("delete from back where link = ?"), [name])
-            conn.commit()
 
             if data:
                 curs.execute(db_change("select data from data where title = ?"), [name])
@@ -58,17 +68,10 @@ def edit_revert(name):
                     data_type = 'backlink'
                 )
 
-                conn.commit()
+            conn.commit()
 
             return redirect('/w/' + url_pas(name))
         else:
-            curs.execute(db_change("select title from history where title = ? and id = ?"), [name, str(num)])
-            if not curs.fetchall():
-                return redirect('/w/' + url_pas(name))
-                
-            b_text = get_edit_text_bottom()
-            cccb_text = get_edit_text_bottom_check_box()
-
             return easy_minify(flask.render_template(skin_check(),
                 imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('revert') + ')', 0])],
                 data =  '''
@@ -77,7 +80,7 @@ def edit_revert(name):
                             <hr class="main_hr">
                             <input placeholder="''' + load_lang('why') + '''" name="send" type="text">
                             <hr class="main_hr">
-                            ''' + captcha_get() + ip_warning() + cccb_text + b_text + '''
+                            ''' + captcha_get() + ip_warning() + get_edit_text_bottom_check_box() + get_edit_text_bottom() + '''
                             <button type="submit">''' + load_lang('revert') + '''</button>
                         </form>
                         ''',

+ 1 - 1
route/main_func_setting_external.py

@@ -127,7 +127,7 @@ def main_func_setting_external():
                         <hr class="main_hr">
                         <input type="password" name="smtp_pass" value="''' + html.escape(d_list[6]) + '''">
 
-                        <h2>3. ''' + load_lang('oauth') + ''' (''' + load_lang('incomplete') + ''')</h2>
+                        <h2>3. ''' + load_lang('oauth') + ''' (''' + load_lang('not_working') + ''')</h2>
                         <a href="https://developers.google.com/identity/protocols/oauth2">(Google)</a>
                         <hr class="main_hr">
 

+ 3 - 3
route/main_func_setting_main.py

@@ -149,10 +149,10 @@ def main_func_setting_main(db_set):
                         <select name="encode">''' + encode_select + '''</select>
 
                         <h3>1.1. ''' + load_lang('communication_set') + '''</h3>
-                        <input type="checkbox" name="enable_comment" ''' + check_box_div[5] + '''> ''' + load_lang('enable_comment_function') + '''
+                        <input type="checkbox" name="enable_comment" ''' + check_box_div[5] + '''> ''' + load_lang('enable_comment_function') + ''' (''' + load_lang('not_working') + ''')
                         <hr class="main_hr">
 
-                        <input type="checkbox" name="enable_challenge" ''' + check_box_div[6] + '''> ''' + load_lang('enable_challenge_function') + '''
+                        <input type="checkbox" name="enable_challenge" ''' + check_box_div[6] + '''> ''' + load_lang('enable_challenge_function') + ''' (''' + load_lang('not_working') + ''')
                         <hr class="main_hr">
 
                         <h2>2. ''' + load_lang('design_set') + '''</h2>
@@ -209,7 +209,7 @@ def main_func_setting_main(db_set):
                         <input name="slow_edit" value="''' + html.escape(d_list[19]) + '''">
                         
                         <hr class="main_hr">
-                        <input type="checkbox" name="edit_bottom_compulsion" ''' + check_box_div[7] + '''> ''' + load_lang('edit_bottom_compulsion') + '''
+                        <input type="checkbox" name="edit_bottom_compulsion" ''' + check_box_div[7] + '''> ''' + load_lang('edit_bottom_compulsion') + ''' (''' + load_lang('beta') + ''')
 
                         <hr class="main_hr">
                         <button id="save" type="submit">''' + load_lang('save') + '''</button>

+ 13 - 0
route/tool/func.py

@@ -1690,6 +1690,17 @@ def get_edit_text_bottom_check_box():
         
     return cccb_text
 
+def do_edit_text_bottom_check_box_check(data):
+    curs = conn.cursor()
+    
+    curs.execute(db_change('select data from other where name = "copyright_checkbox_text"'))
+    db_data = curs.fetchall()
+    if db_data and db_data[0][0] != '':
+        if data != 'yes':
+            return 1
+        
+    return 0
+
 def do_edit_send_check(data):
     curs = conn.cursor()
     
@@ -2059,6 +2070,8 @@ def re_error(data):
             data = load_lang('same_email_error')
         elif num == 36:
             data = load_lang('input_email_error')
+        elif num == 37:
+            data = load_lang('error_edit_send_request')
         else:
             data = '???'
 

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.5 (stable1) (beta1) (dev7)",
+        "r_ver" : "v3.4.5 (stable1) (beta2) (dev8)",
         "c_ver" : "3500106",
         "s_ver" : "3500110"
     }