From 0c6491590eb89c88b3f859f70962df2d8b75189a Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 11 Jun 2021 12:18:51 +0200 Subject: [PATCH] fix: admin password root --- multi_user/operators.py | 8 +++----- multi_user/preferences.py | 13 ++++++------- multi_user/ui.py | 4 ++-- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/multi_user/operators.py b/multi_user/operators.py index 85bf597..0c3f0d4 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -163,7 +163,7 @@ class SessionStartOperator(bpy.types.Operator): settings = utils.get_preferences() runtime_settings = context.window_manager.session users = bpy.data.window_managers['WinMan'].online_users - admin_pass = runtime_settings.password + admin_pass = settings.password users.clear() deleyables.clear() @@ -921,7 +921,6 @@ class SessionPresetServerAdd(bpy.types.Operator): assert(context) settings = utils.get_preferences() - runtime_settings = context.window_manager.session if settings.server_name in settings.server_preset.keys(): @@ -936,7 +935,7 @@ class SessionPresetServerAdd(bpy.types.Operator): new_server.name = settings.server_name new_server.server_ip = settings.ip new_server.server_port = settings.port - new_server.server_password = runtime_settings.password + new_server.server_password = settings.password settings.server_preset_interface = settings.server_name @@ -979,13 +978,12 @@ class SessionPresetServerOverwrite(bpy.types.Operator): assert(context) settings = utils.get_preferences() - runtime_settings = context.window_manager.session old_server = settings.server_preset.get(settings.server_name) old_server.server_ip = settings.ip old_server.server_port = settings.port - old_server.server_password = runtime_settings.password + old_server.server_password = settings.password settings.server_preset_interface = settings.server_name diff --git a/multi_user/preferences.py b/multi_user/preferences.py index fe08db3..392fde5 100644 --- a/multi_user/preferences.py +++ b/multi_user/preferences.py @@ -70,7 +70,6 @@ def update_server_preset_interface(self, context): self.ip = self.server_preset.get(self.server_preset_interface).server_ip self.port = self.server_preset.get(self.server_preset_interface).server_port self.password = self.server_preset.get(self.server_preset_interface).server_password - # TODO: do password def update_directory(self, context): new_dir = Path(self.cache_directory) @@ -173,6 +172,12 @@ class SessionPrefs(bpy.types.AddonPreferences): description="Custom name of the server", default='local host', ) + password: bpy.props.StringProperty( + name="password", + default=random_string_digits(), + description='Session password', + subtype='PASSWORD' + ) sync_flags: bpy.props.PointerProperty( type=ReplicationFlags ) @@ -545,12 +550,6 @@ class SessionProps(bpy.types.PropertyGroup): description='Connect as admin', default=False ) - password: bpy.props.StringProperty( - name="password", - default=random_string_digits(), - description='Session password', - subtype='PASSWORD' - ) internet_ip: bpy.props.StringProperty( name="internet ip", default="no found", diff --git a/multi_user/ui.py b/multi_user/ui.py index 9041829..38f3779 100644 --- a/multi_user/ui.py +++ b/multi_user/ui.py @@ -168,7 +168,7 @@ class SESSION_PT_settings_network(bpy.types.Panel): row.prop(settings, "init_method", text="") row = box.row() row.label(text="Admin password:") - row.prop(runtime_settings, "password", text="") + row.prop(settings, "password", text="") row = box.row() row.operator("session.start", text="HOST").host = True else: @@ -193,7 +193,7 @@ class SESSION_PT_settings_network(bpy.types.Panel): if runtime_settings.admin: row = box.row() row.label(text="Password:") - row.prop(runtime_settings, "password", text="") + row.prop(settings, "password", text="") row = box.row() row.operator("session.start", text="CONNECT").host = False