[2454] | 1 | ##parameters=REQUEST |
---|
| 2 | #$Id: reconfig.py 33523 2006-02-27 16:17:45Z fguillaume $ |
---|
| 3 | """ |
---|
| 4 | This script just saves the portal properties from the reconfig_form |
---|
| 5 | template. |
---|
| 6 | """ |
---|
| 7 | |
---|
| 8 | portal = context.portal_url.getPortalObject() |
---|
| 9 | form = REQUEST.form |
---|
| 10 | |
---|
| 11 | # The portal_properties API is dumb, so we change properties directly |
---|
| 12 | # on the portal object. |
---|
| 13 | portal.manage_changeProperties( |
---|
| 14 | email_from_name=form.get('email_from_name'), |
---|
| 15 | email_from_address=form.get('email_from_address'), |
---|
| 16 | title=form.get('title'), |
---|
| 17 | description=form.get('description'), |
---|
| 18 | session=form.get('session'), |
---|
[2628] | 19 | static_dir=form.get('static_dir'), |
---|
[3000] | 20 | institution_title=form.get('institution_title'), |
---|
[4098] | 21 | date1=form.get('date1'), |
---|
| 22 | date2=form.get('date2'), |
---|
| 23 | date3=form.get('date3'), |
---|
| 24 | date4=form.get('date4'), |
---|
| 25 | date5=form.get('date5'), |
---|
| 26 | date6=form.get('date6'), |
---|
[5177] | 27 | enable_acco_booking=form.get('enable_acco_booking'), |
---|
| 28 | enable_payment=form.get('enable_payment'), |
---|
[2454] | 29 | ) |
---|
| 30 | |
---|
| 31 | # Update membership tool properties |
---|
| 32 | portal.portal_membership.manage_changeProperties( |
---|
| 33 | enable_password_reset=form.get('enable_password_reset'), |
---|
| 34 | enable_password_reminder=form.get('enable_password_reminder'), |
---|
| 35 | ) |
---|
| 36 | |
---|
| 37 | # Update registration tool properties |
---|
| 38 | portal.portal_registration.manage_changeProperties( |
---|
| 39 | enable_portal_joining=form.get('enable_portal_joining'), |
---|
| 40 | ) |
---|
| 41 | |
---|
| 42 | # Update MailHost properties |
---|
| 43 | portal.portal_properties.editProperties({ |
---|
| 44 | 'smtp_server': form.get('smtp_server'), |
---|
| 45 | }) |
---|
| 46 | |
---|
| 47 | url = '%s/config_form?portal_status_message=psm_portal_reconfigured' |
---|
| 48 | return REQUEST.RESPONSE.redirect(url % portal.portal_url()) |
---|