From 9df86ecaa976c2dbf86b5965b9df61109a41781e Mon Sep 17 00:00:00 2001 From: shortcutme Date: Wed, 29 Nov 2017 13:49:41 +0100 Subject: [PATCH] Show proxy user seed on certficate added instead of first visit --- plugins/disabled-Multiuser/MultiuserPlugin.py | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/plugins/disabled-Multiuser/MultiuserPlugin.py b/plugins/disabled-Multiuser/MultiuserPlugin.py index 33c86cf6..bae735a2 100644 --- a/plugins/disabled-Multiuser/MultiuserPlugin.py +++ b/plugins/disabled-Multiuser/MultiuserPlugin.py @@ -58,33 +58,6 @@ class UiRequestPlugin(object): if not back_generator: # Wrapper error or not string returned, injection not possible return False - if user_created: - back = back_generator.next() - master_seed = user.master_seed - # Inject the welcome message - inject_html = """ - - - - - - """.replace("\t", "") - inject_html = inject_html.replace("{master_seed}", master_seed) # Set the master seed in the message - - return iter([re.sub("\s*\s*$", inject_html, back)]) # Replace the tags with the injection - elif loggedin: back = back_generator.next() inject_html = """ @@ -193,6 +166,30 @@ class UiWebsocketPlugin(object): else: return super(UiWebsocketPlugin, self).hasCmdPermission(cmd) + def actionCertAdd(self, *args, **kwargs): + super(UiWebsocketPlugin, self).actionCertAdd(*args, **kwargs) + master_seed = self.user.master_seed + # Inject the welcome message + inject_html = """ + + + + """.replace("\t", "") + inject_html = inject_html.replace("{master_seed}", master_seed) # Set the master seed in the message + self.cmd("injectHtml", inject_html) + @PluginManager.registerTo("ConfigPlugin") class ConfigPlugin(object):