This patch uses the vlimits() API to retrieve the
default user quota for their domain.  This is for
cdb and mysql storage.

This should be applied to 5.3.19

Thanks,


Brian

diff -c vpopmail-5.3.18/vcdb.c vpopmail-5.3.19/vcdb.c
*** vpopmail-5.3.18/vcdb.c      Thu Feb 20 13:27:49 2003
--- vpopmail-5.3.19/vcdb.c      Thu Mar 20 08:49:29 2003
***************
*** 666,671 ****
--- 666,673 ----
   uid_t uid;
   gid_t gid;
   char crypted[100];
+  char quota[30];
+  struct vlimits limits;

        if ( vget_assign(domain, Dir, 156, &uid, &gid ) == NULL ) {
                strcpy(Dir, VPOPMAILDIR);
***************
*** 699,709 ****
          }

  #ifdef HARD_QUOTA
!         fprintf(fs1, "%s", HARD_QUOTA);
  #else
!         fprintf(fs1, "NOQUOTA");
  #endif

  #ifndef CLEAR_PASS
          fprintf(fs1, "\n");
  #else
--- 701,715 ----
          }

  #ifdef HARD_QUOTA
!         snprintf(quota, sizeof(quota), "%s", HARD_QUOTA);
  #else
!         strcpy(quota, "NOQUOTA");
  #endif
 
+         if (!vget_limits(domain, &limits))
+             snprintf(quota, sizeof(quota), "%s", limits.defaultquota);
+         fprintf(fs1, quota);
+
  #ifndef CLEAR_PASS
          fprintf(fs1, "\n");
  #else
diff -c vpopmail-5.3.18/vmysql.c vpopmail-5.3.19/vmysql.c
*** vpopmail-5.3.18/vmysql.c    Mon Jan 27 11:29:15 2003
--- vpopmail-5.3.19/vmysql.c    Thu Mar 20 08:45:53 2003
***************
*** 250,255 ****
--- 250,256 ----
   char quota[30];
   char Crypted[100];
   int err;
+  struct vlimits limits;

      if ( (err=vauth_open_update()) != 0 ) return(err);
      vset_default_domain( domain );
***************
*** 260,265 ****
--- 261,269 ----
      strncpy( quota, "NOQUOTA", 30 );
  #endif

+     if (!vget_limits(domain, &limits))
+         snprintf(quota, sizeof(quota), "%s", limits.defaultquota);
+
  #ifndef MANY_DOMAINS
      domstr = vauth_munch_domain( domain );
  #else

Reply via email to