Divers patchs

Le paquet se construit
This commit is contained in:
Alan Garcia 2013-02-18 14:43:55 +00:00
parent 5890c7a215
commit eb11bb790d
12 changed files with 34 additions and 33 deletions

View File

@ -3,11 +3,11 @@ etc/cron.d
etc/awstats etc/awstats
etc/alternc/templates/awstats etc/alternc/templates/awstats
var/cache/awstats var/cache/awstats
var/alternc/bureau/class usr/lib/alternc/panel/class
var/alternc/bureau/admin usr/lib/alternc/panel/admin
var/alternc/bureau/locales/fr_FR/LC_MESSAGES usr/lib/alternc/panel/locales/fr_FR/LC_MESSAGES
var/alternc/bureau/locales/en_US/LC_MESSAGES usr/lib/alternc/panel/locales/en_US/LC_MESSAGES
var/alternc/bureau/locales/es_ES/LC_MESSAGES usr/lib/alternc/panel/locales/es_ES/LC_MESSAGES
usr/lib/alternc usr/lib/alternc
usr/share/alternc usr/share/alternc
usr/share/doc/alternc-awstats usr/share/doc/alternc-awstats

View File

@ -3,5 +3,5 @@ etc/alternc/templates/squirrelmail
etc/alternc/templates/apache2 etc/alternc/templates/apache2
etc/squirrelmail etc/squirrelmail
usr/lib/alternc/install.d usr/lib/alternc/install.d
var/alternc/bureau/class usr/lib/alternc/panel/class
usr/share/squirrelmail/plugins/alternc_changepass usr/share/squirrelmail/plugins/alternc_changepass

6
debian/rules vendored
View File

@ -48,7 +48,7 @@ install: build
# Install # Install
cp -r etc/* debian/alternc/etc cp -r etc/* debian/alternc/etc
cp -r install/* debian/alternc/usr/share/alternc/install cp -r install/* debian/alternc/usr/share/alternc/install
mkdir debian/alternc/usr/lib/alternc/panel test -d debian/alternc/usr/lib/alternc/panel || mkdir debian/alternc/usr/lib/alternc/panel
cp -r bureau/* debian/alternc/usr/lib/alternc/panel cp -r bureau/* debian/alternc/usr/lib/alternc/panel
(cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc) (cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc)
@ -64,14 +64,12 @@ install: build
chmod 1733 debian/alternc/var/alternc/sessions chmod 1733 debian/alternc/var/alternc/sessions
chmod -R 644 debian/alternc/usr/lib/alternc/panel chmod -R 644 debian/alternc/usr/lib/alternc/panel
chmod -R a+X debian/alternc/usr/lib/alternc/panel chmod -R a+X debian/alternc/usr/lib/alternc/panel
chown -R www-data:www-data debian/alternc/var/alternc/html debian/alternc/var/log/alternc debian/alternc/var/alternc/tmp chown -R www-data:www-data 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 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
#log directory #log directory
mkdir -p debian/alternc/var/alternc/logs mkdir -p debian/alternc/var/alternc/logs
chown 1999:1999 debian/alternc/var/alternc/logs chown 1999:1999 debian/alternc/var/alternc/logs
# Group and user 1999 reference alterncpanel
chown 1999:1999 debian/alternc/var/alternc/html/*
mkdir -p debian/alternc/var/run/alternc/ mkdir -p debian/alternc/var/run/alternc/
chown 1999:1999 debian/alternc/var/run/alternc/ chown 1999:1999 debian/alternc/var/run/alternc/

View File

@ -503,6 +503,7 @@ for service in $SERVICES; do
done done
#launch fixperms #launch fixperms
echo "Fix all the permission. May be quite long..."
/usr/lib/alternc/fixperms.sh /usr/lib/alternc/fixperms.sh
# hook # hook

View File

@ -30,8 +30,8 @@
*/ */
// Ne vérifie pas ma session :) // Ne vérifie pas ma session :)
chdir("/var/alternc/bureau"); chdir("/usr/lib/alternc/panel/");
require("/var/alternc/bureau/class/config_nochk.php"); require("/usr/lib/alternc/panel/class/config_nochk.php");
// On passe super-admin // On passe super-admin
$admin->enabled=1; $admin->enabled=1;

View File

@ -27,6 +27,6 @@ install:
# domaintype template: # domaintype template:
install -m 644 templates/apache2/squirrelmail.conf $(DESTDIR)/etc/alternc/templates/apache2/squirrelmail.conf install -m 644 templates/apache2/squirrelmail.conf $(DESTDIR)/etc/alternc/templates/apache2/squirrelmail.conf
# Desktop files # Desktop files
install -o 1999 -g 1999 -m 644 class/m_squirrelmail.php $(DESTDIR)/var/alternc/bureau/class/ install -o 1999 -g 1999 -m 644 class/m_squirrelmail.php $(DESTDIR)/usr/lib/alternc/panel/class/
# Squirrelmail Change Password Plugin # Squirrelmail Change Password Plugin
install -m 644 alternc_changepass/setup.php alternc_changepass/change.php $(DESTDIR)/usr/share/squirrelmail/plugins/alternc_changepass/ install -m 644 alternc_changepass/setup.php alternc_changepass/change.php $(DESTDIR)/usr/share/squirrelmail/plugins/alternc_changepass/

View File

@ -68,7 +68,7 @@ if ($r=="1" || $r=="a") {
$r=mysql_query("SELECT DISTINCT(path),uid from mail_users;"); $r=mysql_query("SELECT DISTINCT(path),uid from mail_users;");
while ($c=mysql_fetch_array($r)) { while ($c=mysql_fetch_array($r)) {
echo $c["path"]." ".$c["uid"]."\n"; echo $c["path"]." ".$c["uid"]."\n";
if (substr($c["path"],0,17)=="/var/alternc/mail") { if (substr($c["path"],0,17)==ALTERNC_MAIL) {
if (is_dir($c["path"])) { if (is_dir($c["path"])) {
exec("chown -R 33.".$c["uid"]." ".escapeshellarg($c["path"])); exec("chown -R 33.".$c["uid"]." ".escapeshellarg($c["path"]));
} else { } else {
@ -88,27 +88,27 @@ if ($r=="2" || $r=="a") {
$r=mysql_query("SELECT uid,login FROM membres;"); $r=mysql_query("SELECT uid,login FROM membres;");
while ($c=mysql_fetch_array($r)) { while ($c=mysql_fetch_array($r)) {
echo $c["login"]." ".$c["uid"]."\n"; echo $c["login"]." ".$c["uid"]."\n";
if (is_dir("/var/alternc/html/".substr($c["login"],0,1)."/".$c["login"])) { if (is_dir(ALTERNC_HTML."/".substr($c["login"],0,1)."/".$c["login"])) {
exec("chown -R 33.".$c["uid"]." ".escapeshellarg("/var/alternc/html/".substr($c["login"],0,1)."/".$c["login"])); exec("chown -R 33.".$c["uid"]." ".escapeshellarg(ALTERNC_HTML."/".substr($c["login"],0,1)."/".$c["login"]));
} else { } else {
echo "WARNING: Folder "."/var/alternc/html/".substr($c["login"],0,1)."/".$c["login"]." does not exist. Please do relevant check to delete associated alternc account, or recreate the folder\n"; echo "WARNING: Folder ".ALTERNC_HTML."/".substr($c["login"],0,1)."/".$c["login"]." does not exist. Please do relevant check to delete associated alternc account, or recreate the folder\n";
} }
} }
echo "========== ".$checks[2]." ENDING (".date("d/m/Y H:i:s").")\n"; echo "========== ".$checks[2]." ENDING (".date("d/m/Y H:i:s").")\n";
} }
// Remove non-existent pop accounts in /var/alternc/mail // Remove non-existent pop accounts in ALTERNC_MAIL
if ($r=="3" || $r=="a") { if ($r=="3" || $r=="a") {
echo "========== ".$checks[3]." STARTING (".date("d/m/Y H:i:s").")\n"; echo "========== ".$checks[3]." STARTING (".date("d/m/Y H:i:s").")\n";
$mail="/var/alternc/mail"; $mail=ALTERNC_MAIL;
$d1=opendir($mail); $d1=opendir($mail);
while (($c1=readdir($d1))!==false) { while (($c1=readdir($d1))!==false) {
if (substr($c1,0,1)!="." && is_dir($mail."/".$c1)) { if (substr($c1,0,1)!="." && is_dir($mail."/".$c1)) {
$d2=opendir($mail."/".$c1); $d2=opendir($mail."/".$c1);
while ($c2=readdir($d2)) { while ($c2=readdir($d2)) {
if (substr($c2,0,1)!="." && is_dir($mail."/".$c1."/".$c2)) { if (substr($c2,0,1)!="." && is_dir($mail."/".$c1."/".$c2)) {
// Ok, we have a mail folder in /var/alternc/mail/p/popaccount_domain.tld/ Let's check it in the db : // Ok, we have a mail folder in /var/mail/alternc/p/popaccount_domain.tld/ Let's check it in the db :
list($alias)=@mysql_fetch_array(mysql_query("SELECT alias FROM mail_users WHERE path='".addslashes($mail."/".$c1."/".$c2)."';")); list($alias)=@mysql_fetch_array(mysql_query("SELECT alias FROM mail_users WHERE path='".addslashes($mail."/".$c1."/".$c2)."';"));
if (!$alias) { if (!$alias) {
echo "WARNING: NOT FOUND: ".$mail."/".$c1."/".$c2.", deleting old pop folder.\n"; echo "WARNING: NOT FOUND: ".$mail."/".$c1."/".$c2.", deleting old pop folder.\n";
@ -131,17 +131,17 @@ if ($r=="3" || $r=="a") {
} }
// Remove non-existent alternc accounts in /var/alternc/html // Remove non-existent alternc accounts in ALTERNC_HTML
if ($r=="4" || $r=="a") { if ($r=="4" || $r=="a") {
echo "========== ".$checks[4]." STARTING (".date("d/m/Y H:i:s").")\n"; echo "========== ".$checks[4]." STARTING (".date("d/m/Y H:i:s").")\n";
$html="/var/alternc/html"; $html=ALTERNC_HTML;
$d1=opendir($html); $d1=opendir($html);
while (($c1=readdir($d1))!==false) { while (($c1=readdir($d1))!==false) {
if (substr($c1,0,1)!="." && is_dir($html."/".$c1)) { if (substr($c1,0,1)!="." && is_dir($html."/".$c1)) {
$d2=opendir($html."/".$c1); $d2=opendir($html."/".$c1);
while ($c2=readdir($d2)) { while ($c2=readdir($d2)) {
if (substr($c2,0,1)!="." && is_dir($html."/".$c1."/".$c2)) { if (substr($c2,0,1)!="." && is_dir($html."/".$c1."/".$c2)) {
// Ok, we have a html folder in /var/alternc/html/u/user/ Let's check it in the db : // Ok, we have a html folder in ALTERNC_HTML/u/user/ Let's check it in the db :
if (substr($c2,0,1)!=$c1) { if (substr($c2,0,1)!=$c1) {
echo "WARNING: html folder is inconsistent in ".$html."/".$c1."/".$c2." YOU SHOULD FIX IT MANUALLY !\n"; echo "WARNING: html folder is inconsistent in ".$html."/".$c1."/".$c2." YOU SHOULD FIX IT MANUALLY !\n";
} else { } else {

View File

@ -7,7 +7,7 @@ if (empty($mail_id) ) {
die('You must specified a valid mail id (integer)'); die('You must specified a valid mail id (integer)');
} }
require_once("/var/alternc/bureau/class/config_nochk.php"); require_once("/usr/lib/alternc/panel/class/config_nochk.php");
// Wich account should I be ? // Wich account should I be ?
$uid=$mail->get_account_by_mail_id($mail_id); $uid=$mail->get_account_by_mail_id($mail_id);

View File

@ -232,10 +232,10 @@ stop;
function readrules($user="") { function readrules($user="") {
if (!$user) $user=$this->user; if (!$user) $user=$this->user;
$u=substr($user,0,1); $u=substr($user,0,1);
if (!file_exists("/var/alternc/mail/$u/$user/.procmailrc")) { if (!file_exists(ALTERNC_MAIL."/$u/$user/.procmailrc")) {
return false; return false;
} }
$f=fopen("/var/alternc/mail/$u/$user/.procmailrc","rb"); $f=fopen(ALTERNC_MAIL."/$u/$user/.procmailrc","rb");
$state=0; $rulenum=0; $ligne=0; $state=0; $rulenum=0; $ligne=0;
$res=array(); $res=array();
while (!feof($f)) { while (!feof($f)) {
@ -364,7 +364,9 @@ $aactions=array(
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
// CONFIGURATION : // CONFIGURATION :
$ROOT="/var/alternc/mail"; include_once('/usr/lib/alternc/panel/class/local.php');
$ROOT=$L_ALTERNC_MAIL;
$SIEVEROOT="/var/lib/dovecot/sieve"; $SIEVEROOT="/var/lib/dovecot/sieve";
// GO ! // GO !
procmail2sieve(); procmail2sieve();

View File

@ -23,16 +23,16 @@ fi
DATA_PART=`$DF "${ALTERNC_HTML}" 2>/dev/null | $AWK 'NR==2 { print $1 }'` DATA_PART=`$DF "${ALTERNC_HTML}" 2>/dev/null | $AWK 'NR==2 { print $1 }'`
# quota will give over NFS will print the partition using the full NFS name # quota will give over NFS will print the partition using the full NFS name
# (e.g. 10.0.0.1:/var/alternc) so we need to lookup first with mount # (e.g. 10.0.0.1:/var/www/alternc) so we need to lookup first with mount
# to convert DATA_PART if needed. # to convert DATA_PART if needed.
QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${ALTERNC_HTML} type nfs.*,\1,p"` QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${ALTERNC_HTML} type nfs.*,\1,p"`
echo $QUOTA_PART echo $QUOTA_PART
if [ -z "$QUOTA_PART" ]; then if [ -z "$QUOTA_PART" ]; then
`sudo $QUOTA -r -g $MID $SIZE $SIZE 0 0 $DATA_PART 2>/dev/null || echo "Group quota are not enabled on /var/alternc." >&2` `sudo $QUOTA -r -g $MID $SIZE $SIZE 0 0 $DATA_PART 2>/dev/null || echo "Group quota are not enabled on $ALTERNC_HTML." >&2`
else else
`sudo $QUOTA -r -g $MID $SIZE $SIZE 0 0 "$ALTERNC_LOC/html" 2>/dev/null || echo "Group quota are not enabled on /var/alternc." >&2` `sudo $QUOTA -r -g $MID $SIZE $SIZE 0 0 "$ALTERNC_LOC/html" 2>/dev/null || echo "Group quota are not enabled on $ALTERNC_HTML." >&2`
fi fi

View File

@ -28,7 +28,7 @@ command -v $QUOTA >/dev/null || { echo "Quotas uninstalled"; exit 0; }
DATA_PART=`$DF "${ALTERNC_LOC}/html" 2>/dev/null | $AWK 'NR==2 { print $1 }'` DATA_PART=`$DF "${ALTERNC_LOC}/html" 2>/dev/null | $AWK 'NR==2 { print $1 }'`
# quota will give over NFS will print the partition using the full NFS name # quota will give over NFS will print the partition using the full NFS name
# (e.g. 10.0.0.1:/var/alternc) so we need to lookup first with mount # (e.g. 10.0.0.1:/var/www/alternc) so we need to lookup first with mount
# to convert DATA_PART if needed. # to convert DATA_PART if needed.
QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${DATA_PART} type nfs.*,\1,p"` QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${DATA_PART} type nfs.*,\1,p"`

View File

@ -1,7 +1,7 @@
#!/usr/bin/php -q #!/usr/bin/php -q
<?php <?php
require_once("/var/alternc/bureau/class/config_nochk.php"); require_once("/usr/lib/alternc/panel/class/config_nochk.php");
// On déverrouile le bureau AlternC :) // On déverrouile le bureau AlternC :)
@alternc_shutdown(); @alternc_shutdown();
@ -9,7 +9,7 @@ echo "---------------------------\n Generating size-cache for web accounts\n\n";
$r=mysql_query("SELECT uid,login FROM membres;"); $r=mysql_query("SELECT uid,login FROM membres;");
while ($c=mysql_fetch_array($r)) { while ($c=mysql_fetch_array($r)) {
echo $c["login"]; flush(); echo $c["login"]; flush();
$size=exec("sudo /usr/lib/alternc/du.pl /var/alternc/html/".substr($c["login"],0,1)."/".$c["login"]); $size=exec("sudo /usr/lib/alternc/du.pl ".ALTERNC_HTML."/".substr($c["login"],0,1)."/".$c["login"]);
mysql_query("REPLACE INTO size_web SET uid='".$c["uid"]."',size='$size';"); mysql_query("REPLACE INTO size_web SET uid='".$c["uid"]."',size='$size';");
echo " done ($size KB) \n"; flush(); echo " done ($size KB) \n"; flush();
} }