Ignore:
Timestamp:
27 Nov 2011, 08:07:01 (13 years ago)
Author:
Henrik Bettermann
Message:

Add name of administrator which is displayed on contact form.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r7222 r7223  
    463463    pnav = 2
    464464
     465    @property
     466    def config(self):
     467        return grok.getSite()['configuration']
     468
    465469    def title(self):
    466470        """Return True if the calling user is authenticated.
     
    468472        userid = self.request.principal.id
    469473        if userid != 'zope.anybody':
    470             tt = u'Contact'
     474            tt = u'Contact %s' % self.config.name_admin
    471475        else:
    472476            tt = u'Enquiries'
     
    510514        msg = MIMEText(text % (fullname,regno,descr))
    511515        msg['From'] = '%s <%s>' % (fullname,email)
    512 
    513         config = grok.getSite()['configuration']
    514         msg['To'] = config.email_admin
    515         msg['Subject'] = config.email_subject
    516         server = smtplib.SMTP(config.smtp_server)
    517         if config.smtp_requires_login:
    518             server.login(config.smtp_username,config.smtp_password)
    519         server.sendmail(email,config.email_admin,msg.as_string())
     516       
     517        msg['To'] = self.config.email_admin
     518        msg['Subject'] = self.config.email_subject
     519        server = smtplib.SMTP(self.config.smtp_server)
     520        if self.config.smtp_requires_login:
     521            server.login(self.config.smtp_username,self.config.smtp_password)
     522        server.sendmail(email,self.config.email_admin,msg.as_string())
    520523
    521524        server.quit()
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r7222 r7223  
    311311        )
    312312
     313    name_admin = schema.TextLine(
     314        title = u'Name of Administrator',
     315        default = u'Administrator',
     316        required = False,
     317        )
     318
    313319    email_admin = schema.ASCIILine(
    314         title = u'Email',
     320        title = u'Email Address of Administrator',
    315321        default = 'contact@waeup.org',
    316322        required = False,
Note: See TracChangeset for help on using the changeset viewer.