diff --git a/.gitattributes b/.gitattributes index 845b79f7..27bfcc24 100644 --- a/.gitattributes +++ b/.gitattributes @@ -439,6 +439,7 @@ src/update_domains.sh -text tests/mechdump.pm -text tests/test_demo.pl -text tests/whois_test.php -text +tools/alternc_get_path -text tools/get_account_by_domain -text tools/get_domains_by_account -text tools/top_ftp_users -text diff --git a/debian/rules b/debian/rules index 4bb860c6..fd41589c 100755 --- a/debian/rules +++ b/debian/rules @@ -74,6 +74,7 @@ install: build install tools/top_ftp_users debian/alternc/usr/bin install tools/get_domains_by_account debian/alternc/usr/bin install tools/get_account_by_domain debian/alternc/usr/bin + install tools/alternc_get_path debian/alternc/usr/bin install src/alternc_reload debian/alternc/usr/bin install -m 644 po/fr/LC_MESSAGES/alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES/ diff --git a/tools/alternc_get_path b/tools/alternc_get_path new file mode 100644 index 00000000..981488b9 --- /dev/null +++ b/tools/alternc_get_path @@ -0,0 +1,10 @@ +#! /bin/sh -e + +path="$1" +account=`echo "$path" | sed 's#/var/alternc/html/./##' | cut -d '/' -f 1` +relpath=`echo "$path" | sed 's#/var/alternc/html/./[^/]*##'` + +request="SELECT membres.login AS user, CONCAT(s.sub, '.', s.domaine) AS fqdn FROM sub_domaines s INNER JOIN membres ON s.compte=uid WHERE login='$account' AND s.type = 0 AND '$relpath' LIKE CONCAT(s.valeur,'%') ORDER BY sub ASC;" + +mysql --defaults-file=/etc/alternc/my.cnf -B -e "$request" +