mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fixed bug where if a user created a server they would not have access to it.
This commit is contained in:
parent
e40fb45853
commit
67008f0e37
@ -569,6 +569,11 @@ class db_shortcuts:
|
||||
#logger.debug("user: ({}) {}".format(user_id, user))
|
||||
return user
|
||||
|
||||
@staticmethod
|
||||
def add_user_server(server_id, user_id):
|
||||
servers = User_Servers.insert({User_Servers.server_id: server_id, User_Servers.user_id: user_id}).execute()
|
||||
return servers
|
||||
|
||||
|
||||
@staticmethod
|
||||
def user_query(user_id):
|
||||
|
@ -201,6 +201,7 @@ class ServerHandler(BaseHandler):
|
||||
server_type, server_version = server_parts
|
||||
# todo: add server type check here and call the correct server add functions if not a jar
|
||||
new_server_id = self.controller.create_jar_server(server_type, server_version, server_name, min_mem, max_mem, port)
|
||||
db_helper.add_user_server(new_server_id, exec_user_id)
|
||||
db_helper.add_to_audit_log(exec_user_data['user_id'],
|
||||
"created a {} {} server named \"{}\"".format(server_version, str(server_type).capitalize(), server_name), # Example: Admin created a 1.16.5 Bukkit server named "survival"
|
||||
new_server_id,
|
||||
|
Loading…
Reference in New Issue
Block a user