diff --git a/bin/v-add-cron-job b/bin/v-add-cron-job index 3f2c2255d..cd20d26aa 100755 --- a/bin/v-add-cron-job +++ b/bin/v-add-cron-job @@ -74,6 +74,9 @@ increase_user_value $user '$U_CRON_JOBS' # Restart crond $BIN/v-restart-cron +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "added cron job $job" diff --git a/bin/v-add-cron-report b/bin/v-add-cron-report index f42ade3a5..8a3ded277 100755 --- a/bin/v-add-cron-report +++ b/bin/v-add-cron-report @@ -46,6 +46,9 @@ sync_cron_jobs # Restart crond $BIN/v-restart-cron +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "enabled cron reporting" diff --git a/bin/v-add-dns-domain b/bin/v-add-dns-domain index 8224543e9..a415959bb 100755 --- a/bin/v-add-dns-domain +++ b/bin/v-add-dns-domain @@ -162,6 +162,9 @@ increase_user_value "$user" '$U_DNS_RECORDS' "$records" # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-add-dns-record b/bin/v-add-dns-record index 7562218de..6fd66d68b 100755 --- a/bin/v-add-dns-record +++ b/bin/v-add-dns-record @@ -39,7 +39,7 @@ if [ "$rtype" != 'MX' ] && [ "$rtype" != 'SRV' ]; then fi # Add trailing dot at the end of NS/CNAME/MX/PTR/SRV record -fqdn_type=$(echo $rtype | grep "[NS|CNAME|MX|PTR|SRV]") +fqdn_type=$(echo $rtype |grep "NS\|CNAME\|MX\|PTR\|SRV") if [ ! -z "$fqdn_type" ]; then trailing_dot=$(echo $dvalue | grep "\.$") if [ -z $trailing_dot ]; then @@ -107,6 +107,9 @@ increase_user_value "$user" '$U_DNS_RECORDS' # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-add-mail-domain b/bin/v-add-mail-domain index 1051567db..4cb217c29 100755 --- a/bin/v-add-mail-domain +++ b/bin/v-add-mail-domain @@ -18,7 +18,7 @@ domain_idn=$(idn -t --quiet -a "$domain") antispam=${3-yes} antivirus=${4-yes} dkim=${5-yes} -dkim_size=${6-512} +dkim_size=${6-1024} # Includes source $VESTA/func/main.sh diff --git a/bin/v-add-sys-ip b/bin/v-add-sys-ip index 4acd375aa..4ac749e31 100755 --- a/bin/v-add-sys-ip +++ b/bin/v-add-sys-ip @@ -152,7 +152,13 @@ fi # Restart web server $BIN/v-restart-web +if [ $? -ne 0 ]; then + exit E_RESTART +fi $BIN/v-restart-proxy +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "added system ip address $ip" '' 'admin' diff --git a/bin/v-add-web-domain b/bin/v-add-web-domain index 048da8ea8..898d1e15d 100755 --- a/bin/v-add-web-domain +++ b/bin/v-add-web-domain @@ -176,6 +176,9 @@ chmod 660 $USER_DATA/web.conf # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-add-web-domain-alias b/bin/v-add-web-domain-alias index b8000d398..7a27c822a 100755 --- a/bin/v-add-web-domain-alias +++ b/bin/v-add-web-domain-alias @@ -103,7 +103,14 @@ increase_user_value "$user" '$U_WEB_ALIASES' # Adding task to the vesta pipe if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi log_history "added $dom_alias as alias for $domain" diff --git a/bin/v-add-web-domain-proxy b/bin/v-add-web-domain-proxy index cd3d733ba..6a0745b6a 100755 --- a/bin/v-add-web-domain-proxy +++ b/bin/v-add-web-domain-proxy @@ -103,6 +103,9 @@ update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' "$extentions" # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi log_history "enabled proxy support for $domain" diff --git a/bin/v-add-web-domain-ssl b/bin/v-add-web-domain-ssl index ca44e1483..af8cb0790 100755 --- a/bin/v-add-web-domain-ssl +++ b/bin/v-add-web-domain-ssl @@ -126,6 +126,14 @@ update_object_value 'web' 'DOMAIN' "$domain" '$SSL' "yes" # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-cron-job b/bin/v-change-cron-job index ae90ffc18..faca81446 100755 --- a/bin/v-change-cron-job +++ b/bin/v-change-cron-job @@ -65,6 +65,9 @@ sync_cron_jobs # Restart crond $BIN/v-restart-cron +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "changed cron job $job" diff --git a/bin/v-change-dns-domain-ip b/bin/v-change-dns-domain-ip index da4aa1fbe..307fd5cbc 100755 --- a/bin/v-change-dns-domain-ip +++ b/bin/v-change-dns-domain-ip @@ -70,6 +70,9 @@ fi # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-dns-domain-soa b/bin/v-change-dns-domain-soa index 48e2851ba..7b1bf9a38 100755 --- a/bin/v-change-dns-domain-soa +++ b/bin/v-change-dns-domain-soa @@ -64,6 +64,9 @@ fi # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-dns-domain-tpl b/bin/v-change-dns-domain-tpl index d245a548b..d708edb97 100755 --- a/bin/v-change-dns-domain-tpl +++ b/bin/v-change-dns-domain-tpl @@ -88,6 +88,9 @@ fi # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-dns-domain-ttl b/bin/v-change-dns-domain-ttl index 690f57ba6..b05836c26 100755 --- a/bin/v-change-dns-domain-ttl +++ b/bin/v-change-dns-domain-ttl @@ -63,6 +63,9 @@ fi # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-dns-record b/bin/v-change-dns-record index 292aae705..22b41d2f3 100755 --- a/bin/v-change-dns-record +++ b/bin/v-change-dns-record @@ -98,6 +98,9 @@ fi # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-dns-record-id b/bin/v-change-dns-record-id index e5cf6aa31..a9474b56c 100755 --- a/bin/v-change-dns-record-id +++ b/bin/v-change-dns-record-id @@ -70,6 +70,9 @@ fi # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-sys-ip-nat b/bin/v-change-sys-ip-nat index b3b4f9268..a60fb9b3d 100755 --- a/bin/v-change-sys-ip-nat +++ b/bin/v-change-sys-ip-nat @@ -77,6 +77,9 @@ fi # Restart ftp server if [ "$restart" != 'no' ]; then $BIN/v-restart-ftp + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-web-domain-ip b/bin/v-change-web-domain-ip index de88ca78b..429784e60 100755 --- a/bin/v-change-web-domain-ip +++ b/bin/v-change-web-domain-ip @@ -87,7 +87,14 @@ update_object_value 'web' 'DOMAIN' "$domain" '$IP' "$3" # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-web-domain-proxy-tpl b/bin/v-change-web-domain-proxy-tpl index e276868b1..a92c87bf9 100755 --- a/bin/v-change-web-domain-proxy-tpl +++ b/bin/v-change-web-domain-proxy-tpl @@ -94,6 +94,9 @@ update_object_value 'web' 'DOMAIN' "$domain" '$PROXY_EXT' "$extentions" # Restart web if [ "$restart" != 'no' ]; then $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-change-web-domain-sslcert b/bin/v-change-web-domain-sslcert index 204b2e3d7..42b567931 100755 --- a/bin/v-change-web-domain-sslcert +++ b/bin/v-change-web-domain-sslcert @@ -71,7 +71,14 @@ fi # Restart web server $BIN/v-restart-web +if [ $? -ne 0 ]; then + exit E_RESTART +fi + $BIN/v-restart-proxy +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "changed ssl certificate for $domain" diff --git a/bin/v-change-web-domain-sslhome b/bin/v-change-web-domain-sslhome index c2b360f2b..091ad3be1 100755 --- a/bin/v-change-web-domain-sslhome +++ b/bin/v-change-web-domain-sslhome @@ -71,7 +71,14 @@ update_object_value 'web' 'DOMAIN' "$domain" '$SSL_HOME' "$SSL_HOME" # Restart web server $BIN/v-restart-web +if [ $? -ne 0 ]; then + exit E_RESTART +fi + $BIN/v-restart-proxy +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "changed ssl home for $domain to $ssl_home" diff --git a/bin/v-change-web-domain-tpl b/bin/v-change-web-domain-tpl index ff7ae8353..6ba39f903 100755 --- a/bin/v-change-web-domain-tpl +++ b/bin/v-change-web-domain-tpl @@ -75,7 +75,7 @@ fi if [ "$SSL" = 'yes' ]; then conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf" tpl_file="$WEBTPL/$WEB_SYSTEM/$template.stpl" - + del_web_config add_web_config # Running template trigger @@ -96,6 +96,9 @@ update_object_value 'web' 'DOMAIN' "$domain" '$TPL' "$template" # Restart web if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-delete-cron-job b/bin/v-delete-cron-job index 3a62618d5..6e8d8b727 100755 --- a/bin/v-delete-cron-job +++ b/bin/v-delete-cron-job @@ -54,6 +54,9 @@ decrease_user_value "$user" '$U_CRON_JOBS' # Restart crond $BIN/v-restart-cron +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "deleted cron job $job" diff --git a/bin/v-delete-cron-reports b/bin/v-delete-cron-reports index df70b30a7..6ce3fa382 100755 --- a/bin/v-delete-cron-reports +++ b/bin/v-delete-cron-reports @@ -46,6 +46,9 @@ sync_cron_jobs # Restart crond $BIN/v-restart-cron +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "disabled cron reporting" diff --git a/bin/v-delete-dns-domain b/bin/v-delete-dns-domain index 774f53819..61907d514 100755 --- a/bin/v-delete-dns-domain +++ b/bin/v-delete-dns-domain @@ -75,6 +75,9 @@ decrease_user_value "$user" '$U_DNS_RECORDS' "$records" # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns $restart + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-delete-dns-domains b/bin/v-delete-dns-domains index 7e94eae96..dfb361531 100755 --- a/bin/v-delete-dns-domains +++ b/bin/v-delete-dns-domains @@ -43,6 +43,9 @@ done # Restart named $BIN/v-restart-dns +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_event "$OK" "$EVENT" diff --git a/bin/v-delete-dns-domains-src b/bin/v-delete-dns-domains-src index 8c9f4de4e..69f86614b 100755 --- a/bin/v-delete-dns-domains-src +++ b/bin/v-delete-dns-domains-src @@ -46,6 +46,9 @@ done # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-delete-dns-record b/bin/v-delete-dns-record index e3de75fa8..2e02dc5e6 100755 --- a/bin/v-delete-dns-record +++ b/bin/v-delete-dns-record @@ -69,6 +69,9 @@ decrease_user_value "$user" '$U_DNS_RECORDS' # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-delete-domain b/bin/v-delete-domain index be7d487f6..a9c966be8 100755 --- a/bin/v-delete-domain +++ b/bin/v-delete-domain @@ -39,7 +39,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then if [ ! -z "$check_web" ]; then $BIN/v-delete-web-domain $user $domain if [ $? -ne 0 ]; then - exit $? + exit E_RESTART fi fi fi @@ -50,7 +50,7 @@ if [ ! -z "$DNS_SYSTEM" ] && [ "$DNS_SYSTEM" != 'no' ]; then if [ ! -z "$check_dns" ]; then $BIN/v-delete-dns-domain $user $domain if [ $? -ne 0 ]; then - exit $? + exit E_RESTART fi fi fi @@ -61,7 +61,7 @@ if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then if [ ! -z "$check_mail" ]; then $BIN/v-delete-mail-domain $user $domain if [ $? -ne 0 ]; then - exit $? + exit E_RESTART fi fi fi diff --git a/bin/v-delete-sys-ip b/bin/v-delete-sys-ip index 54601bc11..0a1c9aac8 100755 --- a/bin/v-delete-sys-ip +++ b/bin/v-delete-sys-ip @@ -121,7 +121,14 @@ fi # Adding task to the vesta pipe $BIN/v-restart-web +if [ $? -ne 0 ]; then + exit E_RESTART +fi + $BIN/v-restart-proxy +if [ $? -ne 0 ]; then + exit E_RESTART +fi # Logging log_history "deleted system ip address $ip" diff --git a/bin/v-delete-web-domain b/bin/v-delete-web-domain index edba9747e..532ce00ff 100755 --- a/bin/v-delete-web-domain +++ b/bin/v-delete-web-domain @@ -154,7 +154,14 @@ fi # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-delete-web-domain-alias b/bin/v-delete-web-domain-alias index c7b66a474..d6862a5f6 100755 --- a/bin/v-delete-web-domain-alias +++ b/bin/v-delete-web-domain-alias @@ -101,7 +101,14 @@ decrease_user_value "$user" '$U_WEB_ALIASES' # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-delete-web-domain-proxy b/bin/v-delete-web-domain-proxy index 20c4ff4a0..25e6b9d9e 100755 --- a/bin/v-delete-web-domain-proxy +++ b/bin/v-delete-web-domain-proxy @@ -80,6 +80,9 @@ fi # Restart proxy server if [ "$restart" != 'no' ]; then $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-delete-web-domain-ssl b/bin/v-delete-web-domain-ssl index 61d0072d3..d09dc9ad4 100755 --- a/bin/v-delete-web-domain-ssl +++ b/bin/v-delete-web-domain-ssl @@ -92,7 +92,14 @@ decrease_user_value "$user" '$U_WEB_SSL' # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-delete-web-domains b/bin/v-delete-web-domains index ff7052c8a..aff5436d5 100755 --- a/bin/v-delete-web-domains +++ b/bin/v-delete-web-domains @@ -45,7 +45,14 @@ done # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-insert-dns-domain b/bin/v-insert-dns-domain index cdd98de66..949cdfde5 100755 --- a/bin/v-insert-dns-domain +++ b/bin/v-insert-dns-domain @@ -72,6 +72,9 @@ chmod 660 $USER_DATA/dns.conf # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns $restart + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-insert-dns-record b/bin/v-insert-dns-record index cd888471b..29bb3b2cd 100755 --- a/bin/v-insert-dns-record +++ b/bin/v-insert-dns-record @@ -47,6 +47,9 @@ echo "$data" >> $USER_DATA/dns/$domain.conf # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns $restart + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-insert-dns-records b/bin/v-insert-dns-records index 302951e70..5b5b230f0 100755 --- a/bin/v-insert-dns-records +++ b/bin/v-insert-dns-records @@ -50,6 +50,9 @@ fi # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-rebuild-cron-jobs b/bin/v-rebuild-cron-jobs index 0edc1909b..1f229b94b 100755 --- a/bin/v-rebuild-cron-jobs +++ b/bin/v-rebuild-cron-jobs @@ -43,6 +43,9 @@ sync_cron_jobs # Restart crond if [ "$restart" != 'no' ]; then $BIN/v-restart-cron + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-rebuild-dns-domain b/bin/v-rebuild-dns-domain index 564b2aaaa..31be08d13 100755 --- a/bin/v-rebuild-dns-domain +++ b/bin/v-rebuild-dns-domain @@ -78,6 +78,9 @@ update_user_value "$user" '$SUSPENDED_DNS' "$suspended_dns" # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns "$restart" + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-rebuild-dns-domains b/bin/v-rebuild-dns-domains index 2fd2aeee2..e34e38120 100755 --- a/bin/v-rebuild-dns-domains +++ b/bin/v-rebuild-dns-domains @@ -78,6 +78,9 @@ update_user_value "$user" '$SUSPENDED_DNS' "$suspended_dns" # Restart named if [ "$restart" != 'no' ]; then $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-rebuild-web-domains b/bin/v-rebuild-web-domains index 90294eb98..092924455 100755 --- a/bin/v-rebuild-web-domains +++ b/bin/v-rebuild-web-domains @@ -69,7 +69,7 @@ if [ "$domain_counter" -lt 1 ]; then # Deleting web configs rm -f $HOMEDIR/$user/conf/web/* sed -i "/.*\/$user\/.*$WEB_SYSTEM.conf/d" $web_conf - if [ -e "$proxy_conf" ]; then + if [ ! -z "$PROXY_SYSTEM" ]; then sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $proxy_conf fi @@ -103,34 +103,35 @@ else fi # Checking proxy - if [ "$proxy_change" = 'yes' ]; then - tmp_conf="$HOMEDIR/$user/conf/web/tmp_$PROXY_SYSTEM.conf" - conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf" - mv $tmp_conf $conf - proxy_include=$(grep "$conf" $proxy_conf ) - if [ -z "$proxy_include" ]; then - echo "include $conf;" >> $proxy_conf + if [ ! -z "$PROXY_SYSTEM" ]; then + if [ "$proxy_change" = 'yes' ]; then + tmp_conf="$HOMEDIR/$user/conf/web/tmp_$PROXY_SYSTEM.conf" + conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf" + mv $tmp_conf $conf + proxy_include=$(grep "$conf" $proxy_conf ) + if [ -z "$proxy_include" ]; then + echo "include $conf;" >> $proxy_conf + fi + else + conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf" + sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $proxy_conf + rm -f $HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf fi - else - conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf" - sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $proxy_conf - rm -f $HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf - fi - # Checking SSL proxy - if [ "$proxy_change" = 'yes' ] && [ "$ssl_change" = 'yes' ]; then - tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$PROXY_SYSTEM.conf" - conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf" - mv $tmp_conf $conf - proxy_include=$(grep "$conf" $proxy_conf ) - if [ -z "$proxy_include" ]; then - echo "include $conf;" >> $proxy_conf + # Checking SSL proxy + if [ "$proxy_change" = 'yes' ] && [ "$ssl_change" = 'yes' ]; then + tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$PROXY_SYSTEM.conf" + conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf" + mv $tmp_conf $conf + proxy_include=$(grep "$conf" $proxy_conf ) + if [ -z "$proxy_include" ]; then + echo "include $conf;" >> $proxy_conf + fi + else + conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf" + sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $proxy_conf + rm -f $HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf fi - else - conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf" - sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $proxy_conf - rm -f $HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf - fi fi @@ -148,7 +149,14 @@ update_user_value "$user" '$U_WEB_ALIASES' "$user_aliases" # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-restart-dns b/bin/v-restart-dns index 67025040a..9b3dbae2f 100755 --- a/bin/v-restart-dns +++ b/bin/v-restart-dns @@ -56,6 +56,7 @@ if [ $? -ne 0 ]; then /etc/init.d/$DNS_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then send_email_report + echo "Error: $DNS_SYSTEM restart failed" exit $E_RESTART fi fi diff --git a/bin/v-restart-ftp b/bin/v-restart-ftp index 7d02b0623..c002fc07b 100755 --- a/bin/v-restart-ftp +++ b/bin/v-restart-ftp @@ -48,6 +48,7 @@ fi /etc/init.d/$FTP_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then send_email_report + echo "Error: $FTP_SYSTEM restart failed" exit $E_RESTART fi diff --git a/bin/v-restart-mail b/bin/v-restart-mail index 2247e1200..c1ae4a347 100755 --- a/bin/v-restart-mail +++ b/bin/v-restart-mail @@ -49,6 +49,7 @@ fi /etc/init.d/$MAIL_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then send_email_report + echo "Error: $MAIL_SYSTEM restart failed" exit $E_RESTART fi diff --git a/bin/v-restart-proxy b/bin/v-restart-proxy index c13072a28..89c68437e 100755 --- a/bin/v-restart-proxy +++ b/bin/v-restart-proxy @@ -45,13 +45,11 @@ if [ -z "$PROXY_SYSTEM" ]; then fi # Restart system -/etc/init.d/$PROXY_SYSTEM reload >/dev/null 2>&1 +/etc/init.d/$PROXY_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then - /etc/init.d/$PROXY_SYSTEM restart >/dev/null 2>&1 - if [ $? -ne 0 ]; then - send_email_report - exit $E_RESTART - fi + send_email_report + echo "Error: $PROXY_SYSTEM restart failed" + exit $E_RESTART fi # Update restart queue diff --git a/bin/v-restart-web b/bin/v-restart-web index 568db9fbb..9c321cb60 100755 --- a/bin/v-restart-web +++ b/bin/v-restart-web @@ -53,6 +53,7 @@ if [ "$WEB_SYSTEM" == 'apache2' ]; then /etc/init.d/$WEB_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then send_email_report + echo "Error: $WEB_SYSTEM restart failed" exit $E_RESTART fi fi @@ -62,6 +63,7 @@ else /etc/init.d/$WEB_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then send_email_report + echo "Error: $WEB_SYSTEM restart failed" exit $E_RESTART fi fi diff --git a/bin/v-restore-user b/bin/v-restore-user index a7a6f74c4..fe48dba70 100755 --- a/bin/v-restore-user +++ b/bin/v-restore-user @@ -372,7 +372,15 @@ if [ "$web" != 'no' ]; then # Restart WEB $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi + echo msg="$msg\n" fi @@ -482,6 +490,10 @@ if [ "$dns" != 'no' ]; then # Restart DNS $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi + echo msg="$msg\n" fi @@ -695,6 +707,10 @@ if [ "$cron" != 'no' ]; then # Restart cron $BIN/v-restart-cron + if [ $? -ne 0 ]; then + exit E_RESTART + fi + echo msg="$msg\n" fi diff --git a/bin/v-suspend-cron-job b/bin/v-suspend-cron-job index 393ddda93..a26eae21b 100755 --- a/bin/v-suspend-cron-job +++ b/bin/v-suspend-cron-job @@ -49,6 +49,9 @@ sync_cron_jobs # Restart crond if [ "$restart" != 'no' ]; then $BIN/v-restart-cron + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-suspend-cron-jobs b/bin/v-suspend-cron-jobs index cd6b30771..577860c48 100755 --- a/bin/v-suspend-cron-jobs +++ b/bin/v-suspend-cron-jobs @@ -44,6 +44,9 @@ done # Restart crond if [ "$restart" != 'no' ]; then $BIN/v-restart-cron + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-suspend-dns-domain b/bin/v-suspend-dns-domain index 25b430342..3972fc39f 100755 --- a/bin/v-suspend-dns-domain +++ b/bin/v-suspend-dns-domain @@ -49,6 +49,9 @@ increase_user_value "$user" '$SUSPENDED_DNS' # Restart named #if [ "$restart" != 'no' ]; then # $BIN/v-restart-dns +# if [ $? -ne 0 ]; then +# exit E_RESTART +# fi #fi # Logging diff --git a/bin/v-suspend-dns-domains b/bin/v-suspend-dns-domains index e6083e5dc..0b2a5e895 100755 --- a/bin/v-suspend-dns-domains +++ b/bin/v-suspend-dns-domains @@ -45,6 +45,9 @@ done # Restart dns server #if [ "$restart" != 'no' ]; then # $BIN/v-restart-dns +# if [ $? -ne 0 ]; then +# exit E_RESTART +# fi #fi # Logging diff --git a/bin/v-suspend-dns-record b/bin/v-suspend-dns-record index 417c3add2..30da60def 100755 --- a/bin/v-suspend-dns-record +++ b/bin/v-suspend-dns-record @@ -63,6 +63,9 @@ update_domain_zone # Restart named #if [ "$restart" != 'no' ]; then # $BIN/v-restart-dns +# if [ $? -ne 0 ]; then +# exit E_RESTART +# fi #fi # Logging diff --git a/bin/v-suspend-user b/bin/v-suspend-user index 5a754d05d..d812d23f4 100755 --- a/bin/v-suspend-user +++ b/bin/v-suspend-user @@ -71,8 +71,19 @@ fi # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-cron + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Changing suspend value diff --git a/bin/v-suspend-web-domain b/bin/v-suspend-web-domain index 005b81527..963929953 100755 --- a/bin/v-suspend-web-domain +++ b/bin/v-suspend-web-domain @@ -91,7 +91,14 @@ increase_user_value "$user" '$SUSPENDED_WEB' # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-suspend-web-domains b/bin/v-suspend-web-domains index 29e07c6a6..eda982c62 100755 --- a/bin/v-suspend-web-domains +++ b/bin/v-suspend-web-domains @@ -45,6 +45,14 @@ done # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-unsuspend-cron-job b/bin/v-unsuspend-cron-job index 8a184691b..685bcf177 100755 --- a/bin/v-unsuspend-cron-job +++ b/bin/v-unsuspend-cron-job @@ -49,6 +49,9 @@ sync_cron_jobs # Restart crond if [ "$restart" != 'no' ]; then $BIN/v-restart-cron + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-unsuspend-cron-jobs b/bin/v-unsuspend-cron-jobs index 0f3994fa6..ad0f07e99 100755 --- a/bin/v-unsuspend-cron-jobs +++ b/bin/v-unsuspend-cron-jobs @@ -44,6 +44,9 @@ done # Restart crond if [ "$restart" != 'no' ]; then $BIN/v-restart-cron + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-unsuspend-dns-domain b/bin/v-unsuspend-dns-domain index 4e91f514d..9be0b4c8e 100755 --- a/bin/v-unsuspend-dns-domain +++ b/bin/v-unsuspend-dns-domain @@ -51,6 +51,9 @@ sed -i "s/SUSPENDED='yes'/SUSPENDED='no'/g" $USER_DATA/dns/$domain.conf # Restart named #if [ "$restart" != 'no' ]; then # $BIN/v-restart-dns +# if [ $? -ne 0 ]; then +# exit E_RESTART +# fi #fi # Logging diff --git a/bin/v-unsuspend-dns-domains b/bin/v-unsuspend-dns-domains index 0807912af..f06c22185 100755 --- a/bin/v-unsuspend-dns-domains +++ b/bin/v-unsuspend-dns-domains @@ -45,6 +45,9 @@ done # Restart dns server #if [ "$restart" != 'no' ]; then # $BIN/v-restart-dns +# if [ $? -ne 0 ]; then +# exit E_RESTART +# fi #fi # Logging diff --git a/bin/v-unsuspend-dns-record b/bin/v-unsuspend-dns-record index 3d9d048fd..3d4a53ce7 100755 --- a/bin/v-unsuspend-dns-record +++ b/bin/v-unsuspend-dns-record @@ -62,6 +62,9 @@ update_domain_zone # Restart named #if [ "$restart" != 'no' ]; then # $BIN/v-restart-dns +# if [ $? -ne 0 ]; then +# exit E_RESTART +# fi #fi # Logging diff --git a/bin/v-unsuspend-user b/bin/v-unsuspend-user index 47618a4e1..00a21b6f0 100755 --- a/bin/v-unsuspend-user +++ b/bin/v-unsuspend-user @@ -73,8 +73,19 @@ decrease_user_value 'admin' '$SUSPENDED_USERS' if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-cron + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-unsuspend-web-domain b/bin/v-unsuspend-web-domain index eaae49e56..74e4e5f8b 100755 --- a/bin/v-unsuspend-web-domain +++ b/bin/v-unsuspend-web-domain @@ -88,7 +88,14 @@ decrease_user_value "$user" '$SUSPENDED_WEB' # Restart web erver if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-unsuspend-web-domains b/bin/v-unsuspend-web-domains index d60d07274..a9f713f54 100755 --- a/bin/v-unsuspend-web-domains +++ b/bin/v-unsuspend-web-domains @@ -46,6 +46,14 @@ done # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Logging diff --git a/bin/v-update-sys-ip b/bin/v-update-sys-ip index bde0b008d..b0309b182 100755 --- a/bin/v-update-sys-ip +++ b/bin/v-update-sys-ip @@ -53,6 +53,9 @@ if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then /etc/$PROXY_SYSTEM/conf.d/$new.conf sed -i "s/$old/$new/g" /etc/$PROXY_SYSTEM/conf.d/$new.conf $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi if [ ! -z "$WEB_SYSTEM" ]; then mv /etc/$WEB_SYSTEM/conf.d/$old.conf \ @@ -65,6 +68,9 @@ if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then $BIN/v-rebuild-web-domains $user no done $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi if [ ! -z "$DNS_SYSTEM" ]; then @@ -75,6 +81,9 @@ if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then $BIN/v-rebuild-dns-domains $user no done $BIN/v-restart-dns + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # No further comparation is needed diff --git a/bin/v-update-web-domain-stat b/bin/v-update-web-domain-stat index ba80a5c1d..0443d187b 100755 --- a/bin/v-update-web-domain-stat +++ b/bin/v-update-web-domain-stat @@ -110,7 +110,7 @@ build_awstats() { grep -v icon | sort -r ) for link in $months; do year=$(echo $link |cut -f 1 -d \-) - month=$(echo $link |cut -f 2 -d \-) + month=$(echo $link |cut -f 2 -d \-| sed -e "s/^0//") case "$month" in 1) month='January';; 2) month='February';; diff --git a/bin/v-update-web-templates b/bin/v-update-web-templates index 8d426240b..5f0778409 100755 --- a/bin/v-update-web-templates +++ b/bin/v-update-web-templates @@ -64,7 +64,14 @@ done # Restart web server if [ "$restart" != 'no' ]; then $BIN/v-restart-web + if [ $? -ne 0 ]; then + exit E_RESTART + fi + $BIN/v-restart-proxy + if [ $? -ne 0 ]; then + exit E_RESTART + fi fi # Delete tmpdir diff --git a/func/domain.sh b/func/domain.sh index 4215ae678..07c3a1ce2 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -477,7 +477,7 @@ is_dns_record_critical() { is_dns_fqnd() { t=$1 r=$2 - fqdn_type=$(echo $t | grep "[NS|CNAME|MX|PTR|SRV]") + fqdn_type=$(echo $t | grep "NS\|CNAME\|MX\|PTR\|SRV") tree_length=3 if [ $t = 'CNAME' ]; then tree_length=2 diff --git a/func/main.sh b/func/main.sh index a761bc8f4..eadfbb825 100644 --- a/func/main.sh +++ b/func/main.sh @@ -616,10 +616,17 @@ validate_format_name_s() { # Username validate_format_username() { - if ! [[ "$1" =~ ^[a-zA-Z0-9][-|\.|_|a-zA-Z0-9]{0,28}[a-zA-Z0-9]$ ]]; then - echo "Error: $2 $1 is not valid" - log_event "$E_INVALID" "$EVENT" - exit $E_INVALID + if [ "${#1}" -eq 1 ]; then + if ! [[ "$1" =~ [a-z] ]]; then + echo "Error: $2 $1 is not valid" + exit 1 + fi + else + if ! [[ "$1" =~ ^[a-zA-Z0-9][-|\.|_|a-zA-Z0-9]{0,28}[a-zA-Z0-9]$ ]] + then + echo "Error: $2 $1 is not valid" + exit 1 + fi fi } diff --git a/install/debian/templates/web/nginx/caching.stpl b/install/debian/templates/web/nginx/caching.stpl index 036dc6ee7..ca6cffe32 100755 --- a/install/debian/templates/web/nginx/caching.stpl +++ b/install/debian/templates/web/nginx/caching.stpl @@ -40,5 +40,5 @@ server { location ~ /\.hg/ {return 404;} location ~ /\.bzr/ {return 404;} - include %home%/%user%/conf/nginx.%domain%.conf*; + include %home%/%user%/conf/web/nginx.%domain%.conf*; } diff --git a/install/debian/templates/web/nginx/caching.tpl b/install/debian/templates/web/nginx/caching.tpl index 04e38d445..36761b65c 100755 --- a/install/debian/templates/web/nginx/caching.tpl +++ b/install/debian/templates/web/nginx/caching.tpl @@ -37,5 +37,5 @@ server { location ~ /\.hg/ {return 404;} location ~ /\.bzr/ {return 404;} - include %home%/%user%/conf/nginx.%domain%.conf*; + include %home%/%user%/conf/web/nginx.%domain%.conf*; } diff --git a/install/rhel/templates/web/nginx/caching.stpl b/install/rhel/templates/web/nginx/caching.stpl index 31f6111fa..ca6cffe32 100755 --- a/install/rhel/templates/web/nginx/caching.stpl +++ b/install/rhel/templates/web/nginx/caching.stpl @@ -4,7 +4,7 @@ server { ssl on; ssl_certificate %ssl_pem%; ssl_certificate_key %ssl_key%; - error_log /var/log/httpd/domains/%domain%.error.log error; + error_log /var/log/%web_system%/domains/%domain%.error.log error; location / { proxy_pass http://%ip%:%web_port%; @@ -19,8 +19,8 @@ server { location ~* ^.+\.(%proxy_extentions%)$ { proxy_cache off; root %docroot%; - access_log /var/log/httpd/domains/%domain%.log combined; - access_log /var/log/httpd/domains/%domain%.bytes bytes; + access_log /var/log/%web_system%/domains/%domain%.log combined; + access_log /var/log/%web_system%/domains/%domain%.bytes bytes; expires max; try_files $uri @fallback; } @@ -40,5 +40,5 @@ server { location ~ /\.hg/ {return 404;} location ~ /\.bzr/ {return 404;} - include %home%/%user%/conf/nginx.%domain%.conf*; + include %home%/%user%/conf/web/nginx.%domain%.conf*; } diff --git a/install/rhel/templates/web/nginx/caching.tpl b/install/rhel/templates/web/nginx/caching.tpl index 8860be198..36761b65c 100755 --- a/install/rhel/templates/web/nginx/caching.tpl +++ b/install/rhel/templates/web/nginx/caching.tpl @@ -1,7 +1,7 @@ server { listen %ip%:%proxy_port%; server_name %domain_idn% %alias_idn%; - error_log /var/log/httpd/domains/%domain%.error.log error; + error_log /var/log/%web_system%/domains/%domain%.error.log error; location / { proxy_pass http://%ip%:%web_port%; @@ -16,8 +16,8 @@ server { location ~* ^.+\.(%proxy_extentions%)$ { proxy_cache off; root %docroot%; - access_log /var/log/httpd/domains/%domain%.log combined; - access_log /var/log/httpd/domains/%domain%.bytes bytes; + access_log /var/log/%web_system%/domains/%domain%.log combined; + access_log /var/log/%web_system%/domains/%domain%.bytes bytes; expires max; try_files $uri @fallback; } @@ -37,5 +37,5 @@ server { location ~ /\.hg/ {return 404;} location ~ /\.bzr/ {return 404;} - include %home%/%user%/conf/nginx.%domain%.conf*; + include %home%/%user%/conf/web/nginx.%domain%.conf*; } diff --git a/install/ubuntu/templates/web/nginx/caching.stpl b/install/ubuntu/templates/web/nginx/caching.stpl index 036dc6ee7..ca6cffe32 100755 --- a/install/ubuntu/templates/web/nginx/caching.stpl +++ b/install/ubuntu/templates/web/nginx/caching.stpl @@ -40,5 +40,5 @@ server { location ~ /\.hg/ {return 404;} location ~ /\.bzr/ {return 404;} - include %home%/%user%/conf/nginx.%domain%.conf*; + include %home%/%user%/conf/web/nginx.%domain%.conf*; } diff --git a/install/ubuntu/templates/web/nginx/caching.tpl b/install/ubuntu/templates/web/nginx/caching.tpl index 04e38d445..1462f9e1f 100755 --- a/install/ubuntu/templates/web/nginx/caching.tpl +++ b/install/ubuntu/templates/web/nginx/caching.tpl @@ -37,5 +37,5 @@ server { location ~ /\.hg/ {return 404;} location ~ /\.bzr/ {return 404;} - include %home%/%user%/conf/nginx.%domain%.conf*; + include %home%/%user%/web/conf/nginx.%domain%.conf*; } diff --git a/web/add/dns/index.php b/web/add/dns/index.php index e62f7a686..8f6ec6c8e 100644 --- a/web/add/dns/index.php +++ b/web/add/dns/index.php @@ -40,14 +40,14 @@ if (!empty($_POST['ok'])) { $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); } else { // Add DNS - exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip." ".$v_ns1." ".$v_ns2." ".$v_ns3." ".$v_ns4, $output, $return_var); + exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip." ".$v_ns1." ".$v_ns2." ".$v_ns3." ".$v_ns4." no", $output, $return_var); check_return_code($return_var,$output); unset($output); // Change Expiriation date if ((!empty($_POST['v_exp'])) && ($_POST['v_exp'] != date('Y-m-d', strtotime('+1 year')))) { $v_exp = escapeshellarg($_POST['v_exp']); - exec (VESTA_CMD."v-change-dns-domain-exp ".$user." ".$v_domain." ".$v_exp, $output, $return_var); + exec (VESTA_CMD."v-change-dns-domain-exp ".$user." ".$v_domain." ".$v_exp." no", $output, $return_var); check_return_code($return_var,$output); unset($output); } @@ -55,7 +55,7 @@ if (!empty($_POST['ok'])) { // Change TTL if ((!empty($_POST['v_ttl'])) && ($_POST['v_ttl'] != '14400') && (empty($_SESSION['error_msg']))) { $v_ttl = escapeshellarg($_POST['v_ttl']); - exec (VESTA_CMD."v-change-dns-domain-ttl ".$user." ".$v_domain." ".$v_ttl, $output, $return_var); + exec (VESTA_CMD."v-change-dns-domain-ttl ".$user." ".$v_domain." ".$v_ttl." no", $output, $return_var); check_return_code($return_var,$output); unset($output); } @@ -64,6 +64,13 @@ if (!empty($_POST['ok'])) { $_SESSION['ok_msg'] = __('DNS_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]); unset($v_domain); } + + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-restart-dns", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + } } @@ -120,11 +127,7 @@ if ((empty($_GET['domain'])) && (empty($_POST['domain']))) { } if (empty($v_ttl)) $v_ttl = 14400; if (empty($v_exp)) $v_exp = date('Y-m-d', strtotime('+1 year')); - if ($_SESSION['user'] == 'admin') { - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html'); - } else { - include($_SERVER['DOCUMENT_ROOT'].'/templates/user/add_dns.html'); - } + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html'); unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); } else { diff --git a/web/add/web/index.php b/web/add/web/index.php index 394fb7bc6..db4f525ed 100644 --- a/web/add/web/index.php +++ b/web/add/web/index.php @@ -272,12 +272,7 @@ $v_ftp_email = $panel[$user]['CONTACT']; $stats = json_decode(implode('', $output), true); unset($output); -// Are you admin? -if ($_SESSION['user'] == 'admin') { include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_web.html'); -} else { - include($_SERVER['DOCUMENT_ROOT'].'/templates/user/add_web.html'); -} unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); //} diff --git a/web/css/main.css b/web/css/main.css index 619a3c796..d306de594 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -10,6 +10,16 @@ form { margin: 0; } + +table { + border-collapse: collapse; +} + +td { + padding: 0; +} + + .hidden { display: none; } @@ -263,7 +273,7 @@ form { .submenu-select-block { float:left; - padding-left: 22px; + padding-left: 30px; } .submenu-select-link { @@ -274,7 +284,7 @@ form { letter-spacing: 0.1em; margin: 7px 7px 0 0; text-decoration: none; - padding: 0 4px 0 14px + padding: 0 4px } .submenu-select-link:hover { @@ -441,10 +451,9 @@ form { .data-dotted { text-align: left; vertical-align:top; - border-top:1px dotted #d3d3d3; + border-top: 1px dotted #d3d3d3; padding: 0 0 26px 0; margin: 0; - width: 166px; } .data-dotted td { @@ -453,33 +462,33 @@ form { .data-col1 { text-align: left; - padding:0; + padding: 0; + width: 173px; } .data-col1 tr td { - padding:0 0 6px 24px; + padding:2px 0 6px 26px; } .data-col1 tr:first-child td { - padding:22px 0 0 24px; + padding:24px 0 0 26px; } .data-col2 { text-align: left; - padding: 0; overflow: hidden; + width: 827px; } .data-col5 { - table-layout: fixed; text-align: left; - padding: 0; overflow: hidden; + width: 817px; + table-layout: fixed; white-space: nowrap; } .data-date { - padding: 0 0 0 18; letter-spacing: 0.3em; font-size: 8pt; color: #6A6A6A @@ -489,14 +498,12 @@ form { font-size: 8pt; letter-spacing: 0.1em; color: #81a64f; - padding: 0 0 13 18; } .data-suspended { font-size: 8pt; letter-spacing: 0.1em; color: #de5543; - padding: 0 0 13 18; } .data-controls { @@ -504,7 +511,7 @@ form { height: 16px; border-left: 1px solid #d3d3d3; font-size: 8pt; - padding: 2px 12px 0 6px; + padding: 2px 12px 1px 6px; letter-spacing: 0.1em; color: #2361a1; text-decoration: none; @@ -546,21 +553,25 @@ form { .username { color: #222; font-size: 14pt; + padding: 1px 0 2px 0; } .domain { color: #222; font-size: 14pt; + padding: 1px 0 2px 0; } .cron { color: #222; font-size: 18px; + padding: 1px 0 2px 0; } .log { color: #222; font-size: 12pt; + padding: 1px 0 2px 0; } .aliases { @@ -587,14 +598,14 @@ form { line-height: 1.3em; font-size: 10pt; color: #222; - padding: 0 4px 0 0; + padding: 2px 4px 1px 0; } .cron-counter-name { vertical-align:top; line-height: 0.8em; font-size: 8pt; - padding: 4 0 0 0; + padding: 4px 0 0 0; color: #222; } @@ -603,7 +614,7 @@ form { line-height: 1.3em; font-size: 10pt; color: #222; - padding: 0 0 0 2px; + padding: 2px 0 1px 2px; } .log-counter-value { @@ -685,7 +696,7 @@ form { padding: 5px; width: 360px; height: 28px; - margin: 0 6px 0 0; + margin: 2px 6px 0 0; } .vst-input:hover { @@ -706,6 +717,7 @@ form { color: #555; height: 30px; min-width: 138px; + margin: 2px 6px 0 0; } @-moz-document url-prefix() { @@ -718,6 +730,7 @@ form { padding: 5px; font-size: 12pt; border: 1px solid #f7f6ed; + margin: 2px 6px 0 0; } .vst-checkbox:hover { @@ -857,7 +870,6 @@ form { vertical-align:top; width: 500px; height: 50px; - padding: 0 8px 0 0; margin: 0; } @@ -865,7 +877,7 @@ form { font-size: 8pt; color: #222; text-align: right; - padding: 20px 0 0 0; + padding: 0 8px 0 0; } .error { diff --git a/web/edit/web/index.php b/web/edit/web/index.php index b2343cb22..a607e5465 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -97,6 +97,7 @@ if (!empty($_POST['save'])) { exec (VESTA_CMD."v-change-web-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $output, $return_var); check_return_code($return_var,$output); $restart_web = 'yes'; + $restart_proxy = 'yes'; unset($output); exec (VESTA_CMD."v-list-dns-domain ".$v_username." ".$v_domain." json", $output, $return_var); if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) { @@ -138,6 +139,7 @@ if (!empty($_POST['save'])) { foreach ($result as $alias) { if ((empty($_SESSION['error_msg'])) && (!empty($alias))) { $restart_web = 'yes'; + $restart_proxy = 'yes'; $v_template = escapeshellarg($_POST['v_template']); exec (VESTA_CMD."v-delete-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var); check_return_code($return_var,$output); @@ -160,6 +162,7 @@ if (!empty($_POST['save'])) { foreach ($result as $alias) { if ((empty($_SESSION['error_msg'])) && (!empty($alias))) { $restart_web = 'yes'; + $restart_proxy = 'yes'; $v_template = escapeshellarg($_POST['v_template']); exec (VESTA_CMD."v-add-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var); check_return_code($return_var,$output); @@ -225,6 +228,7 @@ if (!empty($_POST['save'])) { unset($output); $v_ssl = 'no'; $restart_web = 'yes'; + $restart_proxy = 'yes'; } if (($v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) { if (( $v_ssl_crt != str_replace("\r\n", "\n", $_POST['v_ssl_crt'])) || ( $v_ssl_key != str_replace("\r\n", "\n", $_POST['v_ssl_key'])) || ( $v_ssl_ca != str_replace("\r\n", "\n", $_POST['v_ssl_ca']))) { @@ -259,6 +263,7 @@ if (!empty($_POST['save'])) { check_return_code($return_var,$output); unset($output); $restart_web = 'yes'; + $restart_proxy = 'yes'; $v_ssl_crt = $_POST['v_ssl_crt']; $v_ssl_key = $_POST['v_ssl_key']; $v_ssl_ca = $_POST['v_ssl_ca']; @@ -316,6 +321,7 @@ if (!empty($_POST['save'])) { unset($output); $v_ssl = 'yes'; $restart_web = 'yes'; + $restart_proxy = 'yes'; $v_ssl_crt = $_POST['v_ssl_crt']; $v_ssl_key = $_POST['v_ssl_key']; $v_ssl_ca = $_POST['v_ssl_ca']; @@ -474,6 +480,13 @@ if (!empty($_POST['save'])) { unset($output); } + // Restart proxy + if (!empty($restart_proxy) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-restart-proxy", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + // Restart dns if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) { exec (VESTA_CMD."v-restart-dns", $output, $return_var); diff --git a/web/inc/i18n/id.php b/web/inc/i18n/id.php index 0f8169439..5f20aa422 100644 --- a/web/inc/i18n/id.php +++ b/web/inc/i18n/id.php @@ -128,10 +128,10 @@ $LANG['id'] = array( 'minute' => 'menit', 'hour' => 'jam', 'day' => 'hari', - 'days' => 'beberapa hari', - 'hours' => 'beberapa jam', - 'minutes' => 'beberapa jam', - 'month' => 'beberapa month', + 'days' => ' hari', + 'hours' => ' jam', + 'minutes' => ' jam', + 'month' => ' month', 'package' => 'paket', 'Bandwidth' => 'Bandwidth', 'Disk' => 'Cakram', @@ -205,7 +205,7 @@ $LANG['id'] = array( 'Bandwidth Usage eth0' => 'Penggunaan Bandwidth eth0', 'FTP Usage' => 'Penggunaan FTP', 'SSH Usage' => 'Penggunaan SSH', - 'reverse proxy' => 'membalikkan proxy', + 'reverse proxy' => 'reverse proxy', 'web server' => 'server web', 'dns server' => 'server dns', 'mail server' => 'server mail', @@ -363,7 +363,7 @@ $LANG['id'] = array( 'IP_CREATED_OK' => 'Alamat IP %s udah berhasil dibikin.', 'PACKAGE_CREATED_OK' => 'Paket %s udah berhasil dibikin.', 'SSL_GENERATED_OK' => 'Sertifikat udah berhasil dihasilkan.', - 'Changes has been saved.' => 'PErubahan udah disimpan.', + 'Changes has been saved.' => 'Perubahan udah disimpan.', 'Confirmation' => 'Konfirmasi', 'DELETE_USER_CONFIRMATION' => 'Yakin pengguna %s mau dihapus nih?', 'SUSPEND_USER_CONFIRMATION' => 'Yakin pengguna %s mau ditangguhkan nih?', diff --git a/web/templates/admin/add_cron.html b/web/templates/admin/add_cron.html index 9c0c43d75..c988cba9b 100644 --- a/web/templates/admin/add_cron.html +++ b/web/templates/admin/add_cron.html @@ -8,7 +8,7 @@ ?>
+ | → ".$_SESSION['error_msg'].""; @@ -26,20 +26,15 @@ |