2014-09-27 - Re: POC - Activate on First login (Or expiry from first login)

Header Data

From: Timothy White <ti***8@gmail.com>
Message Hash: fcc35da9ffabd62f2945d7d48f9bc1c43a20e20488d5ca931dceb28e2f610ac4
Message ID: <CAESLx0+0D68kC6K+Mu=hacnudruKxV0sZNnq7uSFmCTK1eQWwQ@mail.gmail.com>
Reply To: <CAESLx0+hPPKEfVicr66E3xBVeeiPAUafhmxuGyA7v8mzxqkqVA@mail.gmail.com>
UTC Datetime: 2014-09-27 23:09:53 UTC
Raw Date: Sun, 28 Sep 2014 16:09:53 +1000

Raw message

In the latest nightly I've added a GUI to this.
Set the Expire from first login string in the Group settings. Then any new
users created in that group will inherit that setting. A cronjob runs
regularly to ensure that we can have expiries longer than 1 month. (It'll
overwrite any existing expiry after their first login to match the Expire
after setting).

This does mean you can have a long initial "activation" period, but then
after first use, a short expiry. Or, a short initial activation period, and
once activated a long expiry.

Feedback on this feature would be good

Tim

On Sat, Sep 6, 2014 at 1:16 PM, Timothy White <ti***8@gmail.com> wrote:

> As many of you have requested, it would be nice to have a voucher expire a
> certain amount of time from first use. For example, a 24 hour voucher from
> first use.
> https://github.com/GraseHotspot/grase-www-portal/issues/39
>
> I have hopefully worked out the initial part, which is the Perl module
> that Freeradius uses. I've created a new attribute called GRASE-ExpireAfter
> which takes a string describing the relative date/time of when the account
> should expire from first login. The format of the string should be the same
> as the current Expiry string we set in the groups, however it's parsed by
> the Perl parsedate function so may be slightly different. (
> http://search.cpan.org/~muir/Time-ParseDate-2013.1113/lib/Time/ParseDate.pm
> ).
>
> There is currently no GUI to the system, and there is no regular cronjob
> which will be needed for relative expiries greater than 1 month. (Currently
> due to how the archiving of the radacct table occurs, when the archiving
> occurs the required data is lost and the relative expiry will be reset).
>
> An example SQL command to give a relative expiry of 1 day from first use
> is:
>
> INSERT INTO `radius`.`radcheck` (`UserName`, `Attribute`, `op`, `Value`)
> VALUES ('tim', 'GRASE-ExpireAfter', ':=', '+1 day');
>
> If you are using nightlies, the grase-conf-freeradius package should
> update for you with "apt-get update; apt-get upgrade"
>
> If you are using the stable version, and wish to be daring, you should be
> able to manually install the grase-conf-freeradius package from the
> nighlies without breaking anything. Find the latest version at
> http://nightly.packages.grasehotspot.org/pool/main/g/grase-conf-freeradius/
> (anything after 1.9.4.9 should work). You'll need to manually install
> the libtime-modules-perl package first though.
>
> Let me know how the initial step works, and if I've broken anything
> without realising.
>
> Thanks
>
> Tim
>

Thread