Browse Source

임시 저장

잉여개발기 (SPDV) 2 years ago
parent
commit
1d2792f179
53 changed files with 108 additions and 145 deletions
  1. 1 1
      app.py
  2. 1 1
      lang/ko-KR.json
  3. 1 1
      route/bbs_delete.py
  4. 1 1
      route/bbs_make.py
  5. 2 1
      route/bbs_w.py
  6. 1 1
      route/bbs_w_comment_tool.py
  7. 1 1
      route/bbs_w_delete.py
  8. 2 2
      route/bbs_w_edit.py
  9. 1 1
      route/bbs_w_hide.py
  10. 1 1
      route/bbs_w_pinned.py
  11. 2 2
      route/bbs_w_set.py
  12. 1 1
      route/bbs_w_tool.py
  13. 2 5
      route/edit_delete_file.py
  14. 1 1
      route/edit_delete_multiple.py
  15. 4 3
      route/edit_move.py
  16. 1 1
      route/edit_revert.py
  17. 2 1
      route/filter_all.py
  18. 3 3
      route/filter_all_add.py
  19. 1 1
      route/filter_all_delete.py
  20. 2 2
      route/give_admin_groups.py
  21. 7 3
      route/give_auth.py
  22. 2 2
      route/give_delete_admin_group.py
  23. 1 1
      route/give_user_fix.py
  24. 1 1
      route/list_admin_group.py
  25. 1 1
      route/list_user_check.py
  26. 1 1
      route/list_user_check_delete.py
  27. 0 3
      route/login_register_submit.py
  28. 1 1
      route/main_setting_acl.py
  29. 1 1
      route/main_setting_external.py
  30. 1 1
      route/main_setting_head.py
  31. 1 1
      route/main_setting_main.py
  32. 1 1
      route/main_setting_main_logo.py
  33. 1 1
      route/main_setting_phrase.py
  34. 1 1
      route/main_setting_robot.py
  35. 1 1
      route/main_setting_sitemap.py
  36. 1 1
      route/main_setting_sitemap_set.py
  37. 1 1
      route/main_setting_skin_set.py
  38. 1 1
      route/main_setting_top_menu.py
  39. 1 1
      route/main_sys_restart.py
  40. 1 1
      route/main_sys_shutdown.py
  41. 1 1
      route/main_sys_update.py
  42. 1 1
      route/n_bbs_main.py
  43. 1 1
      route/recent_history_add.py
  44. 1 1
      route/recent_history_delete.py
  45. 1 1
      route/recent_history_reset.py
  46. 1 1
      route/recent_history_send.py
  47. 1 1
      route/recent_history_tool.py
  48. 1 1
      route/recent_record_reset.py
  49. 12 74
      route/tool/func.py
  50. 1 1
      route/user_setting_user_name.py
  51. 2 2
      route/view_set.py
  52. 1 1
      route/vote_close.py
  53. 27 3
      route_go/route/tool/acl_and_auth.go

+ 1 - 1
app.py

@@ -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('all', None, for_a[0]) != 1:
+            if acl_check('', 'all_admin_auth', '', 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()

+ 1 - 1
lang/ko-KR.json

@@ -296,7 +296,7 @@
     "skin_set": "스킨 설정",
     "edit_help": "편집 창 문구",
     "default_edit_help": "이곳에 내용을 입력해주세요.",
-    "many_delete": "다중 삭제",
+    "many_delete": "다중 문서 삭제",
     "many_delete_help": "한 줄에 문서명을 한 개씩 적어주세요.",
     "content": "내용",
     "upload_acl": "파일 올리기 ACL",

+ 1 - 1
route/bbs_delete.py

@@ -13,7 +13,7 @@ def bbs_delete(bbs_num = ''):
         
         bbs_num_str = str(bbs_num)
 
-        if admin_check() != 1:
+        if acl_check('', 'owner_auth', '', '') == 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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/error/3')
         
         if flask.request.method == 'POST':

+ 2 - 1
route/bbs_w.py

@@ -9,7 +9,8 @@ def bbs_w(bbs_num = '', tool = 'bbs', page = 1, name = ''):
         sub = ''
         bbs_name_dict = {}
 
-        admin_auth = admin_check()
+        admin_auth = acl_check(tool = 'owner_auth')
+        admin_auth = 0 if admin_auth == 1 else 1
 
         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() == 1:
+        if acl_check('', 'owner_auth', '', '') != 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() != 1:
+        if acl_check('', 'owner_auth', '') == 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 - 2
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() != 1:
+                if not temp_dict['comment_user_id'] == ip and acl_check('', 'owner_auth', '', '') == 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() != 1:
+                if not temp_dict['user_id'] == ip and acl_check('', 'owner_auth', '', '') == 1:
                     return re_error(conn, '/ban')
             else:
                 return redirect(conn, '/bbs/main')

+ 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() != 1:
+        if acl_check('', 'bbs_auth', '', '') == 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() != 1:
+        if acl_check('', 'bbs_auth', '', '') == 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 - 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(None, 'bbs_set (acl)') != 1:
+            if acl_check('', 'owner_auth', '', '', '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() != 1:
+            if acl_check('', 'bbs_auth', '', '') == 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() == 1:
+        if acl_check('', 'bbs_auth', '', '') != 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')
 

+ 2 - 5
route/edit_delete_file.py

@@ -4,10 +4,7 @@ from .edit_delete import edit_delete
 
 def edit_delete_file(name = 'test.jpg'):
     with get_db_connect() as conn:
-        curs = conn.cursor()
-
-        ip = ip_check()
-        if admin_check() == 0:
+        if acl_check('', 'owner_auth', '', '') != 0:
             return re_error(conn, '/ban')
 
         mime_type = re.search(r'([^.]+)$', name)
@@ -25,7 +22,7 @@ def edit_delete_file(name = 'test.jpg'):
             return redirect(conn, '/w/' + url_pas(name))
 
         if flask.request.method == 'POST':
-            admin_check(None, 'file del (' + name + ')')
+            acl_check(tool = 'owner_auth', memo = '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() != 1:
+        if acl_check('', 'acl_auth', '', '') == 1:
             return re_error(conn, '/ban')
 
         if flask.request.method == 'POST':

+ 4 - 3
route/edit_move.py

@@ -44,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(None, 'merge documents (' + name + ') (' + move_title + ')') == 1:
+                if move_option == 'merge' and acl_check(tool = 'owner_auth', memo = 'merge documents (' + name + ') (' + move_title + ')') != 1:
                     curs.execute(db_change("select data from data where title = ?"), [move_title])
                     data = curs.fetchall()
                     if data:
@@ -160,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(None, 'merge document\'s topics (' + name + ') (' + move_title + ')') == 1:
+                if move_option_topic == 'merge' and acl_check(tool = 'owner_auth', memo = '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
@@ -210,7 +210,8 @@ def edit_move(name):
             else:
                 return re_error(conn, '/error/19')
         else:
-            owner_auth = admin_check()
+            owner_auth = acl_check(tool = 'owner_auth')
+            owner_auth = 1 if owner_auth == 0 else 1
 
             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 - 1
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(6) != 1:
+        if curs.fetchall() and acl_check(tool = 'hidel_auth') != 1:
             return re_error(conn, '/error/3')
 
         if acl_check(name, 'document_edit') == 1:

+ 2 - 1
route/filter_all.py

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

+ 3 - 3
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() != 1:
+            if acl_check('', 'owner_auth', '', '') == 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(None, tool + ' edit')
+                acl_check(tool = 'owner_auth', memo = tool + ' edit')
             elif tool == 'edit_filter':
                 day = flask.request.form.get('day', '0')
                 end = 'X' if day == '0' else day
@@ -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() != 1 else ''
+            stat = 'disabled' if acl_check('', 'owner_auth', '', '') == 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(None, 'del_' + tool) != 1:
+        if acl_check(tool = 'owner_auth', memo = 'del_' + tool) == 1:
             return re_error(conn, '/error/3')
 
         if tool == 'inter_wiki':

+ 2 - 2
route/give_admin_groups.py

@@ -46,7 +46,7 @@ def give_admin_groups(name = 'test'):
         ]
 
         if flask.request.method == 'POST':
-            if admin_check(None, 'auth list add (' + name + ')') != 1:
+            if acl_check(tool = 'owner_auth', memo = 'auth list add (' + name + ')') != 1:
                 return re_error(conn, '/error/3')
             elif name in get_default_admin_group():
                 return re_error(conn, '/error/3')
@@ -58,7 +58,7 @@ def give_admin_groups(name = 'test'):
 
             return redirect(conn, '/auth/list/add/' + url_pas(name))
         else:
-            state = 'disabled' if admin_check() != 1 else ''
+            state = 'disabled' if acl_check('', 'owner_auth', '', '') == 1 else ''
             state = 'disabled' if name in get_default_admin_group() else ''
 
             data = '<ul>'

+ 7 - 3
route/give_auth.py

@@ -5,8 +5,12 @@ def give_auth(name):
         curs = conn.cursor()
 
         ip = ip_check()
-        owner_auth = admin_check()
-        admin_auth = admin_check(7)
+        
+        owner_auth = acl_check(tool = 'owner_auth')
+        owner_auth = 1 if owner_auth == 0 else 1
+
+        admin_auth = acl_check(tool = 'give_auth')
+        admin_auth = 1 if admin_auth == 0 else 1
 
         curs.execute(db_change("select data from user_set where id = ? and name = 'acl'"), [name])
         user_acl = curs.fetchall()
@@ -24,7 +28,7 @@ def give_auth(name):
                 return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            if admin_check(7, 'admin (' + name + ')') != 1:
+            if acl_check(tool = 'give_auth', memo = '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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':
-            admin_check(None, 'auth list delete (' + name + ')')
+            acl_check(tool = 'owner_auth', memo = '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])

+ 1 - 1
route/give_user_fix.py

@@ -8,7 +8,7 @@ def give_user_fix(user_name = ''):
         if not curs.fetchall():
             return re_error(conn, '/error/2')
 
-        if admin_check() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':

+ 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() == 1 and not data[0] in org_acl_list:
+            if acl_check('', 'owner_auth', '', '') != 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 = ''

+ 1 - 1
route/list_user_check.py

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

+ 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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/error/4')
 
         user_id = name

+ 0 - 3
route/login_register_submit.py

@@ -50,9 +50,6 @@ def login_register_submit_2():
 
             curs.execute(db_change("insert into user_set (id, name, data) values (?, ?, ?)"), [user_app_data['id'], 'application', json.dumps(user_app_data)])
 
-            for for_a in get_admin_list(conn):
-                add_alarm(conn, for_a, user_app_data['id'], '<a href="/app_submit">' + get_lang(conn, 'new_application') + '</a>')
-
             return re_error(conn, '/error/43')
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),

+ 1 - 1
route/main_setting_acl.py

@@ -34,7 +34,7 @@ def main_setting_acl():
                 return redirect(conn, '/setting/acl')
         else:
             d_list = {}
-            disable = 'disabled' if admin_check() != 1 else ''
+            disable = 'disabled' if acl_check('', 'owner_auth', '', '') == 1 else ''
             acl_div = ['' for _ in range(0, len(i_list))]
 
             for for_a in i_list:

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
         
         i_list = [

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
         
         if flask.request.method == 'POST' and set_preview == 0:

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
         
         setting_list = {

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
 
         skin_list = [0] + load_skin(conn, '', 1)

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
         
         i_list = [

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
 
         curs.execute(db_change("select data from other where name = 'robot'"))

+ 1 - 1
route/main_setting_sitemap.py

@@ -5,7 +5,7 @@ def main_setting_sitemap(do_type = 0):
         curs = conn.cursor()
 
         if not do_type == 1:
-            if admin_check() != 1:
+            if acl_check('', 'owner_auth', '', '') == 1:
                 return re_error(conn, '/ban')
         
         if do_type == 1 or flask.request.method == 'POST':

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
         
         setting_list = {

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
             
         set_list = user_setting_skin_set_main_set_list(conn)

+ 1 - 1
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() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
         
         if flask.request.method == 'POST':

+ 1 - 1
route/main_sys_restart.py

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

+ 1 - 1
route/main_sys_shutdown.py

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

+ 1 - 1
route/main_sys_update.py

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

+ 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() == 1 else [])
+            menu = [['other', get_lang(conn, 'other_tool')]] + ([['bbs/make', get_lang(conn, 'add')], ['bbs/set', get_lang(conn, 'bbs_set')]] if acl_check('', 'owner_auth', '', '') != 1 else [])
         ))

+ 1 - 1
route/recent_history_add.py

@@ -7,7 +7,7 @@ def recent_history_add(name = 'Test', do_type = ''):
         curs = conn.cursor()
 
         ip = ip_check()
-        if admin_check() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
 
         if flask.request.method == 'POST':

+ 1 - 1
route/recent_history_delete.py

@@ -6,7 +6,7 @@ def recent_history_delete(name = 'Test', rev = 1):
 
         num = str(rev)
 
-        if admin_check() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':

+ 1 - 1
route/recent_history_reset.py

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

+ 1 - 1
route/recent_history_send.py

@@ -6,7 +6,7 @@ def recent_history_send(name = 'Test', rev = 1):
 
         num = str(rev)
 
-        if admin_check() != 1:
+        if acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/error/3')
 
         if flask.request.method == 'POST':

+ 1 - 1
route/recent_history_tool.py

@@ -35,7 +35,7 @@ def recent_history_tool(name = 'Test', rev = 1):
             data += '</a></li>'
             data += '</ul>'
 
-        if admin_check() == 1:
+        if acl_check('', 'owner_auth', '', '') != 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>'

+ 1 - 1
route/recent_record_reset.py

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

+ 12 - 74
route/tool/func.py

@@ -1874,50 +1874,6 @@ def do_user_name_check(conn, user_name):
     
     return 0
 
-def get_admin_auth_list(num = None):
-    # without_DB
-
-    check = {
-        0 : 'owner',
-        1 : 'ban',
-        2 : 'nothing',
-        3 : 'toron',
-        4 : 'check',
-        5 : 'acl',
-        6 : 'hidel',
-        7 : 'give'
-    }
-    if not num:
-        check = check[0]
-    elif num == 'all':
-        check = [check[i] for i in check]
-    else:
-        check = check[num]
-        
-    return check
-
-def get_admin_list(conn, num = None):
-    curs = conn.cursor()
-    
-    if num == 'all':
-        curs.execute(db_change("select data from user_set where data != 'user' and name = 'acl'"))
-        db_data = curs.fetchall()
-        db_data = [db_data_in[0] for db_data_in in db_data] if db_data else []
-        
-        return db_data
-    else:
-        check = get_admin_auth_list(num)
-        admin_list = []
-        
-        curs.execute(db_change('select name from alist where acl = ?'), [check])
-        db_data = curs.fetchall()
-        for db_data_in in db_data:
-            curs.execute(db_change("select id from user_set where data = ? and name = 'acl'"), [db_data_in[0]])
-            db_data_2 = curs.fetchall()
-            admin_list += [db_data_2_in[0] for db_data_2_in in db_data_2] if db_data_2 else []
-            
-        return admin_list
-
 def level_check(conn, ip = ''):
     curs = conn.cursor()
 
@@ -1943,36 +1899,9 @@ def level_check(conn, ip = ''):
 
     return [level, exp, max_exp]
 
-def admin_check(num = None, what = None, name = ''):
-    ip = ip_check() if name == '' else name
-    pass_ok = 0
-
-    other_set = {}
-    other_set['ip'] = ip
-
-    data_str = python_to_golang_sync('api_func_auth_list', other_set)
-    data = json.loads(data_str)
-
-    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 = ''):
+def acl_check(name = '', tool = '', topic_num = '', ip = '', memo = ''):
     name = '' if name == None else name
-    ip = ip_check()
+    ip = ip_check() if ip == '' else ip
 
     other_set = {}
     other_set['ip'] = ip
@@ -1983,7 +1912,16 @@ def acl_check(name = '', tool = '', topic_num = ''):
     data_str = python_to_golang_sync('api_func_acl', other_set)
     data = json.loads(data_str)
 
-    return 0 if data["data"] else 1
+    result = 0 if data["data"] else 1
+
+    if memo != '' and result == 0:
+        other_set = {}
+        other_set['ip'] = ip
+        other_set['what'] = memo
+
+        python_to_golang_sync('api_func_auth_post', other_set)
+
+    return result
 
 def ban_check(ip = None, tool = ''):
     ip = ip_check() if not ip else ip

+ 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() != 1:
+            if acl_check('', 'owner_auth', '', '') == 1:
                 return re_error(conn, '/error/3')
             else:
                 ip = user_name

+ 2 - 2
route/view_set.py

@@ -112,7 +112,7 @@ def view_set(name = 'Test', multiple = False):
 
             markup_data = markup_data if markup_data != '' else 'normal'
 
-            if admin_check() == 1:
+            if acl_check('', 'owner_auth', '', '') != 1:
                 document_top = flask.request.form.get('document_top', '')
 
                 acl_text += 'document_top\n'
@@ -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() != 1:
+            if acl_check('', 'owner_auth', '', '') == 1:
                 check_ok = 'disabled'
 
             curs.execute(db_change("select set_data from data_set where doc_name = ? and set_name = 'document_top'"), [name])

+ 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() != 1:
+        if open_user != ip_check() and acl_check('', 'owner_auth', '', '') == 1:
             return re_error(conn, '/ban')
 
         if data_list[0][0] == 'close':

+ 27 - 3
route_go/route/tool/acl_and_auth.go

@@ -282,7 +282,31 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 		acl_data := ""
 		acl_pass_auth := ""
 
-		if tool == "" {
+		if tool == "all_admin_auth" {
+			acl_pass_auth = "treat_as_admin"
+			acl_data = "owner"
+		} else if tool == "owner_auth" {
+			acl_pass_auth = "owner"
+			acl_data = "owner"
+		} else if tool == "ban_auth" {
+			acl_pass_auth = "bbs"
+			acl_data = "owner"
+		} else if tool == "toron_auth" {
+			acl_pass_auth = "toron"
+			acl_data = "owner"
+		} else if tool == "check_auth" {
+			acl_pass_auth = "check"
+			acl_data = "owner"
+		} else if tool == "acl_auth" {
+			acl_pass_auth = "acl"
+			acl_data = "owner"
+		} else if tool == "hidel_auth" {
+			acl_pass_auth = "hidel"
+			acl_data = "owner"
+		} else if tool == "give_auth" {
+			acl_pass_auth = "give"
+			acl_data = "owner"
+		} else if tool == "" {
 			acl_pass_auth = "acl"
 
 			if for_a == 0 {
@@ -691,7 +715,7 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 				}
 			}
 		} else if tool == "recaptcha" {
-			acl_pass_auth = "admin_default_feature"
+			acl_pass_auth = "captcha_pass"
 
 			err := db.QueryRow(DB_change("select data from other where name = 'recaptcha_pass_acl'")).Scan(&acl_data)
 			if err != nil {
@@ -702,7 +726,7 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 				}
 			}
 		} else if tool == "recaptcha_five_pass" {
-			acl_pass_auth = "admin_default_feature"
+			acl_pass_auth = "captcha_one_check_five_pass"
 
 			err := db.QueryRow(DB_change("select data from other where name = 'recaptcha_one_check_five_pass_acl'")).Scan(&acl_data)
 			if err != nil {