comparison src/core/sat_main.py @ 336:953536246d9d

core: added email in registerNewAccount
author Goffi <goffi@goffi.org>
date Wed, 25 May 2011 17:18:05 +0200
parents 8c9b9ef13ba1
children 9eebdc655b8b
comparison
equal deleted inserted replaced
335:99206631503e 336:953536246d9d
263 profile = self.memory.getProfileName(profile_key) 263 profile = self.memory.getProfileName(profile_key)
264 if not profile: 264 if not profile:
265 return None 265 return None
266 return self.profiles[profile] 266 return self.profiles[profile]
267 267
268 def registerNewAccount(self, login, password, server, port = 5222, id = None): 268 def registerNewAccount(self, login, password, email, server, port = 5222, id = None):
269 """Connect to a server and create a new account using in-band registration""" 269 """Connect to a server and create a new account using in-band registration"""
270 270
271 next_id = id or sat_next_id() #the id is used to send server's answer 271 next_id = id or sat_next_id() #the id is used to send server's answer
272 serverRegistrer = xmlstream.XmlStreamFactory(xmpp.RegisteringAuthenticator(self, server, login, password, next_id)) 272 serverRegistrer = xmlstream.XmlStreamFactory(xmpp.RegisteringAuthenticator(self, server, login, password, email, next_id))
273 connector = reactor.connectTCP(server, port, serverRegistrer) 273 connector = reactor.connectTCP(server, port, serverRegistrer)
274 serverRegistrer.clientConnectionLost = lambda conn, reason: connector.disconnect() 274 serverRegistrer.clientConnectionLost = lambda conn, reason: connector.disconnect()
275 275
276 return next_id 276 return next_id
277 277
302 del self.__private_data[id] 302 del self.__private_data[id]
303 if accepted: 303 if accepted:
304 user = jid.parse(self.memory.getParamA("JabberID", "Connection", profile_key=profile))[0] 304 user = jid.parse(self.memory.getParamA("JabberID", "Connection", profile_key=profile))[0]
305 password = self.memory.getParamA("Password", "Connection", profile_key=profile) 305 password = self.memory.getParamA("Password", "Connection", profile_key=profile)
306 server = self.memory.getParamA("Server", "Connection", profile_key=profile) 306 server = self.memory.getParamA("Server", "Connection", profile_key=profile)
307 self.registerNewAccount(user, password, server, id=action_id) 307 self.registerNewAccount(user, password, None, server, id=action_id)
308 else: 308 else:
309 self.actionResult(action_id, "SUPPRESS", {}) 309 self.actionResult(action_id, "SUPPRESS", {})
310 310
311 def submitForm(self, action, target, fields, profile_key='@DEFAULT@'): 311 def submitForm(self, action, target, fields, profile_key='@DEFAULT@'):
312 """submit a form 312 """submit a form