Reduce duplicated code in the handling of roundcube's plugins

This commit is contained in:
dkoao 2019-09-27 10:32:14 +00:00
parent 97ac5553e4
commit 658fe0ceeb
1 changed files with 9 additions and 13 deletions

View File

@ -94,6 +94,14 @@ SECRET_KEY=$(dd if=/dev/urandom bs=1 count=18 2>/dev/null | base64 | fold -w 24
# For security, temp and log files are not stored in the default locations # For security, temp and log files are not stored in the default locations
# which are inside the roundcube sources directory. We put them instead # which are inside the roundcube sources directory. We put them instead
# in normal places. # in normal places.
PLUGINS="'html5_notifier', 'archive', 'zipdownload', 'password', 'managesieve', 'jqueryui', 'persistent_login'"
# Add the carddav plugin if the user wants to install Nextcloud
if [ "${DISABLE_NEXTCLOUD}" != "0" ]; then
PLUGINS="$PLUGINS, 'carddav'"
fi
cat > $RCM_CONFIG <<EOF; cat > $RCM_CONFIG <<EOF;
<?php <?php
/* /*
@ -125,19 +133,7 @@ cat > $RCM_CONFIG <<EOF;
\$config['support_url'] = 'https://mailinabox.email/'; \$config['support_url'] = 'https://mailinabox.email/';
\$config['product_name'] = '$PRIMARY_HOSTNAME Webmail'; \$config['product_name'] = '$PRIMARY_HOSTNAME Webmail';
\$config['des_key'] = '$SECRET_KEY'; \$config['des_key'] = '$SECRET_KEY';
EOF \$config['plugins'] = array($PLUGINS);
if [ "${DISABLE_NEXTCLOUD}" == "0" ]; then
cat >> $RCM_CONFIG <<EOF;
\$config['plugins'] = array('html5_notifier', 'archive', 'zipdownload', 'password', 'managesieve', 'jqueryui', 'persistent_login');
EOF
else
cat >> $RCM_CONFIG <<EOF;
\$config['plugins'] = array('html5_notifier', 'archive', 'zipdownload', 'password', 'managesieve', 'jqueryui', 'persistent_login', 'carddav');
EOF
fi
cat >> $RCM_CONFIG <<EOF;
\$config['skin'] = 'larry'; \$config['skin'] = 'larry';
\$config['login_autocomplete'] = 2; \$config['login_autocomplete'] = 2;
\$config['password_charset'] = 'UTF-8'; \$config['password_charset'] = 'UTF-8';