diff --git a/.gitattributes b/.gitattributes index 7af3e048..52869f71 100644 --- a/.gitattributes +++ b/.gitattributes @@ -353,8 +353,14 @@ src/.cvsignore -text src/Makefile -text src/basedir_prot.sh -text src/du.pl -text +src/mail_add -text +src/mail_del -text +src/mem_add -text +src/mem_del -text src/quota_delete -text +src/quota_edit -text src/quota_edit.sh -text +src/quota_get -text src/quota_get.sh -text src/quota_init -text src/rawstat.daily -text diff --git a/debian/control b/debian/control index e5a676f0..20251cdf 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2.0 Package: alternc Architecture: all -Depends: debianutils (>= 1.13.1), debconf (>= 0.5.00) | debconf-2.0, libapache-mod-php4 | libapache-mod-php5, apache, apache-ssl, courier-ssl, courier-imap-ssl, courier-pop-ssl, mysql-server, php5-mysql | php4-mysql, phpmyadmin, proftpd-mysql, squirrelmail, postfix, postfix-tls, bind9, wget, libapache-mod-gzip, rsync, quota, courier-authmysql, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php4-cli | php5-cli, php4-mysql | php5-mysql, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), pdksh (>= 5.2.14-6), adduser, perl-suid +Depends: debianutils (>= 1.13.1), debconf (>= 0.5.00) | debconf-2.0, libapache-mod-php4 | libapache-mod-php5, apache, apache-ssl, courier-ssl, courier-imap-ssl, courier-pop-ssl, mysql-server, php5-mysql | php4-mysql, phpmyadmin, proftpd-mysql, squirrelmail, postfix, postfix-tls, bind9, wget, libapache-mod-gzip, rsync, quota, courier-authmysql, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, libsasl2-modules, php4-cli | php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), pdksh (>= 5.2.14-6), adduser, perl-suid Conflicts: alternc-admintools, alternc-awstats (<= 0.3.2), alternc-webalizer (<= 0.9.4) Provides: alternc-admintools Replaces: alternc-admintools diff --git a/src/mail_add b/src/mail_add new file mode 100755 index 00000000..5f4ece4d --- /dev/null +++ b/src/mail_add @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +use strict; + +my ($mailname,$uid) = @ARGV; + +if (!$mailname || !$uid) { + print "Usage: mail_add \n"; + print " Create the mail for the alternc account having uid number \n"; + exit(1); +} + +$ENV{PATH} = ""; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; + +if (!($mailname =~ /^([a-z0-9_\+\.-]+\_[a-z0-9\.-]+)$/)) { + die "Email is incorrect."; +} +$mailname=$1; +if (!($uid =~ /^([0-9]+)$/)) { + die "uid is incorrect."; +} +$uid=$1; + +$< = $>; +$( = $); + +my $PTH="/var/alternc/mail/".substr($mailname,0,1)."/".$mailname; + +my @todo=( + $PTH, + $PTH."/Maildir", + $PTH."/Maildir/cur", + $PTH."/Maildir/new", + $PTH."/Maildir/tmp", + ); + +foreach(@todo) { + mkdir($_); + system("/bin/chown 33:$uid '".quotemeta($_)."'"); +} + +0; + diff --git a/src/mail_del b/src/mail_del new file mode 100755 index 00000000..d36f1070 --- /dev/null +++ b/src/mail_del @@ -0,0 +1,27 @@ +#!/usr/bin/perl + +use strict; + +my ($mailname) = @ARGV; + +if (!$mailname) { + print "Usage: mail_del \n"; + print " Destroy pop account \n"; + exit(1); +} + +$ENV{PATH} = ""; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; + +if (!($mailname =~ /^([a-z0-9_\+\.-]+\_[a-z0-9\.-]+)$/)) { + die "Email is incorrect."; +} +$mailname=$1; + +$< = $>; +$( = $); + +system("/bin/rm -rf '".quotemeta("/var/alternc/mail/".substr($mailname,0,1)."/".$mailname)."'"); + +0; + diff --git a/src/mem_add b/src/mem_add new file mode 100755 index 00000000..cebe5799 --- /dev/null +++ b/src/mem_add @@ -0,0 +1,35 @@ +#!/usr/bin/perl + +use strict; + +my ($name,$uid) = @ARGV; + +if (!$name || !$uid) { + print "Usage: mem_add \n"; + print " Create the AlternC account having uid number \n"; + exit(1); +} + +$ENV{PATH} = ""; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; + +if (!($name =~ /^([a-z0-9_\+\.-]+)$/)) { + die "Account name is incorrect."; +} +$name=$1; +if (!($uid =~ /^([0-9]+)$/)) { + die "uid is incorrect."; +} +$uid=$1; + +$< = $>; +$( = $); + +my $PTH="/var/alternc/html/".substr($name,0,1)."/".$name; + +mkdir($PTH); +system("/bin/chown 33:$uid '".quotemeta($PTH)."'"); +system("/bin/chmod 02770 '".quotemeta($PTH)."'"); + +0; + diff --git a/src/mem_del b/src/mem_del new file mode 100755 index 00000000..ecc874fe --- /dev/null +++ b/src/mem_del @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +use strict; + +my ($name) = @ARGV; + +if (!$name) { + print "Usage: mem_del \n"; + print " Delete the AlternC account \n"; + exit(1); +} + +$ENV{PATH} = ""; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; + +if (!($name =~ /^([a-z0-9_\+\.-]+)$/)) { + die "Account name is incorrect."; +} +$name=$1; + +$< = $>; +$( = $); + +my $PTH="/var/alternc/html/".substr($name,0,1)."/".$name; + +system("/bin/rm -rf '".quotemeta($PTH)."'"); + +0; diff --git a/src/quota_edit b/src/quota_edit new file mode 100755 index 00000000..f21cb352 --- /dev/null +++ b/src/quota_edit @@ -0,0 +1,33 @@ +#!/usr/bin/perl + +use strict; + +my ($uid,$size) = @ARGV; + +if (!$size || !$uid) { + print "Usage: quota_edit \n"; + print " Edit the quota of the AlternC account having uid the the available space to \n"; + exit(1); +} + +$ENV{PATH} = ""; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; + +if (!($uid =~ /^([0-9]+)$/)) { + die "uid is incorrect."; +} +$uid=$1; + +if (!($size =~ /^([0-9]+)$/)) { + die "size is incorrect."; +} +$size=$1; + +$< = $>; +$( = $); + +my $PTH="/usr/lib/alternc/quota_edit.sh '".quotemeta($uid)."' '".quotemeta($size)."'"; + +system($PTH); + +0; diff --git a/src/quota_get b/src/quota_get new file mode 100755 index 00000000..34c6dc11 --- /dev/null +++ b/src/quota_get @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +use strict; + +my ($uid) = @ARGV; + +if (!$uid) { + print "Usage: quota_get \n"; + print " Get the quota of the AlternC account having uid \n"; + exit(1); +} + +$ENV{PATH} = ""; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; + +if (!($uid =~ /^([0-9]+)$/)) { + die "uid is incorrect."; +} +$uid=$1; + +$< = $>; +$( = $); + +my $PTH="/usr/lib/alternc/quota_get.sh '".quotemeta($uid)."'"; + +system($PTH); + +0;