From d6511ede23cb9a2f2f97b955685499b2f7678044 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Sun, 6 Mar 2011 19:11:49 +0000 Subject: [PATCH] Correction de bugs Correction d'identations --- bureau/admin/adm_deactivate.php | 4 +-- etc/alternc/apache2.conf | 26 +++++++++++++------ etc/alternc/templates/apache2/panel.conf | 29 ++++++---------------- etc/alternc/templates/apache2/url.conf | 2 +- etc/alternc/templates/apache2/vhost.conf | 2 +- etc/alternc/templates/apache2/webmail.conf | 2 +- src/functions_hosting.sh | 3 ++- tools/get_account_by_domain | 2 +- tools/get_domains_by_account | 2 +- tools/top_http_users | 2 +- 10 files changed, 35 insertions(+), 39 deletions(-) diff --git a/bureau/admin/adm_deactivate.php b/bureau/admin/adm_deactivate.php index d0bb249e..68ad36af 100644 --- a/bureau/admin/adm_deactivate.php +++ b/bureau/admin/adm_deactivate.php @@ -114,9 +114,7 @@ foreach ($domains as $key => $domain) { } else { # 2.1 keep a copy of where it was, in an SQL request - $backup .= "UPDATE `sub_domaines` SET `type`='$type', valeur='$dest' WHERE `domaine`='$domain' AND sub='$sub';\n"; - $backup .= "DELETE FROM `sub_domaines_standby` WHERE domaine='$domain' and sub='$sub';\n"; - $backup .= "INSERT INTO sub_domaines_standby (compte,domaine,sub,valeur,type,action) values ('$cuid','$domain','$sub','$dest','$type',1);\n"; // UPDATE + $backup .= "UPDATE `sub_domaines` SET `type`='$type', valeur='$dest',web_action='UPDATE' WHERE `domaine`='$domain' AND sub='$sub';\n"; # 2.2 change the subdomain to redirect to http://spam.koumbit.org/ $dom->lock(); diff --git a/etc/alternc/apache2.conf b/etc/alternc/apache2.conf index e140563c..71b40f57 100644 --- a/etc/alternc/apache2.conf +++ b/etc/alternc/apache2.conf @@ -11,11 +11,23 @@ ScriptAlias /cgi-bin/ /var/alternc/cgi-bin/ AddHandler cgi-script .cgi - - Order allow,deny - Allow from none + + Options FollowSymLinks + AllowOverride None + + Order allow,deny + Allow from all + + php_admin_flag safe_mode_gid off + php_admin_flag safe_mode off + php_admin_flag register_globals on + AddDefaultCharset ISO-8859-1 + php_admin_value open_basedir /etc/alternc/:/var/run/alternc/:/var/alternc/bureau/:/var/alternc/html/:/var/alternc/tmp:/tmp:/usr/share/php/:/var/cache/alternc-webalizer/ + + + AllowOverride AuthConfig FileInfo Limit Options Indexes Options Indexes Includes FollowSymLinks MultiViews @@ -33,10 +45,10 @@ ScriptAlias /cgi-bin/ /var/alternc/cgi-bin/ - AllowOverride AuthConfig Options FileInfo Limit Indexes - Options Indexes Includes FollowSymLinks MultiViews - Order allow,deny - Allow from all + AllowOverride AuthConfig Options FileInfo Limit Indexes + Options Indexes Includes FollowSymLinks MultiViews + Order allow,deny + Allow from all Include /etc/alternc/bureau.conf diff --git a/etc/alternc/templates/apache2/panel.conf b/etc/alternc/templates/apache2/panel.conf index c562f7a4..0729e96d 100644 --- a/etc/alternc/templates/apache2/panel.conf +++ b/etc/alternc/templates/apache2/panel.conf @@ -1,25 +1,10 @@ - DocumentRoot /var/alternc/bureau - ServerName %%fqdn%% - - alias /admin/sql /usr/share/phpmyadmin - alias /webmail /usr/share/squirrelmail - - - Options FollowSymLinks - AllowOverride None - - - Order allow,deny - Allow from all - - php_admin_flag safe_mode_gid off - php_admin_flag safe_mode off - php_admin_flag register_globals on - AddDefaultCharset ISO-8859-1 - php_admin_value open_basedir /etc/alternc/:/var/run/alternc/:/var/alternc/bureau/:/var/alternc/html/:/var/alternc/tmp:/tmp:/usr/share/php/:/var/cache/alternc-webalizer/ - - - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc + DocumentRoot /var/alternc/bureau + ServerName %%fqdn%% + + alias /admin/sql /usr/share/phpmyadmin + alias /webmail /usr/share/squirrelmail + + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc CustomLog /var/log/apache2/access.log alternc diff --git a/etc/alternc/templates/apache2/url.conf b/etc/alternc/templates/apache2/url.conf index a876ddd3..ab234c97 100644 --- a/etc/alternc/templates/apache2/url.conf +++ b/etc/alternc/templates/apache2/url.conf @@ -6,6 +6,6 @@ RewriteEngine On RewriteRule ^/(.*)$ %%redirect%%/$1 [R=301,L] - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc CustomLog /var/log/apache2/access.log alternc diff --git a/etc/alternc/templates/apache2/vhost.conf b/etc/alternc/templates/apache2/vhost.conf index 810cdd14..77aa4e61 100644 --- a/etc/alternc/templates/apache2/vhost.conf +++ b/etc/alternc/templates/apache2/vhost.conf @@ -6,6 +6,6 @@ php_admin_value open_basedir "%%document_root%%:/usr/share/php/:/var/alternc/tmp:/tmp" - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc CustomLog /var/log/apache2/access.log alternc diff --git a/etc/alternc/templates/apache2/webmail.conf b/etc/alternc/templates/apache2/webmail.conf index 0dd1f150..e97810ff 100644 --- a/etc/alternc/templates/apache2/webmail.conf +++ b/etc/alternc/templates/apache2/webmail.conf @@ -9,6 +9,6 @@ Options Indexes FollowSymLinks - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc CustomLog /var/log/apache2/access.log alternc diff --git a/src/functions_hosting.sh b/src/functions_hosting.sh index a484df38..37bcea00 100644 --- a/src/functions_hosting.sh +++ b/src/functions_hosting.sh @@ -162,7 +162,8 @@ host_change_enable() { } host_delete() { - local FQDN=$1 + local VTYPE=$1 + local FQDN=$2 # Execute post-install hooks launch_hooks "delete" "$1" "$2" "$3" "$4" if [ $? -gt 10 ] ; then diff --git a/tools/get_account_by_domain b/tools/get_account_by_domain index 5b6346cf..65794a65 100755 --- a/tools/get_account_by_domain +++ b/tools/get_account_by_domain @@ -76,7 +76,7 @@ MYSQL_UNREACHABLE_DATABASE=`$printf "$($gettext "Cannot access accounts database # Have to get AlternC conf file : ! [ -f "$ALTERNC_CONF_FILE" ] && { echo $MISSING_CONF_FILE ; exit 1 ; } || . $ALTERNC_CONF_FILE mysql="$mysql --defaults-file=/etc/alternc/my.cnf" -$mysql -e "select count(*) from domaines_standby;" > /dev/null 2>&1 +$mysql -e "desc domaines;" > /dev/null 2>&1 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } # Does the stuff diff --git a/tools/get_domains_by_account b/tools/get_domains_by_account index efc38bbf..5abfdd94 100755 --- a/tools/get_domains_by_account +++ b/tools/get_domains_by_account @@ -75,7 +75,7 @@ MYSQL_UNREACHABLE_DATABASE=`$printf "$($gettext "Cannot access accounts database ! [ -f "$ALTERNC_CONF_FILE" ] && { echo $MISSING_CONF_FILE ; exit 1 ; } || . $ALTERNC_CONF_FILE # Must have access to mysql to retreive accounts owning domains : mysql="$mysql --defaults-file=/etc/alternc/my.cnf -B -N -e" -$mysql "select count(*) from domaines_standby;" > /dev/null 2>&1 +$mysql "desc domaines;" > /dev/null 2>&1 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } # Does the stuff diff --git a/tools/top_http_users b/tools/top_http_users index 6beefd78..2494225c 100755 --- a/tools/top_http_users +++ b/tools/top_http_users @@ -169,7 +169,7 @@ LOG_FILE=$LOG_DIR/access.log [ -f "$ALTERNC_CONF_FILE" ] || { echo $MISSING_CONF_FILE ; exit 1 ; } && . $ALTERNC_CONF_FILE # Must have access to mysql to retreive accounts owning domains : mysql="$mysql --defaults-file=/etc/alternc/my.cnf -B -N -e" -$mysql "select count(*) from domaines_standby;" > /dev/null 2>&1 +$mysql "desc domaines;" > /dev/null 2>&1 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } # Prevents executing more than one shell at the same time $lockfilecreate --retry 1 $LOCK_FILE