Fixed get_protections apache backend

This commit is contained in:
Marc Aymerich 2014-11-10 17:18:04 +00:00
parent 813cfb6f65
commit 856a9bb420
3 changed files with 4 additions and 5 deletions

View File

@ -23,7 +23,7 @@ class WordPressForm(PluginDataForm):
self.fields['site_name'].help_text = mark_safe(url) self.fields['site_name'].help_text = mark_safe(url)
class WordpressService(SoftwareService): class WordPressService(SoftwareService):
verbose_name = "WordPress" verbose_name = "WordPress"
form = WordPressForm form = WordPressForm
description_field = 'site_name' description_field = 'site_name'

View File

@ -2,7 +2,7 @@ from django.conf import settings
SAAS_ENABLED_SERVICES = getattr(settings, 'SAAS_ENABLED_SERVICES', ( SAAS_ENABLED_SERVICES = getattr(settings, 'SAAS_ENABLED_SERVICES', (
'orchestra.apps.saas.services.wordpress.WordpressService', 'orchestra.apps.saas.services.wordpress.WordPressService',
'orchestra.apps.saas.services.drupal.DrupalService', 'orchestra.apps.saas.services.drupal.DrupalService',
'orchestra.apps.saas.services.dokuwiki.DokuwikiService', 'orchestra.apps.saas.services.dokuwiki.DokuwikiService',
'orchestra.apps.saas.services.moodle.MoodleService', 'orchestra.apps.saas.services.moodle.MoodleService',

View File

@ -137,11 +137,10 @@ class Apache2Backend(ServiceController):
return directives return directives
def get_protections(self, site): def get_protections(self, site):
protections = "" protections = ''
__, regex = settings.WEBSITES_OPTIONS['directory_protection']
context = self.get_context(site) context = self.get_context(site)
for protection in site.options.filter(name='directory_protection'): for protection in site.options.filter(name='directory_protection'):
path, name, passwd = re.match(regex, protection.value).groups() path, name, passwd = protection.value.split()
path = os.path.join(context['root'], path) path = os.path.join(context['root'], path)
passwd = os.path.join(self.USER_HOME % context, passwd) passwd = os.path.join(self.USER_HOME % context, passwd)
protections += textwrap.dedent(""" protections += textwrap.dedent("""