def sign_in(self, sender, nick, password): sender_ref = api.actor_lookup_mobile(api.ROOT, sender) if sender_ref: raise exception.ValidationError( "You are already signed in, please SIGN OUT first") user_ref = user.authenticate_user_login(nick, password) if not user_ref: raise exception.ValidationError("Username or password is incorrect") mobile_ref = api.mobile_associate(api.ROOT, user_ref.nick, sender) # if they need to double opt in send them the confirmation message welcome = ' '.join([HELP_WELCOME_NICK % user_ref.display_nick(), HELP_POST, HELP_START, HELP_CHARGES ]) self.send_message([sender], welcome)
def sign_in(self, from_jid, nick, password): jid_ref = api.actor_lookup_im(api.ROOT, from_jid.base()) if jid_ref: raise exception.ValidationError( "You are already signed in, please SIGN OUT first") user_ref = user.authenticate_user_login(nick, password) if not user_ref: raise exception.ValidationError( "Username or password is incorrect") im_ref = api.im_associate(api.ROOT, user_ref.nick, from_jid.base()) welcome = '\n'.join([ HELP_WELCOME_NICK % user_ref.display_nick(), HELP_POST, HELP_CHANNEL_POST, HELP_COMMENT, HELP_FOLLOW, HELP_STOP, HELP_MORE, HELP_FOOTER ]) self.send_message([from_jid], welcome)
def sign_in(self, sender, nick, password): sender_ref = api.actor_lookup_mobile(api.ROOT, sender) if sender_ref: raise exception.ValidationError( "You are already signed in, please SIGN OUT first") user_ref = user.authenticate_user_login(nick, password) if not user_ref: raise exception.ValidationError( "Username or password is incorrect") mobile_ref = api.mobile_associate(api.ROOT, user_ref.nick, sender) # if they need to double opt in send them the confirmation message welcome = ' '.join([ HELP_WELCOME_NICK % user_ref.display_nick(), HELP_POST, HELP_START, HELP_CHARGES ]) self.send_message([sender], welcome)
def sign_in(self, from_jid, nick, password): jid_ref = api.actor_lookup_im(api.ROOT, from_jid.base()) if jid_ref: raise exception.ValidationError( "You are already signed in, please SIGN OUT first") user_ref = user.authenticate_user_login(nick, password) if not user_ref: raise exception.ValidationError("Username or password is incorrect") im_ref = api.im_associate(api.ROOT, user_ref.nick, from_jid.base()) welcome = '\n'.join([HELP_WELCOME_NICK % user_ref.display_nick(), HELP_POST, HELP_CHANNEL_POST, HELP_COMMENT, HELP_FOLLOW, HELP_STOP, HELP_MORE, HELP_FOOTER]) self.send_message([from_jid], welcome)