Implemented unlimited user download limits
This commit is contained in:
parent
83f509ac6d
commit
f32a6e22bf
@ -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.
|
||||
|
@ -11,7 +11,7 @@
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<BLOCKQUOTE>
|
||||
<h5>Last update 29-Jan-2001</h5>
|
||||
<h5>Last update 30-Sep-2001</h5>
|
||||
<P> <P>
|
||||
|
||||
<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>
|
||||
<pre>
|
||||
<strong>Access level </strong>The access level value.
|
||||
<strong>Maximum time </strong>The maximum time each day.
|
||||
<strong>Download Kb. </strong>Maximum Kilobytes download each day.
|
||||
<strong>Download Files </strong>Maximum files to download 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, zero is unlimited.
|
||||
<strong>Download Files </strong>Maximum files to download each day, zero is unlimited.
|
||||
<strong>Description </strong>The description for this level.
|
||||
<strong>Available </strong>If this level is available.
|
||||
<strong>Deleted </strong>If this level must be deleted.
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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")
|
||||
|
Reference in New Issue
Block a user