SearchSearch   ProfileProfile   Log inLog in   RegisterRegister 

Day-Pass scratch code

 
Post new topic   Reply to topic    FirstSpot Forum Index -> Pre-sales Support Forum
View previous topic :: View next topic  
Author Message
Reess



Joined: 28 Oct 2015
Posts: 6
Location: London

PostPosted: Wed Oct 28, 2015 10:23 am    
Post subject: Day-Pass scratch code

We want to bulk load scratch codes, use activate at first login, but then to disable account at 23:59 the same day. ie providing a Day-Pass facility

How would this be possible - would we need to use fsapi to set end date to start date for active codes, or run a query to disable accounts at midnight.
Back to top
alan
Forum facilitator


Joined: 26 Sep 2003
Posts: 4435

PostPosted: Wed Oct 28, 2015 12:40 pm    
Post subject:

Yes, you can run the below command at midnight to disable all the Scratch Codes:

fsapi update_usr_attributes username=* timeleft=0

And then you need to recreate some new codes for the coming day as well.
_________________
~ Patronsoft Limited ~
Back to top
Reess



Joined: 28 Oct 2015
Posts: 6
Location: London

PostPosted: Wed Oct 28, 2015 1:01 pm    
Post subject:

We are in a corporate environment providing internet access for visitors and we intend to preprint a significant number of scratch codes that will be given as required to visitors.

To avoid having to create scratch codes each day could we identify those scratch codes that have been used ie with a start date, and use the FSapi to only delete those codes at midnight ?
Back to top
alan
Forum facilitator


Joined: 26 Sep 2003
Posts: 4435

PostPosted: Wed Oct 28, 2015 1:37 pm    
Post subject:

Currently, fsapi doesn't have this kind of conditional delete.

Alternatively, you can simply use SQL to remove the username at midnight. You can write a simple program like the below pseudo code:

Code:
net stop dispatcherservice  // stop FirstSpot
delete from fsusr where reserved2 is not null  // delete users that has been used
net start dispatcherservice // start FirstSpot


Note that you recommend you to use PHP to run above SQL. Refer to http://patronsoft.com/forum/viewtopic.php?t=1514 for more information.
_________________
~ Patronsoft Limited ~
Back to top
Display posts from previous:   
Post new topic   Reply to topic    FirstSpot Forum Index -> Pre-sales Support Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group