core: added the security_limit to setParam

- params with a security greater than security_limit can not be modified
- special value: security_limit < 0 disable the check (all params can be modified)
This commit is contained in:
souliane 2013-09-07 02:03:17 +02:00
commit 2bf3694fd0
3 changed files with 56 additions and 37 deletions

View file

@ -363,8 +363,7 @@ class MainWindow(wx.Frame, QuickApp):
def onParam(self, e):
debug(_("Param request"))
#security_limit = -1
#xmlui = self.bridge.getParamsUI(security_limit, profile_key=self.profile)
#xmlui = self.bridge.getParamsUI(profile_key=self.profile)
#XMLUI(self, xml_data = xmlui)
param=Param(self)

View file

@ -103,7 +103,6 @@ class Param(wx.Frame):
cat_dom.unlink()
self.host.bridge.getParamsForCategory(category,
security_limit=-1,
profile_key=self.host.profile,
callback=gotParams,
errback=errorGettingParams)
@ -137,7 +136,8 @@ class Param(wx.Frame):
def __save_parameters(self):
for param in self.modified:
self.host.bridge.setParam(param[0], self.modified[param], param[1], profile_key = self.host.profile)
self.host.bridge.setParam(param[0], self.modified[param], param[1],
profile_key=self.host.profile)
self.modified.clear()
def onClose(self, event):

View file

@ -145,11 +145,11 @@ class ProfileManager(wx.Panel):
new_pass = self.login_pass.GetValue()
if old_jid != new_jid:
debug(_('Saving new JID and server'))
self.host.bridge.setParam("JabberID", new_jid, "Connection", profile)
self.host.bridge.setParam("Server", JID(new_jid).domain, "Connection", profile)
self.host.bridge.setParam("JabberID", new_jid, "Connection", profile_key=profile)
self.host.bridge.setParam("Server", JID(new_jid).domain, "Connection", profile_key=profile)
if old_pass != new_pass:
debug(_('Saving new password'))
self.host.bridge.setParam("Password", new_pass, "Connection", profile)
self.host.bridge.setParam("Password", new_pass, "Connection", profile_key=profile)
self.host.plug_profile(profile)