Ver Fonte

기나긴 URL 개편 끝

https://github.com/openNAMU/openNAMU/issues/1139
잉여개발기 (SPDV) há 2 anos atrás
pai
commit
4cbdef977c

+ 3 - 5
app.py

@@ -363,13 +363,11 @@ app.route('/auth/give/ban_regex/<everything:name>', methods = ['POST', 'GET'], d
 app.route('/auth/give/ban_multiple', methods = ['POST', 'GET'], defaults = { 'ban_type' : 'multiple' })(give_user_ban)
 
 # /auth/list
-app.route('/admin_group')(list_admin_group_2)
-
 # /auth/list/add/<name>
-app.route('/admin_plus/<name>', methods = ['POST', 'GET'])(give_admin_groups_2)
-
 # /auth/list/delete/<name>
-app.route('/delete_admin_group/<name>', methods = ['POST', 'GET'])(give_delete_admin_group_2)
+app.route('/auth/list')(list_admin_group_2)
+app.route('/auth/list/add/<name>', methods = ['POST', 'GET'])(give_admin_groups_2)
+app.route('/auth/list/delete/<name>', methods = ['POST', 'GET'])(give_delete_admin_group_2)
 
 app.route('/auth/give/fix/<user_name>', methods = ['POST', 'GET'])(give_user_fix)
 

+ 4 - 4
route/give_admin_groups.py

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

+ 5 - 5
route/give_delete_admin_group.py

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

+ 1 - 1
route/list_admin.py

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

+ 2 - 2
route/list_admin_group.py

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

+ 1 - 1
route/main_tool_admin.py

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

+ 1 - 1
route/main_tool_redirect.py

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