예제 #1
0
 def inputfield(self, escape_html_chars='<>":={}()', label=0):
     s = [
         '<select id="%s" name="%s" %s  size="%d" %s>' %
         (self.name, self.name, self.__accesskeyfield__(), self.size,
          " multiple" * (self.multiselect > 0))
     ]
     for i in self.options:
         if type(i) is types.TupleType:
             optionvalue = i[0]
             optiontext = i[1]
         else:
             optionvalue = optiontext = i
         if type(self.default) is types.ListType:
             optionselected = optionvalue in self.default
         else:
             optionselected = optionvalue == self.default
         s.append('<option value="%s"%s>%s</option>' %
                  (charset.recode(
                      charset.escapeHTML(optionvalue, escape_html_chars),
                      self.charset, 'html4'), ' selected' *
                   (optionselected),
                   charset.recode(
                       charset.escapeHTML(optiontext, escape_html_chars),
                       self.charset, 'html4')))
     s.append('</select>')
     return self.__label__(label) + self.inputfield_template % string.join(
         s, '\n')
예제 #2
0
 def contentprint(self):
     """
 HTML output of self.content using the print template
 in self.contentprint_template.
 """
     return self.contentprint_template % (charset.recode(
         charset.escapeHTML(self.content), self.charset, 'html4'))
예제 #3
0
 def contentprint(self):
   """
   HTML output of self.content using the print template
   in self.contentprint_template.
   """
   return self.contentprint_template % (
     charset.recode(
       charset.escapeHTML(self.content),
       self.charset,'html4'
     )
   )
예제 #4
0
  def inputfield(self,escape_html_chars='<>":={}()',label=0):
    s = ['<select id="%s" name="%s" %s  size="%d" %s>' % (
      self.name,self.name,self.__accesskeyfield__(),self.size," multiple"*(self.multiselect>0))]
    for i in self.options:
      if type(i) is types.TupleType:
        optionvalue = i[0]
	optiontext = i[1]
      else:
        optionvalue = optiontext = i
      if type(self.default) is types.ListType:
	optionselected = optionvalue in self.default
      else:
	optionselected = optionvalue == self.default
      s.append(
	'<option value="%s"%s>%s</option>' % (
	  charset.recode(charset.escapeHTML(optionvalue,escape_html_chars),self.charset,'html4'),
	  ' selected'*(optionselected),
	  charset.recode(charset.escapeHTML(optiontext,escape_html_chars),self.charset,'html4')
	)
      )
    s.append('</select>')
    return self.__label__(label)+self.inputfield_template % string.join(s,'\n')
예제 #5
0
  mail_msg_paramlist = []
  for i in formKeys:
    if (i in form.inputkeys) and form.field[i][0].content:
      mail_msg_paramlist.append('%s = %s' % (i,form.field[i][0].content))
  mail_msg = '%s%s' % (mail_msg,string.join(mail_msg_paramlist,'\n'))

  try:
    smtpconn=smtplib.SMTP(MailRelay)
    smtpconn.set_debuglevel(0)
    try:
      smtpconn.sendmail(caCertReqMailAdr,[to_addr],mail_msg)
    except:
      htmlbase.PrintErrorMsg(
        'Unable to send an e-mail to <B>%s</B>!<BR>Please provide your correct and valid %s or ask your system administrator.' % \
        (
          charset.escapeHTML(to_addr),
          HelpURL(HelpUrlBase,'emailAddress','e-mail address')
        )
      )
      sys.exit(0)
    smtpconn.quit()
  except socket.error:
    htmlbase.PrintErrorMsg('Unable to contact default mail server!')
    sys.exit(0)

htmlbase.PrintHeader('Certificate request stored.')
htmlbase.PrintHeading('Certificate request is stored.')
print """Your certificate request was stored for further processing."""

if caCertReqMailAdr and emailAddress:
  print """<P>You will get an e-mail message with a random ID.
예제 #6
0
 def __defaultprint__(self):
   """
   HTML output of self.content.
   """
   return charset.recode(charset.escapeHTML(self.default),self.charset,'html4')
예제 #7
0
 def __defaultprint__(self):
     """
 HTML output of self.content.
 """
     return charset.recode(charset.escapeHTML(self.default), self.charset,
                           'html4')