comparison src/plugins/plugin_misc_account.py @ 672:712e3782af12

plugin misc_account: added method getNewAccountDomain
author souliane <souliane@mailoo.org>
date Thu, 07 Nov 2013 17:01:40 +0100
parents 53de6954e94e
children 32bbabe809da
comparison
equal deleted inserted replaced
671:4e691a231763 672:712e3782af12
85 85
86 def __init__(self, host): 86 def __init__(self, host):
87 info(_(u"Plugin Account initialization")) 87 info(_(u"Plugin Account initialization"))
88 self.host = host 88 self.host = host
89 host.bridge.addMethod("registerSatAccount", ".plugin", in_sign='sss', out_sign='', method=self._registerAccount, async=True) 89 host.bridge.addMethod("registerSatAccount", ".plugin", in_sign='sss', out_sign='', method=self._registerAccount, async=True)
90 host.bridge.addMethod("getNewAccountDomain", ".plugin", in_sign='', out_sign='s', method=self._getNewAccountDomain, async=False)
90 if not self._prosody_path: 91 if not self._prosody_path:
91 paths = which(_PROSODYCTL) 92 paths = which(_PROSODYCTL)
92 if not paths: 93 if not paths:
93 error(_("Can't find %s") % (_PROSODYCTL, )) 94 error(_("Can't find %s") % (_PROSODYCTL, ))
94 else: 95 else:
183 msg['From'] = _email_from 184 msg['From'] = _email_from
184 msg['To'] = _REG_ADMIN_EMAIL 185 msg['To'] = _REG_ADMIN_EMAIL
185 186
186 d = sendmail(_email_host, _email_from, _REG_ADMIN_EMAIL, msg.as_string()) 187 d = sendmail(_email_host, _email_from, _REG_ADMIN_EMAIL, msg.as_string())
187 d.addCallbacks(email_ok, email_ko) 188 d.addCallbacks(email_ok, email_ko)
189
190 def _getNewAccountDomain(self):
191 """@return: the domain that will be set to new account"""
192 return _NEW_ACCOUNT_DOMAIN
193