Răsfoiți Sursa

Merge pull request #287 from Lupul/bugfix-0504

Webmail bugfixes (syntax errors, php-fpm compatibility)
Kristan Kenney 6 ani în urmă
părinte
comite
511dfa340e

+ 1 - 1
bin/v-add-webmail

@@ -41,7 +41,7 @@ get_user_ip
 #                    Verifications                         #
 #                    Verifications                         #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
-check_args '3' "$#" 'USER DOMAIN [RESTART]'
+check_args '2' "$#" 'USER DOMAIN [RESTART]'
 is_format_valid 'user' 'domain'
 is_format_valid 'user' 'domain'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'

+ 4 - 4
bin/v-delete-mail-domain-ssl

@@ -8,15 +8,15 @@
 #                    Variable&Function                     #
 #                    Variable&Function                     #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
+# Argument definition
+user=$1
+domain=$2
+
 # Includes
 # Includes
 source $HESTIA/func/main.sh
 source $HESTIA/func/main.sh
 source $HESTIA/func/domain.sh
 source $HESTIA/func/domain.sh
 source $HESTIA/conf/hestia.conf
 source $HESTIA/conf/hestia.conf
 
 
-# Argument definition
-user=$1
-domain=$2
-
 # Additional argument formatting
 # Additional argument formatting
 format_domain
 format_domain
 format_domain_idn
 format_domain_idn

+ 4 - 1
bin/v-update-web-templates

@@ -41,7 +41,7 @@ fi
 cp -rf $HESTIA/install/$type/templates/web $HESTIA/data/templates/
 cp -rf $HESTIA/install/$type/templates/web $HESTIA/data/templates/
 
 
 # Update Multiphp templates
 # Update Multiphp templates
-php_versions=$( ls -l /etc/php/ | grep ^d | wc -l )
+php_versions=$(ls /etc/php/*/fpm -d | wc -l)
 if [ "$php_versions" -gt 1 ]; then
 if [ "$php_versions" -gt 1 ]; then
     if [ "$WEB_SYSTEM" = "nginx" ]; then
     if [ "$WEB_SYSTEM" = "nginx" ]; then
         for tplname in $(ls $HESTIA/data/templates/web/$WEB_SYSTEM/ | grep -v 'default'); do
         for tplname in $(ls $HESTIA/data/templates/web/$WEB_SYSTEM/ | grep -v 'default'); do
@@ -49,6 +49,9 @@ if [ "$php_versions" -gt 1 ]; then
         done
         done
     fi
     fi
     for v in $(ls /etc/php/); do
     for v in $(ls /etc/php/); do
+        if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
+            continue
+        fi
         v_tpl=$(echo "$v" | sed -e 's/[.]//')
         v_tpl=$(echo "$v" | sed -e 's/[.]//')
         cp -f $HESTIA/install/$type/multiphp/$WEB_SYSTEM/PHP-$v_tpl.* $HESTIA/data/templates/web/$WEB_SYSTEM/
         cp -f $HESTIA/install/$type/multiphp/$WEB_SYSTEM/PHP-$v_tpl.* $HESTIA/data/templates/web/$WEB_SYSTEM/
     done
     done

+ 0 - 1
install/deb/templates/mail/nginx/web_system.stpl

@@ -19,7 +19,6 @@ server {
     location / {
     location / {
         try_files $uri $uri/ /index.php?$args;
         try_files $uri $uri/ /index.php?$args;
         location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
         location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
-            alias /var/lib/roundcube/;
             expires 1h;
             expires 1h;
             fastcgi_hide_header "Set-Cookie";
             fastcgi_hide_header "Set-Cookie";
         }
         }

+ 0 - 1
install/deb/templates/mail/nginx/web_system.tpl

@@ -19,7 +19,6 @@ server {
     location / {
     location / {
         try_files $uri $uri/ /index.php?$args;
         try_files $uri $uri/ /index.php?$args;
         location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
         location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
-            alias /var/lib/roundcube/;
             expires 1h;
             expires 1h;
             fastcgi_hide_header "Set-Cookie";
             fastcgi_hide_header "Set-Cookie";
         }
         }

+ 11 - 4
install/upgrade/0.10.0-190430.sh

@@ -145,9 +145,13 @@ chmod 751 $HESTIA/data/templates/web/unassigned/js
 chmod 751 $HESTIA/data/templates/web/unassigned/webfonts
 chmod 751 $HESTIA/data/templates/web/unassigned/webfonts
 
 
 # Correct other permissions
 # Correct other permissions
-chown bind:bind /var/cache/bind
-chmod 640 /etc/roundcube/debian-db*
-chown root:www-data /etc/roundcube/debian-db*
+if [ -d "/var/cache/bind" ]; then
+    chown bind:bind /var/cache/bind
+fi
+if [ -d "/etc/roundcube" ]; then
+    chmod 640 /etc/roundcube/debian-db*
+    chown root:www-data /etc/roundcube/debian-db*
+fi
 
 
 # Add unassigned hosts configuration to Nginx and Apache
 # Add unassigned hosts configuration to Nginx and Apache
 if [ "$WEB_SYSTEM" = "apache2" ]; then
 if [ "$WEB_SYSTEM" = "apache2" ]; then
@@ -174,9 +178,12 @@ if [ "$PROXY_SYSTEM" = "nginx" ]; then
 fi
 fi
 
 
 # Fix empty pool error message for MultiPHP
 # Fix empty pool error message for MultiPHP
-php_versions=$( ls -l /etc/php/ | grep ^d | wc -l )
+php_versions=$(ls /etc/php/*/fpm -d | wc -l)
 if [ "$php_versions" -gt 1 ]; then
 if [ "$php_versions" -gt 1 ]; then
     for v in $(ls /etc/php/); do
     for v in $(ls /etc/php/); do
+        if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
+            continue
+        fi
         cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
         cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
         v1=$(echo "$v" | sed -e 's/[.]//')
         v1=$(echo "$v" | sed -e 's/[.]//')
         sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf
         sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf

+ 3 - 3
web/edit/mail/index.php

@@ -154,7 +154,7 @@ if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (empty($_GET['accou
 
 
     // Add antivirs
     // Add antivirs
     if (($v_antivirus == 'no') && (!empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) {
     if (($v_antivirus == 'no') && (!empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) {
-        exec (HESTIA_CMD."v-add-mail-domain-antivirus ".$v_username." ".$escapeshellarg($v_domain), $output, $return_var);
+        exec (HESTIA_CMD."v-add-mail-domain-antivirus ".$v_username." ".escapeshellarg($v_domain), $output, $return_var);
         check_return_code($return_var,$output);
         check_return_code($return_var,$output);
         $v_antivirus = 'yes';
         $v_antivirus = 'yes';
         unset($output);
         unset($output);
@@ -162,7 +162,7 @@ if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (empty($_GET['accou
 
 
     // Delete DKIM
     // Delete DKIM
     if (($v_dkim == 'yes') && (empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) {
     if (($v_dkim == 'yes') && (empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) {
-        exec (HESTIA_CMD."v-delete-mail-domain-dkim ".$v_username." ".$escapeshellarg($v_domain), $output, $return_var);
+        exec (HESTIA_CMD."v-delete-mail-domain-dkim ".$v_username." ".escapeshellarg($v_domain), $output, $return_var);
         check_return_code($return_var,$output);
         check_return_code($return_var,$output);
         $v_dkim = 'no';
         $v_dkim = 'no';
         unset($output);
         unset($output);
@@ -170,7 +170,7 @@ if ((!empty($_POST['save'])) && (!empty($_GET['domain'])) && (empty($_GET['accou
 
 
     // Add DKIM
     // Add DKIM
     if (($v_dkim == 'no') && (!empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) {
     if (($v_dkim == 'no') && (!empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) {
-        exec (HESTIA_CMD."v-add-mail-domain-dkim ".$v_username." ".$escapeshellarg($v_domain), $output, $return_var);
+        exec (HESTIA_CMD."v-add-mail-domain-dkim ".$v_username." ".escapeshellarg($v_domain), $output, $return_var);
         check_return_code($return_var,$output);
         check_return_code($return_var,$output);
         $v_dkim = 'yes';
         $v_dkim = 'yes';
         unset($output);
         unset($output);