Beispiel #1
0
 def provide_invite(self,group,inviter,
                     viewname="paloma_enroll",absolute=lambda x:x):
     ''' Invite
     '''
     ret = Enroll(group=group,inviter=inviter)  
     ret.enroll_type = "invite" 
     ret.dt_expire=now() + timedelta(minutes=3)      #:TODO
     ret.url = self.absolute(
                 reverse(viewname,
                     kwargs={"command":"invite","secret": ret.secret,})
               )
     ret.save()
     return ret
Beispiel #2
0
 def provide_invite(self,
                    group,
                    inviter,
                    viewname="paloma_enroll",
                    absolute=lambda x: x):
     ''' Invite
     '''
     ret = Enroll(group=group, inviter=inviter)
     ret.enroll_type = "invite"
     ret.dt_expire = now() + timedelta(minutes=3)  #:TODO
     ret.url = self.absolute(
         reverse(viewname,
                 kwargs={
                     "command": "invite",
                     "secret": ret.secret,
                 }))
     ret.save()
     return ret
Beispiel #3
0
    def provide_signin(self,mailbox,group, viewname="paloma_enroll"):
        ''' Password reset or.. 
            :param mailbox: Mailbox model instance
        '''
        try:
            ret = mailbox.enroll
        except:
            ret = Enroll(mailbox=mailbox,group=group)

        ret.enroll_type = "signin" 
        ret.secret = create_auto_secret()
        ret.url = self.absolute(
                    reverse(viewname,
                        kwargs={"command":"signin","secret": ret.secret,})
                  )
        ret.dt_expire=now() + timedelta(minutes=3)      #:TODO
        ret.save()
        return ret
Beispiel #4
0
    def provide_activate(self,mailbox,group, viewname="paloma_enroll" ):
        ''' Activation     
            :param mailbox: Mailbox model instance
        '''
        try:
            ret = mailbox.enroll
        except:
            ret = Enroll(mailbox=mailbox,group=group)

        ret.enroll_type = "activate" 
        ret.secret = create_auto_secret()
        ret.url = self.absolute(
                    reverse(viewname,
                        kwargs={"command":"activate","secret": ret.secret,})
                  )
        print ret.url
        ret.dt_expire=now() + timedelta(minutes=3)      #:TODO
        ret.save()
        return ret
Beispiel #5
0
    def provide_signin(self, mailbox, group, viewname="paloma_enroll"):
        ''' Password reset or.. 
            :param mailbox: Mailbox model instance
        '''
        try:
            ret = mailbox.enroll
        except:
            ret = Enroll(mailbox=mailbox, group=group)

        ret.enroll_type = "signin"
        ret.secret = create_auto_secret()
        ret.url = self.absolute(
            reverse(viewname,
                    kwargs={
                        "command": "signin",
                        "secret": ret.secret,
                    }))
        ret.dt_expire = now() + timedelta(minutes=3)  #:TODO
        ret.save()
        return ret
Beispiel #6
0
    def provide_activate(self, mailbox, group, viewname="paloma_enroll"):
        ''' Activation     
            :param mailbox: Mailbox model instance
        '''
        try:
            ret = mailbox.enroll
        except:
            ret = Enroll(mailbox=mailbox, group=group)

        ret.enroll_type = "activate"
        ret.secret = create_auto_secret()
        ret.url = self.absolute(
            reverse(viewname,
                    kwargs={
                        "command": "activate",
                        "secret": ret.secret,
                    }))
        print ret.url
        ret.dt_expire = now() + timedelta(minutes=3)  #:TODO
        ret.save()
        return ret