ソースを参照

Merge pull request #1983 from openNAMU/dev

Dev
잉여개발기 2 年 前
コミット
23b5acb8e8

+ 7 - 7
app.py

@@ -363,13 +363,11 @@ app.route('/auth/give/ban_regex/<everything:name>', methods = ['POST', 'GET'], d
 app.route('/auth/give/ban_multiple', methods = ['POST', 'GET'], defaults = { 'ban_type' : 'multiple' })(give_user_ban)
 
 # /auth/list
-app.route('/admin_group')(list_admin_group_2)
-
 # /auth/list/add/<name>
-app.route('/admin_plus/<name>', methods = ['POST', 'GET'])(give_admin_groups_2)
-
 # /auth/list/delete/<name>
-app.route('/delete_admin_group/<name>', methods = ['POST', 'GET'])(give_delete_admin_group_2)
+app.route('/auth/list')(list_admin_group_2)
+app.route('/auth/list/add/<name>', methods = ['POST', 'GET'])(give_admin_groups_2)
+app.route('/auth/list/delete/<name>', methods = ['POST', 'GET'])(give_delete_admin_group_2)
 
 app.route('/auth/give/fix/<user_name>', methods = ['POST', 'GET'])(give_user_fix)
 
@@ -539,12 +537,14 @@ app.route('/vote/add', methods = ['POST', 'GET'])(vote_add)
 app.route('/bbs/main', defaults = { 'tool' : 'main' })(bbs_w)
 app.route('/bbs/make', methods = ['POST', 'GET'])(bbs_make)
 # app.route('/bbs/main/set')
-app.route('/bbs/hide/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_hide)
-app.route('/bbs/delete/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_delete)
 app.route('/bbs/w/<int:bbs_num>')(bbs_w)
+# app.route('/bbs/blind/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_hide)
+app.route('/bbs/delete/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_delete)
 app.route('/bbs/set/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_w_set)
 app.route('/bbs/edit/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_w_edit)
 app.route('/bbs/w/<int:bbs_num>/<int:post_num>', methods = ['POST', 'GET'])(bbs_w_post)
+# app.route('/bbs/blind/<int:bbs_num>/<int:post_num>', methods = ['POST', 'GET'])(bbs_w_hide)
+app.route('/bbs/delete/<int:bbs_num>/<int:post_num>', methods = ['POST', 'GET'])(bbs_w_delete)
 app.route('/bbs/raw/<int:bbs_num>/<int:post_num>')(view_raw_2)
 app.route('/bbs/tool/<int:bbs_num>/<int:post_num>')(bbs_w_tool)
 app.route('/bbs/edit/<int:bbs_num>/<int:post_num>', methods = ['POST', 'GET'])(bbs_w_edit)

+ 1 - 1
lang/en-US.json

@@ -609,7 +609,7 @@
             "user_head_warning" : "User data will be deleted if you close the browser or when you sign in.",
             "no_login_warning" : "You are not logged in. Your current IP address will be logged within editing or discussing until you log in.",
             "update_warning" : "Manual updates are recommended if your version is 0.2 or lower than the latest version. For Windows, the contents of the route folder will be deleted.",
-            "history_delete_warning" : "If you erase history, it's hard to restore it, so please be careful.",
+            "delete_warning" : "If you erase this, it's hard to restore it, so please be careful.",
             "user_css_warning" : "If you have a problem using this, connect here.",
             "main_css_warning" : "If you have a problem using this, use the emergency tool.",
             "not_support_skin_warning" : "It does not work on skins that do not support this feature.",

+ 1 - 1
lang/ko-KR.json

@@ -393,7 +393,7 @@
     "edit_set": "편집 관련 설정",
     "wiki_shutdown": "위키 엔진 종료",
     "shutdown": "종료",
-    "history_delete_warning": "역사를 지울 경우 복구하기 어려우니 신중하게 결정하세요.",
+    "delete_warning": "지울 경우 복구하기 어려우니 신중하게 결정하세요.",
     "history_reset": "문서 역사 초기화",
     "record_reset": "사용자 편집 기록 초기화",
     "email_setting": "이메일 설정",

+ 4 - 2
route/__init__.py

@@ -19,9 +19,11 @@ from route.api_bbs_w_comment_one import api_bbs_w_comment_one
 
 from route.bbs_w_edit import bbs_w_edit
 from route.bbs_make import bbs_make
-from route.bbs_hide import bbs_hide
-from route.bbs_delete import bbs_delete
+# from route.bbs_w_hide import bbs_w_hide
+from route.bbs_w_delete import bbs_w_delete
 from route.bbs_w import bbs_w
+from route.bbs_delete import bbs_delete
+# from route.bbs_hide import bbs_hide
 from route.bbs_w_post import bbs_w_post
 from route.bbs_w_set import bbs_w_set
 from route.bbs_w_comment_tool import bbs_w_comment_tool

+ 1 - 1
route/api_recent_change.py

@@ -9,7 +9,7 @@ def api_recent_change(num = 10):
 
         data_list = []
 
-        curs.execute(db_change('select id, title from rc where type = "" order by date desc limit ?'), [num])
+        curs.execute(db_change('select id, title from rc where type = "normal" order by date desc limit ?'), [num])
         for for_a in curs.fetchall():
             curs.execute(db_change('select id, title, date, ip, send, leng, hide from history where id = ? and title = ?'), for_a)
             db_data = curs.fetchall()

+ 18 - 4
route/bbs_delete.py

@@ -8,8 +8,8 @@ def bbs_delete(bbs_num = ''):
         db_data = curs.fetchall()
         if not db_data:
             return redirect('/bbs/main')
-        else:
-            bbs_name = db_data[0][0]
+        
+        bbs_name = db_data[0][0]
         
         bbs_num_str = str(bbs_num)
 
@@ -17,6 +17,20 @@ def bbs_delete(bbs_num = ''):
             return redirect('/bbs/w/' + bbs_num_str)
         
         if flask.request.method == 'POST':
-            pass
+            curs.execute(db_change('delete from bbs_data where set_id = ?'), [bbs_num_str])
+            curs.execute(db_change('delete from bbs_set where set_id = ?'), [bbs_num_str])
+            curs.execute(db_change('delete from bbs_data where set_id like ?'), [bbs_num_str + '-%'])
+            
+            return redirect('/bbs/w/' + bbs_num_str)
         else:
-            pass
+            return easy_minify(flask.render_template(skin_check(),
+                imp = [load_lang('bbs_delete'), wiki_set(), wiki_custom(), wiki_css(['(' + bbs_name + ')', 0])],
+                data = render_simple_set('''
+                    <form method="post">
+                        <span>''' + load_lang('delete_warning') + '''</span>
+                        <hr class="main_hr">
+                        <button type="submit">''' + load_lang('delete') + '''</button>
+                    </form>
+                '''),
+                menu = [['bbs/set/' + bbs_num_str, load_lang('return')]]
+            ))

+ 8 - 0
route/bbs_w.py

@@ -6,6 +6,7 @@ def bbs_w(bbs_num = '', tool = 'bbs'):
         
         data = ''
         title_name = ''
+        bbs_name_dict = {}
 
         admin_auth = admin_check()
 
@@ -26,6 +27,8 @@ def bbs_w(bbs_num = '', tool = 'bbs'):
             if db_data:
                 data += '<ul class="opennamu_ul">'
                 for for_a in db_data:
+                    bbs_name_dict[for_a[1]] = for_a[0]
+
                     curs.execute(db_change('select set_data from bbs_set where set_name = "bbs_type" and set_id = ?'), [for_a[1]])
                     db_data_2 = curs.fetchall()
                     bbs_type = db_data_2[0][0] if db_data_2 else 'comment'
@@ -80,6 +83,10 @@ def bbs_w(bbs_num = '', tool = 'bbs'):
             db_data = curs.fetchall()
             last_comment_date = db_data[0][0] if db_data else '0'
 
+            bbs_name_select = ''
+            if tool != 'bbs':
+                bbs_name_select = '(' + bbs_name_dict[for_b[1]] + ')'
+
             data += '''
                 <tr>
                     <td>''' + ip_pas(temp_dict['user_id']) + '''</td>
@@ -90,6 +97,7 @@ def bbs_w(bbs_num = '', tool = 'bbs'):
                     <td colspan="3">
                         <a href="/bbs/w/''' + for_b[1] + '/' + for_b[0] + '">' + html.escape(temp_dict['title']) + '''</a> 
                         (''' + comment_count + ''') 
+                        ''' + bbs_name_select + '''
                     </td>
                 </tr>
             '''

+ 37 - 0
route/bbs_w_delete.py

@@ -0,0 +1,37 @@
+from .tool.func import *
+
+def bbs_w_delete(bbs_num = '', post_num = ''):
+    with get_db_connect() as conn:
+        curs = conn.cursor()
+
+        curs.execute(db_change('select set_data from bbs_set where set_id = ? and set_name = "bbs_name"'), [bbs_num])
+        db_data = curs.fetchall()
+        if not db_data:
+            return redirect('/bbs/main')
+
+        bbs_name = db_data[0][0]
+        
+        bbs_num_str = str(bbs_num)
+        post_num_str = str(post_num)
+
+        if admin_check() != 1:
+            return redirect('/bbs/w/' + bbs_num_str)
+        
+        if flask.request.method == 'POST':
+            curs.execute(db_change('delete from bbs_data where set_code = ? and set_id = ?'), [post_num_str, bbs_num_str])
+            curs.execute(db_change('delete from bbs_set where set_code = ? and set_id = ?'), [post_num_str, bbs_num_str])
+            curs.execute(db_change('delete from bbs_data where set_id = ? or set_id like ?'), [bbs_num_str + '-' + post_num_str, bbs_num_str + '-' + post_num_str + '-%'])
+            
+            return redirect('/bbs/w/' + bbs_num_str)
+        else:
+            return easy_minify(flask.render_template(skin_check(),
+                imp = [load_lang('bbs_post_delete'), wiki_set(), wiki_custom(), wiki_css(['(' + bbs_name + ')' + ' (' + post_num_str + ')', 0])],
+                data = render_simple_set('''
+                    <form method="post">
+                        <span>''' + load_lang('delete_warning') + '''</span>
+                        <hr class="main_hr">
+                        <button type="submit">''' + load_lang('delete') + '''</button>
+                    </form>
+                '''),
+                menu = [['bbs/w/' + bbs_num_str + '/' + post_num_str, load_lang('return')]]
+            ))

+ 7 - 6
route/bbs_hide.py → route/bbs_w_hide.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def bbs_hide(bbs_num = ''):
+def bbs_w_hide(bbs_num = '', post_num = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -8,10 +8,11 @@ def bbs_hide(bbs_num = ''):
         db_data = curs.fetchall()
         if not db_data:
             return redirect('/bbs/main')
-        else:
-            bbs_name = db_data[0][0]
+
+        bbs_name = db_data[0][0]
         
         bbs_num_str = str(bbs_num)
+        post_num_str = str(post_num)
 
         if admin_check() != 1:
             return redirect('/bbs/w/' + bbs_num_str)
@@ -20,11 +21,11 @@ def bbs_hide(bbs_num = ''):
             pass
         else:
             return easy_minify(flask.render_template(skin_check(),
-                imp = [load_lang('bbs_hide'), wiki_set(), wiki_custom(), wiki_css(['(' + bbs_name + ')', 0])],
+                imp = [load_lang('bbs_post_hide'), wiki_set(), wiki_custom(), wiki_css(['(' + bbs_name + ')' + ' (' + post_num_str + ')', 0])],
                 data = render_simple_set('''
                     <form method="post">
-                        <button id="opennamu_save_button" type="submit">''' + load_lang('save') + '''</button>
+                        <button type="submit">''' + load_lang('hide') + '''</button>
                     </form>
                 '''),
-                menu = [['bbs/set/' + bbs_num_str, load_lang('return')]]
+                menu = [['bbs/w/' + bbs_num_str + '/' + post_num_str, load_lang('return')]]
             ))

+ 15 - 1
route/bbs_w_tool.py

@@ -13,10 +13,24 @@ def bbs_w_tool(bbs_num = '', post_num = ''):
             <h2>''' + load_lang('tool') + '''</h2>
             <ul class="opennamu_ul">
                 <li><a href="/bbs/raw/''' + url_pas(bbs_num_str) + '/' + url_pas(post_num_str) + '">' + load_lang('raw') + '''</a></li>
-                <!-- <li><a href="/bbs/blind/''' + url_pas(bbs_num_str) + '/' + url_pas(post_num_str) + '">' + load_lang('hide') + '''</a></li> -->
             </ul>
         '''
 
+        if admin_check() == 1:
+            data += '''
+                <h2>''' + load_lang('admin') + '''</h2>
+                <ul class="opennamu_ul">
+                    <li><a href="/bbs/blind/''' + url_pas(bbs_num_str) + '/' + url_pas(post_num_str) + '">' + load_lang('hide') + '''</a></li>
+                </ul>
+            '''
+
+            data += '''
+                <h3>''' + load_lang('owner') + '''</h2>
+                <ul class="opennamu_ul">
+                    <li><a href="/bbs/delete/''' + url_pas(bbs_num_str) + '/' + url_pas(post_num_str) + '">' + load_lang('delete') + '''</a></li>
+                </ul>
+            '''
+
         return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('bbs_post_tool'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
             data = data,

+ 4 - 4
route/give_admin_groups.py

@@ -1,13 +1,13 @@
 from .tool.func import *
 
-def give_admin_groups_2(name = None):
+def give_admin_groups_2(name = 'test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
         acl_name_list = ['ban', 'nothing', 'toron', 'check', 'acl', 'hidel', 'give', 'owner']
 
         if flask.request.method == 'POST':
-            if admin_check(None, 'admin_plus (' + name + ')') != 1:
+            if admin_check(None, 'auth list add (' + name + ')') != 1:
                 return re_error('/error/3')
             elif name in get_default_admin_group():
                 return re_error('/error/3')
@@ -19,7 +19,7 @@ def give_admin_groups_2(name = None):
 
             conn.commit()
 
-            return redirect('/admin_plus/' + url_pas(name))
+            return redirect('/auth/list/add/' + url_pas(name))
         else:
             data = ''
             exist_list = ['', '', '', '', '', '', '', '']
@@ -63,5 +63,5 @@ def give_admin_groups_2(name = None):
                         <button ''' + state +  ''' type="submit">''' + load_lang('save') + '''</button>
                     </form>
                 ''',
-                menu = [['admin_group', load_lang('return')]]
+                menu = [['auth/list', load_lang('return')]]
             ))

+ 5 - 5
route/give_delete_admin_group.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def give_delete_admin_group_2(name = None):
+def give_delete_admin_group_2(name = 'test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -8,21 +8,21 @@ def give_delete_admin_group_2(name = None):
             return re_error('/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(None, 'alist del ' + name)
+            admin_check(None, 'auth list delete (' + name + ')')
 
             curs.execute(db_change("delete from alist where name = ?"), [name])
             curs.execute(db_change("update user_set set data = 'user' where name = 'acl' and data = ?"), [name])
 
             conn.commit()
 
-            return redirect('/admin_group')
+            return redirect('/auth/list')
         else:
             return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang("delete_admin_group"), wiki_set(), wiki_custom(), wiki_css(['(' + name + ')', 0])],
                 data = '''
                     <form method=post>
-                        <button type=submit>''' + load_lang('start') + '''</button>
+                        <button type=submit>''' + load_lang('delete') + '''</button>
                     </form>
                 ''',
-                menu = [['admin_group', load_lang('return')]]
+                menu = [['auth/list', load_lang('return')]]
             ))

+ 1 - 1
route/list_admin.py

@@ -12,7 +12,7 @@ def list_admin():
         for data in curs.fetchall():
             name = '' + \
                 ip_pas(data[0]) + ' ' + \
-                '<a href="/admin_plus/' + url_pas(data[1]) + '">(' + data[1] + ')</a>' + \
+                '<a href="/auth/list/add/' + url_pas(data[1]) + '">(' + data[1] + ')</a>' + \
             ''
 
             div += '<li>' + name + '</li>'

+ 2 - 2
route/list_admin_group.py

@@ -11,13 +11,13 @@ def list_admin_group_2():
         for data in curs.fetchall():            
             if  admin_check() == 1 and \
                 not data[0] in org_acl_list:
-                delete_admin_group = ' <a href="/delete_admin_group/' + url_pas(data[0]) + '">(' + load_lang("delete") + ')</a>'
+                delete_admin_group = ' <a href="/auth/list/delete/' + url_pas(data[0]) + '">(' + load_lang("delete") + ')</a>'
             else:
                 delete_admin_group = ''
 
             list_data += '' + \
                 '<li>' + \
-                    '<a href="/admin_plus/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a>' + \
+                    '<a href="/auth/list/add/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a>' + \
                     delete_admin_group + \
                 '</li>' + \
             ''

+ 26 - 31
route/main_setting_acl.py

@@ -15,54 +15,43 @@ def main_setting_acl():
             8 : 'document_move_acl',
             9 : 'document_delete_acl',
             10 : 'slow_edit_acl',
-            11 : 'edit_bottom_compulsion_acl'
+            11 : 'edit_bottom_compulsion_acl',
+            12 : 'recaptcha_pass_acl',
+            13 : 'recaptcha_one_check_five_pass_acl'
+        }
+        default_list = {
+            12 : 'user'
         }
 
         if flask.request.method == 'POST':
             if admin_check(None, 'edit_set (acl)') != 1:
                 return re_error('/ban')
             else:
-                for i in i_list:
-                    curs.execute(db_change("update other set data = ? where name = ?"), [
-                        flask.request.form.get(i_list[i], 'normal'),
-                        i_list[i]
-                    ])
-
+                curs.executemany(db_change("update other set data = ? where name = ?"), [[flask.request.form.get(i_list[for_a], 'normal'), i_list[for_a]] for for_a in i_list])
                 conn.commit()
 
                 return redirect('/setting/acl')
         else:
             d_list = {}
+            disable = 'disabled' if admin_check() != 1 else ''
+            acl_div = ['' for _ in range(0, len(i_list))]
 
-            if admin_check() != 1:
-                disable = 'disabled'
-            else:
-                disable = ''
-
-            for i in i_list:
-                curs.execute(db_change('select data from other where name = ?'), [i_list[i]])
+            for for_a in i_list:
+                curs.execute(db_change('select data from other where name = ?'), [i_list[for_a]])
                 sql_d = curs.fetchall()
                 if sql_d:
-                    d_list[i] = sql_d[0][0]
+                    d_list[for_a] = sql_d[0][0]
                 else:
-                    curs.execute(db_change('insert into other (name, data, coverage) values (?, ?, "")'), [i_list[i], 'normal'])
-                    d_list[i] = 'normal'
+                    default_data = 'normal' if not for_a in default_list else default_list[for_a]
+                    curs.execute(db_change('insert into other (name, data, coverage) values (?, ?, "")'), [i_list[for_a], default_data])
+                    d_list[for_a] = default_data
 
             conn.commit()
 
-            acl_div = []
-            for i in range(0, len(i_list)):
-                acl_div += ['']
-
             acl_list = get_acl_list()
-            for i in range(0, len(i_list)):
+            for for_a in range(0, len(i_list)):
                 for data_list in acl_list:
-                    if data_list == d_list[i + 1]:
-                        check = 'selected="selected"'
-                    else:
-                        check = ''
-
-                    acl_div[i] += '<option value="' + data_list + '" ' + check + '>' + (data_list if data_list != '' else 'normal') + '</option>'
+                    acl_div[for_a] += '<option value="' + data_list + '" ' + ('selected="selected"' if data_list == d_list[for_a + 1] else '') + '>' + (data_list if data_list != '' else 'normal') + '</option>'
 
             return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('main_acl_setting'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
@@ -89,12 +78,12 @@ def main_setting_acl():
                         <h2>''' + load_lang('upload_acl') + '''</h2>
                         <select ''' + disable + ''' name="upload_acl">''' + acl_div[2] + '''</select>
                         
+                        <h3>''' + load_lang('many_upload_acl') + '''</h3>
+                        <select ''' + disable + ''' name="many_upload_acl">''' + acl_div[4] + '''</select>
+                        
                         <h2>''' + load_lang('view_acl') + '''</h2>
                         <select ''' + disable + ''' name="all_view_acl">''' + acl_div[3] + '''</select>
                         
-                        <h2>''' + load_lang('many_upload_acl') + '''</h2>
-                        <select ''' + disable + ''' name="many_upload_acl">''' + acl_div[4] + '''</select>
-                        
                         <h2>''' + load_lang('vote_acl') + '''</h2>
                         <select ''' + disable + ''' name="vote_acl">''' + acl_div[5] + '''</select>
 
@@ -103,6 +92,12 @@ def main_setting_acl():
 
                         <h2>''' + load_lang('edit_bottom_compulsion_acl') + '''</h2>
                         <select ''' + disable + ''' name="edit_bottom_compulsion_acl">''' + acl_div[10] + '''</select>
+
+                        <h2>''' + load_lang('recaptcha_pass_acl') + '''</h2>
+                        <select ''' + disable + ''' name="recaptcha_pass_acl">''' + acl_div[11] + '''</select>
+
+                        <h3>''' + load_lang('recaptcha_one_check_five_pass_acl') + '''</h3>
+                        <select ''' + disable + ''' name="recaptcha_one_check_five_pass_acl">''' + acl_div[12] + '''</select>
                         
                         <hr class="main_hr">
                         <button id="opennamu_save_button" type="submit">''' + load_lang('save') + '''</button>

+ 1 - 1
route/main_tool_admin.py

@@ -16,7 +16,7 @@ def main_tool_admin():
                 </ul>
                 <h2>''' + load_lang('owner') + '''</h2>
                 <ul class="opennamu_ul">
-                    <li><a href="/admin_group">''' + load_lang('admin_group_list') + '''</a></li>
+                    <li><a href="/auth/list">''' + load_lang('admin_group_list') + '''</a></li>
                     <li><a href="/delete_multiple">''' + load_lang('many_delete') + '''</a></li>
                     <li><a href="/app_submit">''' + load_lang('application_list') + '''</a></li>
                     <li><a href="/register">''' + load_lang('add_user') + '''</a></li>

+ 1 - 1
route/main_tool_redirect.py

@@ -9,7 +9,7 @@ def main_tool_redirect(num = 1, add_2 = ''):
             3 : [0, '/auth/give', load_lang('authorize')],
             4 : [0, '/record', load_lang('edit_record')],
             5 : [0, '/record/topic', load_lang('discussion_record')],
-            6 : [load_lang('name'), '/admin_plus', load_lang('add_admin_group')],
+            6 : [load_lang('name'), '/auth/list/add', load_lang('add_admin_group')],
             7 : [load_lang('name'), '/filter/edit_filter/add', load_lang('edit_filter_add')],
             8 : [load_lang('document_name'), '/search', load_lang('search')],
             9 : [0, '/block_log/user', load_lang('blocked_user')],

+ 12 - 15
route/recent_change.py

@@ -23,6 +23,15 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
         all_admin = admin_check('all', None, ip)
         owner = admin_check(None, None, ip)
 
+        option_list = [
+            ['normal', load_lang('normal')],
+            ['edit', load_lang('edit')],
+            ['move', load_lang('move')],
+            ['delete', load_lang('delete')],
+            ['revert', load_lang('revert')],
+            ['r1', load_lang('new_doc')]
+        ]
+
         if flask.request.method == 'POST':
             return redirect('/diff/' + flask.request.form.get('b', '1') + '/' + flask.request.form.get('a', '1') + '/' + url_pas(name))
         else:
@@ -152,11 +161,7 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
 
             if tool == 'history':
                 div = '' + \
-                    '<a href="/history_page/1/normal/' + url_pas(name) + '">(' + load_lang('normal') + ')</a> ' + \
-                    '<a href="/history_page/1/edit/' + url_pas(name) + '">(' + load_lang('edit') + ')</a> ' + \
-                    '<a href="/history_page/1/move/' + url_pas(name) + '">(' + load_lang('move') + ')</a> ' + \
-                    '<a href="/history_page/1/delete/' + url_pas(name) + '">(' + load_lang('delete') + ')</a> ' + \
-                    '<a href="/history_page/1/revert/' + url_pas(name) + '">(' + load_lang('revert') + ')</a>' + \
+                    ' '.join(['<a href="/history_page/1/' + for_a[0] + '/' + url_pas(name) + '">(' + for_a[1] + ')</a> ' for for_a in option_list]) + \
                     '<hr class="main_hr">' + div + \
                 ''
                 menu = [['w/' + url_pas(name), load_lang('return')]]
@@ -180,11 +185,7 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
                 div += get_next_page_bottom('/history_page/{}/' + set_type + '/' + url_pas(name), num, data_list)
             elif tool == 'record':
                 div = '' + \
-                    '<a href="/record/1/normal/' + url_pas(name) + '">(' + load_lang('normal') + ')</a> ' + \
-                    '<a href="/record/1/edit/' + url_pas(name) + '">(' + load_lang('edit') + ')</a> ' + \
-                    '<a href="/record/1/move/' + url_pas(name) + '">(' + load_lang('move') + ')</a> ' + \
-                    '<a href="/record/1/delete/' + url_pas(name) + '">(' + load_lang('delete') + ')</a> ' + \
-                    '<a href="/record/1/revert/' + url_pas(name) + '">(' + load_lang('revert') + ')</a>' + \
+                    ' '.join(['<a href="/record/1/' + for_a[0] + '/' + url_pas(name) + '">(' + for_a[1] + ')</a> ' for for_a in option_list]) + \
                     '<hr class="main_hr">' + div + \
                 ''
 
@@ -199,12 +200,8 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
                 div += get_next_page_bottom('/record/{}/' + url_pas(name), num, data_list)
             else:
                 div = '' + \
-                    '<a href="/recent_change/1/normal">(' + load_lang('normal') + ')</a> ' + \
-                    '<a href="/recent_change/1/edit">(' + load_lang('edit') + ')</a> ' + \
+                    ' '.join(['<a href="/recent_change/1/' + for_a[0] + '">(' + for_a[1] + ')</a> ' for for_a in option_list]) + \
                     '<a href="/recent_change/1/user">(' + load_lang('user_document') + ')</a> ' + \
-                    '<a href="/recent_change/1/move">(' + load_lang('move') + ')</a> ' + \
-                    '<a href="/recent_change/1/delete">(' + load_lang('delete') + ')</a> ' + \
-                    '<a href="/recent_change/1/revert">(' + load_lang('revert') + ')</a>' + \
                     '<hr class="main_hr">' + div + \
                 ''
 

+ 1 - 1
route/recent_history_delete.py

@@ -21,7 +21,7 @@ def recent_history_delete(name = 'Test', rev = 1):
                 imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('history_delete') + ') (r' + num + ')', 0])],
                 data = '''
                     <form method="post">
-                        <span>''' + load_lang('history_delete_warning') + '''</span>
+                        <span>''' + load_lang('delete_warning') + '''</span>
                         <hr class="main_hr">
                         <button type="submit">''' + load_lang('delete') + '''</button>
                     </form>

+ 1 - 1
route/recent_history_reset.py

@@ -19,7 +19,7 @@ def recent_history_reset(name = 'Test'):
                 imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('history_reset') + ')', 0])],
                 data = '''
                     <form method="post">
-                        <span>''' + load_lang('history_delete_warning') + '''</span>
+                        <span>''' + load_lang('delete_warning') + '''</span>
                         <hr class="main_hr">
                         <button type="submit">''' + load_lang('reset') + '''</button>
                     </form>

+ 1 - 1
route/recent_history_send.py

@@ -33,7 +33,7 @@ def recent_history_send(name = 'Test', rev = 1):
                     imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('send_edit') + ') (r' + num + ')', 0])],
                     data = '''
                         <form method="post">
-                            <span>''' + load_lang('history_delete_warning') + '''</span>
+                            <span>''' + load_lang('delete_warning') + '''</span>
                             <hr class="main_hr">
                             <input value="''' + html.escape(send) + '''" name="send">
                             <hr class="main_hr">

+ 1 - 1
route/recent_record_reset.py

@@ -19,7 +19,7 @@ def recent_record_reset(name = 'Test'):
                 imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('record_reset') + ')', 0])],
                 data = '''
                     <form method="post">
-                        <span>''' + load_lang('history_delete_warning') + '''</span>
+                        <span>''' + load_lang('delete_warning') + '''</span>
                         <hr class="main_hr">
                         <button type="submit">''' + load_lang('reset') + '''</button>
                     </form>

+ 101 - 181
route/tool/func.py

@@ -691,11 +691,7 @@ def get_default_robots_txt():
     return data
 
 def load_random_key(long = 128):
-    return ''.join(
-        random.choice(
-            "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
-        ) for i in range(long)
-    )
+    return ''.join(random.choice("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") for _ in range(long))
 
 def http_warning():
     return '''
@@ -1160,10 +1156,15 @@ def wiki_set(num = 1):
         db_data = db_data[0][0] if db_data else ''
         db_data = db_data.replace('\r', '')
         
-        curs.execute(db_change("select data from user_set where name = '' and id = ?"), [ip])
+        curs.execute(db_change("select data from user_set where name = 'top_menu' and id = ?"), [ip])
         db_data_2 = curs.fetchall()
         db_data_2 = db_data_2[0][0] if db_data_2 else ''
-        db_data += db_data_2.replace('\r', '')
+        db_data_2 = db_data_2.replace('\r', '')
+        if db_data_2 != '' and db_data != '':
+            db_data += '\n' + db_data_2
+        elif db_data_2 != '':
+            db_data += db_data_2
+        
         if db_data != '':
             db_data = db_data.split('\n')
         
@@ -1242,7 +1243,7 @@ def wiki_custom():
         
         split_path = flask.request.path.split('/')
         if len(split_path) > 1:
-            split_path = split_path[1]
+            split_path = split_path[1:]
         else:
             split_path = 0
 
@@ -1551,7 +1552,9 @@ def captcha_get():
 
         data = ''
         
-        if ip_or_user() != 0:
+        if acl_check(None, 'recaptcha_five_pass') == 0 and 'recapcha_pass' in flask.session and flask.session['recapcha_pass'] > 0:
+            pass
+        elif acl_check(None, 'recaptcha') == 1:
             curs.execute(db_change('select data from other where name = "recaptcha"'))
             recaptcha = curs.fetchall()
             
@@ -1599,7 +1602,11 @@ def captcha_post(re_data, num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if num == 1 and ip_or_user() != 0:
+        if num != 1:
+            pass
+        elif acl_check(None, 'recaptcha_five_pass') == 0 and 'recapcha_pass' in flask.session and flask.session['recapcha_pass'] > 0:
+            pass
+        elif acl_check(None, 'recaptcha') == 1:
             curs.execute(db_change('select data from other where name = "sec_re"'))
             sec_re = curs.fetchall()
             
@@ -1637,6 +1644,15 @@ def captcha_post(re_data, num = 1):
                     if json_data['success'] != True:
                         return 1
 
+        if num == 1:
+            if 'recapcha_pass' in flask.session:
+                if flask.session['recapcha_pass'] > 0:
+                    flask.session['recapcha_pass'] -= 1
+                else:
+                    flask.session['recapcha_pass'] = 5
+            else:
+                flask.session['recapcha_pass'] = 5
+
         return 0
 
 # Func-user
@@ -1831,108 +1847,71 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
         for i in range(0, end):
             if tool == '':
                 if i == 0:
-                    curs.execute(db_change(
-                        "select data from acl where title = ? and type = 'decu'"
-                    ), [name])
-                    '''
-                elif i == 1:
-                    curs.execute(db_change(
-                        "select plus from html_filter where kind = 'document'"
-                    ))
-                    '''
+                    curs.execute(db_change("select data from acl where title = ? and type = 'decu'"), [name])
                 else:
-                    curs.execute(db_change(
-                        'select data from other where name = "edit"'
-                    ))
+                    curs.execute(db_change('select data from other where name = "edit"'))
+
+                '''
+                elif i == 1:
+                    curs.execute(db_change("select plus from html_filter where kind = 'document'"))
+                '''
 
                 num = 5
             elif tool == 'document_move':
                 if i == 0:
-                    curs.execute(db_change(
-                        "select data from acl where title = ? and type = 'document_move_acl'"
-                    ), [name])
+                    curs.execute(db_change("select data from acl where title = ? and type = 'document_move_acl'"), [name])
                 else:
-                    curs.execute(db_change(
-                        'select data from other where name = "document_move_acl"'
-                    ))
+                    curs.execute(db_change('select data from other where name = "document_move_acl"'))
 
                 num = 5
             elif tool == 'document_edit':
                 if i == 0:
-                    curs.execute(db_change(
-                        "select data from acl where title = ? and type = 'document_edit_acl'"
-                    ), [name])
+                    curs.execute(db_change("select data from acl where title = ? and type = 'document_edit_acl'"), [name])
                 else:
-                    curs.execute(db_change(
-                        'select data from other where name = "document_edit_acl"'
-                    ))
+                    curs.execute(db_change('select data from other where name = "document_edit_acl"'))
 
                 num = 5
             elif tool == 'document_delete':
                 if i == 0:
-                    curs.execute(db_change(
-                        "select data from acl where title = ? and type = 'document_delete_acl'"
-                    ), [name])
+                    curs.execute(db_change("select data from acl where title = ? and type = 'document_delete_acl'"), [name])
                 else:
-                    curs.execute(db_change(
-                        'select data from other where name = "document_delete_acl"'
-                    ))
+                    curs.execute(db_change('select data from other where name = "document_delete_acl"'))
 
                 num = 5
             elif tool == 'topic':
                 if i == 0:
-                    curs.execute(db_change(
-                        "select acl from rd where code = ?"
-                    ), [topic_num])
+                    curs.execute(db_change("select acl from rd where code = ?"), [topic_num])
                 elif i == 1:
-                    curs.execute(db_change(
-                        "select data from acl where title = ? and type = 'dis'"
-                    ), [name])
+                    curs.execute(db_change("select data from acl where title = ? and type = 'dis'"), [name])
                 else:
-                    curs.execute(db_change(
-                        'select data from other where name = "discussion"'
-                    ))
+                    curs.execute(db_change('select data from other where name = "discussion"'))
 
                 num = 3
             elif tool == 'topic_view':
-                curs.execute(db_change("select set_data from topic_set where thread_code = ? and set_name = 'thread_view_acl'"), [
-                    topic_num
-                ])
+                curs.execute(db_change("select set_data from topic_set where thread_code = ? and set_name = 'thread_view_acl'"), [topic_num])
                 
                 num = 3
             elif tool == 'upload':
-                curs.execute(db_change(
-                    "select data from other where name = 'upload_acl'"
-                ))
+                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'"
-                ))
+                curs.execute(db_change("select data from other where name = 'many_upload_acl'"))
 
                 num = 5
             elif tool == 'vote':
                 if i == 0:
-                    curs.execute(db_change(
-                        'select acl from vote where id = ? and user = ""'
-                    ), [topic_num])
+                    curs.execute(db_change('select acl from vote where id = ? and user = ""'), [topic_num])
                 else:
-                    curs.execute(db_change(
-                        'select data from other where name = "vote_acl"'
-                    ))
+                    curs.execute(db_change('select data from other where name = "vote_acl"'))
 
                 num = None
             elif tool == 'slow_edit':
-                curs.execute(db_change(
-                    'select data from other where name = "slow_edit_acl"'
-                ))
+                curs.execute(db_change('select data from other where name = "slow_edit_acl"'))
 
                 num = 'all'
             elif tool == 'edit_bottom_compulsion':
-                curs.execute(db_change(
-                    'select data from other where name = "edit_bottom_compulsion_acl"'
-                ))
+                curs.execute(db_change('select data from other where name = "edit_bottom_compulsion_acl"'))
 
                 num = 'all'
             elif tool == 'bbs_edit':
@@ -1952,13 +1931,19 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
             elif tool == 'bbs_view':
                 curs.execute(db_change('select set_data from bbs_set where set_name = "bbs_view_acl" and set_id = ?'), [name])
 
+                num = 'all'
+            elif tool == 'recaptcha':
+                curs.execute(db_change('select data from other where name = "recaptcha_pass_acl"'))
+
+                num = 'all'
+            elif tool == 'recaptcha_five_pass':
+                curs.execute(db_change('select data from other where name = "recaptcha_one_check_five_pass_acl"'))
+
                 num = 'all'
             else:
                 # tool == 'render'
                 if i == 0:
-                    curs.execute(db_change(
-                        "select data from acl where title = ? and type = 'view'"
-                    ), [name])
+                    curs.execute(db_change("select data from acl where title = ? and type = 'view'"), [name])
                 else:
                     curs.execute(db_change("select data from other where name = 'all_view_acl'"))
 
@@ -1966,7 +1951,9 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
 
             acl_data = curs.fetchall()
             if not acl_data or acl_data[0][0] == '':
-                if tool == 'slow_edit' or tool == 'edit_bottom_compulsion':
+                if tool == 'recaptcha':
+                    acl_data = [['admin']]
+                elif tool == 'slow_edit' or tool == 'edit_bottom_compulsion':
                     acl_data = [['not_all']]
                 else:
                     acl_data = [['normal']]
@@ -1991,9 +1978,7 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
                         if admin_check(num) == 1:
                             return 0
                         else:
-                            curs.execute(db_change(
-                                "select count(*) from history where ip = ?"
-                            ), [ip])
+                            curs.execute(db_change("select count(*) from history where ip = ?"), [ip])
                             count = curs.fetchall()
                             count = count[0][0] if count else 0
                             if count >= 50:
@@ -2003,9 +1988,7 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
                         if admin_check(num) == 1:
                             return 0
                     
-                    curs.execute(db_change(
-                        "select ip from history where title = ? and ip = ?"
-                    ), [name, ip])
+                    curs.execute(db_change("select ip from history where title = ? and ip = ?"), [name, ip])
                     if curs.fetchall():
                         return 0
                 elif acl_data[0][0] == '30_day' or acl_data[0][0] == '90_day':
@@ -2013,27 +1996,15 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
                         if admin_check(num) == 1:
                             return 0
                         else:
-                            curs.execute(db_change(
-                                "select data from user_set where id = ? and name = 'date'"
-                            ), [ip])
+                            curs.execute(db_change("select data from user_set where id = ? and name = 'date'"), [ip])
                             user_date = curs.fetchall()[0][0]
                             
                             if acl_data[0][0] == '30_day':
-                                time_1 = datetime.datetime.strptime(
-                                    user_date, 
-                                    '%Y-%m-%d %H:%M:%S'
-                                ) + datetime.timedelta(days = 30)
+                                time_1 = datetime.datetime.strptime(user_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days = 30)
                             else:
-                                time_1 = datetime.datetime.strptime(
-                                    user_date, 
-                                    '%Y-%m-%d %H:%M:%S'
-                                ) + datetime.timedelta(days = 90)
-
-                            time_2 = datetime.datetime.strptime(
-                                get_time(), 
-                                '%Y-%m-%d %H:%M:%S'
-                            )
-                            
+                                time_1 = datetime.datetime.strptime(user_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days = 90)
+
+                            time_2 = datetime.datetime.strptime(get_time(), '%Y-%m-%d %H:%M:%S')
                             if time_2 > time_1:
                                 return 0
                 elif acl_data[0][0] == 'email':
@@ -2041,9 +2012,7 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
                         if admin_check(num) == 1:
                             return 0
                         else:
-                            curs.execute(db_change(
-                                "select data from user_set where id = ? and name = 'email'"
-                            ), [ip])
+                            curs.execute(db_change("select data from user_set where id = ? and name = 'email'"), [ip])
                             if curs.fetchall():
                                 return 0
                 elif acl_data[0][0] == 'owner':
@@ -2062,9 +2031,7 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
                         return 1
                 
                 if tool == 'topic':
-                    curs.execute(db_change(
-                        "select title from rd where code = ? and stop != ''"
-                    ), [topic_num])
+                    curs.execute(db_change("select title from rd where code = ? and stop != ''"), [topic_num])
                     if curs.fetchall():
                         if admin_check(3, 'topic (code ' + topic_num + ')') == 1:
                             return 0
@@ -2479,7 +2446,7 @@ def ban_insert(name, end, why, login, blocker, type_d = None):
         curs.execute(db_change("" + \
             "select block from rb " + \
             "where ((end > ? and end != '') or end = '') and block = ? and " + \
-                "band = ? and ongoing = '1'" + \
+            "band = ? and ongoing = '1'" + \
         ""), [now_time, name, band])
         if curs.fetchall():
             curs.execute(db_change(
@@ -2519,6 +2486,14 @@ def ban_insert(name, end, why, login, blocker, type_d = None):
                 login
             ])
 
+def history_plus_rc_max(curs, mode):
+    curs.execute(db_change("select count(*) from rc where type = ?"), [mode])
+    if curs.fetchall()[0][0] >= 200:
+        curs.execute(db_change("select id, title from rc where type = ? order by date asc limit 1"), [mode])
+        rc_data = curs.fetchall()
+        if rc_data:
+            curs.execute(db_change('delete from rc where id = ? and title = ? and type = ?'), [rc_data[0][0], rc_data[0][1], mode])
+
 def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
@@ -2530,18 +2505,15 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
             return 0
 
         if mode == 'add':
-            curs.execute(db_change(
-                "select id from history where title = ? order by id + 0 asc limit 1"
-            ), [title])
+            curs.execute(db_change("select id from history where title = ? order by id + 0 asc limit 1"), [title])
             id_data = curs.fetchall()
             id_data = str(int(id_data[0][0]) - 1) if id_data else '0'
         else:
-            curs.execute(db_change(
-                "select id from history where title = ? order by id + 0 desc limit 1"
-            ), [title])
+            curs.execute(db_change("select id from history where title = ? order by id + 0 desc limit 1"), [title])
             id_data = curs.fetchall()
             id_data = str(int(id_data[0][0]) + 1) if id_data else '1'
             
+            mode = 'r1' if id_data == '1' else mode
             mode = mode if not re.search('^user:', title) else 'user'
 
         send = re.sub(r'\(|\)|<|>', '', send)
@@ -2549,82 +2521,30 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
         send = send + ' (' + t_check + ')' if t_check != '' else send
 
         if mode != 'add' and mode != 'user':
-            curs.execute(db_change("select count(*) from rc where type = 'normal'"))
-            if curs.fetchall()[0][0] >= 200:
-                curs.execute(db_change(
-                    "select id, title from rc where type = 'normal' order by date asc limit 1"
-                ))
-                rc_data = curs.fetchall()
-                if rc_data:
-                    curs.execute(db_change(
-                        'delete from rc where id = ? and title = ? and type = "normal"'
-                    ), [
-                        rc_data[0][0],
-                        rc_data[0][1]
-                    ])
-        
-            curs.execute(db_change(
-                "insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"
-            ), [
-                id_data,
-                title,
-                date
-            ])
+            history_plus_rc_max(curs, 'normal')
+            curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"), [id_data, title, date])
         
         if mode != 'add':
-            curs.execute(db_change("select count(*) from rc where type = ?"), [mode])
-            if curs.fetchall()[0][0] >= 200:
-                curs.execute(db_change(
-                    "select id, title from rc where type = ? order by date asc limit 1"
-                ), [mode])
-                rc_data = curs.fetchall()
-                if rc_data:
-                    curs.execute(db_change(
-                        'delete from rc where id = ? and title = ? and type = ?'
-                    ), [
-                        rc_data[0][0],
-                        rc_data[0][1],
-                        mode
-                    ])
-        
-            curs.execute(db_change(
-                "insert into rc (id, title, date, type) values (?, ?, ?, ?)"
-            ), [
-                id_data,
-                title,
-                date,
-                mode
-            ])
-                
-        curs.execute(db_change(
-            "insert into history (id, title, data, date, ip, send, leng, hide, type) " + \
-            "values (?, ?, ?, ?, ?, ?, ?, '', ?)"
-        ), [
-            id_data,
-            title,
-            data,
-            date,
-            ip,
-            send,
-            leng,
-            mode
-        ])
+            history_plus_rc_max(curs, mode)
+            curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, ?)"), [id_data, title, date, mode])
 
-        data_set_exist = '' if t_check != 'delete' else '1'
+            data_set_exist = '' if t_check != 'delete' else '1'
 
-        curs.execute(db_change("select doc_name from data_set where doc_name = ? and set_name = 'last_edit'"), [title])
-        db_data = curs.fetchall()
-        if db_data:
-            curs.execute(db_change("update data_set set set_data = ?, doc_rev = ? where doc_name = ? and set_name = 'last_edit'"), [date, data_set_exist, title])
-        else:
-            curs.execute(db_change("insert into data_set (doc_name, doc_rev, set_name, set_data) values (?, ?, 'last_edit', ?)"), [title, data_set_exist, date])
+            curs.execute(db_change("select doc_name from data_set where doc_name = ? and set_name = 'last_edit'"), [title])
+            db_data = curs.fetchall()
+            if db_data:
+                curs.execute(db_change("update data_set set set_data = ?, doc_rev = ? where doc_name = ? and set_name = 'last_edit'"), [date, data_set_exist, title])
+            else:
+                curs.execute(db_change("insert into data_set (doc_name, doc_rev, set_name, set_data) values (?, ?, 'last_edit', ?)"), [title, data_set_exist, date])
 
-        curs.execute(db_change("select doc_name from data_set where doc_name = ? and set_name = 'length'"), [title])
-        db_data = curs.fetchall()
-        if db_data:
-            curs.execute(db_change("update data_set set set_data = ?, doc_rev = ? where doc_name = ? and set_name = 'length'"), [len(data), data_set_exist, title])
-        else:
-            curs.execute(db_change("insert into data_set (doc_name, doc_rev, set_name, set_data) values (?, ?, 'length', ?)"), [title, data_set_exist, len(data)])
+            curs.execute(db_change("select doc_name from data_set where doc_name = ? and set_name = 'length'"), [title])
+            db_data = curs.fetchall()
+            if db_data:
+                curs.execute(db_change("update data_set set set_data = ?, doc_rev = ? where doc_name = ? and set_name = 'length'"), [len(data), data_set_exist, title])
+            else:
+                curs.execute(db_change("insert into data_set (doc_name, doc_rev, set_name, set_data) values (?, ?, 'length', ?)"), [title, data_set_exist, len(data)])
+
+        curs.execute(db_change("insert into history (id, title, data, date, ip, send, leng, hide, type) values (?, ?, ?, ?, ?, ?, ?, '', ?)"), [id_data, title, data, date, ip, send, leng, mode])
 
 # Func-error
 def re_error(data):

+ 3 - 2
route/topic_tool_delete.py

@@ -19,9 +19,10 @@ def topic_tool_delete(topic_num = 1):
             return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('topic_delete'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
                 data = '''
-                    <hr class="main_hr">
                     <form method="post">
-                        <button type="submit">''' + load_lang('start') + '''</button>
+                        <span>''' + load_lang('delete_warning') + '''</span>
+                        <hr class="main_hr">
+                        <button type="submit">''' + load_lang('delete') + '''</button>
                     </form>
                 ''',
                 menu = [['thread/' + topic_num + '/tool', load_lang('return')]]

+ 5 - 2
route/user_setting_top_menu.py

@@ -7,9 +7,12 @@ def user_setting_top_menu():
         ip = ip_check()
         if ban_check(ip) == 1:
             return re_error('/ban')
+
+        if ip_or_user(ip) == 1:
+            return redirect('/login')
         
         if flask.request.method == 'POST':
-            curs.execute(db_change("select name from other where name = 'top_menu'"))
+            curs.execute(db_change("select data from user_set where name = 'top_menu' and id = ?"), [ip])
             if curs.fetchall():
                 curs.execute(db_change("update user_set set data = ? where name = 'top_menu' and id = ?"), [flask.request.form.get('content', ''), ip])
             else:
@@ -17,7 +20,7 @@ def user_setting_top_menu():
 
             conn.commit()
 
-            return redirect('/setting/top_menu')
+            return redirect('/change/top_menu')
         else:
             curs.execute(db_change("select data from user_set where name = 'top_menu' and id = ?"), [ip])
             db_data = curs.fetchall()

+ 7 - 0
ubuntu.sh

@@ -0,0 +1,7 @@
+sudo apt-get install python3
+sudo apt-get install python3-pip
+
+chmod +x ./route_go/bin
+
+pip3 install -r requirements.txt
+python3 app.py

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.6-RC5-dev28",
+        "r_ver" : "v3.4.6-RC5-dev32",
         "c_ver" : "3500373",
         "s_ver" : "3500112"
     }

+ 1 - 1
views/ringo/index.html

@@ -27,7 +27,7 @@
             <meta name="title" content="{{imp[0]}} - {{imp[1][0]}}">
         {% endif %}
         <meta name="keywords" content="{{imp[0]}}">
-        {% if imp[2][12] != 0 and imp[2][12] == 'w' %}
+        {% if imp[2][12] != 0 and imp[2][12][0] == 'w' %}
             <meta name="description" content="{{data|cut_100}}">
         {% endif %}
         <meta name="viewport" content="width=device-width, initial-scale=1">

+ 1 - 1
views/tenshi/index.html

@@ -25,7 +25,7 @@
             <meta name="title" content="{{imp[0]}} - {{imp[1][0]}}">
         {% endif %}
         <meta name="keywords" content="{{imp[0]}}">
-        {% if imp[2][12] != 0 and imp[2][12] == 'w' %}
+        {% if imp[2][12] != 0 and imp[2][12][0] == 'w' %}
             <meta name="description" content="{{data|cut_100}}">
         {% endif %}
         <meta name="viewport" content="width=device-width, initial-scale=1">