Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0050.py @ 1539:98f92a054539
plugins: lowered security limits for non dangerous actions. A reference documentation is in progress to choose values: http://wiki.goffi.org/wiki/Security_Limits/en
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 29 Sep 2015 20:19:43 +0200 |
parents | 4eca4f5e21ec |
children | 94c450972346 |
comparison
equal
deleted
inserted
replaced
1538:55967cf161b1 | 1539:98f92a054539 |
---|---|
217 self.answering = {} | 217 self.answering = {} |
218 host.bridge.addMethod("requestCommand", ".plugin", in_sign='ss', out_sign='s', | 218 host.bridge.addMethod("requestCommand", ".plugin", in_sign='ss', out_sign='s', |
219 method=self._requestCommandsList, | 219 method=self._requestCommandsList, |
220 async=True) | 220 async=True) |
221 self.__requesting_id = host.registerCallback(self._requestingEntity, with_data=True) | 221 self.__requesting_id = host.registerCallback(self._requestingEntity, with_data=True) |
222 host.importMenu((D_("Service"), D_("commands")), self._commandsMenu, security_limit=4, help_string=D_("Execute ad-hoc commands")) | 222 host.importMenu((D_("Service"), D_("commands")), self._commandsMenu, security_limit=2, help_string=D_("Execute ad-hoc commands")) |
223 | 223 |
224 def getHandler(self, profile): | 224 def getHandler(self, profile): |
225 return XEP_0050_handler(self) | 225 return XEP_0050_handler(self) |
226 | 226 |
227 def profileConnected(self, profile): | 227 def profileConnected(self, profile): |
399 """ | 399 """ |
400 form_ui = xml_tools.XMLUI("form", submit_id=self.__requesting_id) | 400 form_ui = xml_tools.XMLUI("form", submit_id=self.__requesting_id) |
401 form_ui.addText(_("Please enter target jid"), 'instructions') | 401 form_ui.addText(_("Please enter target jid"), 'instructions') |
402 form_ui.changeContainer("pairs") | 402 form_ui.changeContainer("pairs") |
403 form_ui.addLabel("jid") | 403 form_ui.addLabel("jid") |
404 jid = form_ui.addString("jid", value=self.host.getClient(profile).jid.host) | 404 form_ui.addString("jid", value=self.host.getClient(profile).jid.host) |
405 return {'xmlui': form_ui.toXml()} | 405 return {'xmlui': form_ui.toXml()} |
406 | 406 |
407 def _statusCallback(self, command_elt, session_data, action, node, profile): | 407 def _statusCallback(self, command_elt, session_data, action, node, profile): |
408 """ Ad-hoc command used to change the "show" part of status """ | 408 """ Ad-hoc command used to change the "show" part of status """ |
409 actions = session_data.setdefault('actions',[]) | 409 actions = session_data.setdefault('actions',[]) |