Serghey Rodin 14 лет назад
Родитель
Сommit
c819cdaeb0

+ 2 - 2
bin/v_add_web_domain_alias

@@ -89,8 +89,8 @@ str_repl="    ServerAlias ${new_alias_idn//,/ }"
 httpd_change_config
 
 # Checking ssl domain
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Defining ssl template
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"

+ 2 - 2
bin/v_add_web_domain_cgi

@@ -75,8 +75,8 @@ str_repl='        Options +Includes -Indexes +ExecCGI'
 httpd_change_config
 
 # Checking ssl
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Get ssl template name
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"

+ 2 - 2
bin/v_add_web_domain_elog

@@ -66,8 +66,8 @@ str_repl="    ErrorLog /var/log/httpd/domains/$domain.error.log"
 httpd_change_config
 
 # Checking ssl
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Get ssl template name
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"

+ 1 - 2
bin/v_add_web_domain_ssl

@@ -52,7 +52,7 @@ ip=$(get_web_domain_value '$IP')
 is_sys_ip_owner
 
 # Check ssl is not added
-is_web_domain_key_empty '$SSL'
+is_web_domain_key_empty '$SSL_CERT'
 
 # Checking ssl certificate
 is_web_domain_cert_valid
@@ -121,7 +121,6 @@ fi
 increase_user_value "$user" '$U_WEB_SSL'
 
 # Adding ssl values
-update_web_domain_value '$SSL' 'yes'
 update_web_domain_value '$SSL_HOME' "$tpl_option"
 update_web_domain_value '$SSL_CERT' "$cert"
 

+ 2 - 2
bin/v_change_web_domain_ip

@@ -61,8 +61,8 @@ old_ip=$(get_web_domain_value '$IP')
 change_domain_ip "$conf" "$domain" "$ip" "$old_ip" "$tpl_file"
 
 # Checking ssl
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Get tpl
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"

+ 3 - 2
bin/v_change_web_domain_sslcert

@@ -7,7 +7,8 @@
 
 # Argument defenition
 user="$1"
-domain="$2"
+domain=$(idn -t --quiet -u "$2" )
+domain_idn=$(idn -t --quiet -a "$domain")
 certificate="$3"
 
 # Importing variables
@@ -42,7 +43,7 @@ is_web_domain_valid
 is_domain_suspended 'web_domains'
 
 # Check SSL is added
-is_web_domain_value_exist '$SSL'
+is_web_domain_value_exist '$SSL_CERT'
 
 # Checking ssl certificate
 is_web_domain_cert_valid

+ 1 - 1
bin/v_change_web_domain_sslhome

@@ -42,7 +42,7 @@ is_web_domain_valid
 is_domain_suspended 'web_domains'
 
 # Check SSL is added
-is_web_domain_value_exist '$SSL'
+is_web_domain_value_exist '$SSL_CERT'
 
 
 #----------------------------------------------------------#

+ 3 - 4
bin/v_change_web_domain_tpl

@@ -60,8 +60,8 @@ conf="$V_HOME/$user/conf/httpd.conf"
 httpd_del_config
 
 # Checking ssl
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Get tpl
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
@@ -104,11 +104,10 @@ if [ -x $V_WEBTPL/apache_$template.sh ]; then
 fi
 
 # Checking ssl
-if [ "$ssl" = 'yes' ]; then
+if [ ! -z "$cert" = 'yes' ]; then
     # Defining variables for ssl template replace
     web_ssl_port=$(get_config_value '$WEB_SSL_PORT')
     tpl_option=$(get_web_domain_value '$SSL_HOME')
-    cert=$(get_web_domain_value '$SSL_CERT')
     ssl_cert="$V_HOME/$user/conf/$cert.crt"
     ssl_key="$V_HOME/$user/conf/$cert.key"
     case $tpl_option in

+ 2 - 2
bin/v_del_web_domain

@@ -57,8 +57,8 @@ conf="$V_HOME/$user/conf/httpd.conf"
 httpd_del_config
 
 # Checking ssl
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Get tpl
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"

+ 2 - 2
bin/v_del_web_domain_alias

@@ -86,8 +86,8 @@ str_repl="    ServerAlias ${new_alias_idn//,/ }"
 httpd_change_config
 
 # Checking ssl domain
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Defining ssl template
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"

+ 2 - 2
bin/v_del_web_domain_cgi

@@ -75,8 +75,8 @@ str_repl='        Options +Includes -Indexes -ExecCGI'
 httpd_change_config
 
 # Checking ssl
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Get ssl template name
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"

+ 2 - 2
bin/v_del_web_domain_elog

@@ -66,8 +66,8 @@ str_repl="    #ErrorLog /var/log/httpd/domains/$domain.error.log"
 httpd_change_config
 
 # Checking ssl
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
 
     # Get ssl template name
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"

+ 1 - 2
bin/v_del_web_domain_ssl

@@ -42,7 +42,7 @@ is_web_domain_valid
 is_domain_suspended 'web_domains'
 
 # Checking ssl is added
-is_web_domain_value_exist '$SSL'
+is_web_domain_value_exist '$SSL_CERT'
 
 
 #----------------------------------------------------------#
@@ -67,7 +67,6 @@ cert=$(get_web_domain_value '$SSL_CERT' )
 tpl_option=$(get_web_domain_value '$SSL_HOME' )
 
 # Deleting ssl in config
-update_web_domain_value '$SSL' 'no'
 update_web_domain_value '$SSL_HOME' ''
 update_web_domain_value '$SSL_CERT' ''
 

+ 2 - 2
bin/v_suspend_web_domain

@@ -62,8 +62,8 @@ str_repl="    Redirect / http://$url/"
 httpd_change_config
 
 # Check ssl vhost
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
     # Defining teplate name
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
 

+ 2 - 2
bin/v_suspend_web_domains

@@ -70,8 +70,8 @@ for domain in $domains; do
     httpd_change_config
 
     # Check ssl vhost
-    ssl=$(get_web_domain_value '$SSL')
-    if [ "$ssl" = 'yes' ]; then
+    cert=$(get_web_domain_value '$SSL_CERT')
+    if [ ! -z "$cert" ]; then
         # Defining teplate name
         tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
 

+ 2 - 2
bin/v_unsuspend_web_domain

@@ -59,8 +59,8 @@ str_repl="    DocumentRoot $V_HOME/$user/domains/$domain/public_html"
 httpd_change_config
 
 # Check ssl vhost
-ssl=$(get_web_domain_value '$SSL')
-if [ "$ssl" = 'yes' ]; then
+cert=$(get_web_domain_value '$SSL_CERT')
+if [ ! -z "$cert" ]; then
     # Defining teplate name and ssl documentroot option
     tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
     tpl_option=$(get_web_domain_value '$SSL_HOME')

+ 2 - 2
bin/v_unsuspend_web_domains

@@ -67,8 +67,8 @@ for domain in $domains; do
     httpd_change_config
 
     # Check ssl vhost
-    ssl=$(get_web_domain_value '$SSL')
-    if [ "$ssl" = 'yes' ]; then
+    cert=$(get_web_domain_value '$SSL_CERT')
+    if [ ! -z "$cert" ]; then
         # Defining teplate name and ssl documentroot option
         tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
         tpl_opt=$(get_web_domain_value '$SSL_HOME')