Example #1
0
  def sendTmpl(self, qTemplate = '', mainTable = '', qSuperSearch = '', toaddr = '', lang = ''):

    # Make instance of dTP
    d = dtp.dTP(lang)
    
    # Process template
    d.dTLtmpl.qVars['qTemplate'] = qTemplate
    d.setMainTable(mainTable)
    d.dTLtmpl.qVars['qSuperSearch'] = qSuperSearch
    d.go(script = 1)
         
    try:
      # Send mail
      self.email.sendFileAsMail(fromaddr = self.cp.get('email', 'from'), toaddr = [toaddr,], file = d.fdoutName)
      # Log
      self.log.write('SENDING EMAIL TEMPLATE (%s)%s TO %s' % (lang, qTemplate, toaddr), printLevel = 1)
      # Remove temporary file
      os.remove(d.fdoutName)

    # Any error      
    except:
      # Log
      self.log.write('ERROR SENDING MAIL: %s(%s)' % (sys.exc_info()[0], sys.exc_info()[1]), printLevel = 1)
    
    # Delete instance
    del d
Example #2
0
File: login.py Project: rbe/dmerce
  def __init__(self):
  
    # Call constructor of perms.login
    perms.login.__init__(self)
    
    # Make instance of dtp
    self.dtp = dtp.dTP()

    try:
      # Try to set qLogin
      self.params = self.params + 'qLogin='******'qLogin'] + '&'

    # Any error
    except:
      # Set standard
      self.params = ''

    try:
      # Try to get failURL
      self.failURL = self.cp.get('login', 'failURL')

    # Any error
    except:
      # Log
      self.log.write('SECTION login OPTION failURL NOT SET, USING STANDARD /', printLevel = 1)
      # Set standard
      self.failURL = '/'

    try:
      # Try to get failURL
      self.sendPasswdOKURL = self.cp.get('login', 'sendPasswdOKURL')

    # Any error
    except:
      # Log
      self.log.write('SECTION login OPTION sendPasswdOKURL NOT SET, USING STANDARD /', printLevel = 1)
      # Set standard
      self.sendPasswdOKURL = '/'

    try:
      # Return new URL
      self.sendPasswdErrorURL = self.cp.get('login', 'sendPasswdErrorURL')

    # Any error
    except:
      # Log
      self.log.write('SECTION login OPTION sendPasswdErrorURL NOT SET, USING STANDARD /', printLevel = 1)
      # Set standard
      self.sendPasswdErrorURL = '/'
Example #3
0
    def __init__(self):

        # Call constructor of aDS
        aDataStruct.aDS.__init__(self)

        # Check session
        self.checkSession(SessionMustExist=1, SessionMustBeAuthorized=1)

        # Call constructor of class dTP
        self.__dtp = dtp.dTP()

        # Make instance of misc.email
        self.email = misc.email()

        # Set timestamp of 'now'
        self.timeNow = time.time()