Implemented unlimited user download limits

This commit is contained in:
Michiel Broek 2001-09-30 18:58:17 +00:00
parent 83f509ac6d
commit f32a6e22bf
6 changed files with 46 additions and 30 deletions

View File

@ -4141,6 +4141,10 @@ v0.33.18 27-Jul-2001
Removed some compiler warnings on some systems. Removed some compiler warnings on some systems.
Added menu Display lines. Added menu Display lines.
Added menu item 21, display text only. 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: mbuseradd:
Ported to work on FreeBSD. Ported to work on FreeBSD.

View File

@ -11,7 +11,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<h5>Last update 29-Jan-2001</h5> <h5>Last update 30-Sep-2001</h5>
<P>&nbsp;<P> <P>&nbsp;<P>
<H1>MBSE BBS Setup - BBS Setup - Security Limits.</H1> <H1>MBSE BBS Setup - BBS Setup - Security Limits.</H1>
@ -36,9 +36,9 @@ is not wanted. Some defaults are installed during first bbs setup.
<P> <P>
<pre> <pre>
<strong>Access level </strong>The access level value. <strong>Access level </strong>The access level value.
<strong>Maximum time </strong>The maximum time each day. <strong>Maximum time </strong>The maximum time each day. If set to zero, the user gets 24 hours a day.
<strong>Download Kb. </strong>Maximum Kilobytes download each day. <strong>Download Kb. </strong>Maximum Kilobytes download each day, zero is unlimited.
<strong>Download Files </strong>Maximum files to download each day. <strong>Download Files </strong>Maximum files to download each day, zero is unlimited.
<strong>Description </strong>The description for this level. <strong>Description </strong>The description for this level.
<strong>Available </strong>If this level is available. <strong>Available </strong>If this level is available.
<strong>Deleted </strong>If this level must be deleted. <strong>Deleted </strong>If this level must be deleted.

View File

@ -2,7 +2,7 @@
* *
* File ..................: bbs/file.c * File ..................: bbs/file.c
* Purpose ...............: All the file functions. * Purpose ...............: All the file functions.
* Last modification date : 10-Aug-2001 * Last modification date : 30-Sep-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -415,8 +415,10 @@ void Download(void)
* Minus the amount downloaded today from downloadktoday * Minus the amount downloaded today from downloadktoday
* if less than zero, it won't let the user download anymore. * if less than zero, it won't let the user download anymore.
*/ */
exitinfo.DownloadKToday -= (Size / 1024); if (LIMIT.DownK || LIMIT.DownF) {
exitinfo.iTransferTime = iTransfer; exitinfo.DownloadKToday -= (Size / 1024);
exitinfo.iTransferTime = iTransfer;
}
WriteExitinfo(); WriteExitinfo();
Pause(); Pause();

View File

@ -2,7 +2,7 @@
* *
* File ..................: bbs/filesub.c * File ..................: bbs/filesub.c
* Purpose ...............: All the file sub functions. * Purpose ...............: All the file sub functions.
* Last modification date : 09-Aug-2001 * Last modification date : 30-Sep-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -488,24 +488,26 @@ int ShowOneFile()
int CheckBytesAvailable(long CostSize) 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 \" */ colour(15, 0);
pout(12, 0, (char *) Language(252)); /* You must upload before you can download. */
Enter(1); pout(12, 0, (char *) Language(253));
Syslog('+', "Not enough bytes to download %ld", CostSize); Enter(2);
colour(15, 0); colour(14, 0);
/* You must upload before you can download. */ /* Kilobytes currently available: */
pout(12, 0, (char *) Language(253)); printf("%s%lu Kbytes.\n\n", (char *) Language(254), exitinfo.DownloadKToday);
Enter(2);
colour(14, 0); Pause();
/* Kilobytes currently available: */ return FALSE;
printf("%s%lu Kbytes.\n\n", (char *) Language(254), exitinfo.DownloadKToday); }
Pause();
return FALSE;
} }
return TRUE; return TRUE;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Main user login procedure. Checks for limits, * Purpose ...............: Main user login procedure. Checks for limits,
* new ratio's cats all the welcome screens, and * new ratio's cats all the welcome screens, and
* does a lot of checking in general. * does a lot of checking in general.
* Last modification date : 08-Aug-2001 * Last modification date : 30-Sep-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -964,15 +964,23 @@ void user()
sprintf(temp,"%s", (char *) GetDateDMY()); sprintf(temp,"%s", (char *) GetDateDMY());
if((strcmp(StrDateDMY(usrconfig.tLastLoginDate), temp)) != 0) { 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.iTimeUsed = 0; /* Set time used today to Zero */
usrconfig.iConnectTime = 0; /* Set connect time 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; if (LIMIT.DownK && LIMIT.DownF) {
usrconfig.DownloadsToday = LIMIT.DownF; usrconfig.DownloadKToday = LIMIT.DownK;
usrconfig.DownloadsToday = LIMIT.DownF;
}
} }
} /* End of else */ } /* End of else */

View File

@ -2,7 +2,7 @@
* *
* File ..................: setup/m_limits.c * File ..................: setup/m_limits.c
* Purpose ...............: Setup Limits. * Purpose ...............: Setup Limits.
* Last modification date : 24-Jun-2001 * Last modification date : 30-Sep-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -332,7 +332,7 @@ int EditLimRec(int Area)
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");
return 0; return 0;
case 1: E_INT( 7,25, LIMIT.Security, "The ^Security^ level for this limit") 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 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 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") case 5: E_STR( 11,25,40,LIMIT.Description,"A short ^description^ for this limit")