Re: Time limited account

Dale E. Reed Jr. ( (no email) )
Tue, 11 Aug 1998 13:29:51 -0700

Olivier Astier (Echoweb) wrote:
>
> Thank you for your help but I don't want a session timeout of 9 hours : I
> want to limit the account to 9 hours a month.
> I'm sorry if I didn't explain it the right way (I am not american).

Currently Emerlad doesn't support recurring time limits, but it does
support time banking. You can use time banking to accomplish this, but
have to create an external "reset" for it.

Here is one way I have accomplished this.

1. Create a table called AccountTypeTimeLimits with two fields. The
first field is a AccountType varchar(12), and the second is TimeLeft
int.

2. Populate the table with those AccountTypes that will be using the
recurring timebanking and the number of minutes per month they will get.

3. Execute an SQL Statement from SQL Executive's scehduled tasks the
first day of each month to reset the totals based on the user's
account type.

For those who don't want to go through the trouble of the above, here
is the script to do it. :) As always, check carefully and use at
your own risk.

------------------------------------------------------------
Use Emerald

CREATE TABLE AccountTypeTimeLimits (
AccountType varchar (15) NOT NULL ,
TimeLeft int NOT NULL ,
CONSTRAINT pk_ATTimeLImits PRIMARY KEY ( AccountType, TimeLeft )
)
GO

Insert AccountTypeTimeLimits VALUES ('PPP 20 Hour', 1200)
GO

Use master
go

Exec msdb..sp_addtask 'Monthly Time Limit Reset', @subsystem = 'TSQL',
@server = null, @username = null, @databasename = 'Emerald', @enabled =
1, @freqtype = 16, @freqinterval = 1, @freqsubtype = 1, @freqsubinterval
= 0, @freqrelativeinterval = 1, @freqrecurrencefactor = 1,
@activestartdate = 19980811, @activeenddate = 99991231,
@activestarttimeofday = 0, @activeendtimeofday = 235959, @runpriority =
0, @emailoperatorname = null, @retryattempts = 0, @retrydelay = 0,
@loghistcompletionlevel = 2, @emailcompletionlevel = 0, @command =
'Update sa
Set sa.TimeLeft = tl.TimeLeft