2du 5 лет назад
Родитель
Сommit
77e5ba7fd2

+ 152 - 137
app.py

@@ -312,14 +312,16 @@ if os.path.exists('custom.py'):
     custom_run(conn, app)
 
 # Func
-@app.route('/del_alarm')
-def alarm_del():
-    return alarm_del_2(conn)
-
+# Func-alarm
 @app.route('/alarm')
 def alarm():
     return alarm_2(conn)
 
+@app.route('/del_alarm')
+def alarm_del():
+    return alarm_del_2(conn)
+
+# Func-inter_wiki
 @app.route('/<regex("inter_wiki|edit_top|image_license|(?:edit|email|file|name|extension)_filter"):tools>')
 def inter_wiki(tools = None):
     return inter_wiki_2(conn, tools)
@@ -333,11 +335,7 @@ def inter_wiki_del(tools = None, name = None):
 def inter_wiki_plus(tools = None, name = None):
     return inter_wiki_plus_2(conn, tools, name)
 
-@app.route('/setting')
-@app.route('/setting/<int:num>', methods=['POST', 'GET'])
-def setting(num = 0):
-    return setting_2(conn, num, set_data['db_type'])
-
+# Func-list
 @app.route('/not_close_topic')
 def list_not_close_topic():
     return list_not_close_topic_2(conn)
@@ -354,17 +352,46 @@ def list_acl():
 def list_image_file():
     return list_image_file_2(conn)
 
+@app.route('/admin_list')
+def list_admin():
+    return list_admin_2(conn)
+
+@app.route('/user_log')
+def list_user():
+    return list_user_2(conn)
+
+@app.route('/admin_log', methods=['POST', 'GET'])
+def list_admin_use():
+    return list_admin_use_2(conn)
+
+@app.route('/give_log')
+def list_give():
+    return list_give_2(conn)
+
+@app.route('/please')
+def list_please():
+    return list_please_2(conn)
+
+@app.route('/title_index')
+def list_title_index():
+    return list_title_index_2(conn)
+
+@app.route('/topic_record/<name>')
+def list_user_topic(name = 'test'):
+    return list_user_topic_2(conn, name)
+
+@app.route('/<regex("long_page|short_page"):tool>')
+def list_long_page(tool = 'long_page'):
+    return list_long_page_2(conn, tool)
+
+# Func-give
 @app.route('/admin_plus/<name>', methods=['POST', 'GET'])
 def give_admin_groups(name = None):
     return give_admin_groups_2(conn, name)
 
 @app.route('/delete_admin_group/<name>', methods=['POST', 'GET'])
-def delete_admin_group(name = None):
-    return delete_admin_group_2(conn, name)
-
-@app.route('/admin_list')
-def list_admin():
-    return list_admin_2(conn)
+def give_delete_admin_group(name = None):
+    return give_delete_admin_group_2(conn, name)
 
 @app.route('/hidden/<everything:name>')
 def give_history_hidden(name = None):
@@ -374,18 +401,28 @@ def give_history_hidden(name = None):
 def give_history_add(name = None):
     return give_history_add_2(conn, name)
 
-@app.route('/user_log')
-def list_user():
-    return list_user_2(conn)
+@app.route('/check/<name>')
+def give_user_check(name = None):
+    return give_user_check_2(conn, name)
+    
+@app.route('/check_delete', methods=['POST', 'GET'])
+def give_user_check_delete():
+    return give_user_check_delete_2(conn)
 
-@app.route('/admin_log', methods=['POST', 'GET'])
-def list_admin_use():
-    return list_admin_use_2(conn)
+@app.route('/ban', methods=['POST', 'GET'])
+@app.route('/ban/<name>', methods=['POST', 'GET'])
+def give_user_ban(name = None):
+    return give_user_ban_2(conn, name)
 
-@app.route('/give_log')
-def list_give():
-    return list_give_2(conn)
+@app.route('/acl/<everything:name>', methods=['POST', 'GET'])
+def give_acl(name = None):
+    return give_acl_2(conn, name)
+
+@app.route('/admin/<name>', methods=['POST', 'GET'])
+def give_admin(name = None):
+    return give_admin_2(conn, name)
 
+# Func-server
 @app.route('/restart', methods=['POST', 'GET'])
 def server_restart():
     return server_restart_2(conn)
@@ -394,14 +431,29 @@ def server_restart():
 def server_now_update():
     return server_now_update_2(conn, version_list['beta']['r_ver'])
 
+# Func-view
 @app.route('/xref/<everything:name>')
 def view_xref(name = None):
     return view_xref_2(conn, name)
 
-@app.route('/please')
-def list_please():
-    return list_please_2(conn)
+@app.route('/raw/<everything:name>')
+@app.route('/thread/<int:topic_num>/raw/<int:num>')
+def view_raw(name = None, topic_num = None, num = None):
+    return view_raw_2(conn, name, topic_num, num)
+
+@app.route('/diff/<everything:name>')
+def view_diff_data(name = None):
+    return view_diff_data_2(conn, name)
+
+@app.route('/down/<everything:name>')
+def view_down(name = None):
+    return view_down_2(conn, name)
+
+@app.route('/w/<everything:name>')
+def view_read(name = None):
+    return view_read_2(conn, name)
 
+# Func-recent
 @app.route('/recent_discuss')
 def recent_discuss():
     return recent_discuss_2(conn)
@@ -411,6 +463,21 @@ def recent_discuss():
 def recent_block(name = None, tool = None):
     return recent_block_2(conn, name, tool)
 
+@app.route('/recent_changes')
+@app.route('/<regex("record"):tool>/<name>')
+@app.route('/<regex("history"):tool>/<everything:name>', methods=['POST', 'GET'])
+def recent_changes(name = None, tool = 'record'):
+    return recent_changes_2(conn, name, tool)
+
+@app.route('/history_tool/<everything:name>')
+def recent_history_tool(name = None):
+    return recent_history_tool_2(conn, name)
+
+@app.route('/history_delete/<everything:name>', methods=['POST', 'GET'])
+def recent_history_delete(name = None):
+    return recent_history_delete_2(conn, name)
+
+# Func-search
 @app.route('/search', methods=['POST'])
 def search():
     return search_2(conn)
@@ -424,11 +491,7 @@ def search_goto(name = 'test'):
 def search_deep(name = 'test'):
     return search_deep_2(conn, name)
 
-@app.route('/raw/<everything:name>')
-@app.route('/thread/<int:topic_num>/raw/<int:num>')
-def view_raw(name = None, topic_num = None, num = None):
-    return view_raw_2(conn, name, topic_num, num)
-
+# Func-edit
 @app.route('/revert/<everything:name>', methods=['POST', 'GET'])
 def edit_revert(name = None):
     return edit_revert_2(conn, name)
@@ -453,19 +516,7 @@ def edit_many_delete(name = None):
 def edit_move(name = None):
     return edit_move_2(conn, name)
 
-@app.route('/other')
-def main_other():
-    return main_other_2(conn)
-
-@app.route('/manager', methods=['POST', 'GET'])
-@app.route('/manager/<int:num>', methods=['POST', 'GET'])
-def main_manager(num = 1):
-    return main_manager_2(conn, num, version_list['beta']['r_ver'])
-
-@app.route('/title_index')
-def list_title_index():
-    return list_title_index_2(conn)
-
+# Func-topic
 @app.route('/thread/<int:topic_num>/b/<int:num>')
 def topic_block(topic_num = 1, num = 1):
     return topic_block_2(conn, topic_num, num)
@@ -506,10 +557,29 @@ def topic(topic_num = 1):
 def topic_close_list(name = 'test'):
     return topic_close_list_2(conn, name)
 
+# Func-user
 @app.route('/tool/<name>')
 def user_tool(name = None):
     return user_tool_2(conn, name)
 
+@app.route('/change', methods=['POST', 'GET'])
+def user_setting():
+    return user_setting_2(conn, server_init)
+
+@app.route('/user')
+def user_info():
+    return user_info_2(conn)
+
+@app.route('/custom_head', methods=['GET', 'POST'])
+def user_custom_head_view():
+    return user_custom_head_view_2(conn)
+
+@app.route('/count')
+@app.route('/count/<name>')
+def user_count_edit(name = None):
+    return user_count_edit_2(conn, name)
+
+# Func-login
 @app.route('/2fa_login', methods=['POST', 'GET'])
 def login_2fa():
     return login_2fa_2(conn)
@@ -518,22 +588,10 @@ def login_2fa():
 def login():
     return login_2(conn)
 
-@app.route('/change', methods=['POST', 'GET'])
-def user_setting():
-    return user_setting_2(conn, server_init)
-
 @app.route('/pw_change', methods=['POST', 'GET'])
 def login_pw_change():
     return login_pw_change_2(conn)
 
-@app.route('/check/<name>')
-def give_user_check(name = None):
-    return give_user_check_2(conn, name)
-    
-@app.route('/check_delete', methods=['POST', 'GET'])
-def give_user_check_delete():
-    return give_user_check_delete_2(conn)
-
 @app.route('/register', methods=['POST', 'GET'])
 def login_register():
     return login_register_2(conn)
@@ -550,61 +608,7 @@ def login_check_key(tool = 'check_pass_key'):
 def login_logout():
     return login_logout_2(conn)
 
-@app.route('/ban', methods=['POST', 'GET'])
-@app.route('/ban/<name>', methods=['POST', 'GET'])
-def give_user_ban(name = None):
-    return give_user_ban_2(conn, name)
-
-@app.route('/acl/<everything:name>', methods=['POST', 'GET'])
-def give_acl(name = None):
-    return give_acl_2(conn, name)
-
-@app.route('/admin/<name>', methods=['POST', 'GET'])
-def give_admin(name = None):
-    return give_admin_2(conn, name)
-
-@app.route('/diff/<everything:name>')
-def view_diff_data(name = None):
-    return view_diff_data_2(conn, name)
-
-@app.route('/down/<everything:name>')
-def view_down(name = None):
-    return view_down_2(conn, name)
-
-@app.route('/w/<everything:name>')
-def view_read(name = None):
-    return view_read_2(conn, name)
-
-@app.route('/topic_record/<name>')
-def list_user_topic(name = 'test'):
-    return list_user_topic_2(conn, name)
-
-@app.route('/recent_changes')
-@app.route('/<regex("record"):tool>/<name>')
-@app.route('/<regex("history"):tool>/<everything:name>', methods=['POST', 'GET'])
-def recent_changes(name = None, tool = 'record'):
-    return recent_changes_2(conn, name, tool)
-
-@app.route('/history_tool/<everything:name>')
-def recent_history_tool(name = None):
-    return recent_history_tool_2(conn, name)
-
-@app.route('/history_delete/<everything:name>', methods=['POST', 'GET'])
-def recent_history_delete(name = None):
-    return recent_history_delete_2(conn, name)
-
-@app.route('/upload', methods=['GET', 'POST'])
-def func_upload():
-    return func_upload_2(conn)
-
-@app.route('/user')
-def user_info():
-    return user_info_2(conn)
-
-@app.route('/<regex("long_page|short_page"):tool>')
-def list_long_page(tool = 'long_page'):
-    return list_long_page_2(conn, tool)
-
+# Func-watch_list
 @app.route('/<regex("watch_list|star_doc"):tool>')
 def watch_list(tool = 'star_doc'):
     return watch_list_2(conn, tool)
@@ -613,28 +617,7 @@ def watch_list(tool = 'star_doc'):
 def watch_list_name(tool = 'star_doc', name = 'Test'):
     return watch_list_name_2(conn, tool, name)
 
-@app.route('/custom_head', methods=['GET', 'POST'])
-def user_custom_head_view():
-    return user_custom_head_view_2(conn)
-
-@app.route('/count')
-@app.route('/count/<name>')
-def user_count_edit(name = None):
-    return user_count_edit_2(conn, name)
-
-@app.route('/random')
-def func_title_random():
-    return func_title_random_2(conn)
-
-@app.route('/image/<everything:name>')
-def main_image_view(name = None):
-    return main_image_view_2(conn, name)
-
-@app.route('/skin_set')
-@app.route('/main_skin_set')
-def main_skin_set():
-    return main_skin_set_2(conn)
-
+# Func-application
 @app.route('/application_submitted')
 def application_submitted():
     return application_submitted_2(conn)
@@ -643,6 +626,7 @@ def application_submitted():
 def applications():
     return applications_2(conn)
 
+# Func-vote
 @app.route('/vote/<num>', methods=['POST', 'GET'])
 def vote_select(num = '1'):
     return vote_select_2(conn, num)
@@ -663,7 +647,7 @@ def vote():
 def vote_add():
     return vote_add_2(conn)
 
-# API
+# Func-api
 @app.route('/api/w/<everything:name>', methods=['POST', 'GET'])
 def api_w(name = ''):
     return api_w_2(conn, name)
@@ -717,7 +701,38 @@ def api_image_view(name = ''):
 def api_sitemap():
     return api_sitemap_2(conn)
 
-# File
+# Func-main
+@app.route('/random')
+def main_title_random():
+    return main_title_random_2(conn)
+
+@app.route('/upload', methods=['GET', 'POST'])
+def main_upload():
+    return main_upload_2(conn)
+
+@app.route('/setting')
+@app.route('/setting/<int:num>', methods=['POST', 'GET'])
+def setting(num = 0):
+    return main_setting_2(conn, num, set_data['db_type'])
+
+@app.route('/other')
+def main_other():
+    return main_other_2(conn)
+
+@app.route('/manager', methods=['POST', 'GET'])
+@app.route('/manager/<int:num>', methods=['POST', 'GET'])
+def main_manager(num = 1):
+    return main_manager_2(conn, num, version_list['beta']['r_ver'])
+
+@app.route('/image/<everything:name>')
+def main_image_view(name = None):
+    return main_image_view_2(conn, name)
+
+@app.route('/skin_set')
+@app.route('/main_skin_set')
+def main_skin_set():
+    return main_skin_set_2(conn)
+
 @app.route('/views/<everything:name>')
 def main_views(name = None):
     return main_views_2(conn, name)
@@ -726,11 +741,11 @@ def main_views(name = None):
 def main_file(data = None):
     return main_file_2(conn, data)
 
-# End
 @app.errorhandler(404)
 def main_error_404(e):
     return main_error_404_2(conn)
 
+# End
 app.secret_key = rep_key
 app.wsgi_app = werkzeug.debug.DebuggedApplication(app.wsgi_app, True)
 app.debug = True

+ 1 - 1
route/give_delete_admin_group.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def delete_admin_group_2(conn, name):
+def give_delete_admin_group_2(conn, name):
     curs = conn.cursor()
 
     if admin_check() != 1:

+ 1 - 1
route/setting.py → route/main_setting.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def setting_2(conn, num, db_set):
+def main_setting_2(conn, num, db_set):
     curs = conn.cursor()
 
     if not (num == 0 or num == 8) and admin_check() != 1:

+ 1 - 1
route/func_title_random.py → route/main_title_random.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def func_title_random_2(conn):
+def main_title_random_2(conn):
     curs = conn.cursor()
 
     curs.execute(db_change("" + \

+ 1 - 1
route/func_upload.py → route/main_upload.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def func_upload_2(conn):
+def main_upload_2(conn):
     curs = conn.cursor()
 
     if acl_check(None, 'upload') == 1:

+ 1 - 1
route/recent_block.py

@@ -9,7 +9,7 @@ def recent_block_2(conn, name, tool):
     div = '''
         <table id="main_table_set">
             <tbody>
-                <tr>
+                <tr id="main_table_top_tr">
                     <td id="main_table_width">''' + load_lang('blocked') + '''</td>
                     <td id="main_table_width">''' + load_lang('admin') + '''</td>
                     <td id="main_table_width">''' + load_lang('period') + '''</td>

+ 1 - 1
route/recent_changes.py

@@ -18,7 +18,7 @@ def recent_changes_2(conn, name, tool):
         div = '''
             <table id="main_table_set">
                 <tbody>
-                    <tr>
+                    <tr id="main_table_top_tr">
         '''
 
         num = int(number_check(flask.request.args.get('num', '1')))

+ 2 - 2
route/recent_discuss.py

@@ -15,10 +15,10 @@ def recent_discuss_2(conn):
         m_sub = ' (' + load_lang('closed') + ')'
 
     div +=  '''
-            <hr class=\"main_hr\">
+            <hr class="main_hr">
             <table id="main_table_set">
                 <tbody>
-                    <tr>
+                    <tr id="main_table_top_tr">
                         <td id="main_table_width_half">''' + load_lang('discussion_name') + '''</td>
                         <td id="main_table_width_half">''' + load_lang('time') + '''</td>
                     </tr>

+ 444 - 431
route/tool/func.py

@@ -1,3 +1,4 @@
+# Init
 import sys
 import platform
 import json
@@ -65,12 +66,14 @@ from .func_mark import *
         
 global_lang = {}
 
-data_css_ver = '82'
+data_css_ver = '83'
 data_css = ''
 
 conn = ''
 curs = ''
 
+# Func
+# Func-main
 def load_conn(data):
     global conn
     global curs
@@ -80,6 +83,7 @@ def load_conn(data):
 
     load_conn2(data)
     
+# Func-init
 class server_init:
     def __init__(self):
         self.env_dict = {
@@ -144,112 +148,7 @@ class server_init:
                         return server_set_val
                 else:
                     return self.server_set_var[key]['default']
-    
-def load_image_url():
-    curs.execute(db_change('select data from other where name = "image_where"'))
-    image_where = curs.fetchall()
-    image_where = image_where[0][0] if image_where else 'data/images'
-    
-    return image_where
-
-def http_warring():
-    return '''
-        <div id="http_warring_text"></div>
-        <script>
-            if(window.location.protocol !== 'https:') {
-                document.getElementById('http_warring_text').innerHTML = "''' + load_lang('http_warring') + '''";
-                document.getElementById('http_warring_text').style.margin = "10px 0px 0px 0px";
-            }
-        </script>
-    '''
-    
-def send_email(who, title, data):
-    try:
-        curs.execute(db_change('' + \
-            'select name, data from other ' + \
-            'where name = "smtp_email" or name = "smtp_pass" or name = "smtp_server" or name = "smtp_port" or name = "smtp_security"' + \
-        ''))
-        rep_data = curs.fetchall()
-
-        smtp_email = ''
-        smtp_pass = ''
-        smtp_server = ''
-        smtp_security = ''
-        smtp_port = ''
-        smtp = ''
-
-        for i in rep_data:
-            if i[0] == 'smtp_email':
-                smtp_email = i[1]
-            elif i[0] == 'smtp_pass':
-                smtp_pass = i[1]
-            elif i[0] == 'smtp_server':
-                smtp_server = i[1]
-            elif i[0] == 'smtp_security':
-                smtp_security = i[1]
-            elif i[0] == 'smtp_port':
-                smtp_port = i[1]
-        
-        smtp_port = int(smtp_port)
-        if smtp_security == 'plain':
-            smtp = smtplib.SMTP(smtp_server, smtp_port)
-        elif smtp_security == 'starttls':
-            smtp = smtplib.SMTP(smtp_server, smtp_port)
-            smtp.starttls()
-        else:
-            # if smtp_security == 'tls':
-            smtp = smtplib.SMTP_SSL(smtp_server, smtp_port)
-        
-        smtp.login(smtp_email, smtp_pass)
-
-        domain = load_domain()
-        wiki_name = wiki_set()[0]
-        
-        msg = email.mime.text.MIMEText(data)
-        msg['Subject'] = title
-        msg['From'] = 'openNAMU <noreply@' + domain + '>'
-        msg['To'] = who
-        
-        smtp.sendmail('openNAMU@' + domain, who, msg.as_string())
-        smtp.quit()
-
-        return 1
-    except Exception as e:
-        print('----')
-        print('Error : email send error')
-        print(e)
-
-        return 0
-
-def load_domain():
-    curs.execute(db_change("select data from other where name = 'domain'"))
-    domain = curs.fetchall()
-    domain = domain[0][0] if domain and domain[0][0] != '' else flask.request.host_url
-
-    return domain
-
-def load_random_key(long = 64):
-    return ''.join(random.choice("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") for i in range(long))
-
-def easy_minify(data, tool = None):
-    return data
-
-def render_set(doc_name = '', doc_data = '', data_type = 'view', data_in = '', doc_acl = ''):
-    # data_type in ['view', 'raw', 'api_view', 'backlink']
-    doc_acl = acl_check(doc_name, 'render') if doc_acl == '' else doc_acl
-    doc_data = 0 if not doc_data else doc_data
-        
-    if doc_acl == 1:
-        return 'HTTP Request 401.3'
-    else:
-        if data_type == 'raw':
-            return doc_data
-        else:
-            if doc_data != 0:
-                return render_do(doc_name, doc_data, data_type, data_in)
-            else:
-                return 'HTTP Request 404'
-
+                
 def update(ver_num, set_data):
     print('----')
     # 업데이트 하위 호환 유지 함수
@@ -396,6 +295,120 @@ def set_init():
         for i in [['smtp_server', 'smtp.gmail.com'], ['smtp_port', '587'], ['smtp_security', 'starttls']]:
             curs.execute(db_change("insert into other (name, data) values (?, ?)"), [i[0], i[1]])
 
+# Func-simple
+def load_image_url():
+    curs.execute(db_change('select data from other where name = "image_where"'))
+    image_where = curs.fetchall()
+    image_where = image_where[0][0] if image_where else 'data/images'
+    
+    return image_where
+
+def http_warring():
+    return '''
+        <div id="http_warring_text"></div>
+        <script>
+            if(window.location.protocol !== 'https:') {
+                document.getElementById('http_warring_text').innerHTML = "''' + load_lang('http_warring') + '''";
+                document.getElementById('http_warring_text').style.margin = "10px 0px 0px 0px";
+            }
+        </script>
+    '''
+
+def load_domain():
+    curs.execute(db_change("select data from other where name = 'domain'"))
+    domain = curs.fetchall()
+    domain = domain[0][0] if domain and domain[0][0] != '' else flask.request.host_url
+
+    return domain
+
+def load_random_key(long = 64):
+    return ''.join(random.choice("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") for i in range(long))
+
+def edit_button():
+    insert_list = []
+
+    curs.execute(db_change("select html, plus from html_filter where kind = 'edit_top'"))
+    db_data = curs.fetchall()
+    for get_data in db_data:
+        insert_list += [[get_data[1], get_data[0]]]
+
+    data = ''
+    for insert_data in insert_list:
+        data += '<a href="javascript:do_insert_data(\'content\', \'' + insert_data[0] + '\')">(' + insert_data[1] + ')</a> '
+
+    if admin_check() == 1:
+        data += (' ' if data != '' else '') + '<a href="/edit_top">(' + load_lang('add') + ')</a>'
+
+    return data + '<hr class="main_hr">'
+
+def ip_warring():
+    if ip_or_user() != 0:
+        curs.execute(db_change('select data from other where name = "no_login_warring"'))
+        data = curs.fetchall()
+        if data and data[0][0] != '':
+            text_data = '' + \
+                '<span>' + data[0][0] + '</span>' + \
+                '<hr class="main_hr">' + \
+            ''
+        else:
+            text_data = '' + \
+                '<span>' + load_lang('no_login_warring') + '</span>' + \
+                '<hr class="main_hr">' + \
+            ''
+    else:
+        text_data = ''
+
+    return text_data
+
+def next_fix(link, num, page, end = 50):
+    list_data = ''
+
+    if num == 1:
+        if len(page) == end:
+            list_data += '' + \
+                '<hr class="main_hr">' + \
+                '<a href="' + link + str(num + 1) + '">(' + load_lang('next') + ')</a>' + \
+            ''
+    elif len(page) != end:
+        list_data += '' + \
+            '<hr class="main_hr">' + \
+            '<a href="' + link + str(num - 1) + '">(' + load_lang('previous') + ')</a>' + \
+        ''
+    else:
+        list_data += '' + \
+            '<hr class="main_hr">' + \
+            '<a href="' + link + str(num - 1) + '">(' + load_lang('previous') + ')</a> <a href="' + link + str(num + 1) + '">(' + load_lang('next') + ')</a>' + \
+        ''
+
+    return list_data
+
+def leng_check(first, second):
+    if first < second:
+        all_plus = '+' + str(second - first)
+    elif second < first:
+        all_plus = '-' + str(first - second)
+    else:
+        all_plus = '0'
+
+    return all_plus
+
+def number_check(data):
+    try:
+        int(data)
+        return data
+    except:
+        return '1'
+
+def redirect(data = '/'):
+    return flask.redirect(flask.request.host_url[:-1] + data)
+    
+def get_acl_list(type_d = 'normal'):
+    if type_d == 'user':
+        return ['', 'user', 'all']
+    else:
+        return ['', 'all', 'user', 'admin', 'owner', '50_edit', 'email', 'ban', 'before', '30_day', 'ban_admin']
+    
+# Func-login    
 def pw_encode(data, type_d = ''):
     if type_d == '':
         curs.execute(db_change('select data from other where name = "encode"'))
@@ -428,74 +441,11 @@ def pw_check(data, data2, type_d = 'no', id_d = ''):
         curs.execute(db_change("update user set pw = ?, encode = ? where id = ?"), [pw_encode(data), db_data[0][0], id_d])
 
     return re_data
-
-def add_alarm(who, context):
-    curs.execute(db_change('insert into alarm (name, data, date) values (?, ?, ?)'), [who, context, get_time()])
-
-def captcha_get():
-    data = ''
-
-    if ip_or_user() != 0:
-        curs.execute(db_change('select data from other where name = "recaptcha"'))
-        recaptcha = curs.fetchall()
-        if recaptcha and recaptcha[0][0] != '':
-            curs.execute(db_change('select data from other where name = "sec_re"'))
-            sec_re = curs.fetchall()
-            if sec_re and sec_re[0][0] != '':
-                curs.execute(db_change('select data from other where name = "recaptcha_ver"'))
-                rec_ver = curs.fetchall()
-                if not rec_ver or rec_ver[0][0] == '':
-                    data += '' + \
-                        '<script src="https://www.google.com/recaptcha/api.js" async defer></script>' + \
-                        '<div class="g-recaptcha" data-sitekey="' + recaptcha[0][0] + '"></div>' + \
-                        '<hr class="main_hr">' + \
-                    ''
-                else:
-                    data += '' + \
-                        '<script src="https://www.google.com/recaptcha/api.js?render=' + recaptcha[0][0] + '"></script>' + \
-                        '<input type="hidden" id="g-recaptcha" name="g-recaptcha">' + \
-                        '<script type="text/javascript">' + \
-                            'grecaptcha.ready(function() {' + \
-                                'grecaptcha.execute(\'' + recaptcha[0][0] + '\', {action: \'homepage\'}).then(function(token) {' + \
-                                    'document.getElementById(\'g-recaptcha\').value = token;' + \
-                                '});' + \
-                            '});' + \
-                        '</script>' + \
-                    ''
-
+        
+# Func-skin
+def easy_minify(data, tool = None):
     return data
 
-def captcha_post(re_data, num = 1):
-    if num == 1:
-        curs.execute(db_change('select data from other where name = "sec_re"'))
-        sec_re = curs.fetchall()
-        if sec_re and sec_re[0][0] != '' and ip_or_user() != 0 and captcha_get() != '':
-            try:
-                data = urllib.request.urlopen('https://www.google.com/recaptcha/api/siteverify?secret=' + sec_re[0][0] + '&response=' + re_data)
-            except:
-                data = None
-
-            if data and data.getcode() == 200:
-                json_data = json.loads(data.read().decode(data.headers.get_content_charset()))
-                if json_data['success'] == True:
-                    return 0
-                else:
-                    return 1
-            else:
-                return 0
-        else:
-            return 0
-    else:
-        pass
-
-def ua_plus(id, ip, ua, time):
-    curs.execute(db_change("select data from other where name = 'ua_get'"))
-    rep_data = curs.fetchall()
-    if rep_data and rep_data[0][0] != '':
-        pass
-    else:
-        curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [id, ip, ua, time])
-
 def load_lang(data, num = 2, safe = 0):
     global global_lang
 
@@ -514,69 +464,24 @@ def load_lang(data, num = 2, safe = 0):
             curs.execute(db_change("select data from other where name = 'language'"))
             rep_data = curs.fetchall()
         
-        if rep_data and rep_data[0][0] != '' and rep_data[0][0] != 'default':
-            try:
-                if not rep_data[0][0] in global_lang:
-                    lang = json.loads(open(os.path.join('lang', rep_data[0][0] + '.json'), encoding='utf8').read())
-                    global_lang[rep_data[0][0]] = lang
-                else:
-                    lang = global_lang[rep_data[0][0]]
-            except:
-                continue
-
-            if data in lang:
-                return lang[data] if safe == 1 else html.escape(lang[data])
-            else:
-                continue
-        else:
-            continue
-    
-    return html.escape(data + ' (' + rep_data[0][0] + ')')
-
-def ip_or_user(data = ''):
-    if data == '':
-        data = ip_check()
-
-    if re.search(r'(\.|:)', data):
-        return 1
-    else:
-        return 0
-
-def edit_button():
-    insert_list = []
-
-    curs.execute(db_change("select html, plus from html_filter where kind = 'edit_top'"))
-    db_data = curs.fetchall()
-    for get_data in db_data:
-        insert_list += [[get_data[1], get_data[0]]]
-
-    data = ''
-    for insert_data in insert_list:
-        data += '<a href="javascript:do_insert_data(\'content\', \'' + insert_data[0] + '\')">(' + insert_data[1] + ')</a> '
-
-    if admin_check() == 1:
-        data += (' ' if data != '' else '') + '<a href="/edit_top">(' + load_lang('add') + ')</a>'
-
-    return data + '<hr class="main_hr">'
-
-def ip_warring():
-    if ip_or_user() != 0:
-        curs.execute(db_change('select data from other where name = "no_login_warring"'))
-        data = curs.fetchall()
-        if data and data[0][0] != '':
-            text_data = '' + \
-                '<span>' + data[0][0] + '</span>' + \
-                '<hr class="main_hr">' + \
-            ''
-        else:
-            text_data = '' + \
-                '<span>' + load_lang('no_login_warring') + '</span>' + \
-                '<hr class="main_hr">' + \
-            ''
-    else:
-        text_data = ''
+        if rep_data and rep_data[0][0] != '' and rep_data[0][0] != 'default':
+            try:
+                if not rep_data[0][0] in global_lang:
+                    lang = json.loads(open(os.path.join('lang', rep_data[0][0] + '.json'), encoding='utf8').read())
+                    global_lang[rep_data[0][0]] = lang
+                else:
+                    lang = global_lang[rep_data[0][0]]
+            except:
+                continue
 
-    return text_data
+            if data in lang:
+                return lang[data] if safe == 1 else html.escape(lang[data])
+            else:
+                continue
+        else:
+            continue
+    
+    return html.escape(data + ' (' + rep_data[0][0] + ')')
 
 def skin_check(set_n = 0):
     skin_list = load_skin('tenshi', 1)
@@ -604,28 +509,6 @@ def skin_check(set_n = 0):
 
     return './views/' + skin + '/index.html' if set_n == 0 else skin
 
-def next_fix(link, num, page, end = 50):
-    list_data = ''
-
-    if num == 1:
-        if len(page) == end:
-            list_data += '' + \
-                '<hr class="main_hr">' + \
-                '<a href="' + link + str(num + 1) + '">(' + load_lang('next') + ')</a>' + \
-            ''
-    elif len(page) != end:
-        list_data += '' + \
-            '<hr class="main_hr">' + \
-            '<a href="' + link + str(num - 1) + '">(' + load_lang('previous') + ')</a>' + \
-        ''
-    else:
-        list_data += '' + \
-            '<hr class="main_hr">' + \
-            '<a href="' + link + str(num - 1) + '">(' + load_lang('previous') + ')</a> <a href="' + link + str(num + 1) + '">(' + load_lang('next') + ')</a>' + \
-        ''
-
-    return list_data
-
 def other2(data):
     global data_css
     global data_css_ver
@@ -720,95 +603,6 @@ def wiki_set(num = 1):
 
     return data_list
 
-def admin_check(num = None, what = None, name = ''):
-    ip = ip_check() if name == '' else name
-    time_data = get_time()
-
-    curs.execute(db_change("select acl from user where id = ?"), [ip])
-    user = curs.fetchall()
-    if user:
-        back_num = num
-        while 1:
-            if num == 1:
-                check = 'ban'
-            elif num == 2:
-                check = 'nothing'
-            elif num == 3:
-                check = 'toron'
-            elif num == 4:
-                check = 'check'
-            elif num == 5:
-                check = 'acl'
-            elif num == 6:
-                check = 'hidel'
-            elif num == 7:
-                check = 'give'
-            else:
-                check = 'owner'
-
-            curs.execute(db_change('select name from alist where name = ? and acl = ?'), [user[0][0], check])
-            if curs.fetchall():
-                if what:
-                    curs.execute(db_change("insert into re_admin (who, what, time) values (?, ?, ?)"), [ip, what, time_data])
-                    conn.commit()
-
-                return 1
-            else:
-                if back_num == 'all':
-                    if num == 'all':
-                        num = 1
-                    elif num != 8:
-                        num += 1
-                    else:
-                        break
-                elif num:
-                    num = None
-                else:
-                    break
-
-    return 0
-
-def ip_pas(raw_ip, type_d = 0):
-    hide = 0
-    end_ip = {}
-
-    if type(raw_ip) != type([]):
-        get_ip = [raw_ip]
-        return_ip = 1
-    else:
-        get_ip = raw_ip
-        return_ip = 0
-
-    for raw_ip in get_ip:
-        if not raw_ip in end_ip:
-            if ip_or_user(raw_ip) != 0:
-                curs.execute(db_change("select data from other where name = 'ip_view'"))
-                data = curs.fetchall()
-                if data and data[0][0] != '':
-                    ip = re.sub(r'\.([^.]*)\.([^.]*)$', '.*.*', raw_ip) if re.search(r'\.', raw_ip) else re.sub(r':([^:]*):([^:]*)$', ':*:*', raw_ip)
-                    hide = 1 if not admin_check(1) else 0
-                else:
-                    ip = raw_ip
-            else:
-                if type_d == 0:
-                    ip = '<a href="/w/' + url_pas('user:' + raw_ip) + '">' + raw_ip + '</a>'
-                    ip = '<b>' + ip + '</b>' if admin_check('all', None, raw_ip) == 1 else ip
-                else:
-                    ip = raw_ip
-
-            if type_d == 0:
-                if ban_check(raw_ip) == 1:
-                    ip = '<s>' + ip + '</s>'
-
-                    if ban_check(raw_ip, 'login') == 1:
-                        ip = '<i>' + ip + '</i>'
-
-                ip = (ip + ' <a href="/tool/' + url_pas(raw_ip) + '">(' + load_lang('tool') + ')</a>') if hide == 0 else ip
-        
-            end_ip[raw_ip] = ip
-
-    return ip if return_ip == 1 else end_ip
-
 def custom():
     ip = ip_check()
     if ip_or_user(ip) == 0:
@@ -875,58 +669,231 @@ def load_skin(data = '', set_n = 0, default = 0):
     # default == 0 -> 디폴트 미포함
     # default == 1 -> 디폴트 포함
 
-    skin_return_data = '' if set_n == 0 else []
-    system_file = ['main_css']
-    skin_list_get = os.listdir(os.path.abspath('views'))
+    skin_return_data = '' if set_n == 0 else []
+    system_file = ['main_css']
+    skin_list_get = os.listdir(os.path.abspath('views'))
+
+    if default == 1:
+        skin_list_get += ['default']
+
+    if data == '':
+        curs.execute(db_change('select data from user_set where name = "skin" and id = ?'), [ip_check()])
+        data = curs.fetchall()
+        if not data:
+            curs.execute(db_change('select data from other where name = "skin"'))
+            data = curs.fetchall()
+            if not data or data[0][0] == '':
+                if default == 1:
+                    data = [['default']]
+                else:
+                    data = [['tenshi']]
+    else:
+        data = [[data]]
+
+    for skin_data in skin_list_get:
+        see_data = skin_data if skin_data != 'default' else load_lang('default')
+
+        if not skin_data in system_file:
+            if data[0][0] == skin_data:
+                if set_n == 0:
+                    skin_return_data = '<option value="' + skin_data + '">' + see_data + '</option>' + skin_return_data
+                else:
+                    skin_return_data = [skin_data] + skin_return_data
+            else:
+                if set_n == 0:
+                    skin_return_data += '<option value="' + skin_data + '">' + see_data + '</option>'
+                else:
+                    skin_return_data += [skin_data]                    
+
+    return skin_return_data
+
+# Func-markup
+def render_set(doc_name = '', doc_data = '', data_type = 'view', data_in = '', doc_acl = ''):
+    # data_type in ['view', 'raw', 'api_view', 'backlink']
+    doc_acl = acl_check(doc_name, 'render') if doc_acl == '' else doc_acl
+    doc_data = 0 if not doc_data else doc_data
+        
+    if doc_acl == 1:
+        return 'HTTP Request 401.3'
+    else:
+        if data_type == 'raw':
+            return doc_data
+        else:
+            if doc_data != 0:
+                return render_do(doc_name, doc_data, data_type, data_in)
+            else:
+                return 'HTTP Request 404'
+
+# Func-request
+def send_email(who, title, data):
+    try:
+        curs.execute(db_change('' + \
+            'select name, data from other ' + \
+            'where name = "smtp_email" or name = "smtp_pass" or name = "smtp_server" or name = "smtp_port" or name = "smtp_security"' + \
+        ''))
+        rep_data = curs.fetchall()
+
+        smtp_email = ''
+        smtp_pass = ''
+        smtp_server = ''
+        smtp_security = ''
+        smtp_port = ''
+        smtp = ''
+
+        for i in rep_data:
+            if i[0] == 'smtp_email':
+                smtp_email = i[1]
+            elif i[0] == 'smtp_pass':
+                smtp_pass = i[1]
+            elif i[0] == 'smtp_server':
+                smtp_server = i[1]
+            elif i[0] == 'smtp_security':
+                smtp_security = i[1]
+            elif i[0] == 'smtp_port':
+                smtp_port = i[1]
+        
+        smtp_port = int(smtp_port)
+        if smtp_security == 'plain':
+            smtp = smtplib.SMTP(smtp_server, smtp_port)
+        elif smtp_security == 'starttls':
+            smtp = smtplib.SMTP(smtp_server, smtp_port)
+            smtp.starttls()
+        else:
+            # if smtp_security == 'tls':
+            smtp = smtplib.SMTP_SSL(smtp_server, smtp_port)
+        
+        smtp.login(smtp_email, smtp_pass)
+
+        domain = load_domain()
+        wiki_name = wiki_set()[0]
+        
+        msg = email.mime.text.MIMEText(data)
+        msg['Subject'] = title
+        msg['From'] = 'openNAMU <noreply@' + domain + '>'
+        msg['To'] = who
+        
+        smtp.sendmail('openNAMU@' + domain, who, msg.as_string())
+        smtp.quit()
+
+        return 1
+    except Exception as e:
+        print('----')
+        print('Error : email send error')
+        print(e)
+
+        return 0
+
+def captcha_get():
+    data = ''
+
+    if ip_or_user() != 0:
+        curs.execute(db_change('select data from other where name = "recaptcha"'))
+        recaptcha = curs.fetchall()
+        if recaptcha and recaptcha[0][0] != '':
+            curs.execute(db_change('select data from other where name = "sec_re"'))
+            sec_re = curs.fetchall()
+            if sec_re and sec_re[0][0] != '':
+                curs.execute(db_change('select data from other where name = "recaptcha_ver"'))
+                rec_ver = curs.fetchall()
+                if not rec_ver or rec_ver[0][0] == '':
+                    data += '' + \
+                        '<script src="https://www.google.com/recaptcha/api.js" async defer></script>' + \
+                        '<div class="g-recaptcha" data-sitekey="' + recaptcha[0][0] + '"></div>' + \
+                        '<hr class="main_hr">' + \
+                    ''
+                else:
+                    data += '' + \
+                        '<script src="https://www.google.com/recaptcha/api.js?render=' + recaptcha[0][0] + '"></script>' + \
+                        '<input type="hidden" id="g-recaptcha" name="g-recaptcha">' + \
+                        '<script type="text/javascript">' + \
+                            'grecaptcha.ready(function() {' + \
+                                'grecaptcha.execute(\'' + recaptcha[0][0] + '\', {action: \'homepage\'}).then(function(token) {' + \
+                                    'document.getElementById(\'g-recaptcha\').value = token;' + \
+                                '});' + \
+                            '});' + \
+                        '</script>' + \
+                    ''
+
+    return data
 
-    if default == 1:
-        skin_list_get += ['default']
+def captcha_post(re_data, num = 1):
+    if num == 1:
+        curs.execute(db_change('select data from other where name = "sec_re"'))
+        sec_re = curs.fetchall()
+        if sec_re and sec_re[0][0] != '' and ip_or_user() != 0 and captcha_get() != '':
+            try:
+                data = urllib.request.urlopen('https://www.google.com/recaptcha/api/siteverify?secret=' + sec_re[0][0] + '&response=' + re_data)
+            except:
+                data = None
 
-    if data == '':
-        curs.execute(db_change('select data from user_set where name = "skin" and id = ?'), [ip_check()])
-        data = curs.fetchall()
-        if not data:
-            curs.execute(db_change('select data from other where name = "skin"'))
-            data = curs.fetchall()
-            if not data or data[0][0] == '':
-                if default == 1:
-                    data = [['default']]
+            if data and data.getcode() == 200:
+                json_data = json.loads(data.read().decode(data.headers.get_content_charset()))
+                if json_data['success'] == True:
+                    return 0
                 else:
-                    data = [['tenshi']]
+                    return 1
+            else:
+                return 0
+        else:
+            return 0
     else:
-        data = [[data]]
+        pass
 
-    for skin_data in skin_list_get:
-        see_data = skin_data if skin_data != 'default' else load_lang('default')
+# Func-user
+def ip_or_user(data = ''):
+    if data == '':
+        data = ip_check()
 
-        if not skin_data in system_file:
-            if data[0][0] == skin_data:
-                if set_n == 0:
-                    skin_return_data = '<option value="' + skin_data + '">' + see_data + '</option>' + skin_return_data
-                else:
-                    skin_return_data = [skin_data] + skin_return_data
-            else:
-                if set_n == 0:
-                    skin_return_data += '<option value="' + skin_data + '">' + see_data + '</option>'
-                else:
-                    skin_return_data += [skin_data]                    
+    if re.search(r'(\.|:)', data):
+        return 1
+    else:
+        return 0
 
-    return skin_return_data
+def admin_check(num = None, what = None, name = ''):
+    ip = ip_check() if name == '' else name
+    time_data = get_time()
 
-def slow_edit_check():
-    curs.execute(db_change("select data from other where name = 'slow_edit'"))
-    slow_edit = curs.fetchall()
-    if slow_edit and slow_edit != '0' and admin_check(5) != 1:
-        slow_edit = slow_edit[0][0]
+    curs.execute(db_change("select acl from user where id = ?"), [ip])
+    user = curs.fetchall()
+    if user:
+        back_num = num
+        while 1:
+            if num == 1:
+                check = 'ban'
+            elif num == 2:
+                check = 'nothing'
+            elif num == 3:
+                check = 'toron'
+            elif num == 4:
+                check = 'check'
+            elif num == 5:
+                check = 'acl'
+            elif num == 6:
+                check = 'hidel'
+            elif num == 7:
+                check = 'give'
+            else:
+                check = 'owner'
 
-        curs.execute(db_change("select date from history where ip = ? order by date desc limit 1"), [ip_check()])
-        last_edit_data = curs.fetchall()
-        if last_edit_data:
-            last_edit_data = int(re.sub(' |:|-', '', last_edit_data[0][0]))
-            now_edit_data = int((datetime.datetime.now() - datetime.timedelta(seconds = int(slow_edit))).strftime("%Y%m%d%H%M%S"))
+            curs.execute(db_change('select name from alist where name = ? and acl = ?'), [user[0][0], check])
+            if curs.fetchall():
+                if what:
+                    curs.execute(db_change("insert into re_admin (who, what, time) values (?, ?, ?)"), [ip, what, time_data])
+                    conn.commit()
 
-            if last_edit_data > now_edit_data:
                 return 1
+            else:
+                if back_num == 'all':
+                    if num == 'all':
+                        num = 1
+                    elif num != 8:
+                        num += 1
+                    else:
+                        break
+                elif num:
+                    num = None
+                else:
+                    break
 
     return 0
 
@@ -1130,6 +1097,95 @@ def ban_check(ip = None, tool = None):
 
     return 0
 
+def ip_pas(raw_ip, type_d = 0):
+    hide = 0
+    end_ip = {}
+
+    if type(raw_ip) != type([]):
+        get_ip = [raw_ip]
+        return_ip = 1
+    else:
+        get_ip = raw_ip
+        return_ip = 0
+
+    for raw_ip in get_ip:
+        if not raw_ip in end_ip:
+            if ip_or_user(raw_ip) != 0:
+                curs.execute(db_change("select data from other where name = 'ip_view'"))
+                data = curs.fetchall()
+                if data and data[0][0] != '':
+                    ip = re.sub(r'\.([^.]*)\.([^.]*)$', '.*.*', raw_ip) if re.search(r'\.', raw_ip) else re.sub(r':([^:]*):([^:]*)$', ':*:*', raw_ip)
+                    hide = 1 if not admin_check(1) else 0
+                else:
+                    ip = raw_ip
+            else:
+                if type_d == 0:
+                    ip = '<a href="/w/' + url_pas('user:' + raw_ip) + '">' + raw_ip + '</a>'
+                    ip = '<b>' + ip + '</b>' if admin_check('all', None, raw_ip) == 1 else ip
+                else:
+                    ip = raw_ip
+
+            if type_d == 0:
+                if ban_check(raw_ip) == 1:
+                    ip = '<s>' + ip + '</s>'
+
+                    if ban_check(raw_ip, 'login') == 1:
+                        ip = '<i>' + ip + '</i>'
+
+                ip = (ip + ' <a href="/tool/' + url_pas(raw_ip) + '">(' + load_lang('tool') + ')</a>') if hide == 0 else ip
+        
+            end_ip[raw_ip] = ip
+
+    return ip if return_ip == 1 else end_ip
+
+# Func-edit
+def slow_edit_check():
+    curs.execute(db_change("select data from other where name = 'slow_edit'"))
+    slow_edit = curs.fetchall()
+    if slow_edit and slow_edit != '0' and admin_check(5) != 1:
+        slow_edit = slow_edit[0][0]
+
+        curs.execute(db_change("select date from history where ip = ? order by date desc limit 1"), [ip_check()])
+        last_edit_data = curs.fetchall()
+        if last_edit_data:
+            last_edit_data = int(re.sub(' |:|-', '', last_edit_data[0][0]))
+            now_edit_data = int((datetime.datetime.now() - datetime.timedelta(seconds = int(slow_edit))).strftime("%Y%m%d%H%M%S"))
+
+            if last_edit_data > now_edit_data:
+                return 1
+
+    return 0
+
+def edit_filter_do(data):
+    if admin_check(1) != 1:
+        curs.execute(db_change("select plus, plus_t from html_filter where kind = 'regex_filter' and plus != ''"))
+        for data_list in curs.fetchall():
+            match = re.compile(data_list[0], re.I)
+            if match.search(data):
+                ban_insert(
+                    ip_check(),
+                    '0' if data_list[1] == 'X' else data_list[1],
+                    'edit filter',
+                    None,
+                    'tool:edit filter'
+                )
+
+                return 1
+
+    return 0
+
+# Func-insert
+def add_alarm(who, context):
+    curs.execute(db_change('insert into alarm (name, data, date) values (?, ?, ?)'), [who, context, get_time()])
+    
+def ua_plus(id, ip, ua, time):
+    curs.execute(db_change("select data from other where name = 'ua_get'"))
+    rep_data = curs.fetchall()
+    if rep_data and rep_data[0][0] != '':
+        pass
+    else:
+        curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [id, ip, ua, time])
+
 def ban_insert(name, end, why, login, blocker, type_d = None):
     now_time = get_time()
     band = type_d if type_d else ''
@@ -1243,50 +1299,7 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
         mode
     ])
 
-def leng_check(first, second):
-    if first < second:
-        all_plus = '+' + str(second - first)
-    elif second < first:
-        all_plus = '-' + str(first - second)
-    else:
-        all_plus = '0'
-
-    return all_plus
-
-def number_check(data):
-    try:
-        int(data)
-        return data
-    except:
-        return '1'
-
-def edit_filter_do(data):
-    if admin_check(1) != 1:
-        curs.execute(db_change("select plus, plus_t from html_filter where kind = 'regex_filter' and plus != ''"))
-        for data_list in curs.fetchall():
-            match = re.compile(data_list[0], re.I)
-            if match.search(data):
-                ban_insert(
-                    ip_check(),
-                    '0' if data_list[1] == 'X' else data_list[1],
-                    'edit filter',
-                    None,
-                    'tool:edit filter'
-                )
-
-                return 1
-
-    return 0
-
-def redirect(data = '/'):
-    return flask.redirect(flask.request.host_url[:-1] + data)
-    
-def get_acl_list(type_d = 'normal'):
-    if type_d == 'user':
-        return ['', 'user', 'all']
-    else:
-        return ['', 'all', 'user', 'admin', 'owner', '50_edit', 'email', 'ban', 'before', '30_day', 'ban_admin']
-
+# Func-error
 def re_error(data):
     conn.commit()
 

+ 0 - 0
route/tool/func_init.py


+ 1 - 1
version.json

@@ -2,6 +2,6 @@
     "beta" : {
         "r_ver" : "v3.3.0-stable-01b (beta-03b) (dev-2021-04-30-01)",
         "c_ver" : "3300101",
-        "s_ver" : "11"
+        "s_ver" : "12"
     }
 }

+ 14 - 9
views/main_css/css/main.css

@@ -16,7 +16,7 @@ input {
 }
 
 #toc {
-    border: 1px solid;
+    border: 1px solid gainsboro;
     padding: 20px;
     width: fit-content;
     width: -moz-fit-content;
@@ -29,7 +29,7 @@ table {
 }
 
 td {
-    border: 1px solid;
+    border: 1px solid gainsboro;
     padding: 5px 10px;
 }
 
@@ -69,15 +69,19 @@ input[type="checkbox"], input[type="radio"] {
 }
 
 #toron_color_green {
-    background: #99ffcd;
+    background: palegreen;
 }
 
 #toron_color_blue {
-    background: #ffcbf9;
+    background: paleturquoise;
 }
 
 #toron_color_red {
-    background: #fecabf;
+    background: palevioletred;
+}
+
+#toron_color_normal {
+    background: palegoldenrod;
 }
 
 #toron_color_grey {
@@ -89,7 +93,7 @@ input[type="checkbox"], input[type="radio"] {
 }
 
 #cate {
-    border: 1px solid;
+    border: 1px solid gainsboro;
     padding: 5px;
     margin-top: 20px;
 }
@@ -99,7 +103,7 @@ img, iframe {
 }
 
 pre {
-    border: 1px solid;
+    border: 1px solid gainsboro;
     padding: 10px;
     white-space: pre-wrap;
 }
@@ -140,7 +144,7 @@ s:hover, strike:hover, del:hover {
 }
 
 #redirect {
-    border: 1px solid;
+    border: 1px solid gainsboro;
     padding: 10px;
 }
 
@@ -248,7 +252,8 @@ blockquote {
 }
 
 hr {
-    border-top: 1px solid lightgray;
+    border: 0;
+    border-top: 1px solid gainsboro;
 }
 
 .render_content {

+ 4 - 0
views/main_css/css/sub/dark.css

@@ -28,6 +28,10 @@ input::placeholder, textarea::placeholder, select::placeholder {
     background: #803737;
 }
 
+#toron_color_normal {
+    background: #38340e;
+}
+
 #toron_color_blue {
     background: #314c56;
 }

+ 1 - 1
views/main_css/js/load_topic.js

@@ -78,7 +78,7 @@ function new_topic_load(topic_num, type_do = 'top', some = '', where = 'top_topi
                 } else if(ip_o === ip_first) {
                     color_t = 'toron_color_green';
                 } else {
-                    color_t = 'toron_color';
+                    color_t = 'toron_color_normal';
                 }
                 
                 data_a += '' + 

+ 0 - 1
views/main_css/js/render_onmark.js

@@ -1,5 +1,4 @@
 // 인터위키
-// footnote 오류 확인
 // Tool
 function do_url_change(data) {
     return encodeURIComponent(data);

+ 5 - 1
views/tenshi/css/dark.css

@@ -26,7 +26,7 @@ html, #main {
     color: white;
 }
 
-a#titlt_a {
+#titlt_a {
     color: white;
 }
 
@@ -46,4 +46,8 @@ a#titlt_a {
 
 button#save {
     background: #083808;
+}
+
+#main_table_top_tr {
+    background: black;
 }

+ 3 - 8
views/tenshi/css/main.css

@@ -349,13 +349,8 @@ table {
     box-shadow: 0 2px 4px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
 }
 
-td {
-    border: 1px solid gainsboro;
-}
-
-hr {
-    border: 0;
-    border-top: 1px solid gainsboro;
+#main_table_top_tr {
+    background: aquamarine;
 }
 
 button {
@@ -435,7 +430,7 @@ select {
     color: white;
 }
 
-/* */
+/* content */
 #out_link::before {
     content: '🅴';
     font-weight: lighter;

+ 2 - 2
views/tenshi/index.html

@@ -8,8 +8,8 @@
             <title>{{imp[0]}} - {{imp[1][0]}}</title>
         {% endif %}
         {{imp[3][3]|safe}}
-        <link rel="stylesheet" href="/views/tenshi/css/main.css?ver=18">
-        <script src="/views/tenshi/js/skin_set.js?ver=7"></script>
+        <link rel="stylesheet" href="/views/tenshi/css/main.css?ver=19">
+        <script src="/views/tenshi/js/skin_set.js?ver=8"></script>
         <script src="/views/tenshi/js/main.js?ver=3"></script>
         <script>main_load(); window.addEventListener('DOMContentLoaded', skin_set);</script>
         <script src="https://code.iconify.design/1/1.0.3/iconify.min.js"></script>

+ 2 - 2
views/tenshi/info.json

@@ -1,5 +1,5 @@
 {
     "name" : "Tenshi",
-    "skin_ver" : "v2.0.0",
-    "require_ver" : "10"
+    "skin_ver" : "v2.0.1",
+    "require_ver" : "12"
 }

+ 2 - 2
views/tenshi/js/skin_set.js

@@ -16,8 +16,8 @@ function main_load() {
         cookies.match(regex_data('main_css_darkmode'))[1] === '1'
     ) {
         head_data.innerHTML += '' +
-            '<link rel="stylesheet" href="/views/main_css/css/sub/dark.css?ver=3">' +
-            '<link rel="stylesheet" href="/views/tenshi/css/dark.css?ver=7">' +
+            '<link rel="stylesheet" href="/views/main_css/css/sub/dark.css?ver=4">' +
+            '<link rel="stylesheet" href="/views/tenshi/css/dark.css?ver=8">' +
         '';
     }
 }