Update of /cvsroot/qmailadmin/qmailadmin
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28079
Modified Files:
Tag: stable-1_2
ChangeLog template.c
Log Message:
Report disk usage to non-admin user on their Modify User page. (from Chaz Owensby)
Index: template.c
===================================================================
RCS file: /cvsroot/qmailadmin/qmailadmin/template.c,v
retrieving revision 1.7.2.15
retrieving revision 1.7.2.16
diff -u -d -r1.7.2.15 -r1.7.2.16
--- template.c 21 Sep 2007 23:27:39 -0000 1.7.2.15
+++ template.c 8 Jan 2008 04:45:01 -0000 1.7.2.16
@@ -422,6 +422,21 @@
show_user_lines(Username, Domain, Mytime, RealDir);
break;
+ /* show quota usage */
+ case 'Q':
+ vpw = vauth_getpw(ActionUser, Domain);
+ if (strncmp(vpw->pw_shell, "NOQUOTA", 2) != 0) {
+ long diskquota = 0;
+ int maxmsg = 0;
+ char path[256];
+
+ quota_to_megabytes(qconvert, vpw->pw_shell);
+ snprintf(path, sizeof(path), "%s/" MAILDIR, vpw->pw_dir);
+ readuserquota(path, &diskquota, &maxmsg);
+ printf ("%-2.2lf /", ((double)diskquota)/1048576.0); /* Convert to MB */
+ }
+ break;
+
/* display user's quota (mod user page) */
case 'q':
vpw = vauth_getpw(ActionUser, Domain);
Index: ChangeLog
===================================================================
RCS file: /cvsroot/qmailadmin/qmailadmin/ChangeLog,v
retrieving revision 1.15.2.110
retrieving revision 1.15.2.111
diff -u -d -r1.15.2.110 -r1.15.2.111
--- ChangeLog 8 Jan 2008 04:42:54 -0000 1.15.2.110
+++ ChangeLog 8 Jan 2008 04:45:01 -0000 1.15.2.111
@@ -7,6 +7,9 @@
- qmailadmin.c: check return value of setuid() and setgid() and
exit if either fail (security issue reported by Miguel Lourenco).
+ Chaz Owensby
+ - Report disk usage to non-admin user on their Modify User page.
+
1.2.12 - released 13-Nov-07
John Simpson
|