From 46510d79e5e071634fe5a043cd3774eb8378d882 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Tue, 1 Feb 2011 17:17:58 +0000 Subject: [PATCH] Patchs editions/suppression --- .gitattributes | 4 ---- bureau/class/m_dom.php | 2 +- etc/alternc/apache2.conf | 3 ++- src/functions_hosting.sh | 2 +- src/hosting_functions/hosting_panel.sh | 20 ----------------- src/hosting_functions/hosting_redirect.sh | 23 -------------------- src/hosting_functions/hosting_vhost.sh | 26 ----------------------- src/hosting_functions/hosting_webmail.sh | 20 ----------------- src/update_domains.sh | 8 +++---- 9 files changed, 8 insertions(+), 100 deletions(-) delete mode 100644 src/hosting_functions/hosting_panel.sh delete mode 100644 src/hosting_functions/hosting_redirect.sh delete mode 100644 src/hosting_functions/hosting_vhost.sh delete mode 100644 src/hosting_functions/hosting_webmail.sh diff --git a/.gitattributes b/.gitattributes index ffb3082e..57a2148f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -439,10 +439,6 @@ src/fixperms.sh -text src/functions.sh -text src/functions_dns.sh -text src/functions_hosting.sh -text -src/hosting_functions/hosting_panel.sh -text -src/hosting_functions/hosting_redirect.sh -text -src/hosting_functions/hosting_vhost.sh -text -src/hosting_functions/hosting_webmail.sh -text src/mail_add -text src/mail_del -text src/mem_add -text diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 1c5db1c5..b2ab0227 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -900,7 +900,7 @@ class m_dom { return false; } else { // OK, on valide : - $db->query("delete from sub_domaines where domaine='$dom' and sub='$sub' and type='$type' and ( length('$value')=0 or valeur='$value') "); + $db->query("update sub_domaines set web_action='DELETE' where domaine='$dom' and sub='$sub' and type='$type' and ( length('$value')=0 or valeur='$value') "); $db->query("update domaines set dns_action='UPDATE' where domaine='$dom';"); } return true; diff --git a/etc/alternc/apache2.conf b/etc/alternc/apache2.conf index 661be7bb..a4173d7f 100644 --- a/etc/alternc/apache2.conf +++ b/etc/alternc/apache2.conf @@ -11,6 +11,8 @@ ScriptAlias /cgi-bin/ /var/alternc/cgi-bin/ AddHandler cgi-script .cgi +Include /var/alternc/apache-vhost/vhosts_all.conf + # ***ALTERNC_ALIASES*** Alias /icons/ /usr/share/apache/icons/ @@ -46,4 +48,3 @@ ScriptAlias /cgi-bin/ /var/alternc/cgi-bin/ Include /etc/alternc/bureau.conf -Include /var/alternc/apache-vhost/vhosts_all.conf diff --git a/src/functions_hosting.sh b/src/functions_hosting.sh index f3a97531..afbad0ec 100644 --- a/src/functions_hosting.sh +++ b/src/functions_hosting.sh @@ -92,7 +92,7 @@ host_create() { # Check if all is right in the conf file # If not, put a debug message local ISNOTGOOD=$(grep "%%" "$TMP_FILE") - [ "$ISNOTGOOD" ] && (echo "# There was a probleme in the generation : $ISNOTGOOD" > "$TMP_FILE" ) + [ "$ISNOTGOOD" ] && (echo "# There was a probleme in the generation : $ISNOTGOOD" > "$TMP_FILE" ; return 44 ) # Put the conf file in prod mkdir -p "$(dirname "$FILE_TARGET")" diff --git a/src/hosting_functions/hosting_panel.sh b/src/hosting_functions/hosting_panel.sh deleted file mode 100644 index dc9e6cd9..00000000 --- a/src/hosting_functions/hosting_panel.sh +++ /dev/null @@ -1,20 +0,0 @@ -host_create_panel() { - - if [[ ( -z $1 ) || (-z $2 ) ]]; then - exit 1; - fi - - echo "création panel $1" - - local USER=$1 - local FQDN=$2 - local TEMPLATE="panel.conf" - local TARGET=$HOST_DIR"/"$USER"/"$FQDN - host_prepare_conf $TEMPLATE #Return #HOST_TMP - - sed -i \ - -e "s#%%fqdn%%#$FQDN#g" \ - $HOST_TMP - - host_save_conf $HOST_TMP $TARGET -} diff --git a/src/hosting_functions/hosting_redirect.sh b/src/hosting_functions/hosting_redirect.sh deleted file mode 100644 index 03af374a..00000000 --- a/src/hosting_functions/hosting_redirect.sh +++ /dev/null @@ -1,23 +0,0 @@ -host_create_redirect() { - - if [[ ( -z $1 ) || (-z $2 ) || ( -z $3) ]]; then - exit 1; - fi - - echo "création redirection pour $1 de $2 vers $3" - - local USER=$1 - local FQDN=$2 - local REDIRECT=$3 - local TEMPLATE="redirect.conf" - local TARGET=$HOST_DIR"/"$USER"/"$FQDN - host_prepare_conf $TEMPLATE #Return #HOST_TMP - - sed -i \ - -e "s#%%fqdn%%#${FQDN}#g" \ - -e "s#%%redirect%%#${REDIRECT}#g" \ - $HOST_TMP - - host_save_conf $HOST_TMP $TARGET - -} diff --git a/src/hosting_functions/hosting_vhost.sh b/src/hosting_functions/hosting_vhost.sh deleted file mode 100644 index b6340672..00000000 --- a/src/hosting_functions/hosting_vhost.sh +++ /dev/null @@ -1,26 +0,0 @@ -host_create_vhost() { - - if [[ ( -z $1 ) || (-z $2 ) || ( -z $3) ]]; then - exit 1; - fi - - echo "création vhost $1 pour $2, repertoire $3" - - local USER=$1 - local FQDN=$2 - local TEMPLATE="vhost.conf" - local TARGET=$HOST_DIR"/"$USER"/"$FQDN - - local domain_letter=`print_domain_letter "$domain"` - local user_letter=`print_user_letter "$user"` - local DIRECTORY=${HTML_HOME}/${user_letter}/${user}$3 - - host_prepare_conf $TEMPLATE #Return #HOST_TMP - - sed -i \ - -e "s#%%fqdn%%#$FQDN#g" \ - -e "s#%%document_root%%#$DIRECTORY#g" \ - $HOST_TMP - - host_save_conf $HOST_TMP $TARGET -} diff --git a/src/hosting_functions/hosting_webmail.sh b/src/hosting_functions/hosting_webmail.sh deleted file mode 100644 index 190c4f7b..00000000 --- a/src/hosting_functions/hosting_webmail.sh +++ /dev/null @@ -1,20 +0,0 @@ -host_create_webmail() { - - if [[ ( -z $1 ) || (-z $2 ) ]]; then - exit 1; - fi - - echo "création webmail $1 pour $2" - - local USER=$1 - local FQDN=$2 - local TEMPLATE="webmail.conf" - local TARGET=$HOST_DIR"/"$USER"/"$FQDN - host_prepare_conf $TEMPLATE #Return #HOST_TMP - - sed -i \ - -e "s#%%fqdn%%#$FQDN#g" \ - $HOST_TMP - - host_save_conf $HOST_TMP $TARGET -} diff --git a/src/update_domains.sh b/src/update_domains.sh index a31afbeb..168b9647 100644 --- a/src/update_domains.sh +++ b/src/update_domains.sh @@ -41,14 +41,14 @@ touch "$LOCK_FILE" # set sub_domaines.web_action = delete where domaines.dns_action = DELETE $MYSQL_DO "update sub_domaines sd, domaines d set sd.web_action = 'DELETE' where sd.domaine = d.domaine and sd.compte=d.compte and d.dns_action = 'DELETE';" -# Sub_domaines we want to delete +# Sub_domaines we want to delete # sub_domaines.web_action = delete for sub in $( $MYSQL_DO "select concat_ws('$B',if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine),sd.type) from sub_domaines sd where web_action ='DELETE';") ; do host_delete $(echo $sub|tr "$B" ' ') - # TODO Update the entry in the DB with the result and the action + $MYSQL_DO "delete from sub_domaines where concat_ws('$B',if(length(sub)>0,concat_ws('.',sub,domaine),domaine),type) = '$sub' and web_action ='DELETE';" done -# Sub domaines we want to update +# Sub domaines we want to update # sub_domaines.web_action = update and sub_domains.only_dns = false params=$( $MYSQL_DO " select concat_ws('$B',lower(sd.type), if(length(sd.sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine), valeur) @@ -90,7 +90,7 @@ done # domaines.dns_action = DELETE for dom in $( $MYSQL_DO "select domaine from domaines where dns_action = 'DELETE';") ; do dns_delete $dom - # Web configurations have already bean cleaned previously + # Web configurations have already bean cleaned previously $MYSQL_DO "delete sub_domaines where domaine='$dom'; delete domaines where domaine='$dom';" done