{

if ((${'mozilla-mcd'}{'status'} || 'disabled') eq 'enabled'){
    my $access = ${'mozilla-mcd'}{'access'} || 'private';
    $access = ($access eq 'public') ? "all" : "$localAccess $externalSSLAccess";

    my $php =<<'_EOF';
    AddType application/x-httpd-php .php
    php_admin_value open_basedir /usr/share/mozilla-mcd
_EOF

    if ($fastcgi_mod eq 'mod_fastcgi'){
        $php =<<'_EOF';
    AddHandler php-fastcgi .php
_EOF
    }
    elsif ($fastcgi_mod eq 'mod_proxy_fcgi'){
        $php =<<'_EOF';
     <FilesMatch \.php$>
         SetHandler "proxy:unix:/var/run/php-fpm/php.sock|fcgi://localhost"
     </FilesMatch>
_EOF
    }

    $OUT .=<<"EOF";

Alias /thunderbird.cfg /usr/share/mozilla-mcd/thunderbird.php
Alias /firefox.cfg /usr/share/mozilla-mcd/firefox.php

<Directory /usr/share/mozilla-mcd/>
$php
    Order deny,allow
    Deny from all
    Allow from $access
    <FilesMatch "conf\.php$">
        order deny,allow
        Deny from all
    </FilesMatch>
</Directory>

EOF
}
else{
    $OUT .= "# Mozilla MCD is disabled\n";
}
}
