diff --git a/ChangeLog b/ChangeLog index f015b29b..750b0f0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4141,6 +4141,10 @@ v0.33.18 27-Jul-2001 Removed some compiler warnings on some systems. Added menu Display lines. Added menu item 21, display text only. + When a user has no download files limit and no download Kbytes + limit he may download unlimited. + When a user has no timelimit set in the limits, he will get + a 24 hours session limit. mbuseradd: Ported to work on FreeBSD. diff --git a/html/setup/security.html b/html/setup/security.html index b172514b..4b706cc5 100644 --- a/html/setup/security.html +++ b/html/setup/security.html @@ -11,7 +11,7 @@
-
Last update 29-Jan-2001
+
Last update 30-Sep-2001

 

MBSE BBS Setup - BBS Setup - Security Limits.

@@ -36,9 +36,9 @@ is not wanted. Some defaults are installed during first bbs setup.

 Access level    The access level value.
-Maximum time    The maximum time each day.
-Download Kb.    Maximum Kilobytes download each day.
-Download Files  Maximum files to download each day.
+Maximum time    The maximum time each day. If set to zero, the user gets 24 hours a day.
+Download Kb.    Maximum Kilobytes download each day, zero is unlimited.
+Download Files  Maximum files to download each day, zero is unlimited.
 Description     The description for this level.
 Available       If this level is available.
 Deleted         If this level must be deleted.
diff --git a/mbsebbs/file.c b/mbsebbs/file.c
index 789c2470..025ae290 100644
--- a/mbsebbs/file.c
+++ b/mbsebbs/file.c
@@ -2,7 +2,7 @@
  *
  * File ..................: bbs/file.c
  * Purpose ...............: All the file functions. 
- * Last modification date : 10-Aug-2001
+ * Last modification date : 30-Sep-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -415,8 +415,10 @@ void Download(void)
 	 * Minus the amount downloaded today from downloadktoday
 	 * if less than zero, it won't let the user download anymore.
 	 */
-	exitinfo.DownloadKToday -= (Size / 1024);
-	exitinfo.iTransferTime = iTransfer;
+	if (LIMIT.DownK || LIMIT.DownF) {
+		exitinfo.DownloadKToday -= (Size / 1024);
+		exitinfo.iTransferTime = iTransfer;
+	}
 
 	WriteExitinfo();
 	Pause();
diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c
index 9268c05a..7cfcad63 100644
--- a/mbsebbs/filesub.c
+++ b/mbsebbs/filesub.c
@@ -2,7 +2,7 @@
  *
  * File ..................: bbs/filesub.c
  * Purpose ...............: All the file sub functions. 
- * Last modification date : 09-Aug-2001
+ * Last modification date : 30-Sep-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -488,24 +488,26 @@ int ShowOneFile()
 
 int CheckBytesAvailable(long CostSize)
 {
-	if((exitinfo.DownloadKToday <= 0) || ((CostSize / 1024) > exitinfo.DownloadKToday)) {
+	if (LIMIT.DownK || LIMIT.DownF) {
+		if ((exitinfo.DownloadKToday <= 0) || ((CostSize / 1024) > exitinfo.DownloadKToday)) {
+	
+			/* You do not have enough bytes to download \" */
+			pout(12, 0, (char *) Language(252));
+			Enter(1);
+			Syslog('+', "Not enough bytes to download %ld", CostSize);
 
-		/* You do not have enough bytes to download \" */
-		pout(12, 0, (char *) Language(252));
-		Enter(1);
-		Syslog('+', "Not enough bytes to download %ld", CostSize);
+			colour(15, 0);
+			/* You must upload before you can download. */
+			pout(12, 0, (char *) Language(253));
+			Enter(2);
 
-		colour(15, 0);
-		/* You must upload before you can download. */
-		pout(12, 0, (char *) Language(253));
-		Enter(2);
+			colour(14, 0);
+			/* Kilobytes currently available: */
+			printf("%s%lu Kbytes.\n\n", (char *) Language(254), exitinfo.DownloadKToday);
 
-		colour(14, 0);
-		/* Kilobytes currently available: */
-		printf("%s%lu Kbytes.\n\n", (char *) Language(254), exitinfo.DownloadKToday);
-
-		Pause();
-		return FALSE;
+			Pause();
+			return FALSE;
+		}
 	}
 	
 	return TRUE;
diff --git a/mbsebbs/user.c b/mbsebbs/user.c
index db507d9c..2eb605bf 100644
--- a/mbsebbs/user.c
+++ b/mbsebbs/user.c
@@ -4,7 +4,7 @@
  * Purpose ...............: Main user login procedure.  Checks for limits, 
  *                          new ratio's cats all the welcome screens, and 
  *                          does a lot of checking in general.
- * Last modification date : 08-Aug-2001
+ * Last modification date : 30-Sep-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -964,15 +964,23 @@ void user()
 			sprintf(temp,"%s", (char *) GetDateDMY());
 
 			if((strcmp(StrDateDMY(usrconfig.tLastLoginDate), temp)) != 0) {
-				usrconfig.iTimeLeft    = LIMIT.Time; /* Copy Sec limit/time to users file */
+				/*
+				 *  If no timelimit set give user 24 hours.
+				 */
+				if (LIMIT.Time)
+					usrconfig.iTimeLeft = LIMIT.Time;
+				else
+					usrconfig.iTimeLeft = 86400;
 				usrconfig.iTimeUsed    = 0;          /* Set time used today to Zero       */
 				usrconfig.iConnectTime = 0;	     /* Set connect time to Zero          */
 
 				/*
-				 * Give user new bytes and files every day
+				 * Give user new bytes and files every day if needed.
 				 */
-				usrconfig.DownloadKToday = LIMIT.DownK;
-				usrconfig.DownloadsToday = LIMIT.DownF;
+				if (LIMIT.DownK && LIMIT.DownF) {
+					usrconfig.DownloadKToday = LIMIT.DownK;
+					usrconfig.DownloadsToday = LIMIT.DownF;
+				}
 			}
 		} /* End of else  */
 
diff --git a/mbsetup/m_limits.c b/mbsetup/m_limits.c
index 090a688c..b4739056 100644
--- a/mbsetup/m_limits.c
+++ b/mbsetup/m_limits.c
@@ -2,7 +2,7 @@
  *
  * File ..................: setup/m_limits.c
  * Purpose ...............: Setup Limits.
- * Last modification date : 24-Jun-2001
+ * Last modification date : 30-Sep-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -332,7 +332,7 @@ int EditLimRec(int Area)
 			IsDoing("Browsing Menu");
 			return 0;
 		case 1:	E_INT(  7,25,   LIMIT.Security,   "The ^Security^ level for this limit")
-		case 2:	E_INT(  8,25,   LIMIT.Time,       "The maxmimum ^Time online^ per day for this limit")
+		case 2:	E_INT(  8,25,   LIMIT.Time,       "The maxmimum ^Time online^ per day for this limit, zero to disable")
 		case 3:	E_INT(  9,25,   LIMIT.DownK,      "The ^Kilobytes^ download limit per day, 0 = don't care")
 		case 4:	E_INT( 10,25,   LIMIT.DownF,      "The ^nr of files^ to download per day, 0 = don't care")
 		case 5:	E_STR( 11,25,40,LIMIT.Description,"A short ^description^ for this limit")