Преглед изворни кода

Merge pull request #2309 from openNAMU/dont_use

버그 수정
잉여개발기 пре 1 година
родитељ
комит
4bec4c6f5c

+ 2 - 2
app.py

@@ -733,8 +733,8 @@ app.route('/api/skin_info/<name>')(api_skin_info)
 app.route('/api/user_info/<user_name>')(api_user_info)
 app.route('/api/setting/<name>')(api_setting)
 
-app.route('/api/auth_list')(api_func_auth_list)
-app.route('/api/auth_list/<user_name>')(api_func_auth_list)
+app.route('/api/auth')(api_func_auth)
+app.route('/api/auth/<user_name>')(api_func_auth)
 
 app.route('/api/thread/<int:topic_num>/<int:s_num>/<int:e_num>')(api_topic)
 app.route('/api/thread/<int:topic_num>/<tool>')(api_topic)

+ 1 - 1
route/__init__.py

@@ -187,7 +187,7 @@ from route.go_api_func_language import api_func_language
 from route.go_api_func_sha224 import api_func_sha224
 from route.go_api_func_ip import api_func_ip
 from route.go_api_func_ip_menu import api_func_ip_menu
-from route.go_api_func_auth_list import api_func_auth_list
+from route.go_api_func_auth import api_func_auth
 from route.go_api_func_acl_list import api_func_acl_list
 
 from route.go_api_search import api_search

+ 4 - 8
route/give_user_ban.py

@@ -75,16 +75,12 @@ def give_user_ban(name = None, ban_type = ''):
                 else:
                     type_d = None
 
-                if type_d:
-                    if acl_check(tool = 'owner_auth', memo = 'ban ' + type_d + ' (' + name + ')') == 1:
+                if name == ip:
+                    if acl_check(tool = 'all_admin_auth', memo = 'ban (' + name + ')') == 1:
                         return re_error(conn, '/error/3')
                 else:
-                    if name == ip:
-                        if acl_check(tool = 'all_admin_auth', memo = 'ban (' + name + ')') == 1:
-                            return re_error(conn, '/error/3')
-                    else:
-                        if acl_check(tool = 'ban_auth', memo = 'ban (' + name + ')') == 1:
-                            return re_error(conn, '/error/3')
+                    if acl_check(tool = 'ban_auth', memo = 'ban (' + name + ')') == 1:
+                        return re_error(conn, '/error/3')
 
                 ban_insert(conn, 
                     name,

+ 1 - 1
route/go_api_func_auth_list.py → route/go_api_func_auth.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def api_func_auth_list(user_name = ''):
+async def api_func_auth(user_name = ''):
     other_set = {}
     other_set["ip"] = ip_check() if user_name == '' else user_name
 

+ 1 - 1
route/tool/func.py

@@ -438,7 +438,7 @@ def get_db_table_list():
     create_data['html_filter'] = ['html', 'kind', 'plus', 'plus_t']
     create_data['vote'] = ['name', 'id', 'subject', 'data', 'user', 'type', 'acl']
 
-    # 개편 예정 (auth_list와 auth_log로 변경)
+    # 개편 예정 (auth와 auth_log로 변경)
     create_data['alist'] = ['name', 'acl']
     create_data['re_admin'] = ['who', 'what', 'time']
 

BIN
route_go/bin/main.amd64.bin


BIN
route_go/bin/main.amd64.exe


BIN
route_go/bin/main.arm64.bin


BIN
route_go/bin/main.arm64.exe


+ 2 - 2
route_go/main.go

@@ -45,8 +45,8 @@ func main() {
 		route_data = route.Api_func_llm(call_arg[1:])
 	} else if call_arg[0] == "api_func_language" {
 		route_data = route.Api_func_language(call_arg[1:])
-	} else if call_arg[0] == "api_func_auth_list" {
-		route_data = route.Api_func_auth_list(call_arg[1:])
+	} else if call_arg[0] == "api_func_auth" {
+		route_data = route.Api_func_auth(call_arg[1:])
 	} else if call_arg[0] == "api_list_recent_discuss" {
 		route_data = route.Api_list_recent_discuss(call_arg[1:])
 	} else if call_arg[0] == "api_bbs_list" {

+ 1 - 1
route_go/route/api_func_auth_list.go → route_go/route/api_func_auth.go

@@ -5,7 +5,7 @@ import (
 	"opennamu/route/tool"
 )
 
-func Api_func_auth_list(call_arg []string) string {
+func Api_func_auth(call_arg []string) string {
 	other_set := map[string]string{}
 	json.Unmarshal([]byte(call_arg[0]), &other_set)
 

+ 4 - 1
route_go/route/tool/acl_and_auth.go

@@ -289,6 +289,9 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 			acl_pass_auth = "owner"
 			acl_data = "owner"
 		} else if tool == "ban_auth" {
+			acl_pass_auth = "ban"
+			acl_data = "owner"
+		} else if tool == "bbs_auth" {
 			acl_pass_auth = "bbs"
 			acl_data = "owner"
 		} else if tool == "toron_auth" {
@@ -458,7 +461,7 @@ func Check_acl(db *sql.DB, name string, topic_number string, tool string, ip str
 				}
 				defer stmt.Close()
 
-				err = stmt.QueryRow(topic_number).Scan(&acl_data)
+				err = stmt.QueryRow(name).Scan(&acl_data)
 				if err != nil {
 					if err == sql.ErrNoRows {
 						acl_data = ""

+ 1 - 1
version.json

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