Logo Search packages:      
Sourcecode: zope-emarket version File versions

def EMarket::EMarket::EMarket::assignNewCookie (   self,
  REQUEST = None,
  RESPONSE = None,
  PATH_INFO = None,
  PARENTS = None 
)

This method allows for assignment of 'random' cookies....
so folks don't have to fill in forms just to shop around...

Definition at line 545 of file EMarket.py.

00545                                                                                         :
        """
        This method allows for assignment of 'random' cookies....
        so folks don't have to fill in forms just to shop around...
        """
        #
        errs = StringIO.StringIO()

        if REQUEST.cookies.has_key('clientCookie'):
            id = REQUEST.cookies['clientCookie']
        else:
            id = 'temp' + `time.time()`

        try:
            if RESPONSE is not None:
                newShopper = self.shopperFolder.newShopper(id,passwd='',email='')
                result = self.set_cookie( REQUEST=REQUEST, RESPONSE=RESPONSE, path=PATH_INFO, parents=PARENTS, clientCookie=id)
                return 0,"Successfully created user and set cookie...." + result
            else:
                raise RuntimeError, "Hello? This needs a RESPONSE!"
        except:
            traceback.print_exc(file=errs)
            errs.seek(0)
            return 1, "failed to create new shopper. \n" + errs.read()
        
    def addShopper(self, id, passwd, passwd2, email, REQUEST=None ):


Generated by  Doxygen 1.6.0   Back to index