Jelajahi Sumber

Merge pull request #2298 from openNAMU/dev

버그 수정
잉여개발기 2 tahun lalu
induk
melakukan
fdce0c3bf7
98 mengubah file dengan 348 tambahan dan 290 penghapusan
  1. 2 2
      app.py
  2. 2 0
      lang/en-US.json
  3. 3 1
      lang/ko-KR.json
  4. 1 1
      route/bbs_delete.py
  5. 1 1
      route/bbs_make.py
  6. 1 1
      route/bbs_w.py
  7. 1 1
      route/bbs_w_comment_tool.py
  8. 1 1
      route/bbs_w_delete.py
  9. 2 4
      route/bbs_w_edit.py
  10. 1 1
      route/bbs_w_hide.py
  11. 1 1
      route/bbs_w_pinned.py
  12. 0 4
      route/bbs_w_post.py
  13. 2 2
      route/bbs_w_set.py
  14. 1 1
      route/bbs_w_tool.py
  15. 0 2
      route/edit.py
  16. 0 2
      route/edit_delete.py
  17. 2 2
      route/edit_delete_file.py
  18. 1 1
      route/edit_delete_multiple.py
  19. 3 5
      route/edit_move.py
  20. 1 3
      route/edit_revert.py
  21. 0 2
      route/edit_upload.py
  22. 1 1
      route/filter_all.py
  23. 12 12
      route/filter_all_add.py
  24. 1 1
      route/filter_all_delete.py
  25. 6 2
      route/give_admin_groups.py
  26. 3 3
      route/give_auth.py
  27. 2 2
      route/give_delete_admin_group.py
  28. 15 6
      route/give_user_ban.py
  29. 2 2
      route/give_user_fix.py
  30. 1 1
      route/list_admin_auth_use.py
  31. 1 1
      route/list_admin_group.py
  32. 3 3
      route/list_user_check.py
  33. 1 1
      route/list_user_check_delete.py
  34. 0 2
      route/login_find_key.py
  35. 3 19
      route/login_login.py
  36. 0 2
      route/login_login_2fa.py
  37. 0 2
      route/login_login_2fa_email.py
  38. 1 3
      route/login_register.py
  39. 2 2
      route/main_setting_acl.py
  40. 2 2
      route/main_setting_external.py
  41. 2 2
      route/main_setting_head.py
  42. 2 2
      route/main_setting_main.py
  43. 2 2
      route/main_setting_main_logo.py
  44. 2 2
      route/main_setting_phrase.py
  45. 2 2
      route/main_setting_robot.py
  46. 2 2
      route/main_setting_sitemap.py
  47. 2 2
      route/main_setting_sitemap_set.py
  48. 2 2
      route/main_setting_skin_set.py
  49. 2 2
      route/main_setting_top_menu.py
  50. 2 2
      route/main_sys_restart.py
  51. 2 2
      route/main_sys_shutdown.py
  52. 2 2
      route/main_sys_update.py
  53. 1 1
      route/n_bbs_main.py
  54. 1 1
      route/recent_app_submit.py
  55. 2 2
      route/recent_change.py
  56. 2 2
      route/recent_history_add.py
  57. 2 2
      route/recent_history_delete.py
  58. 1 1
      route/recent_history_hidden.py
  59. 2 2
      route/recent_history_reset.py
  60. 2 2
      route/recent_history_send.py
  61. 2 2
      route/recent_history_tool.py
  62. 2 2
      route/recent_record_reset.py
  63. 76 87
      route/tool/func.py
  64. 0 2
      route/topic.py
  65. 1 1
      route/topic_comment_blind.py
  66. 1 1
      route/topic_comment_delete.py
  67. 1 1
      route/topic_comment_notice.py
  68. 1 1
      route/topic_comment_tool.py
  69. 2 2
      route/topic_tool.py
  70. 2 2
      route/topic_tool_acl.py
  71. 2 2
      route/topic_tool_change.py
  72. 1 1
      route/topic_tool_delete.py
  73. 2 2
      route/topic_tool_setting.py
  74. 1 1
      route/user_challenge.py
  75. 1 1
      route/user_edit_filter.py
  76. 1 1
      route/user_info.py
  77. 1 1
      route/user_setting_user_name.py
  78. 1 1
      route/view_diff.py
  79. 2 2
      route/view_raw.py
  80. 5 5
      route/view_set.py
  81. 2 2
      route/view_w.py
  82. 1 1
      route/vote_add.py
  83. 1 1
      route/vote_close.py
  84. TEMPAT SAMPAH
      route_go/bin/main.amd64.bin
  85. TEMPAT SAMPAH
      route_go/bin/main.amd64.exe
  86. TEMPAT SAMPAH
      route_go/bin/main.arm64.bin
  87. TEMPAT SAMPAH
      route_go/bin/main.arm64.exe
  88. 2 0
      route_go/main.go
  89. 1 1
      route_go/route/api_bbs_w_comment.go
  90. 1 1
      route_go/route/api_edit_move_all.go
  91. 25 0
      route_go/route/api_func_auth_post.go
  92. 1 1
      route_go/route/api_user_rankup_patch.go
  93. 62 12
      route_go/route/tool/acl_and_auth.go
  94. 4 0
      route_go/route/tool/ip_parser.go
  95. 1 1
      version.json
  96. 8 0
      views/main_css/css/sub/dark.css
  97. 15 2
      views/main_css/js/func/render.js
  98. 0 8
      views/ringo/css/dark.css

+ 2 - 2
app.py

@@ -25,7 +25,7 @@ with open('version.json', encoding = 'utf8') as file_data:
 data_db_set = class_check_json()
 do_db_set(data_db_set)
 
-with get_db_connect() as conn:
+with get_db_connect(init_mode = True) as conn:
     curs = conn.cursor()
 
     setup_tool = ''
@@ -334,7 +334,7 @@ def do_every_day():
         # 칭호 관리
         curs.execute(db_change("select id from user_set where name = 'user_title' and data = '✅'"))
         for for_a in curs.fetchall():
-            if admin_check(conn, 'all', None, for_a[0]) != 1:
+            if admin_check('all', None, for_a[0]) != 1:
                 curs.execute(db_change("update user_set set data = '☑️' where name = 'user_title' and data = '✅' and id = ?"), [for_a[0]])
 
         threading.Timer(60 * 60 * 24, do_every_day).start()

+ 2 - 0
lang/en-US.json

@@ -145,6 +145,8 @@
     "ban" : "Block",
     "blocked" : "Blocked user",
     "release" : "Unblock",
+    "completely_ban" : "Completely block",
+    "dont_come_this_site" : "Site access block",
     
     "_comment_" : "Func",
     "wiki_restart" : "Restart wiki engine",

+ 3 - 1
lang/ko-KR.json

@@ -646,5 +646,7 @@
     "edit_bottom_compulsion_pass_authority": "편집 사유 필수 넘기기 권한",
     "404_page_setting": "404 페이지 설정",
     "404_page": "아래의 입력을 404 페이지로 사용",
-    "404_file": "루트 폴더 안의 404.html 사용"
+    "404_file": "루트 폴더 안의 404.html 사용",
+    "completely_ban": "완전 차단",
+    "dont_come_this_site": "사이트 접근 차단"
 }

+ 1 - 1
route/bbs_delete.py

@@ -13,7 +13,7 @@ def bbs_delete(bbs_num = ''):
         
         bbs_num_str = str(bbs_num)
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return redirect(conn, '/bbs/in/' + bbs_num_str)
         
         if flask.request.method == 'POST':

+ 1 - 1
route/bbs_make.py

@@ -4,7 +4,7 @@ def bbs_make():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
         
         if flask.request.method == 'POST':

+ 1 - 1
route/bbs_w.py

@@ -9,7 +9,7 @@ def bbs_w(bbs_num = '', tool = 'bbs', page = 1, name = ''):
         sub = ''
         bbs_name_dict = {}
 
-        admin_auth = admin_check(conn)
+        admin_auth = admin_check()
 
         if tool == 'bbs':
             curs.execute(db_change('select set_data from bbs_set where set_id = ? and set_name = "bbs_name"'), [bbs_num])

+ 1 - 1
route/bbs_w_comment_tool.py

@@ -15,7 +15,7 @@ def bbs_w_comment_tool(bbs_num = '', post_num = '', comment_num = ''):
             </ul>
         '''
 
-        if admin_check(conn) == 1:
+        if admin_check() == 1:
             data += '''
                 <h3>''' + get_lang(conn, 'owner') + '''</h2>
                 <ul>

+ 1 - 1
route/bbs_w_delete.py

@@ -16,7 +16,7 @@ def bbs_w_delete(bbs_num = '', post_num = '', comment_num = ''):
         bbs_num_str = str(bbs_num)
         post_num_str = str(post_num)
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return redirect(conn, '/bbs/in/' + bbs_num_str)
         
         temp_dict = json.loads(api_bbs_w_post(bbs_num_str + '-' + post_num_str).data)

+ 2 - 4
route/bbs_w_edit.py

@@ -21,14 +21,14 @@ def bbs_w_edit(bbs_num = '', post_num = '', comment_num = ''):
         if comment_num != '':
             temp_dict = json.loads(api_bbs_w_comment_one(bbs_num_str + '-' + post_num_str + '-' + comment_num).data)
             if 'comment_user_id' in temp_dict:
-                if not temp_dict['comment_user_id'] == ip and admin_check(conn) != 1:
+                if not temp_dict['comment_user_id'] == ip and admin_check() != 1:
                     return re_error(conn, '/ban')
             else:
                 return redirect(conn, '/bbs/main')
         elif post_num != '':
             temp_dict = json.loads(api_bbs_w_post(bbs_num_str + '-' + post_num_str).data)
             if 'user_id' in temp_dict:
-                if not temp_dict['user_id'] == ip and admin_check(conn) != 1:
+                if not temp_dict['user_id'] == ip and admin_check() != 1:
                     return re_error(conn, '/ban')
             else:
                 return redirect(conn, '/bbs/main')
@@ -41,8 +41,6 @@ def bbs_w_edit(bbs_num = '', post_num = '', comment_num = ''):
         if flask.request.method == 'POST':
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
         
             if post_num == '':
                 curs.execute(db_change('select set_code from bbs_data where set_name = "title" and set_id = ? order by set_code + 0 desc'), [bbs_num_str])

+ 1 - 1
route/bbs_w_hide.py

@@ -14,7 +14,7 @@ def bbs_w_hide(bbs_num = '', post_num = ''):
         bbs_num_str = str(bbs_num)
         post_num_str = str(post_num)
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return redirect(conn, '/bbs/in/' + bbs_num_str)
         
         if flask.request.method == 'POST':

+ 1 - 1
route/bbs_w_pinned.py

@@ -16,7 +16,7 @@ def bbs_w_pinned(bbs_num = '', post_num = ''):
         bbs_num_str = str(bbs_num)
         post_num_str = str(post_num)
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return redirect(conn, '/bbs/in/' + bbs_num_str)
         
         temp_dict = json.loads(api_bbs_w_post(bbs_num_str + '-' + post_num_str).data)

+ 0 - 4
route/bbs_w_post.py

@@ -88,8 +88,6 @@ def bbs_w_post(bbs_num = '', post_num = ''):
                 
                 if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                     return re_error(conn, '/error/13')
-                else:
-                    captcha_post(conn, '', 0)
 
                 set_id = bbs_num_str + '-' + post_num_str
 
@@ -175,8 +173,6 @@ def bbs_w_post(bbs_num = '', post_num = ''):
                 
                 if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                     return re_error(conn, '/error/13')
-                else:
-                    captcha_post(conn, '', 0)
                 
                 select = flask.request.form.get('comment_select', '0')
                 select = '' if select == '0' else select

+ 2 - 2
route/bbs_w_set.py

@@ -16,7 +16,7 @@ def bbs_w_set(bbs_num = ''):
         i_list = ['bbs_acl', 'bbs_edit_acl', 'bbs_comment_acl', 'bbs_view_acl', 'bbs_markup']
 
         if flask.request.method == 'POST':
-            if admin_check(conn, None, 'bbs_set (acl)') != 1:
+            if admin_check(None, 'bbs_set (acl)') != 1:
                 return re_error(conn, '/ban')
             else:
                 for for_a in range(len(i_list)):
@@ -31,7 +31,7 @@ def bbs_w_set(bbs_num = ''):
             d_list = ['' for _ in range(0, len(i_list))]
 
             other_menu = []
-            if admin_check(conn) != 1:
+            if admin_check() != 1:
                 disable = 'disabled'
             else:
                 disable = ''

+ 1 - 1
route/bbs_w_tool.py

@@ -16,7 +16,7 @@ def bbs_w_tool(bbs_num = '', post_num = ''):
             </ul>
         '''
 
-        if admin_check(conn) == 1:
+        if admin_check() == 1:
             curs.execute(db_change('select set_data from bbs_data where set_code = ? and set_id = ? and set_name = "pinned"'), [post_num_str, bbs_num_str])
             pinned = get_lang(conn, 'pinned') if not curs.fetchall() else get_lang(conn, 'pinned_release')
 

+ 0 - 2
route/edit.py

@@ -153,8 +153,6 @@ def edit(name = 'Test', section = 0, do_type = ''):
         if edit_repeat == 'post':
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
     
             if do_edit_slow_check(conn) == 1:
                 return re_error(conn, '/error/24')

+ 0 - 2
route/edit_delete.py

@@ -15,8 +15,6 @@ def edit_delete(name):
         if flask.request.method == 'POST':
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
 
             if do_edit_slow_check(conn) == 1:
                 return re_error(conn, '/error/24')

+ 2 - 2
route/edit_delete_file.py

@@ -7,7 +7,7 @@ def edit_delete_file(name = 'test.jpg'):
         curs = conn.cursor()
 
         ip = ip_check()
-        if admin_check(conn) == 0:
+        if admin_check() == 0:
             return re_error(conn, '/ban')
 
         mime_type = re.search(r'([^.]+)$', name)
@@ -25,7 +25,7 @@ def edit_delete_file(name = 'test.jpg'):
             return redirect(conn, '/w/' + url_pas(name))
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'file del (' + name + ')')
+            admin_check(None, 'file del (' + name + ')')
             os.remove(file_directory)
 
             if flask.request.form.get('with_doc', '') != '':

+ 1 - 1
route/edit_delete_multiple.py

@@ -4,7 +4,7 @@ from .edit_delete import edit_delete
 
 def edit_delete_multiple():
     with get_db_connect() as conn:
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
 
         if flask.request.method == 'POST':

+ 3 - 5
route/edit_move.py

@@ -17,8 +17,6 @@ def edit_move(name):
 
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
 
             if do_edit_slow_check(conn) == 1:
                 return re_error(conn, '/error/24')
@@ -46,7 +44,7 @@ def edit_move(name):
             # 문서 이동 파트 S
             curs.execute(db_change("select title from history where title = ?"), [move_title])
             if curs.fetchall():
-                if move_option == 'merge' and admin_check(conn, None, 'merge documents (' + name + ') (' + move_title + ')') == 1:
+                if move_option == 'merge' and admin_check(None, 'merge documents (' + name + ') (' + move_title + ')') == 1:
                     curs.execute(db_change("select data from data where title = ?"), [move_title])
                     data = curs.fetchall()
                     if data:
@@ -162,7 +160,7 @@ def edit_move(name):
             # 토론 이동 파트 S
             curs.execute(db_change("select title from rd where title = ?"), [move_title])
             if curs.fetchall():
-                if move_option_topic == 'merge' and admin_check(conn, None, 'merge document\'s topics (' + name + ') (' + move_title + ')') == 1:
+                if move_option_topic == 'merge' and admin_check(None, 'merge document\'s topics (' + name + ') (' + move_title + ')') == 1:
                     curs.execute(db_change("update rd set title = ? where title = ?"), [move_title, name])
                 elif move_option_topic == 'reverse':
                     i = 0
@@ -212,7 +210,7 @@ def edit_move(name):
             else:
                 return re_error(conn, '/error/19')
         else:
-            owner_auth = admin_check(conn)
+            owner_auth = admin_check()
 
             return easy_minify(conn, flask.render_template(skin_check(conn),
                 imp = [name, wiki_set(conn), wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'move') + ')', 0])],

+ 1 - 3
route/edit_revert.py

@@ -5,7 +5,7 @@ def edit_revert(name, num):
         curs = conn.cursor()
 
         curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, str(num)])
-        if curs.fetchall() and admin_check(conn, 6) != 1:
+        if curs.fetchall() and admin_check(6) != 1:
             return re_error(conn, '/error/3')
 
         if acl_check(name, 'document_edit') == 1:
@@ -19,8 +19,6 @@ def edit_revert(name, num):
         if flask.request.method == 'POST':
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
 
             if do_edit_slow_check(conn) == 1:
                 return re_error(conn, '/error/24')

+ 0 - 2
route/edit_upload.py

@@ -15,8 +15,6 @@ def edit_upload():
         if flask.request.method == 'POST':
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
 
             file_data = flask.request.files.getlist("f_data[]")
             file_len = len(file_data)

+ 1 - 1
route/filter_all.py

@@ -13,7 +13,7 @@ def filter_all(tool):
 
         div += '</tr>'
 
-        admin = admin_check(conn)
+        admin = admin_check()
 
         if tool == 'inter_wiki':
             title = get_lang(conn, 'interwiki_list')

+ 12 - 12
route/filter_all_add.py

@@ -8,7 +8,7 @@ def filter_all_add(tool, name = None):
             return redirect(conn, '/manager/9')
 
         if flask.request.method == 'POST':
-            if admin_check(conn) != 1:
+            if admin_check() != 1:
                 return re_error(conn, '/error/3')
 
             title = flask.request.form.get('title', 'test')
@@ -23,7 +23,7 @@ def filter_all_add(tool, name = None):
                     curs.execute(db_change("delete from html_filter where html = ? and kind = 'inter_wiki_sub'"), [title])
                     curs.execute(db_change('insert into html_filter (html, plus, plus_t, kind) values (?, "inter_wiki_type", ?, "inter_wiki_sub")'), [title, inter_type])
                 
-                admin_check(conn, None, tool + ' edit')
+                admin_check(None, tool + ' edit')
             elif tool == 'edit_filter':
                 day = flask.request.form.get('day', '0')
                 end = 'X' if day == '0' else day
@@ -39,7 +39,7 @@ def filter_all_add(tool, name = None):
                 
                 curs.execute(db_change("delete from html_filter where html = ? and kind = 'regex_filter'"), [name])
                 curs.execute(db_change("insert into html_filter (html, plus, plus_t, kind) values (?, ?, ?, 'regex_filter')"), [name, content, end])
-                admin_check(conn, None, 'edit_filter edit')
+                admin_check(None, 'edit_filter edit')
             elif tool == 'document':
                 post_name = flask.request.form.get('name', '')
                 if post_name == '':
@@ -53,7 +53,7 @@ def filter_all_add(tool, name = None):
                     return re_error(conn, '/error/23')
                 
                 curs.execute(db_change('insert into html_filter (html, kind, plus, plus_t) values (?, "document", ?, ?)'), [post_name, post_regex, post_acl])
-                admin_check(conn, None, 'document_filter edit')
+                admin_check(None, 'document_filter edit')
             else:
                 plus_d = ''
                 if tool == 'name_filter':
@@ -62,7 +62,7 @@ def filter_all_add(tool, name = None):
                     except:
                         return re_error(conn, '/error/23')
 
-                    admin_check(conn, None, 'name_filter edit')
+                    admin_check(None, 'name_filter edit')
                     type_d = 'name'
                 elif tool == 'file_filter':
                     try:
@@ -70,26 +70,26 @@ def filter_all_add(tool, name = None):
                     except:
                         return re_error(conn, '/error/23')
 
-                    admin_check(conn, None, 'file_filter edit')
+                    admin_check(None, 'file_filter edit')
                     type_d = 'file'
                 elif tool == 'email_filter':
-                    admin_check(conn, None, 'email_filter edit')
+                    admin_check(None, 'email_filter edit')
                     type_d = 'email'
                 elif tool == 'image_license':
-                    admin_check(conn, None, 'image_license edit')
+                    admin_check(None, 'image_license edit')
                     type_d = 'image_license'
                 elif tool == 'extension_filter':
-                    admin_check(conn, None, 'extension_filter edit')
+                    admin_check(None, 'extension_filter edit')
                     type_d = 'extension'
                     plus_d = flask.request.form.get('max_file_size', '')
                     if plus_d != '':
                         plus_d = number_check(plus_d)
                 elif tool == 'template':
-                    admin_check(conn, None, 'template_document edit')
+                    admin_check(None, 'template_document edit')
                     type_d = 'template'
                     plus_d = flask.request.form.get('exp', 'test')
                 else:
-                    admin_check(conn, None, 'edit_top edit')
+                    admin_check(None, 'edit_top edit')
                     type_d = 'edit_top'
                     plus_d = flask.request.form.get('markup', 'test')
 
@@ -101,7 +101,7 @@ def filter_all_add(tool, name = None):
             return redirect(conn, '/filter/' + tool)
         else:
             get_sub = 0
-            stat = 'disabled' if admin_check(conn) != 1 else ''
+            stat = 'disabled' if admin_check() != 1 else ''
             name = name if name else ''
 
             if tool in ('inter_wiki', 'outer_link'):

+ 1 - 1
route/filter_all_delete.py

@@ -4,7 +4,7 @@ def filter_all_delete(tool, name = 'Test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
         
-        if admin_check(conn, None, 'del_' + tool) != 1:
+        if admin_check(None, 'del_' + tool) != 1:
             return re_error(conn, '/error/3')
 
         if tool == 'inter_wiki':

+ 6 - 2
route/give_admin_groups.py

@@ -6,6 +6,7 @@ def give_admin_groups(name = 'test'):
 
         acl_name_list = [
             [1, 'owner', get_lang(conn, 'owner_authority')],
+            [2, 'all_function', get_lang(conn, 'all_function_authority')],
             [2, 'admin', get_lang(conn, 'admin_authority')],
             [3, 'ban', get_lang(conn, 'ban_authority')],
             [4, '', get_lang(conn, 'admin_default_feature_authority'), True],
@@ -19,7 +20,10 @@ def give_admin_groups(name = 'test'):
             [4, '', get_lang(conn, 'admin_default_feature_authority'), True],
             [3, 'give', get_lang(conn, 'authorization_authority')],
             [4, '', get_lang(conn, 'admin_default_feature_authority'), True],
+            [3, 'bbs', get_lang(conn, 'bbs_authority')],
+            [4, '', get_lang(conn, 'admin_default_feature_authority'), True],
             [3, 'admin_default_feature', get_lang(conn, 'admin_default_feature_authority')],
+            [4, 'treat_as_admin', get_lang(conn, 'treat_as_admin_authority')],
             [4, 'user_name_bold', get_lang(conn, 'user_name_bold_authority')],
             [4, 'multiple_upload', get_lang(conn, 'multiple_upload_authority')],
             [4, 'slow_edit_pass', get_lang(conn, 'slow_edit_pass_authority')],
@@ -42,7 +46,7 @@ def give_admin_groups(name = 'test'):
         ]
 
         if flask.request.method == 'POST':
-            if admin_check(conn, None, 'auth list add (' + name + ')') != 1:
+            if admin_check(None, 'auth list add (' + name + ')') != 1:
                 return re_error(conn, '/error/3')
             elif name in get_default_admin_group():
                 return re_error(conn, '/error/3')
@@ -54,7 +58,7 @@ def give_admin_groups(name = 'test'):
 
             return redirect(conn, '/auth/list/add/' + url_pas(name))
         else:
-            state = 'disabled' if admin_check(conn) != 1 else ''
+            state = 'disabled' if admin_check() != 1 else ''
             state = 'disabled' if name in get_default_admin_group() else ''
 
             data = '<ul>'

+ 3 - 3
route/give_auth.py

@@ -5,8 +5,8 @@ def give_auth(name):
         curs = conn.cursor()
 
         ip = ip_check()
-        owner_auth = admin_check(conn)
-        admin_auth = admin_check(conn, 7)
+        owner_auth = admin_check()
+        admin_auth = admin_check(7)
 
         curs.execute(db_change("select data from user_set where id = ? and name = 'acl'"), [name])
         user_acl = curs.fetchall()
@@ -24,7 +24,7 @@ def give_auth(name):
                 return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            if admin_check(conn, 7, 'admin (' + name + ')') != 1:
+            if admin_check(7, 'admin (' + name + ')') != 1:
                 return re_error(conn, '/error/3')
 
             select_data = flask.request.form.get('select', 'X')

+ 2 - 2
route/give_delete_admin_group.py

@@ -4,11 +4,11 @@ def give_delete_admin_group_2(name = 'test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'auth list delete (' + 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])

+ 15 - 6
route/give_user_ban.py

@@ -7,10 +7,10 @@ def give_user_ban(name = None, ban_type = ''):
         ip = ip_check()
         
         if ban_check(ip = ip, tool = 'login')[0] == 1:
-            if ip_or_user(ip) == 1 or admin_check(conn, 'all', None, ip) == 0:
+            if ip_or_user(ip) == 1 or admin_check('all', None, ip) == 0:
                 return re_error(conn, '/ban')
         else:
-            if admin_check(conn, 1, None, ip) != 1:
+            if admin_check(1, None, ip) != 1:
                 return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
@@ -39,6 +39,10 @@ def give_user_ban(name = None, ban_type = ''):
                 login = 'O'
             elif ban_option == 'edit_request_able':
                 login = 'E'
+            elif ban_option == 'completely_ban':
+                login = 'A'
+            elif ban_option == 'dont_come_this_site':
+                login = 'D'
             elif ban_option == 'release':
                 release = '1'
 
@@ -64,19 +68,22 @@ def give_user_ban(name = None, ban_type = ''):
                     try:
                         ipaddress.IPv4Network(name, False)
                     except:
-                        return re_error(conn, '/error/45')
+                        try:
+                            ipaddress.IPv6Network(name, False)
+                        except:
+                            return re_error(conn, '/error/45')
                 else:
                     type_d = None
 
                 if type_d:
-                    if admin_check(conn, None, 'ban ' + type_d + ' (' + name + ')') != 1:
+                    if admin_check(None, 'ban ' + type_d + ' (' + name + ')') != 1:
                         return re_error(conn, '/error/3')
                 else:
                     if name == ip:
-                        if admin_check(conn, 'all', 'ban (' + name + ')') != 1:
+                        if admin_check('all', 'ban (' + name + ')') != 1:
                             return re_error(conn, '/error/3')
                     else:
-                        if admin_check(conn, 1, 'ban (' + name + ')') != 1:
+                        if admin_check(1, 'ban (' + name + ')') != 1:
                             return re_error(conn, '/error/3')
 
                 ban_insert(conn, 
@@ -134,6 +141,8 @@ def give_user_ban(name = None, ban_type = ''):
                             <option value="">''' + get_lang(conn, 'default') + '''</option>
                             <option value="login_able">''' + get_lang(conn, 'login_able') + '''</option>
                             <option value="edit_request_able">''' + get_lang(conn, 'edit_request_able') + '''</option>
+                            <option value="completely_ban">''' + get_lang(conn, 'completely_ban') + '''</option>
+                            <option value="dont_come_this_site">''' + get_lang(conn, 'dont_come_this_site') + '''</option>
                             <option value="release">''' + get_lang(conn, 'release') + '''</option>
                         </select>
         

+ 2 - 2
route/give_user_fix.py

@@ -8,13 +8,13 @@ def give_user_fix(user_name = ''):
         if not curs.fetchall():
             return re_error(conn, '/error/2')
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
             select = flask.request.form.get('select', '')
 
-            admin_check(conn, None, 'user_fix (' + user_name + ') (' + select + ')')
+            admin_check(None, 'user_fix (' + user_name + ') (' + select + ')')
             if select == 'password_change':
                 password = flask.request.form.get('new_password', '')
                 check_password = flask.request.form.get('password_check', '')

+ 1 - 1
route/list_admin_auth_use.py

@@ -26,7 +26,7 @@ def list_admin_auth_use(arg_num = 1, arg_search = 'normal'):
                     curs.execute(db_change("select data from other where name = 'ip_view'"))
                     db_data = curs.fetchall()
                     ip_view = db_data[0][0] if db_data else ''
-                    ip_view = '' if admin_check(conn, 1) == 1 else ip_view
+                    ip_view = '' if admin_check(1) == 1 else ip_view
                     
                     if ip_view != '':
                         do_data = do_data.split(' ')

+ 1 - 1
route/list_admin_group.py

@@ -9,7 +9,7 @@ def list_admin_group_2():
 
         curs.execute(db_change("select distinct name from alist order by name asc"))
         for data in curs.fetchall():
-            if admin_check(conn) == 1 and not data[0] in org_acl_list:
+            if admin_check() == 1 and not data[0] in org_acl_list:
                 delete_admin_group = ' <a href="/auth/list/delete/' + url_pas(data[0]) + '">(' + get_lang(conn, "delete") + ')</a>'
             else:
                 delete_admin_group = ''

+ 3 - 3
route/list_user_check.py

@@ -12,13 +12,13 @@ def list_user_check(name = 'test', plus_name = None, arg_num = 1, do_type = 'nor
         num = arg_num
         sql_num = (num * 50 - 50) if num * 50 > 0 else 0
 
-        if admin_check(conn, 'all', None, name) == 1 or (plus_id and admin_check(conn, 'all', None, plus_id) == 1):
-            if admin_check(conn) != 1:
+        if admin_check('all', None, name) == 1 or (plus_id and admin_check('all', None, plus_id) == 1):
+            if admin_check() != 1:
                 return re_error(conn, '/error/4')
 
         div = ''
 
-        if admin_check(conn, 4, (check_type + ' ' if check_type != '' else '') + 'check (' + name + ')') != 1:
+        if admin_check(4, (check_type + ' ' if check_type != '' else '') + 'check (' + name + ')') != 1:
             return re_error(conn, '/error/3')
 
         if check_type == '':

+ 1 - 1
route/list_user_check_delete.py

@@ -4,7 +4,7 @@ def list_user_check_delete(name = None, ip = None, time = None, do_type = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/4')
 
         user_id = name

+ 0 - 2
route/login_find_key.py

@@ -6,8 +6,6 @@ def login_find_key():
         if flask.request.method == 'POST':
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
             
             input_key = flask.request.form.get('key', '')
             curs.execute(db_change('select id from user_set where name = "random_key" and data = ?'), [input_key])

+ 3 - 19
route/login_login.py

@@ -12,13 +12,8 @@ def login_login_2():
             return re_error(conn, '/ban')
 
         if flask.request.method == 'POST':
-            if 'login_count' in flask.session:
-                count = int(number_check(flask.session['login_count']))
-                if count > 3:
-                    if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
-                        return re_error(conn, '/error/13')
-                    else:
-                        captcha_post(conn, '', 0)
+            if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
+                return re_error(conn, '/error/13')
 
             user_agent = flask.request.headers.get('User-Agent', '')
             user_id = flask.request.form.get('id', '')
@@ -39,11 +34,6 @@ def login_login_2():
                 db_user_encode = db_data[0][0]
 
             if pw_check(conn, user_pw, db_user_pw, db_user_encode, user_id) != 1:
-                if not 'login_count' in flask.session:
-                    flask.session['login_count'] = 1
-                else:
-                    flask.session['login_count'] = int(number_check(flask.session['login_count'])) + 1
-
                 return re_error(conn, '/error/10')
 
             curs.execute(db_change('select data from user_set where name = "2fa" and id = ?'), [user_id])
@@ -59,12 +49,6 @@ def login_login_2():
 
                 return redirect(conn, '/user')
         else:
-            captcha_data = ''
-            if 'login_count' in flask.session:
-                count = int(number_check(flask.session['login_count']))
-                if count > 3:
-                    captcha_data = captcha_get(conn)
-
             return easy_minify(conn, flask.render_template(skin_check(conn),
                 imp = [get_lang(conn, 'login'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
                 data =  '''
@@ -75,7 +59,7 @@ def login_login_2():
                             <hr class="main_hr">
                             <!-- <input type="checkbox" name="auto_login"> ''' + get_lang(conn, 'auto_login') + ''' (''' + get_lang(conn, 'not_working') + ''')
                             <hr class="main_hr"> -->
-                            ''' + captcha_data + '''
+                            ''' + captcha_get(conn) + '''
                             <button type="submit">''' + get_lang(conn, 'login') + '''</button>
                             ''' + http_warning(conn) + '''
                         </form>

+ 0 - 2
route/login_login_2fa.py

@@ -20,8 +20,6 @@ def login_login_2fa_2():
         if flask.request.method == 'POST':
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
 
             user_agent = flask.request.headers.get('User-Agent', '')
             user_id = flask.session['login_id']

+ 0 - 2
route/login_login_2fa_email.py

@@ -20,8 +20,6 @@ def login_login_2fa_email_2():
         if flask.request.method == 'POST':
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
 
             user_agent = flask.request.headers.get('User-Agent', '')
             user_id = flask.session['b_id']

+ 1 - 3
route/login_register.py

@@ -8,7 +8,7 @@ def login_register_2():
             return re_error(conn, '/ban')
 
         ip = ip_check()
-        admin = admin_check(conn)
+        admin = admin_check()
         if admin != 1 and ip_or_user(ip) == 0:
             return redirect(conn, '/user')
 
@@ -22,8 +22,6 @@ def login_register_2():
             # 리캡차
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
 
             user_id = flask.request.form.get('id', '')
             user_pw = flask.request.form.get('pw', '')

+ 2 - 2
route/main_setting_acl.py

@@ -26,7 +26,7 @@ def main_setting_acl():
         }
 
         if flask.request.method == 'POST':
-            if admin_check(conn, None, 'edit_set (acl)') != 1:
+            if admin_check(None, 'edit_set (acl)') != 1:
                 return re_error(conn, '/ban')
             else:
                 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])
@@ -34,7 +34,7 @@ def main_setting_acl():
                 return redirect(conn, '/setting/acl')
         else:
             d_list = {}
-            disable = 'disabled' if admin_check(conn) != 1 else ''
+            disable = 'disabled' if admin_check() != 1 else ''
             acl_div = ['' for _ in range(0, len(i_list))]
 
             for for_a in i_list:

+ 2 - 2
route/main_setting_external.py

@@ -4,7 +4,7 @@ def main_setting_external():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
         
         i_list = [
@@ -26,7 +26,7 @@ def main_setting_external():
 
                 curs.execute(db_change("update other set data = ? where name = ?"), [into_data, data])
 
-            admin_check(conn, None, 'edit_set (external)')
+            admin_check(None, 'edit_set (external)')
 
             return redirect(conn, '/setting/external')
         else:

+ 2 - 2
route/main_setting_head.py

@@ -4,7 +4,7 @@ def main_setting_head(num, skin_name = '', set_preview = 0):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
         
         if flask.request.method == 'POST' and set_preview == 0:
@@ -30,7 +30,7 @@ def main_setting_head(num, skin_name = '', set_preview = 0):
             else:
                 curs.execute(db_change("insert into other (name, data, coverage) values (?, ?, ?)"), [info_d, flask.request.form.get('content', ''), coverage])
 
-            admin_check(conn, None, 'edit_set (' + info_d + ')')
+            admin_check(None, 'edit_set (' + info_d + ')')
 
             if skin_name == '':
                 return redirect(conn, '/setting/' + end_r)

+ 2 - 2
route/main_setting_main.py

@@ -4,7 +4,7 @@ def main_setting_main():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
         
         setting_list = {
@@ -55,7 +55,7 @@ def main_setting_main():
                     setting_list[i][0]
                 ])
 
-            admin_check(conn, None, 'edit_set (main)')
+            admin_check(None, 'edit_set (main)')
 
             return redirect(conn, '/setting/main')
         else:

+ 2 - 2
route/main_setting_main_logo.py

@@ -4,7 +4,7 @@ def main_setting_main_logo():
     with get_db_connect() as conn:
         curs = conn.cursor()
         
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
 
         skin_list = [0] + load_skin(conn, '', 1)
@@ -20,7 +20,7 @@ def main_setting_main_logo():
                     i[1]
                 ])
 
-            admin_check(conn, None, 'edit_set (logo)')
+            admin_check(None, 'edit_set (logo)')
 
             return redirect(conn, '/setting/main/logo')
         else:

+ 2 - 2
route/main_setting_phrase.py

@@ -4,7 +4,7 @@ def main_setting_phrase():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
         
         i_list = [
@@ -42,7 +42,7 @@ def main_setting_phrase():
         if flask.request.method == 'POST':
             curs.executemany(db_change("update other set data = ? where name = ?"), [[flask.request.form.get(for_a, ''), for_a] for for_a in i_list])
 
-            admin_check(conn, None, 'edit_set (phrase)')
+            admin_check(None, 'edit_set (phrase)')
 
             return redirect(conn, '/setting/phrase')
         else:

+ 2 - 2
route/main_setting_robot.py

@@ -4,7 +4,7 @@ def main_setting_robot():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
 
         curs.execute(db_change("select data from other where name = 'robot'"))
@@ -32,7 +32,7 @@ def main_setting_robot():
             else:
                 curs.execute(db_change("insert into other (name, data, coverage) values ('robot_default', ?, '')"), [flask.request.form.get('default', '')])
 
-            admin_check(conn, None, 'edit_set (robot)')
+            admin_check(None, 'edit_set (robot)')
 
             return redirect(conn, '/setting/robot')
         else:

+ 2 - 2
route/main_setting_sitemap.py

@@ -5,12 +5,12 @@ def main_setting_sitemap(do_type = 0):
         curs = conn.cursor()
 
         if not do_type == 1:
-            if admin_check(conn) != 1:
+            if admin_check() != 1:
                 return re_error(conn, '/ban')
         
         if do_type == 1 or flask.request.method == 'POST':
             if not do_type == 1:
-                admin_check(conn, None, 'make sitemap')
+                admin_check(None, 'make sitemap')
 
             data = '' + \
                 '<?xml version="1.0" encoding="UTF-8"?>\n' + \

+ 2 - 2
route/main_setting_sitemap_set.py

@@ -4,7 +4,7 @@ def main_setting_sitemap_set():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
         
         setting_list = {
@@ -22,7 +22,7 @@ def main_setting_sitemap_set():
                     setting_list[i][0]
                 ])
 
-            admin_check(conn, None, 'edit_set (sitemap)')
+            admin_check(None, 'edit_set (sitemap)')
 
             return redirect(conn, '/setting/sitemap_set')
         else:

+ 2 - 2
route/main_setting_skin_set.py

@@ -6,7 +6,7 @@ def main_setting_skin_set():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
             
         set_list = user_setting_skin_set_main_set_list(conn)
@@ -19,7 +19,7 @@ def main_setting_skin_set():
                 else:
                     curs.execute(db_change('insert into other (name, data, coverage) values (?, ?, "")'), [for_b, flask.request.form.get(for_b, set_list[for_b][0][0])])
 
-            admin_check(conn, None, 'edit_set (skin_set)')
+            admin_check(None, 'edit_set (skin_set)')
 
             return redirect(conn, '/setting/skin_set')
         else:

+ 2 - 2
route/main_setting_top_menu.py

@@ -4,7 +4,7 @@ def main_setting_top_menu():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
         
         if flask.request.method == 'POST':
@@ -14,7 +14,7 @@ def main_setting_top_menu():
             else:
                 curs.execute(db_change("insert into other (name, data, coverage) values ('top_menu', ?, '')"), [flask.request.form.get('content', '')])
 
-            admin_check(conn, None, 'edit_set (top_menu)')
+            admin_check(None, 'edit_set (top_menu)')
 
             return redirect(conn, '/setting/top_menu')
         else:

+ 2 - 2
route/main_sys_restart.py

@@ -2,11 +2,11 @@ from .tool.func import *
 
 def main_sys_restart():
     with get_db_connect() as conn:
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'restart')
+            admin_check(None, 'restart')
 
             print('Restart')
 

+ 2 - 2
route/main_sys_shutdown.py

@@ -2,11 +2,11 @@ from .tool.func import *
 
 def main_sys_shutdown():
     with get_db_connect() as conn:
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'shutdown')
+            admin_check(None, 'shutdown')
 
             print('Shutdown')
 

+ 2 - 2
route/main_sys_update.py

@@ -7,11 +7,11 @@ def main_sys_update():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'update')
+            admin_check(None, 'update')
 
             curs.execute(db_change('select data from other where name = "update"'))
             up_data = curs.fetchall()

+ 1 - 1
route/n_bbs_main.py

@@ -9,5 +9,5 @@ def bbs_main():
                 '<script defer src="/views/main_css/js/route/bbs_main.js' + cache_v() + '"></script>' + \
                 '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_bbs_main(); });</script>' + \
             '',
-            menu = [['other', get_lang(conn, 'other_tool')]] + ([['bbs/make', get_lang(conn, 'add')], ['bbs/set', get_lang(conn, 'bbs_set')]] if admin_check(conn) == 1 else [])
+            menu = [['other', get_lang(conn, 'other_tool')]] + ([['bbs/make', get_lang(conn, 'add')], ['bbs/set', get_lang(conn, 'bbs_set')]] if admin_check() == 1 else [])
         ))

+ 1 - 1
route/recent_app_submit.py

@@ -92,7 +92,7 @@ def recent_app_submit_2():
                 menu = [['other', get_lang(conn, 'return')]]
             ))
         else:
-            if admin_check(conn, None, 'app submit') != 1:
+            if admin_check(None, 'app submit') != 1:
                 return re_error(conn, '/ban')
 
             if flask.request.form.get('approve', '') != '':

+ 2 - 2
route/recent_change.py

@@ -28,8 +28,8 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
         curs = conn.cursor()
 
         ip = ip_check()
-        all_admin = admin_check(conn, 'all', None, ip)
-        owner = admin_check(conn, None, None, ip)
+        all_admin = admin_check('all', None, ip)
+        owner = admin_check(None, None, ip)
 
         option_list = [
             ['normal', get_lang(conn, 'normal')],

+ 2 - 2
route/recent_history_add.py

@@ -7,11 +7,11 @@ def recent_history_add(name = 'Test', do_type = ''):
         curs = conn.cursor()
 
         ip = ip_check()
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/ban')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'history_add (' + name + ')')
+            admin_check(None, 'history_add (' + name + ')')
 
             today = get_time()
             content = flask.request.form.get('content', '')

+ 2 - 2
route/recent_history_delete.py

@@ -6,11 +6,11 @@ def recent_history_delete(name = 'Test', rev = 1):
 
         num = str(rev)
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'history delete ' + name + ' r' + num)
+            admin_check(None, 'history delete ' + name + ' r' + num)
 
             curs.execute(db_change("delete from history where id = ? and title = ?"), [num, name])
 

+ 1 - 1
route/recent_history_hidden.py

@@ -6,7 +6,7 @@ def recent_history_hidden(name = 'Test', rev = 1):
 
         num = str(rev)
 
-        if admin_check(conn, 6, 'history_hidden (' + name + '#' + num + ')') == 1:
+        if admin_check(6, 'history_hidden (' + name + '#' + num + ')') == 1:
             curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, num])
             if curs.fetchall():
                 curs.execute(db_change("update history set hide = '' where title = ? and id = ?"), [name, num])

+ 2 - 2
route/recent_history_reset.py

@@ -4,11 +4,11 @@ def recent_history_reset(name = 'Test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'history reset ' + name)
+            admin_check(None, 'history reset ' + name)
 
             curs.execute(db_change("delete from history where title = ?"), [name])
 

+ 2 - 2
route/recent_history_send.py

@@ -6,11 +6,11 @@ def recent_history_send(name = 'Test', rev = 1):
 
         num = str(rev)
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'send edit ' + name + ' r' + num)
+            admin_check(None, 'send edit ' + name + ' r' + num)
 
             curs.execute(db_change("select send from history where title = ? and id = ?"), [name, num])
             if curs.fetchall():

+ 2 - 2
route/recent_history_tool.py

@@ -22,7 +22,7 @@ def recent_history_tool(name = 'Test', rev = 1):
         data += '<li><a href="/history/' + url_pas(name) + '">' + get_lang(conn, 'history') + '</a></li>'
         data += '</ul>'
 
-        if admin_check(conn, 6) == 1:
+        if admin_check(6) == 1:
             data += '<h3>' + get_lang(conn, 'admin') + '</h3>'
             data += '<ul>'
             curs.execute(db_change('select title from history where title = ? and id = ? and hide = "O"'), [name, num])
@@ -35,7 +35,7 @@ def recent_history_tool(name = 'Test', rev = 1):
             data += '</a></li>'
             data += '</ul>'
 
-        if admin_check(conn) == 1:
+        if admin_check() == 1:
             data += '<h3>' + get_lang(conn, 'owner') + '</h3>'
             data += '<ul>'
             data += '<li><a href="/history_delete/' + num + '/' + url_pas(name) + '">' + get_lang(conn, 'history_delete') + '</a></li>'

+ 2 - 2
route/recent_record_reset.py

@@ -4,11 +4,11 @@ def recent_record_reset(name = 'Test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn) != 1:
+        if admin_check() != 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'record reset ' + name)
+            admin_check(None, 'record reset ' + name)
 
             curs.execute(db_change("delete from history where ip = ?"), [name])
 

+ 76 - 87
route/tool/func.py

@@ -137,19 +137,18 @@ def python_to_golang_sync(func_name, other_set = {}):
     )
     stdout, stderr = process.communicate()
     
-    while 1:
-        try:
-            data = stdout.decode('utf8')
-            err = stderr.decode('utf8')
-            if err != '':
-                if 'database is locked' in err:
-                    raise
-                else:
-                    print(err)
+    data = ''
+    while data == '':
+        data = stdout.decode('utf8')
+        err = stderr.decode('utf8')
+        if err != '':
+            if 'database is locked' in err:
+                pass
+            else:
+                print(err)
+                break
 
-            break
-        except:
-            time.sleep(0.01)
+        time.sleep(0.01)
 
     return data
 
@@ -178,19 +177,18 @@ async def python_to_golang(func_name, other_set = {}):
     )
     stdout, stderr = await process.communicate()
 
-    while 1:
-        try:
-            data = stdout.decode('utf8')
-            err = stderr.decode('utf8')
-            if err != '':
-                if 'database is locked' in err:
-                    raise
-                else:
-                    print(err)
+    data = ''
+    while data == '':
+        data = stdout.decode('utf8')
+        err = stderr.decode('utf8')
+        if err != '':
+            if 'database is locked' in err:
+                pass
+            else:
+                print(err)
+                break
 
-            break
-        except:
-            await asyncio.sleep(0.01)
+        await asyncio.sleep(0.01)
 
     return data
 
@@ -229,11 +227,12 @@ def get_init_set_list(need = 'all'):
         return init_set_list[need]
     
 class get_db_connect:
-    def __init__(self, db_type = ''):
+    def __init__(self, db_type = '', init_mode = False):
         with class_temp_db() as m_conn:
             m_curs = m_conn.cursor()
 
             self.db_set = {}
+            self.init_mode = init_mode
 
             m_curs.execute('select name, data from temp where name in ("db_type", "db_name")')
             db_data = m_curs.fetchall()
@@ -257,19 +256,25 @@ class get_db_connect:
                 isolation_level = None
             )
         else:
-            self.conn = pymysql.connect(
-                host = self.db_set['db_mysql_host'],
-                user = self.db_set['db_mysql_user'],
-                password = self.db_set['db_mysql_pw'],
-                charset = 'utf8mb4',
-                port = int(self.db_set['db_mysql_port']),
-                autocommit = True
-            )
-
-            try:
-                self.conn.select_db(self.db_set['db_name'])
-            except:
-                pass
+            if self.init_mode:
+                self.conn = pymysql.connect(
+                    host = self.db_set['db_mysql_host'],
+                    user = self.db_set['db_mysql_user'],
+                    password = self.db_set['db_mysql_pw'],
+                    charset = 'utf8mb4',
+                    port = int(self.db_set['db_mysql_port']),
+                    autocommit = True
+                )
+            else:
+                self.conn = pymysql.connect(
+                    host = self.db_set['db_mysql_host'],
+                    user = self.db_set['db_mysql_user'],
+                    password = self.db_set['db_mysql_pw'],
+                    charset = 'utf8mb4',
+                    port = int(self.db_set['db_mysql_port']),
+                    autocommit = True,
+                    db = self.db_set['db_name']
+                )
 
         return self.conn
     
@@ -990,7 +995,7 @@ def get_user_title_list(conn, ip = ''):
     if curs.fetchall():
         user_title['☑️'] = '☑️ before_admin'
 
-    if admin_check(conn, 'all') == 1:
+    if admin_check('all') == 1:
         user_title['✅'] = '✅ admin'
     
     return user_title
@@ -1209,7 +1214,7 @@ def skin_check(conn, set_n = 0):
         return skin
     
 def cache_v():
-    return '.cache_v267'
+    return '.cache_v269'
 
 def wiki_css(data):
     with class_temp_db() as m_conn:
@@ -1228,7 +1233,7 @@ def wiki_css(data):
         if db_data:
             data_css = db_data[0][0]
         else:
-            data_css += '<meta http-equiv="Cache-Control" content="max-age=3600">'
+            data_css += '<meta http-equiv="Cache-Control" content="max-age=31536000">'
 
             # External JS
             data_css += '<script defer src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/katex.min.js" integrity="sha512-LQNxIMR5rXv7o+b1l8+N1EZMfhG7iFZ9HhnbJkTp4zjNr5Wvst75AqUeFDxeRUa7l5vEDyUiAip//r+EFLLCyA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>'
@@ -1391,7 +1396,7 @@ def wiki_custom(conn):
         email = curs.fetchall()
         email = email[0][0] if email else ''
 
-        if admin_check(conn, 'all') == 1:
+        if admin_check('all') == 1:
             user_admin = '1'
 
             curs.execute(db_change("select data from user_set where id = ? and name = 'acl'"), [ip])
@@ -1777,12 +1782,10 @@ def captcha_get(conn):
 
     return data
 
-def captcha_post(conn, re_data, num = 1):
+def captcha_post(conn, re_data):
     curs = conn.cursor()
 
-    if num != 1:
-        pass
-    elif acl_check('', 'recaptcha_five_pass') == 0 and 'recapcha_pass' in flask.session and flask.session['recapcha_pass'] > 0:
+    if acl_check('', 'recaptcha_five_pass') == 0 and 'recapcha_pass' in flask.session and flask.session['recapcha_pass'] > 0:
         pass
     elif acl_check('', 'recaptcha') == 1:
         curs.execute(db_change('select data from other where name = "sec_re"'))
@@ -1822,14 +1825,13 @@ def captcha_post(conn, 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
+    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
 
@@ -1941,45 +1943,32 @@ def level_check(conn, ip = ''):
 
     return [level, exp, max_exp]
 
-def admin_check(conn, num = None, what = None, name = ''):
-    curs = conn.cursor()
-
+def admin_check(num = None, what = None, name = ''):
     ip = ip_check() if name == '' else name
-    time_data = get_time()
     pass_ok = 0
 
-    if ip_or_user(ip) == 0:
-        curs.execute(db_change("select data from user_set where id = ? and name = 'acl'"), [ip])
-        user_auth = curs.fetchall()
-        if user_auth:
-            user_auth = user_auth[0][0]
-            check = get_admin_auth_list(num)
-            
-            curs.execute(db_change('select name from alist where name = ? and acl = "owner"'), [user_auth])
-            if curs.fetchall():
-                pass_ok = 1
-            elif num == 'all':                    
-                curs.execute(db_change('select acl from alist where name = ?'), [user_auth])
-                db_data = curs.fetchall()
-                if db_data and db_data[0][0] in check:
-                    pass_ok = 1
-            else:
-                curs.execute(db_change('select name from alist where name = ? and acl = ?'), [user_auth, check])
-                if curs.fetchall():
-                    pass_ok = 1
-
-            if pass_ok == 1:
-                if what:
-                    curs.execute(db_change('select data from other where name = "auth_history_off"'))
-                    db_data = curs.fetchall()
-                    if db_data and db_data[0][0] != '':
-                        pass
-                    else:
-                        curs.execute(db_change("insert into re_admin (who, what, time) values (?, ?, ?)"), [ip, what, time_data])
+    other_set = {}
+    other_set['ip'] = ip
 
-                return 1
+    data_str = python_to_golang_sync('api_func_auth_list', other_set)
+    data = json.loads(data_str)
 
-    return 0
+    if num == 'all':
+        if "treat_as_admin" in data:
+            pass_ok = 1
+    else:
+        auth_name = get_admin_auth_list(num)
+        if auth_name in data:
+            pass_ok = 1
+
+    if pass_ok == 1:
+        if what:
+            other_set['what'] = what
+            python_to_golang_sync('api_func_auth_post', other_set)
+
+        return 1
+    else:
+        return 0
 
 def acl_check(name = '', tool = '', topic_num = ''):
     name = '' if name == None else name
@@ -2118,7 +2107,7 @@ def do_edit_filter(conn, data):
     curs = conn.cursor()
 
     ip = ip_check()
-    if admin_check(conn, 1) != 1:
+    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)

+ 0 - 2
route/topic.py

@@ -64,8 +64,6 @@ def topic(topic_num = 0, do_type = '', doc_name = 'Test'):
 
             if captcha_post(conn, flask.request.form.get('g-recaptcha-response', flask.request.form.get('g-recaptcha', ''))) == 1:
                 return re_error(conn, '/error/13')
-            else:
-                captcha_post(conn, '', 0)
 
             today = get_time()
 

+ 1 - 1
route/topic_comment_blind.py

@@ -7,7 +7,7 @@ def topic_comment_blind(topic_num = 1, num = 1):
         topic_num = str(topic_num)
         num = str(num)
         
-        if admin_check(conn, 3, 'blind (code ' + topic_num + '#' + num + ')') != 1:
+        if admin_check(3, 'blind (code ' + topic_num + '#' + num + ')') != 1:
             return re_error(conn, '/error/3')
 
         curs.execute(db_change("select block from topic where code = ? and id = ?"), [topic_num, num])

+ 1 - 1
route/topic_comment_delete.py

@@ -4,7 +4,7 @@ def topic_comment_delete(topic_num = 1, num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn, None) != 1:
+        if admin_check(None) != 1:
             return re_error(conn, '/error/3')
 
         topic_num = str(topic_num)

+ 1 - 1
route/topic_comment_notice.py

@@ -7,7 +7,7 @@ def topic_comment_notice(topic_num = 1, num = 1):
         topic_num = str(topic_num)
         num = str(num)
         
-        if admin_check(conn, 3, 'notice (code ' + topic_num + '#' + num + ')') != 1:
+        if admin_check(3, 'notice (code ' + topic_num + '#' + num + ')') != 1:
             return re_error(conn, '/error/3')
 
         curs.execute(db_change("select code from topic where code = ? and id = ?"), [topic_num, num])

+ 1 - 1
route/topic_comment_tool.py

@@ -29,7 +29,7 @@ def topic_comment_tool(topic_num = 1, num = 1):
             </ul>
         '''
 
-        if admin_check(conn, 3) == 1:
+        if admin_check(3) == 1:
             ban += '''
                 <h2>''' + get_lang(conn, 'admin_tool') + '''</h2>
                 <ul>

+ 2 - 2
route/topic_tool.py

@@ -42,7 +42,7 @@ def topic_tool(topic_num = 1):
         else:
             acl_view_state = 'normal'
 
-        if admin_check(conn, 3) == 1:
+        if admin_check(3) == 1:
             data = '''
                 <h2>''' + get_lang(conn, 'admin_tool') + '''</h2>
                 <ul>
@@ -59,7 +59,7 @@ def topic_tool(topic_num = 1):
             </ul>
         '''
 
-        if admin_check(conn, None) == 1:
+        if admin_check(None) == 1:
             data += '''
                 <h2>''' + get_lang(conn, 'owner') + '''</h2>
                 <ul>

+ 2 - 2
route/topic_tool_acl.py

@@ -4,7 +4,7 @@ def topic_tool_acl(topic_num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn, 3) != 1:
+        if admin_check(3) != 1:
             return re_error(conn, '/error/3')
 
         ip = ip_check()
@@ -17,7 +17,7 @@ def topic_tool_acl(topic_num = 1):
             return redirect(conn, '/')
 
         if flask.request.method == 'POST':
-            admin_check(conn, 3, 'topic_acl_set (code ' + topic_num + ')')
+            admin_check(3, 'topic_acl_set (code ' + topic_num + ')')
 
             curs.execute(db_change("select id from topic where code = ? order by id + 0 desc limit 1"), [topic_num])
             topic_check = curs.fetchall()

+ 2 - 2
route/topic_tool_change.py

@@ -4,7 +4,7 @@ def topic_tool_change(topic_num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn, None) != 1:
+        if admin_check(None) != 1:
             return re_error(conn, '/error/3')
 
         time = get_time()
@@ -16,7 +16,7 @@ def topic_tool_change(topic_num = 1):
             return redirect(conn, '/')
 
         if flask.request.method == 'POST':
-            admin_check(conn, None, 'move_topic (code ' + topic_num + ')')
+            admin_check(None, 'move_topic (code ' + topic_num + ')')
 
             title_d = flask.request.form.get('title', 'test')
             sub_d = flask.request.form.get('sub', 'test')

+ 1 - 1
route/topic_tool_delete.py

@@ -4,7 +4,7 @@ def topic_tool_delete(topic_num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn, None) != 1:
+        if admin_check(None) != 1:
             return re_error(conn, '/error/3')
 
         topic_num = str(topic_num)

+ 2 - 2
route/topic_tool_setting.py

@@ -4,7 +4,7 @@ def topic_tool_setting(topic_num = 1):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        if admin_check(conn, 3) != 1:
+        if admin_check(3) != 1:
             return re_error(conn, '/error/3')
 
         ip = ip_check()
@@ -17,7 +17,7 @@ def topic_tool_setting(topic_num = 1):
             return redirect(conn, '/')
 
         if flask.request.method == 'POST':
-            admin_check(conn, 3, 'change_topic_set (code ' + topic_num + ')')
+            admin_check(3, 'change_topic_set (code ' + topic_num + ')')
 
             stop_d = flask.request.form.get('stop_d', '')
             why_d = flask.request.form.get('why', '')

+ 1 - 1
route/user_challenge.py

@@ -89,7 +89,7 @@ def user_challenge():
 
             curs.execute(db_change('select data from user_set where name = ? and id = ?'), ['challenge_admin', ip])
             db_data = curs.fetchall()
-            if admin_check(conn, 'all') == 1 or db_data:
+            if admin_check('all') == 1 or db_data:
                 curs.execute(db_change("delete from user_set where id = ? and name = 'challenge_admin'"), [ip])
                 curs.execute(db_change("insert into user_set (name, id, data) values ('challenge_admin', ?, '1')"), [ip])
                 user_exp += 10000

+ 1 - 1
route/user_edit_filter.py

@@ -4,7 +4,7 @@ def user_edit_filter(name = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
-        owner_auth = admin_check(conn, 1, None)
+        owner_auth = admin_check(1, None)
         if ip_check() != name:
             if owner_auth != 1:
                 return redirect(conn, '/recent_block')

+ 1 - 1
route/user_info.py

@@ -41,7 +41,7 @@ def user_info(name = ''):
             login_menu = '<h2>' + get_lang(conn, 'login') + '</h2><ul>' + login_menu + '</ul>'
             tool_menu = '<h2>' + get_lang(conn, 'tool') + '</h2><ul>' + tool_menu + '</ul>'
     
-        if admin_check(conn, 1) == 1:
+        if admin_check(1) == 1:
             curs.execute(db_change("select block from rb where block = ? and ongoing = '1'"), [ip])
             ban_name = get_lang(conn, 'release') if curs.fetchall() else get_lang(conn, 'ban')
             

+ 1 - 1
route/user_setting_user_name.py

@@ -6,7 +6,7 @@ def user_setting_user_name(user_name = ''):
 
         ip = ip_check()
         if user_name != '':
-            if admin_check(conn) != 1:
+            if admin_check() != 1:
                 return re_error(conn, '/error/3')
             else:
                 ip = user_name

+ 1 - 1
route/view_diff.py

@@ -73,7 +73,7 @@ def view_diff(name = 'Test', num_a = 1, num_b = 1):
             return re_error(conn, '/ban')
 
         curs.execute(db_change("select title from history where title = ? and (id = ? or id = ?) and hide = 'O'"), [name, first, second])
-        if curs.fetchall() and admin_check(conn, 6) != 1:
+        if curs.fetchall() and admin_check(6) != 1:
             return re_error(conn, '/error/3')
 
         curs.execute(db_change("select data from history where id = ? and title = ?"), [first, name])

+ 2 - 2
route/view_raw.py

@@ -39,7 +39,7 @@ def view_raw(name = '', topic_num = '', num = '', doc_acl = 0, bbs_num = '', pos
                 sub += ' (' + comment_num + ')'
         elif topic_num == '' and num != '':
             curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, num])
-            if curs.fetchall() and admin_check(conn, 6) != 1:
+            if curs.fetchall() and admin_check(6) != 1:
                 return re_error(conn, '/error/3')
 
             curs.execute(db_change("select data from history where title = ? and id = ?"), [name, num])
@@ -48,7 +48,7 @@ def view_raw(name = '', topic_num = '', num = '', doc_acl = 0, bbs_num = '', pos
 
             menu = [['history_tool/' + url_pas(num) + '/' + url_pas(name), get_lang(conn, 'return')]]
         elif topic_num != '':
-            if admin_check(conn, 6) != 1:
+            if admin_check(6) != 1:
                 curs.execute(db_change("select data from topic where id = ? and code = ? and block = ''"), [num, topic_num])
             else:
                 curs.execute(db_change("select data from topic where id = ? and code = ?"), [num, topic_num])

+ 5 - 5
route/view_set.py

@@ -51,13 +51,13 @@ def view_set(name = 'Test', multiple = False):
                     return redirect(conn, '/login')
 
                 if user_data.group(1) != ip:
-                    if admin_check(conn, 5) != 1:
+                    if admin_check(5) != 1:
                         if check_data:
                             return re_error(conn, '/error/3')
                         else:
                             check_ok = 'disabled'
             else:
-                if admin_check(conn, 5) != 1:
+                if admin_check(5) != 1:
                     if check_data:
                         return re_error(conn, '/error/3')
                     else:
@@ -112,7 +112,7 @@ def view_set(name = 'Test', multiple = False):
 
             markup_data = markup_data if markup_data != '' else 'normal'
 
-            if admin_check(conn) == 1:
+            if admin_check() == 1:
                 document_top = flask.request.form.get('document_top', '')
 
                 acl_text += 'document_top\n'
@@ -129,7 +129,7 @@ def view_set(name = 'Test', multiple = False):
                 curs.execute(db_change("delete from data_set where doc_name = ? and set_name = 'document_editor_top'"), [name])
                 curs.execute(db_change("insert into data_set (doc_name, doc_rev, set_name, set_data) values (?, '', 'document_editor_top', ?)"), [name, document_editor_top])
 
-            admin_check(conn, 5, check_data)
+            admin_check(5, check_data)
 
             history_plus(conn, 
                 name,
@@ -220,7 +220,7 @@ def view_set(name = 'Test', multiple = False):
             data += view_set_markup(conn, document_name = name, disable = check_ok)
 
             save_button = '<button type="submit" ' + check_ok + '>' + get_lang(conn, 'save') + '</button>'
-            if admin_check(conn) != 1:
+            if admin_check() != 1:
                 check_ok = 'disabled'
 
             curs.execute(db_change("select set_data from data_set where doc_name = ? and set_name = 'document_top'"), [name])

+ 2 - 2
route/view_w.py

@@ -94,8 +94,8 @@ def view_w(name = 'Test', do_type = ''):
             user_doc = ''
             
             # S admin or owner 특수 틀 추가
-            if admin_check(conn, 'all', None, user_name) == 1:
-                if admin_check(conn, None, None, user_name) == 1:
+            if admin_check('all', None, user_name) == 1:
+                if admin_check(None, None, user_name) == 1:
                     curs.execute(db_change('select data from other where name = "phrase_user_page_owner"'))
                     db_data = curs.fetchall()
                     if db_data and db_data[0][0] != '':

+ 1 - 1
route/vote_add.py

@@ -16,7 +16,7 @@ def vote_add():
             id_data = curs.fetchall()
             id_data = str((int(id_data[0][0]) + 1) if id_data else 1)
 
-            admin_check(conn, None, 'add vote ' + id_data)
+            admin_check(None, 'add vote ' + id_data)
 
             if flask.request.form.get('open_select', 'N') == 'Y':
                 open_data = 'open'

+ 1 - 1
route/vote_close.py

@@ -17,7 +17,7 @@ def vote_close(num = 1):
         curs.execute(db_change('select data from vote where id = ? and name = "open_user" and type = "option"'), [num])
         db_data = curs.fetchall()
         open_user = db_data[0][0] if db_data else ''
-        if open_user != ip_check() and admin_check(conn) != 1:
+        if open_user != ip_check() and admin_check() != 1:
             return re_error(conn, '/ban')
 
         if data_list[0][0] == 'close':

TEMPAT SAMPAH
route_go/bin/main.amd64.bin


TEMPAT SAMPAH
route_go/bin/main.amd64.exe


TEMPAT SAMPAH
route_go/bin/main.arm64.bin


TEMPAT SAMPAH
route_go/bin/main.arm64.exe


+ 2 - 0
route_go/main.go

@@ -87,6 +87,8 @@ func main() {
 		route_data = route.Api_func_acl(call_arg[1:])
 	} else if call_arg[0] == "api_func_ban" {
 		route_data = route.Api_func_ban(call_arg[1:])
+	} else if call_arg[0] == "api_func_auth_post" {
+		route_data = route.Api_func_auth_post(call_arg[1:])
 	} else {
 		log.Fatal(call_arg[0] + " is 404")
 	}

+ 1 - 1
route_go/route/api_bbs_w_comment.go

@@ -66,6 +66,6 @@ func Api_bbs_w_comment(call_arg []string) string {
 		json_data, _ := json.Marshal(data_list)
 		return string(json_data)
 	} else {
-		return ""
+		return "{}"
 	}
 }

+ 1 - 1
route_go/route/api_edit_move_all.go

@@ -20,5 +20,5 @@ func Api_edit_move_all(call_arg []string) string {
 
 	}
 
-	return ""
+	return "{}"
 }

+ 25 - 0
route_go/route/api_func_auth_post.go

@@ -0,0 +1,25 @@
+package route
+
+import (
+	"encoding/json"
+	"opennamu/route/tool"
+)
+
+func Api_func_auth_post(call_arg []string) string {
+	other_set := map[string]string{}
+	json.Unmarshal([]byte(call_arg[0]), &other_set)
+
+	db := tool.DB_connect()
+	defer db.Close()
+
+	ip := other_set["ip"]
+	what := other_set["what"]
+
+	tool.Do_insert_auth_history(db, ip, what)
+
+	new_data := make(map[string]interface{})
+	new_data["response"] = "ok"
+
+	json_data, _ := json.Marshal(new_data)
+	return string(json_data)
+}

+ 1 - 1
route_go/route/api_user_rankup_patch.go

@@ -12,5 +12,5 @@ func Api_user_rankup_patch(call_arg []string) string {
 	db := tool.DB_connect()
 	defer db.Close()
 
-	return ""
+	return "{}"
 }

+ 62 - 12
route_go/route/tool/acl_and_auth.go

@@ -37,6 +37,34 @@ func List_acl(func_type string) []string {
 	}
 }
 
+func Do_insert_auth_history(db *sql.DB, ip string, what string) {
+	var log_off string
+
+	err := db.QueryRow(DB_change("select data from other where name = 'auth_history_off'")).Scan(&log_off)
+	if err != nil {
+		if err == sql.ErrNoRows {
+			log_off = ""
+		} else {
+			log.Fatal(err)
+		}
+	}
+
+	if log_off == "" {
+		stmt, err := db.Prepare(DB_change("insert into re_admin (who, what, time) values (?, ?, ?)"))
+		if err != nil {
+			log.Fatal(err)
+		}
+		defer stmt.Close()
+
+		time := Get_time()
+
+		_, err = stmt.Exec(ip, what, time)
+		if err != nil {
+			log.Fatal(err)
+		}
+	}
+}
+
 func Get_user_auth(db *sql.DB, ip string) string {
 	if !IP_or_user(ip) {
 		var auth string
@@ -67,7 +95,7 @@ func Get_user_auth(db *sql.DB, ip string) string {
 }
 
 func Get_auth_group_info(db *sql.DB, auth string) map[string]bool {
-	stmt, err := db.Prepare(DB_change("select name from alist where name = ?"))
+	stmt, err := db.Prepare(DB_change("select acl from alist where name = ?"))
 	if err != nil {
 		log.Fatal(err)
 	}
@@ -120,7 +148,7 @@ func Check_auth(auth_info map[string]bool) map[string]bool {
 		auth_info["admin_default_feature"] = true
 	}
 
-	admin_default_feature := []string{"user_name_bold", "multiple_upload", "slow_edit_pass", "edit_bottom_compulsion_pass"}
+	admin_default_feature := []string{"treat_as_admin", "user_name_bold", "multiple_upload", "slow_edit_pass", "edit_bottom_compulsion_pass"}
 
 	if _, ok := auth_info["admin_default_feature"]; ok {
 		for _, v := range admin_default_feature {
@@ -146,10 +174,26 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 	level_int, _ := strconv.Atoi(level)
 
 	get_ban := ""
+	ban_type := ""
 	if tool == "document_edit_request" {
-		get_ban = Get_user_ban(db, ip, "edit_request")[0]
+		temp_arr := Get_user_ban(db, ip, "edit_request")
+
+		get_ban = temp_arr[0]
+		ban_type = temp_arr[1]
 	} else {
-		get_ban = Get_user_ban(db, ip, "")[0]
+		temp_arr := Get_user_ban(db, ip, "")
+
+		get_ban = temp_arr[0]
+		ban_type = temp_arr[1]
+	}
+
+	if ban_type != "" {
+		ban_type_len := len(ban_type)
+		if ban_type_len == 1 {
+			ban_type = string(ban_type[0])
+		} else if ban_type_len == 2 {
+			ban_type = string(ban_type[1])
+		}
 	}
 
 	if tool == "" && name != "" {
@@ -742,6 +786,12 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 			}
 		}
 
+		if auth_info[acl_pass_auth] {
+			return true
+		} else if ban_type == "4" {
+			return false
+		}
+
 		if acl_data == "" {
 			if tool == "recaptcha" {
 				acl_data = "admin"
@@ -754,22 +804,22 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 
 		except_ban_tool_list := []string{"render", "topic_view", "bbs_view"}
 		if acl_data != "normal" {
-			if !(acl_data == "ban" || acl_data == "ban_admin") && !Arr_in_str(except_ban_tool_list, tool) {
-				if get_ban == "true" {
-					return false
+			if !(acl_data == "ban" || acl_data == "ban_admin") || ban_type == "3" {
+				if !Arr_in_str(except_ban_tool_list, tool) {
+					if get_ban == "true" {
+						return false
+					}
 				}
 			}
 
-			if auth_info[acl_pass_auth] {
-				return true
-			} else if acl_data == "all" || acl_data == "ban" {
+			if acl_data == "all" || acl_data == "ban" {
 				return true
 			} else if acl_data == "user" {
 				if !ip_or_user {
 					return true
 				}
 			} else if acl_data == "admin" {
-				if auth_info["admin_default_feature"] {
+				if auth_info["treat_as_admin"] {
 					return true
 				}
 			} else if acl_data == "50_edit" {
@@ -875,7 +925,7 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 					return true
 				}
 			} else if acl_data == "ban_admin" {
-				if auth_info["admin_default_feature"] || get_ban == "true" {
+				if auth_info["treat_as_admin"] || get_ban == "true" {
 					return true
 				}
 			} else if acl_data == "not_all" {

+ 4 - 0
route_go/route/tool/ip_parser.go

@@ -224,6 +224,10 @@ func Get_user_ban_type(ban_type string) string {
 		return "1"
 	} else if ban_type == "E" {
 		return "2"
+	} else if ban_type == "A" {
+		return "3"
+	} else if ban_type == "D" {
+		return "4"
 	} else {
 		return ""
 	}

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.5.0-v154",
+        "r_ver" : "v3.5.0-v158",
         "c_ver" : "20240513",
         "s_ver" : "20240426"
     }

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

@@ -92,4 +92,12 @@
 
 .opennamu_main .opennamu_diff_red {
     background: #803737;
+}
+
+.opennamu_main a {
+    color: #A7C8FF;
+}
+
+.opennamu_main a:hover {
+    color: #7e97c1;
 }

+ 15 - 2
views/main_css/js/func/render.js

@@ -110,7 +110,7 @@ function opennamu_do_render_html(name = '') {
         ];
         for(let key in t_data) {
             let patt = new RegExp(
-                '&lt;' + t_data[key] + '( (?:(?:(?!&gt;).)+))?&gt;((?:(?!&lt;\/' + t_data[key] + '&gt;).)*)&lt;\/' + t_data[key] + '&gt;',
+                '&lt;' + t_data[key] + '( (?:(?:(?!&gt;).)+))?&gt;((?:(?!&lt;\/' + t_data[key] + '&gt;).)*)(&lt;\/' + t_data[key] + '&gt;|$)',
                 'ig'
             );
             
@@ -120,7 +120,20 @@ function opennamu_do_render_html(name = '') {
                 } else if(t_data[key] === 'div' || t_data[key] === 'span') {
                     let style_data = in_data.match(/ style=['"]([^'"]*)['"]/);
                     if(style_data) {
-                        style_data = style_data[1].replace(/position/ig, '');
+                        style_data = style_data[1];
+
+                        const find_regex = [
+                            / *box-shadow *: *(([^,;]*)(,|;|$)){10,}/i,
+                            / *url\([^()]*\)/i,
+                            / *linear-gradient\((([^(),]+)(,|\))){10,}/i,
+                            / *position *: */i
+                        ];
+                        for(let regex of find_regex) {
+                            if(regex.test(style_data)) {
+                                style_data = "";
+                                break;
+                            }
+                        }
                     } else {
                         style_data = '';
                     }

+ 0 - 8
views/ringo/css/dark.css

@@ -72,12 +72,4 @@ button.search_button#search:hover {
 
 #opennamu_save_button {
     background: #325a56;
-}
-
-a {
-    color: #A7C8FF;
-}
-
-a:hover {
-    color: #7e97c1;
 }