Modifs debian sur quelques scripts

This commit is contained in:
Alan Garcia 2013-02-18 13:54:00 +00:00
parent 04462b0cf3
commit fcca1511c6
5 changed files with 10 additions and 11 deletions

View File

@ -6,7 +6,7 @@
echo "Connecting to AlternC MySQL database... "; flush();
define('NOCHECK', 1);
require_once("/var/alternc/bureau/class/config.php");
require_once("/usr/lib/alternc/panel/class/config.php");
echo "done.\n";
echo "------------------------------------------------------------\n";
@ -35,8 +35,8 @@ if (!$m1 && !$m2 && !$m3 && !$m4 && !$m5) {
$checks=array(
"1" => "Change owner and group of pop mail accounts",
"2" => "Change owner and group of html folders",
"3" => "Remove non-existent pop accounts in /var/alternc/mail",
"4" => "Remove non-existent alternc accounts in /var/alternc/html",
"3" => "Remove non-existent pop accounts in ALTERNC_MAIL",
"4" => "Remove non-existent alternc accounts in ALTERNC_HTML",
"5" => "Delete subdomains of non-existents folders pointers (dangling links)",
"6" => "Delete ftp accounts of non-existents folders",
"7" => "Delete mailman mailing-lists in mailman alternc table who does not exists anymore in /var/lib/mailman/lists",
@ -209,4 +209,4 @@ if ($r=="100" || $r=="a") {
}
?>
?>

View File

@ -17,7 +17,7 @@ if ($argc!=2) {
$name=$argv[1];
include("/var/alternc/bureau/class/local.php");
include("/usr/lib/alternc/panel/class/local.php");
if (!mysql_connect($L_MYSQL_HOST,$L_MYSQL_LOGIN,$L_MYSQL_PWD)) {
echo "Cannot connect to Mysql !\n";

View File

@ -20,13 +20,13 @@ if [ $# -ne 2 ] || [[ ! "$MID" =~ ^[0-9]+$ ]] || [[ ! "$SIZE" =~ ^[0-9]+$ ]]; th
exit 1
fi
DATA_PART=`$DF "${ALTERNC_LOC}/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
# (e.g. 10.0.0.1:/var/alternc) so we need to lookup first with mount
# to convert DATA_PART if needed.
QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${ALTERNC_LOC}/html type nfs.*,\1,p"`
QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${ALTERNC_HTML} type nfs.*,\1,p"`
echo $QUOTA_PART
if [ -z "$QUOTA_PART" ]; then

View File

@ -21,7 +21,7 @@ if ($argc!=3) {
$name=$argv[1];
$quota=$argv[2];
include("/var/alternc/bureau/class/local.php");
include("/usr/lib/alternc/panel/class/local.php");
if (!mysql_connect($L_MYSQL_HOST,$L_MYSQL_LOGIN,$L_MYSQL_PWD)) {
echo "Cannot connect to Mysql !\n";

View File

@ -15,8 +15,7 @@ done
LOCK_FILE="/var/run/alternc/update_mails"
#FIXME: this var should be define by local.sh
ALTERNC_MAIL_LOC="/var/alternc/mail"
# ALTERNC_MAIL is from local.sh
# Somes check before start operations
if [ `id -u` -ne 0 ]; then
@ -44,7 +43,7 @@ mysql_query "SELECT id, address_id, quote(replace(path,'!','\\!')) FROM mailbox
mysql_query "UPDATE mailbox set mail_action='DELETING' WHERE id=$id;"
/usr/lib/alternc/mail_dodelete.php "$address_id"
# Check there is no instruction of changing directory, and check the first part of the string
if [[ "$path" =~ '../' || "$path" =~ '/..' || ! "'$ALTERNC_MAIL_LOC'" == "${path:0:$((${#ALTERNC_MAIL_LOC}+1))}'" ]] ; then
if [[ "$path" =~ '../' || "$path" =~ '/..' || ! "'$ALTERNC_MAIL'" == "${path:0:$((${#ALTERNC_MAIL}+1))}'" ]] ; then
# The path will be empty for mailman addresses
if [[ "$path" != "''" ]]; then
echo "Error : this directory will not be deleted, pattern incorrect"