surplus-dev 3 rokov pred
rodič
commit
416ca3f83a

+ 1 - 1
app.py

@@ -260,7 +260,7 @@ with get_db_connect() as conn:
 if os.path.exists('custom.py'):
     from custom import custom_run
     custom_run('error', app)
-    
+
 # Func
 # Func-inter_wiki
 app.route('/inter_wiki', defaults = { 'tool' : 'inter_wiki' })(filter_inter_wiki)

+ 1 - 0
lang/en-US.json

@@ -443,6 +443,7 @@
             "answer": "Answer",
             "approve": "Approve",
             "decline": "Decline",
+            "new_application" : "A new register application exists.",
             "approve_or_decline": "Approve or reject",
             "no_applications_now" : "There are no applications.",
             "approval_requirement_disabled": "Approval requirement is disabled now. You can enable this feature on settings",

+ 2 - 1
lang/ko-KR.json

@@ -493,5 +493,6 @@
     "top_menu_setting": "추가 메뉴 설정",
     "enter_top_menu_setting": "윗 줄에는 이름을 쓰고 아랫 줄에는 URL을 입력하세요.",
     "not_support_skin_warning": "이 기능을 미지원하는 스킨에서는 작동하지 않습니다.",
-    "acl_thread_change": "스레드 ACL 변경"
+    "acl_thread_change": "스레드 ACL 변경",
+    "new_application": "새로운 가입 신청이 있습니다."
 }

+ 9 - 10
route/give_admin_groups.py

@@ -9,9 +9,8 @@ def give_admin_groups_2(name):
         if flask.request.method == 'POST':
             if admin_check(None, 'admin_plus (' + name + ')') != 1:
                 return re_error('/error/3')
-            else:
-                if name in ['owner', 'ban']:
-                    return re_error('/error/3')
+            elif name in get_default_admin_group():
+                return re_error('/error/3')
 
             curs.execute(db_change("delete from alist where name = ?"), [name])
             for i in acl_name_list:
@@ -52,13 +51,13 @@ def give_admin_groups_2(name):
                         <hr class="main_hr">
                         <h2>''' + load_lang('explanation') + '''</h2>
                         <ul class="opennamu_ul">
-                            <li>ban : ''' + load_lang('ban_authority') + '''</li>
-                            <li>toron : ''' + load_lang('discussion_authority') + '''</li>
-                            <li>check : ''' + load_lang('user_check_authority') + '''</li>
-                            <li>acl : ''' + load_lang('document_acl_authority') + '''</li>
-                            <li>hidel : ''' + load_lang('history_hide_authority') + '''</li>
-                            <li>give : ''' + load_lang('authorization_authority') + '''</li>
-                            <li>owner : ''' + load_lang('owner_authority') + '''</li>
+                            <li style="margin-left: 20px;">owner : ''' + load_lang('owner_authority') + '''</li>
+                            <li style="margin-left: 40px; list-style: circle;">ban : ''' + load_lang('ban_authority') + '''</li>
+                            <li style="margin-left: 40px; list-style: circle;">toron : ''' + load_lang('discussion_authority') + '''</li>
+                            <li style="margin-left: 40px; list-style: circle;">check : ''' + load_lang('user_check_authority') + '''</li>
+                            <li style="margin-left: 40px; list-style: circle;">acl : ''' + load_lang('document_acl_authority') + '''</li>
+                            <li style="margin-left: 40px; list-style: circle;">hidel : ''' + load_lang('history_hide_authority') + '''</li>
+                            <li style="margin-left: 40px; list-style: circle;">give : ''' + load_lang('authorization_authority') + '''</li>
                         </ul>
                         <hr class="main_hr">
                         <button ''' + state +  ''' type="submit">''' + load_lang('save') + '''</button>

+ 3 - 0
route/login_register_submit.py

@@ -42,6 +42,9 @@ def login_register_submit_2():
                 json.dumps(user_app_data)
             ])
             conn.commit()
+            
+            for for_a in get_admin_list():
+                add_alarm(for_a, flask.session['submit_id'] + ' | <a href="/app_submit">' + load_lang('new_application') + '</a>')
 
             return redirect('/')
         else:

+ 50 - 18
route/tool/func.py

@@ -707,7 +707,7 @@ def set_init():
 # Func-simple
 ## Func-simple-without_DB
 def get_default_admin_group():
-    return ['owner', 'ban']
+    return ['owner', 'user', 'ban']
 
 def get_default_robots_txt():
     data = '' + \
@@ -1562,6 +1562,54 @@ def captcha_post(re_data, num = 1):
         return 0
 
 # Func-user
+def get_admin_auth_list(num = None):
+    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(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 admin_check(num = None, what = None, name = ''):
     curs = conn.cursor()
 
@@ -1576,24 +1624,8 @@ def admin_check(num = None, what = None, name = ''):
         user_auth = curs.fetchall()
         if user_auth:
             user_auth = user_auth[0][0]
+            check = get_admin_auth_list(num)
             
-            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]
-
             curs.execute(db_change(
                 'select name from alist where name = ? and acl = "owner"'
             ), [user_auth])

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.6-RC2-dev116",
+        "r_ver" : "v3.4.6-RC2-dev117",
         "c_ver" : "3500355",
         "s_ver" : "3500111"
     }