Vaguement :

- correction de qques identation (et surement rajout d'erreur)
 - supression de apache 1 (c'est plus maintenu, on va pas s'étaler)
 - suppression du mass vhosting
 - corrections de bugs divers et varié
This commit is contained in:
Alan Garcia 2011-03-06 18:06:27 +00:00
parent 68d7a7dd15
commit 4e0f98b93e
27 changed files with 238 additions and 530 deletions

5
.gitattributes vendored
View File

@ -349,8 +349,6 @@ debian/po/templates.pot -text
debian/rules -text
debian/templates -text
etc/alternc/alternc.ini -text
etc/alternc/apache-ssl.conf -text
etc/alternc/apache.conf -text
etc/alternc/apache2-ssl.conf -text
etc/alternc/apache2.conf -text
etc/alternc/functions_hosting/hosting_massvhost.sh -text
@ -396,9 +394,7 @@ install/mysql.sql -text
install/newone.php -text
install/reset_root.php -text
install/upgrade_check.sh -text
install/upgrades/0.9.1.sh -text
install/upgrades/0.9.1.sql -text
install/upgrades/0.9.10.sh -text
install/upgrades/0.9.10.sql -text
install/upgrades/0.9.1_migrationldap.php -text
install/upgrades/0.9.2.php -text
@ -434,7 +430,6 @@ src/Makefile -text
src/alternc-check -text
src/alternc-passwd -text
src/alternc_reload -text
src/basedir_prot.sh -text
src/du.pl -text
src/fixperms.sh -text
src/functions.sh -text

View File

@ -65,7 +65,7 @@ function dnsoff() {
</script>
<h3><?php printf(_("Editing subdomains of %s"),$domain); ?></h3>
<?php
if ($error) {
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
}
?>

View File

@ -57,7 +57,7 @@ if (!isset($restrictip)) {
<p id="logo"> <img src="logo.png" border="0" alt="<?php __("Web Hosting Control Panel"); ?>" title="<?php __("Web Hosting Control Panel"); ?>" /></a>
</p>
<p>&nbsp;</p>
<?php if ($error) echo "<font color=red>$error</font>"; ?>
<?php if (isset($error) && $error) echo "<font color=red>$error</font>"; ?>
<?php
/*
if (!$_SERVER[HTTPS]) {

View File

@ -64,7 +64,7 @@ if (ini_get("safe_mode")) {
// For people who want to authenticate with HTTP AUTH
if (isset($_GET['http_auth'])) $http_auth=strval($_GET['http_auth']);
if ($http_auth) {
if (isset($http_auth) && $http_auth) {
if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW'])) {
header('WWW-Authenticate: Basic realm="Test Authentication System"');
header('HTTP/1.0 401 Unauthorized');
@ -93,7 +93,7 @@ require_once($root."class/functions.php");
require_once($root."class/variables.php");
// Redirection si appel à https://(!fqdn)/
if ($_SERVER["HTTPS"]=="on" && $host!=$L_FQDN) {
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"]=="on" && $host!=$L_FQDN) {
header("Location: https://$L_FQDN/");
}

View File

@ -723,6 +723,7 @@ EOF;
" HAVING status=2 or status=3 ORDER BY status DESC, expiry;"))
return false;
else {
$res=array();
while($db->next_record())
$res[] = $db->Record;
return $res;

View File

@ -66,7 +66,7 @@ class m_dom {
*/
var $islocked=false;
var $type_local = "LOCAL";
var $type_local = "VHOST";
var $type_url = "URL";
var $type_ip = "IP";
var $type_webmail = "WEBMAIL";
@ -669,7 +669,7 @@ class m_dom {
$r["dns_result"]=$db->Record["dns_result"];
$r["mail"]=$db->Record["gesmx"];
$r["mx"]=$db->Record["mx"];
$r[noerase]=$db->Record[noerase];
$r['noerase']=$db->Record['noerase'];
$db->free();
$db->query("select count(*) as cnt from sub_domaines where compte='$cuid' and domaine='$dom'");
$db->next_record();
@ -754,6 +754,8 @@ class m_dom {
function check_type_value($type, $value) {
global $db,$err,$cuid;
// check the type we can have in domaines_type.target
switch ($this->domains_type_target_values($type)) {

View File

@ -488,7 +488,7 @@ Cordialement.
*/
function show_help($file,$force=false) {
global $err;
$err->log("mem","show_help",$show);
$err->log("mem","show_help");
if ($this->user["show_help"] || $force) {
$hlp=_("hlp_$file");
if ($hlp!="hlp_$file") {

View File

@ -5,7 +5,6 @@ alternc-slave: setuid-binary usr/lib/alternc/mem_add 4750 root/www-data
alternc-slave: setuid-binary usr/lib/alternc/mem_del 4750 root/www-data
alternc-slave: setuid-binary usr/lib/alternc/quota_edit 4750 root/www-data
alternc-slave: setuid-binary usr/lib/alternc/quota_get 4750 root/www-data
alternc-slave: executable-is-not-world-readable usr/lib/alternc/basedir_prot.sh 0750 != 0755
alternc-slave: executable-is-not-world-readable usr/lib/alternc/du.pl 4750
alternc-slave: executable-is-not-world-readable usr/lib/alternc/fixperms.sh 0750 != 0755
alternc-slave: executable-is-not-world-readable usr/lib/alternc/mail_add 4750

112
debian/alternc.dirs vendored
View File

@ -17,123 +17,13 @@ usr/share/locale/fr/LC_MESSAGES
usr/share/lintian/overrides/
var/alternc/apache-vhost
var/alternc/apacheconf
var/alternc/apacheconf/_
var/alternc/apacheconf/0
var/alternc/apacheconf/1
var/alternc/apacheconf/2
var/alternc/apacheconf/3
var/alternc/apacheconf/4
var/alternc/apacheconf/5
var/alternc/apacheconf/6
var/alternc/apacheconf/7
var/alternc/apacheconf/8
var/alternc/apacheconf/9
var/alternc/apacheconf/a
var/alternc/apacheconf/b
var/alternc/apacheconf/c
var/alternc/apacheconf/d
var/alternc/apacheconf/e
var/alternc/apacheconf/f
var/alternc/apacheconf/g
var/alternc/apacheconf/h
var/alternc/apacheconf/i
var/alternc/apacheconf/j
var/alternc/apacheconf/k
var/alternc/apacheconf/l
var/alternc/apacheconf/m
var/alternc/apacheconf/n
var/alternc/apacheconf/o
var/alternc/apacheconf/p
var/alternc/apacheconf/q
var/alternc/apacheconf/r
var/alternc/apacheconf/s
var/alternc/apacheconf/t
var/alternc/apacheconf/u
var/alternc/apacheconf/v
var/alternc/apacheconf/w
var/alternc/apacheconf/x
var/alternc/apacheconf/y
var/alternc/apacheconf/z
var/alternc/bind
var/alternc/bind/zones
var/alternc/bureau
var/alternc/cgi-bin
var/alternc/db
var/alternc/dns
var/alternc/dns/_
var/alternc/dns/0
var/alternc/dns/1
var/alternc/dns/2
var/alternc/dns/3
var/alternc/dns/4
var/alternc/dns/5
var/alternc/dns/6
var/alternc/dns/7
var/alternc/dns/8
var/alternc/dns/9
var/alternc/dns/a
var/alternc/dns/b
var/alternc/dns/c
var/alternc/dns/d
var/alternc/dns/e
var/alternc/dns/f
var/alternc/dns/g
var/alternc/dns/h
var/alternc/dns/i
var/alternc/dns/j
var/alternc/dns/k
var/alternc/dns/l
var/alternc/dns/m
var/alternc/dns/n
var/alternc/dns/o
var/alternc/dns/p
var/alternc/dns/q
var/alternc/dns/r
var/alternc/dns/redir/_
var/alternc/dns/redir/0
var/alternc/dns/redir/1
var/alternc/dns/redir/2
var/alternc/dns/redir/3
var/alternc/dns/redir/4
var/alternc/dns/redir/5
var/alternc/dns/redir/6
var/alternc/dns/redir/7
var/alternc/dns/redir/8
var/alternc/dns/redir/9
var/alternc/dns/redir/a
var/alternc/dns/redir/b
var/alternc/dns/redir/c
var/alternc/dns/redir/d
var/alternc/dns/redir/e
var/alternc/dns/redir/f
var/alternc/dns/redir/g
var/alternc/dns/redir/h
var/alternc/dns/redir/i
var/alternc/dns/redir/j
var/alternc/dns/redir/k
var/alternc/dns/redir/l
var/alternc/dns/redir/m
var/alternc/dns/redir/n
var/alternc/dns/redir/o
var/alternc/dns/redir/p
var/alternc/dns/redir/q
var/alternc/dns/redir/r
var/alternc/dns/redir/s
var/alternc/dns/redir/t
var/alternc/dns/redir/u
var/alternc/dns/redir/v
var/alternc/dns/redir/w
var/alternc/dns/redir/x
var/alternc/dns/redir/y
var/alternc/dns/redir/z
var/alternc/dns/s
var/alternc/dns/t
var/alternc/dns/u
var/alternc/dns/v
var/alternc/dns/w
var/alternc/dns/x
var/alternc/dns/y
var/alternc/dns/z
var/alternc/dns/redir/
var/alternc/exec.usr
var/alternc/html
var/alternc/html/_

View File

@ -11,7 +11,6 @@ alternc: setuid-binary usr/lib/alternc/db_create 4750 root/www-data
alternc: setuid-binary usr/lib/alternc/du.pl 4750 root/www-data
alternc: non-standard-executable-perm usr/lib/alternc/quota_edit.sh 0750 != 0755
alternc: non-standard-executable-perm usr/lib/alternc/quota_get.sh 0750 != 0755
alternc: non-standard-executable-perm usr/lib/alternc/basedir_prot.sh 0750 != 0755
alternc: non-standard-executable-perm usr/lib/alternc/sqlbackup.sh 0750 != 0755
alternc: non-standard-executable-perm usr/lib/alternc/rawstat.daily 0750 != 0755
alternc: non-standard-executable-perm usr/lib/alternc/quota_init 0750 != 0755
@ -41,7 +40,6 @@ alternc: executable-is-not-world-readable usr/lib/alternc/functions_hosting.sh 0
alternc: executable-is-not-world-readable usr/lib/alternc/functions_dns.sh 0750 != 0755
alternc: executable-is-not-world-readable usr/lib/alternc/du.pl 4750
alternc: executable-is-not-world-readable usr/lib/alternc/quota_init 0750 != 0755
alternc: executable-is-not-world-readable usr/lib/alternc/basedir_prot.sh 0750 != 0755
alternc: executable-is-not-world-readable usr/lib/alternc/spoolsize.php 0750 != 0755
alternc: executable-is-not-world-readable usr/lib/alternc/rawstat.daily 0750 != 0755
alternc: using-first-person-in-templates alternc/monitor_ip

View File

@ -192,7 +192,6 @@ EOF
# They will be regenerated without the bug by upgrade_check.sh below.
if dpkg --compare-versions "$2" le "0.9.3.9-globenet14"; then
rm -f /var/alternc/apacheconf/*/*
rm -f /var/alternc/apacheconf/override_php.conf
fi
echo "checking for upgrades"
@ -214,12 +213,6 @@ EOF
#clean old access to the management panel
find /var/alternc/dns/ -type l -lname /var/alternc/bureau -exec rm {} \;
# Add access to the management panel
PUBLIC_IP_C=$(echo $PUBLIC_IP|cut -c 1)
ln -nsf /var/alternc/bureau /var/alternc/dns/$FQDN_LETTER/$FQDN
mkdir -p /var/alternc/dns/$PUBLIC_IP_C
ln -nsf /var/alternc/bureau /var/alternc/dns/$PUBLIC_IP_C/$PUBLIC_IP
# Bind stuff
touch /var/alternc/bind/automatic.conf /var/alternc/bind/slaveip.conf
chown root:bind /var/alternc/bind/automatic.conf /var/alternc/bind/slaveip.conf
@ -227,7 +220,6 @@ EOF
touch /var/run/alternc/refresh_slave
/usr/lib/alternc/slave_dns
# Apache will not start without this file
touch /var/alternc/apacheconf/override_php.conf
touch /var/alternc/apache-vhost/vhosts_all.conf
# Update l18n files
@ -239,9 +231,6 @@ EOF
echo "running alternc.install"
alternc.install
# Add basedir protection
/usr/lib/alternc/basedir_prot.sh
;;
abort-upgrade|abort-remove|abort-deconfigure)

2
debian/rules vendored
View File

@ -61,7 +61,7 @@ install: build
chown -R www-data:www-data debian/alternc/var/alternc/dns debian/alternc/var/alternc/html debian/alternc/var/run/alternc debian/alternc/var/log/alternc debian/alternc/var/alternc/tmp
chmod a+x debian/alternc/usr/share/alternc/install/alternc.install debian/alternc/usr/share/alternc/install/dopo.sh debian/alternc/usr/share/alternc/install/mysql.sh debian/alternc/usr/share/alternc/install/newone.php debian/alternc/usr/share/alternc/install/reset_root.php debian/alternc/usr/share/alternc/install/upgrade_check.sh debian/alternc/usr/share/alternc/install/upgrades/*.php debian/alternc/usr/share/alternc/install/upgrades/*.sh
for sub in dns dns/redir mail html apacheconf; do \
for sub in mail html ; do \
for i in a b c d e f g h i j k l m n o p q r s t u v w x y z _ 0 1 2 3 4 5 6 7 8 9; do \
mkdir -p debian/alternc/var/alternc/${sub}/${i} ;\
chown www-data debian/alternc/var/alternc/${sub}/${i} ;\

View File

@ -1,6 +0,0 @@
<VirtualHost *:443>
SSLEnable
SSLRequireSSL
DocumentRoot /var/alternc/bureau
Include /etc/alternc/bureau.conf
</VirtualHost>

View File

@ -1,42 +0,0 @@
# This module is loaded in /etc/apache/modules, and enabled by apache-modconf
# LoadModule vhost_alias_module /usr/lib/apache/1.3/mod_vhost_alias.so
ScriptAlias /cgi-bin/ /var/alternc/cgi-bin/
<Directory /var/alternc/cgi-bin/>
Options FollowSymLinks IncludesNOEXEC ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AddHandler cgi-script .cgi
</Directory>
<VirtualHost *:80>
# ***ALTERNC_ALIASES***
Alias /icons/ /usr/share/apache/icons/
UseCanonicalName Off
VirtualDocumentRoot /var/alternc/dns/%-2.1/%0
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc
CustomLog /var/log/apache/access.log alternc
</VirtualHost>
<Directory /var/alternc>
AllowOverride AuthConfig FileInfo
Options Indexes Includes FollowSymLinks MultiViews
Order allow,deny
Allow from all
php_admin_flag safe_mode_gid on
php_admin_flag safe_mode on
php_admin_value disable_functions chmod,chown,chgrp,link,symlink
php_admin_value safe_mode_exec_dir /var/alternc/exec.usr
php_admin_value disable_functions chgrp,link,symlink
php_admin_flag enable_dl off
php_admin_value upload_tmp_dir /var/alternc/tmp
php_admin_value sendmail_path /usr/lib/alternc/sendmail
</Directory>
Include /etc/alternc/bureau.conf
Include /var/alternc/apache-vhost/vhosts_all.conf

View File

@ -11,12 +11,27 @@ ScriptAlias /cgi-bin/ /var/alternc/cgi-bin/
AddHandler cgi-script .cgi
</Directory>
<Directory /var/alternc>
Order allow,deny
Allow from none
</Directory>
<Directory /var/alternc/html>
AllowOverride AuthConfig FileInfo Limit Options Indexes
Options Indexes Includes FollowSymLinks MultiViews
Order allow,deny
Allow from all
php_admin_flag safe_mode_gid on
php_admin_flag safe_mode on
php_admin_value disable_functions chmod,chown,chgrp,link,symlink
php_admin_value safe_mode_exec_dir /var/alternc/exec.usr
php_admin_value disable_functions chgrp,link,symlink
php_admin_flag enable_dl off
php_admin_value upload_tmp_dir /var/alternc/tmp
php_admin_value sendmail_path /usr/lib/alternc/sendmail
</Directory>
<Directory /usr/share/phpmyadmin>
AllowOverride AuthConfig Options FileInfo Limit Indexes
Options Indexes Includes FollowSymLinks MultiViews

View File

@ -10,6 +10,8 @@
AllowOverride None
</Directory>
<Directory /var/alternc/bureau>
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

View File

@ -10,10 +10,16 @@
AllowOverride None
</Directory>
<Directory /var/alternc/bureau>
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/
</Directory>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc
CustomLog /var/log/apache2/access.log alternc
</VirtualHost>

View File

@ -1,9 +1,11 @@
<Virtualhost *:80>
ServerName %%fqdn%%
KeepAlive Off
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
CustomLog /var/log/apache2/access.log alternc
</Virtualhost>

View File

@ -6,20 +6,6 @@
php_admin_value open_basedir "%%document_root%%:/usr/share/php/:/var/alternc/tmp:/tmp"
</Directory>
AllowOverride AuthConfig FileInfo Limit Options Indexes
Options Indexes Includes FollowSymLinks MultiViews
Order allow,deny
Allow from all
php_admin_flag safe_mode_gid on
php_admin_flag safe_mode on
php_admin_value disable_functions chmod,chown,chgrp,link,symlink
php_admin_value safe_mode_exec_dir /var/alternc/exec.usr
php_admin_value disable_functions chgrp,link,symlink
php_admin_flag enable_dl off
php_admin_value upload_tmp_dir /var/alternc/tmp
php_admin_value sendmail_path /usr/lib/alternc/sendmail
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc
CustomLog /var/log/apache2/access.log alternc
</VirtualHost>

View File

@ -8,4 +8,7 @@
php_admin_flag safe_mode off
Options Indexes FollowSymLinks
</Directory>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %{Host}i" alternc
CustomLog /var/log/apache2/access.log alternc
</VirtualHost>

View File

@ -210,10 +210,6 @@ then
ln -sf /etc/alternc/apache.conf /etc/apache/conf.d/alternc.conf
fi
touch /var/alternc/apacheconf/override_php.conf
if [ ! -h /etc/apache/conf.d/override_php.conf ] && [ -e /etc/apache/conf.d/ ]; then
ln -sf /var/alternc/apacheconf/override_php.conf /etc/apache/conf.d/override_php.conf
fi
SERVICES="$SERVICES apache apache-ssl"
fi
if [ -x /usr/sbin/apache2 ]; then
@ -251,10 +247,6 @@ if [ -x /usr/sbin/apache2 ]; then
ln -sf /etc/alternc/apache2.conf /etc/apache2/conf.d/alternc.conf
s="apache2"
fi
if [ ! -h /etc/apache2/conf.d/override_php.conf ] && [ -e /etc/apache2/conf.d/ ]; then
ln -sf /var/alternc/apacheconf/override_php.conf /etc/apache2/conf.d/override_php.conf
s="apache2"
fi
if [ -e /etc/apache2/sites-enabled/000-default ]; then
a2dissite default
s="apache2"
@ -338,9 +330,6 @@ done
# Last touches
#
ln -nsf /var/alternc/bureau /var/alternc/dns/$FQDN_LETTER/$FQDN
ln -nsf /var/alternc/bureau /var/alternc/dns/$PUBLIC_IP_BEGIN/$PUBLIC_IP
# Creating admin user if needed
HAS_ROOT=`mysql --defaults-file=/etc/alternc/my.cnf -e "SELECT COUNT(*) FROM membres WHERE login = 'admin' OR login = 'root' and su = 1" | tail -1`

View File

@ -1,17 +0,0 @@
#!/bin/sh
set -e
# protect all domains, not just new ones
. /usr/lib/alternc/basedir_prot.sh
servers="apache-ssl apache"
for server in $servers; do
includefile=/var/alternc/apacheconf/override_php.conf
. /usr/share/wwwconfig-common/apache-include_all.sh
[ "$status" = "uncomment" -o "$status" = "include" ] && restart="$server $restart"
done
. /usr/share/wwwconfig-common/restart.sh

View File

@ -1,22 +0,0 @@
#!/bin/sh
set -e
# We load local.sh
. /etc/alternc/local.sh
find ${ALTERNC_LOC}/dns -lname "${ALTERNC_LOC}/dns/redir/mail" -print -exec rm -f '{}' \; -exec ln -sf ${ALTERNC_LOC}/bureau/admin/webmail '{}' \;
rm -rf ${ALTERNC_LOC}/apacheconf
/usr/lib/alternc/basedir_prot.sh
# if apache exists we reload
if [ -x /etc/init.d/apache ] ; then
invoke-rc.d apache reload
invoke-rc.d apache-ssl reload
fi
# if apache2 exists we reload
if [ -x /etc/init.d/apache2 ] ; then
invoke-rc.d apache2 force-reload
fi

View File

@ -26,7 +26,7 @@
# ----------------------------------------------------------------------
#
SETUID=mail_add mail_del quota_edit quota_get mem_add mem_del
SCRIPTS=quota_edit.sh quota_get.sh basedir_prot.sh sqlbackup.sh rawstat.daily quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh
SCRIPTS=quota_edit.sh quota_get.sh sqlbackup.sh rawstat.daily quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh
LIBS=functions.sh functions_hosting.sh functions_dns.sh
BIN=$(DESTDIR)/usr/lib/alternc/

View File

@ -56,9 +56,6 @@ if [ ! -z "$RELOAD_ZONES" ]; then
$sudo rndc reload "$zone" > /dev/null || echo "Cannot reload bind for zone $zone" >> "$DOMAIN_LOG_FILE"
done
fi
if [ -x /usr/sbin/apachectl ]; then
$sudo /usr/sbin/apachectl graceful > /dev/null || echo "Cannot restart apache" >> "$DOMAIN_LOG_FILE"
fi
if [ -x /usr/sbin/apache2ctl ]; then
$sudo /usr/sbin/apache2ctl graceful > /dev/null || echo "Cannot restart apache" >> "$DOMAIN_LOG_FILE"
fi

View File

@ -1,80 +0,0 @@
#!/bin/sh
set -e
# Ceci créé un hack php pour chacun des domaines hébergés par alternc
# ce hack consiste à restreindre chaque usager à son propre répertoire
# dans alternc/html/u/user avec open_base_dir
# ce script a les dépendances suivantes:
# (mysql, /etc/alternc/local.sh) OR /usr/bin/get_account_by_domain dans
# l'ancien package alternc-admintools désormais dans alternc natif.
# cut, awk, sort
override_d=/var/alternc/apacheconf
override_f=${override_d}/override_php.conf
extra_paths="/var/alternc/dns/redir:/usr/share/php/:/var/alternc/tmp:/tmp"
. /etc/alternc/local.sh
. /usr/lib/alternc/functions.sh
echo -n "adding open_base_dir protection for:"
# boucle sur tous les domaines hébergés, ou sur les arguments de la
# ligne de commande
if [ $# -gt 0 ]; then
for i in "$*"
do
if echo "$i" | grep -q '^\*\.'
then
echo skipping wildcard "$i" >&2
continue
fi
if echo "$i" | grep -q /var/alternc/dns > /dev/null; then
dom="$i"
else
initial_domain=`print_domain_letter "$i"`
dom="/var/alternc/dns/$initial_domain/$i"
fi
doms="$doms $dom"
done
else
doms=`find /var/alternc/dns -type l`
fi
for i in $doms
do
# don't "protect" squirrelmail, it legitimatly needs to consult
# files out of its own directory
if readlink "$i" | grep -q '^/var/alternc/bureau/admin/webmail/*$' || \
readlink "$i" | grep -q '^/var/alternc/bureau/*$'
then
continue
fi
domain=`basename "$i"`
account=`get_account_by_domain $domain`
if [ -z "$account" ]; then
continue
fi
# la première lettre de l'avant-dernière partie du domaine (e.g.
# www.alternc.org -> a)
initial_domain=`print_domain_letter "$domain"`
# la première lettre du username
initial_account=`print_user_letter "$account"`
path1="/var/alternc/dns/$initial_domain/$domain"
path2="/var/alternc/html/$initial_account/$account"
mkdir -p "$override_d/$initial_domain"
if append_no_dupe "$override_d/$initial_domain/$domain" <<EOF
<Directory ${path1}>
php_admin_value open_basedir ${path2}/:${extra_paths}
</Directory>
EOF
then
true
else
echo -n " $domain"
add_dom_entry "Include $override_d/$initial_domain/$domain"
fi
done
echo .

View File

@ -95,7 +95,7 @@ done
for dom in $( mysql_query "select domaine from domaines where dns_action = 'DELETE';") ; do
dns_delete $dom
# Web configurations have already bean cleaned previously
mysql_query "delete sub_domaines where domaine='$dom'; delete domaines where domaine='$dom';"
mysql_query "delete from sub_domaines where domaine='$dom'; delete from domaines where domaine='$dom';"
RELOAD_ZONES="$RELOAD_ZONES $dom"
done
@ -114,7 +114,8 @@ fi
mv "$tempo" "$VHOST_FILE"
# we assume we run apache and bind on the master
/usr/bin/alternc_reload $RELOAD_ZONES || true
#/usr/bin/alternc_reload $RELOAD_ZONES || true
/usr/bin/alternc_reload all || true
for slave in $ALTERNC_SLAVES; do
if [ "$slave" != "localhost" ]; then
ssh alternc@$slave alternc_reload "$RELOAD_ZONES" || true