diff --git a/plugins/disabled-Multiuser/MultiuserPlugin.py b/plugins/disabled-Multiuser/MultiuserPlugin.py index 8153ccb7..7fd70dd1 100644 --- a/plugins/disabled-Multiuser/MultiuserPlugin.py +++ b/plugins/disabled-Multiuser/MultiuserPlugin.py @@ -128,9 +128,12 @@ class UiWebsocketPlugin(object): def actionUserLogout(self, to): if "ADMIN" not in self.site.settings["permissions"]: return self.response(to, "Logout not allowed") - message = "You have been logged out. Login to another account" - message += "" + message = "You have been logged out. Login to another account" self.cmd("notification", ["done", message, 1000000]) # 1000000 = Show ~forever :) + + script = "document.cookie = 'master_address=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/';" + script += "$('#button_notification').on('click', function() { zeroframe.cmd(\"userLoginForm\", []); });" + self.cmd("injectScript", script) # Delete from user_manager user_manager = sys.modules["User.UserManager"].user_manager if self.user.master_address in user_manager.users: @@ -151,10 +154,10 @@ class UiWebsocketPlugin(object): if not user: user = user_manager.create(master_seed=master_seed) if user.master_address: - message = "Successfull login, reloading page..." - message += "" % user.master_address - message += "" - self.cmd("notification", ["done", message]) + script = "document.cookie = 'master_address=%s;path=/;max-age=2592000;';" % user.master_address + script += "zeroframe.cmd('wrapperReload', ['login=done']);" + self.cmd("notification", ["done", "Successfull login, reloading page..."]) + self.cmd("injectScript", script) else: self.cmd("notification", ["error", "Error: Invalid master seed"]) self.actionUserLoginForm(0) @@ -178,9 +181,9 @@ class UiWebsocketPlugin(object): } Hello, welcome to ZeroProxy!
A new, unique account created for you:
- +
- or Download backup as text file
@@ -191,8 +194,20 @@ class UiWebsocketPlugin(object): This site allows you to browse ZeroNet content, but if you want to secure your account
and help to keep the network alive, then please run your own ZeroNet client.
""".replace("{master_seed}", master_seed) + self.cmd("notification", ["info", message]) + script = """ + $("#button_notification_masterseed").on("click", function() { + this.value = "{master_seed}"; this.setSelectionRange(0,100); + }) + $("#button_notification_download").on("mousedown", function() { + this.href = window.URL.createObjectURL(new Blob(["ZeroNet user master seed:\\r\\n{master_seed}"])) + }) + """.replace("{master_seed}", master_seed) + self.cmd("injectScript", script) + + def actionPermissionAdd(self, to, permission): if permission == "NOSANDBOX": self.cmd("notification", ["info", "You can't disable sandbox on this proxy!"])