From eb11bb790d6bfd45e3fb7d7c42315101d35ea3a1 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Mon, 18 Feb 2013 14:43:55 +0000 Subject: [PATCH] Divers patchs Le paquet se construit --- debian/alternc-awstats.dirs | 10 +++++----- debian/alternc-squirrelmail.dirs | 2 +- debian/rules | 6 ++---- install/alternc.install | 1 + install/reset_root.php | 4 ++-- squirrelmail/Makefile | 2 +- src/alternc-check | 20 ++++++++++---------- src/mail_dodelete.php | 2 +- src/procmail_to_sieve.php | 8 +++++--- src/quota_edit | 6 +++--- src/quota_get | 2 +- src/spoolsize.php | 4 ++-- 12 files changed, 34 insertions(+), 33 deletions(-) diff --git a/debian/alternc-awstats.dirs b/debian/alternc-awstats.dirs index ea9cb079..14240217 100644 --- a/debian/alternc-awstats.dirs +++ b/debian/alternc-awstats.dirs @@ -3,11 +3,11 @@ etc/cron.d etc/awstats etc/alternc/templates/awstats var/cache/awstats -var/alternc/bureau/class -var/alternc/bureau/admin -var/alternc/bureau/locales/fr_FR/LC_MESSAGES -var/alternc/bureau/locales/en_US/LC_MESSAGES -var/alternc/bureau/locales/es_ES/LC_MESSAGES +usr/lib/alternc/panel/class +usr/lib/alternc/panel/admin +usr/lib/alternc/panel/locales/fr_FR/LC_MESSAGES +usr/lib/alternc/panel/locales/en_US/LC_MESSAGES +usr/lib/alternc/panel/locales/es_ES/LC_MESSAGES usr/lib/alternc usr/share/alternc usr/share/doc/alternc-awstats diff --git a/debian/alternc-squirrelmail.dirs b/debian/alternc-squirrelmail.dirs index 5881ff2f..48b70254 100644 --- a/debian/alternc-squirrelmail.dirs +++ b/debian/alternc-squirrelmail.dirs @@ -3,5 +3,5 @@ etc/alternc/templates/squirrelmail etc/alternc/templates/apache2 etc/squirrelmail usr/lib/alternc/install.d -var/alternc/bureau/class +usr/lib/alternc/panel/class usr/share/squirrelmail/plugins/alternc_changepass diff --git a/debian/rules b/debian/rules index b9a80406..29cce28a 100755 --- a/debian/rules +++ b/debian/rules @@ -48,7 +48,7 @@ install: build # Install cp -r etc/* debian/alternc/etc 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 (cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc) @@ -64,14 +64,12 @@ install: build chmod 1733 debian/alternc/var/alternc/sessions chmod -R 644 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 #log directory mkdir -p 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/ chown 1999:1999 debian/alternc/var/run/alternc/ diff --git a/install/alternc.install b/install/alternc.install index 64e21f9f..391688a1 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -503,6 +503,7 @@ for service in $SERVICES; do done #launch fixperms +echo "Fix all the permission. May be quite long..." /usr/lib/alternc/fixperms.sh # hook diff --git a/install/reset_root.php b/install/reset_root.php index 396b6b11..121883a3 100644 --- a/install/reset_root.php +++ b/install/reset_root.php @@ -30,8 +30,8 @@ */ // Ne vérifie pas ma session :) -chdir("/var/alternc/bureau"); -require("/var/alternc/bureau/class/config_nochk.php"); +chdir("/usr/lib/alternc/panel/"); +require("/usr/lib/alternc/panel/class/config_nochk.php"); // On passe super-admin $admin->enabled=1; diff --git a/squirrelmail/Makefile b/squirrelmail/Makefile index dd956da6..fb82a6fc 100644 --- a/squirrelmail/Makefile +++ b/squirrelmail/Makefile @@ -27,6 +27,6 @@ install: # domaintype template: install -m 644 templates/apache2/squirrelmail.conf $(DESTDIR)/etc/alternc/templates/apache2/squirrelmail.conf # 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 install -m 644 alternc_changepass/setup.php alternc_changepass/change.php $(DESTDIR)/usr/share/squirrelmail/plugins/alternc_changepass/ diff --git a/src/alternc-check b/src/alternc-check index 219f2caa..08e060b7 100755 --- a/src/alternc-check +++ b/src/alternc-check @@ -68,7 +68,7 @@ if ($r=="1" || $r=="a") { $r=mysql_query("SELECT DISTINCT(path),uid from mail_users;"); while ($c=mysql_fetch_array($r)) { 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"])) { exec("chown -R 33.".$c["uid"]." ".escapeshellarg($c["path"])); } else { @@ -88,27 +88,27 @@ if ($r=="2" || $r=="a") { $r=mysql_query("SELECT uid,login FROM membres;"); while ($c=mysql_fetch_array($r)) { echo $c["login"]." ".$c["uid"]."\n"; - if (is_dir("/var/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"])); + if (is_dir(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 { - 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"; } -// Remove non-existent pop accounts in /var/alternc/mail +// Remove non-existent pop accounts in ALTERNC_MAIL if ($r=="3" || $r=="a") { echo "========== ".$checks[3]." STARTING (".date("d/m/Y H:i:s").")\n"; - $mail="/var/alternc/mail"; + $mail=ALTERNC_MAIL; $d1=opendir($mail); while (($c1=readdir($d1))!==false) { if (substr($c1,0,1)!="." && is_dir($mail."/".$c1)) { $d2=opendir($mail."/".$c1); while ($c2=readdir($d2)) { 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)."';")); if (!$alias) { 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") { echo "========== ".$checks[4]." STARTING (".date("d/m/Y H:i:s").")\n"; - $html="/var/alternc/html"; + $html=ALTERNC_HTML; $d1=opendir($html); while (($c1=readdir($d1))!==false) { if (substr($c1,0,1)!="." && is_dir($html."/".$c1)) { $d2=opendir($html."/".$c1); while ($c2=readdir($d2)) { 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) { echo "WARNING: html folder is inconsistent in ".$html."/".$c1."/".$c2." YOU SHOULD FIX IT MANUALLY !\n"; } else { diff --git a/src/mail_dodelete.php b/src/mail_dodelete.php index a2fc3234..6fcfbad4 100644 --- a/src/mail_dodelete.php +++ b/src/mail_dodelete.php @@ -7,7 +7,7 @@ if (empty($mail_id) ) { 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 ? $uid=$mail->get_account_by_mail_id($mail_id); diff --git a/src/procmail_to_sieve.php b/src/procmail_to_sieve.php index ce10bca3..0b0981f0 100755 --- a/src/procmail_to_sieve.php +++ b/src/procmail_to_sieve.php @@ -232,10 +232,10 @@ stop; function readrules($user="") { if (!$user) $user=$this->user; $u=substr($user,0,1); - if (!file_exists("/var/alternc/mail/$u/$user/.procmailrc")) { + if (!file_exists(ALTERNC_MAIL."/$u/$user/.procmailrc")) { 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; $res=array(); while (!feof($f)) { @@ -364,7 +364,9 @@ $aactions=array( /* ----------------------------------------------------------------- */ // CONFIGURATION : -$ROOT="/var/alternc/mail"; +include_once('/usr/lib/alternc/panel/class/local.php'); +$ROOT=$L_ALTERNC_MAIL; + $SIEVEROOT="/var/lib/dovecot/sieve"; // GO ! procmail2sieve(); diff --git a/src/quota_edit b/src/quota_edit index 66bbf3aa..ac0778bc 100755 --- a/src/quota_edit +++ b/src/quota_edit @@ -23,16 +23,16 @@ fi 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 -# (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. QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${ALTERNC_HTML} type nfs.*,\1,p"` echo $QUOTA_PART 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 - `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 diff --git a/src/quota_get b/src/quota_get index cd0cd8c1..0b30bac8 100755 --- a/src/quota_get +++ b/src/quota_get @@ -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 }'` # 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. QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${DATA_PART} type nfs.*,\1,p"` diff --git a/src/spoolsize.php b/src/spoolsize.php index 4b4c0d74..e91cebec 100644 --- a/src/spoolsize.php +++ b/src/spoolsize.php @@ -1,7 +1,7 @@ #!/usr/bin/php -q