Formatting for better readability
This commit is contained in:
parent
3e97c154a0
commit
be742c78e7
2 changed files with 8 additions and 3 deletions
|
@ -56,9 +56,10 @@ class UiWebsocketPlugin(object):
|
|||
if "ADMIN" in self.getPermissions(to):
|
||||
self.cbMuteRemove(to, auth_address)
|
||||
else:
|
||||
cert_user_id = html.escape(filter_storage.file_content["mutes"][auth_address]["cert_user_id"])
|
||||
self.cmd(
|
||||
"confirm",
|
||||
[_["Unmute <b>%s</b>?"] % html.escape(filter_storage.file_content["mutes"][auth_address]["cert_user_id"]), _["Unmute"]],
|
||||
[_["Unmute <b>%s</b>?"] % cert_user_id, _["Unmute"]],
|
||||
lambda res: self.cbMuteRemove(to, auth_address)
|
||||
)
|
||||
|
||||
|
@ -180,7 +181,7 @@ class SiteStoragePlugin(object):
|
|||
@PluginManager.registerTo("UiRequest")
|
||||
class UiRequestPlugin(object):
|
||||
def actionWrapper(self, path, extra_headers=None):
|
||||
match = re.match("/(?P<address>[A-Za-z0-9\._-]+)(?P<inner_path>/.*|$)", path)
|
||||
match = re.match(r"/(?P<address>[A-Za-z0-9\._-]+)(?P<inner_path>/.*|$)", path)
|
||||
if not match:
|
||||
return False
|
||||
address = match.group("address")
|
||||
|
|
|
@ -32,7 +32,11 @@ class UiWebsocketPlugin(object):
|
|||
if super(UiWebsocketPlugin, self).hasSitePermission(address, cmd=cmd):
|
||||
return True
|
||||
|
||||
if not "Cors:%s" % address in self.site.settings["permissions"] or cmd not in ["fileGet", "fileList", "dirList", "fileRules", "optionalFileInfo", "fileQuery", "dbQuery", "userGetSettings", "siteInfo"]:
|
||||
allowed_commands = [
|
||||
"fileGet", "fileList", "dirList", "fileRules", "optionalFileInfo",
|
||||
"fileQuery", "dbQuery", "userGetSettings", "siteInfo"
|
||||
]
|
||||
if not "Cors:%s" % address in self.site.settings["permissions"] or cmd not in allowed_commands:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue