2012-11-16 - Re: [GRASE-Hotspot] Adjust a User’s expiry date

Header Data

From: Bob Hunt <bo***2@gmail.com>
Message Hash: 266fc0c26a3d20d53b07fa4878c909ad7529c1e1b485ead58b317f5f486e4c67
Message ID: <CAA-jMMTqbvNeNWt_2hT1wNnDBvzRayQscDjWDMDvNNGQVKzzCQ@mail.gmail.com>
Reply To: N/A
UTC Datetime: 2012-11-16 17:20:43 UTC
Raw Date: Sat, 17 Nov 2012 11:20:43 +1100

Raw message

Hi Tim,

I can see that Grase is set up to cater mainly for time-based accounts  (
similar to how ISPs would provide dialup hours). It seems that adapting it
to suit monthly expiry/quota based accounts (similar to how ISPs provide
broadband plans) does pose challenges and needs some thought.

I think that giving Admin the ability to manually adjust an individual
user's expiry-date is a flexible and powerful tool to manage various
scenarios with  expiry-based accounts. If this function is liable to be be
used incorrectly, a help/warning text could be included. I'm certainly
finding that expiry based account management on my set-up is easier now
that I've got this functionality.

>Some things you might not know about Expiry,
>is that it's updated when ever a user is changed
>....................................
>at least, it used to be, can't verify right now

I can confirm that I still works that way (Its a trap for the unwary that
already caught me).

I think that its fair enough to reset expiry to the group expiry when the
user's group is changed (obviously) or when adding time (as it is clearly a
time based account). But I don't think that it should  happen in the
background when changing or adding data-limits as it messes up expiry based
accounts (like I use). I've commented-out the offending lines in my own
set-up.

I also think it would be a good idea to log all expiry changes  as thy
occur (and include old and new expiry dates).


>Also, when a users account is "expired", a button appears allowing you
>to renew their account. Maybe I just need to have that visible for
>"updating" the expiry based on the group, at any time.

Good idea.  If the button clearly indicates that it will "Update Expiry to
Group Expiry", the  current expiry could be displayed in a text entry field
(rather than as normal text as at present), able to be edited and updated
on clicking the "Update User Details" button.

>Of course, the use case of people booking ahead is a little harder, as
>is when you need to add on more expiry. I might need to find a way to
>allow us to purchase "days" in the same way you'll be able to purchase
>time and data in the new vouchers.
>
>(If you could please open a ticket, I'll remember to do that)
>
>How would that sound for most of your use cases, where you can ether
>refresh the expiry based on the users group, and also have a new
>category of users who purchase "days", and for them you can add more
>days to their account? (The use case of booking ahead, will need a "not
>valid till" field as well, which I believe we can do.)

There are a few issues here.

My regular monthly users want to keep their usernames. They get 1 month of
access and a data-quota for the month. At the end of the month, if they
renew, both of these limits are reset.  Until you fixed the 4Gb bug (thanks
for that!!!), I would reset the user's data-usage to zero (by archiving it)
before allocating their month's data-quota. Now when I reset the expiry at
renewal time, I don't have to archive, but I do have to look at the user's
"data-remaining" and top it up to reach their data-quota for this month. So
its a bit complicated especially if accounts are renewed early or for many
months in advance.
A calendar application with notifications helps keep it together.

Maybe the way to go is to have a new class of user who's accounts all
roll-over on the 1st of each month and to have a cron job to do the above
tasks based on the expiration set for the user?

Cheers,

Bob




> Date: Thu, 15 Nov 2012 16:26:26 +1000
> From: Tim White <ti***8@gmail.com>
> Subject: Re: [GRASE-Hotspot] Adjust a User's expiry date
> To: GRASE Hotspot General Discussions
>         <gr***t@lists.sourceforge.net>
> Cc: Bob Hunt <bo***2@gmail.com>
> Message-ID: <50***4@gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hey Bob.
>
> Expiry Date was one of those things that used to get used incorrectly,
> so it's current setup doesn't suit everyone.
>
> Some things you might not know about Expiry, is that it's updated when
> ever a user is changed. So for example, if you add more data, it should
> be updated (at least, it used to be, can't verify right now). In most
> setups, Expiry isn't used to control a users account access, but more to
> help cleanup the system of old "expired" accounts. Often users are being
> controlled with data and time limits. Understandably, when you don't
> want to limit a user in that way, but give them a set number of days
> they can use the account, you need to use expiry.
>
> Also, when a users account is "expired", a button appears allowing you
> to renew their account. Maybe I just need to have that visible for
> "updating" the expiry based on the group, at any time.
>
> Of course, the use case of people booking ahead is a little harder, as
> is when you need to add on more expiry. I might need to find a way to
> allow us to purchase "days" in the same way you'll be able to purchase
> time and data in the new vouchers.
>
> (If you could please open a ticket, I'll remember to do that)
>
> How would that sound for most of your use cases, where you can ether
> refresh the expiry based on the users group, and also have a new
> category of users who purchase "days", and for them you can add more
> days to their account? (The use case of booking ahead, will need a "not
> valid till" field as well, which I believe we can do.)
>
> Tim
>
> On 15/11/12 14:21, Bob Hunt wrote:
> > Hi Tim,
> >
> > Many times I've wished that I could easily adjust a user's expiry-date.
> >
> >  I use monthly expiry based accounts and sometimes users renew weeks
> > before expiry or book 2, 3 or 6 months ahead and there are many more
> > instances which cause issues.
> >
> > There's  always the option of creating another group for the purpose,
> > but it gets ridiculous having many groups with single users.
> >
> > So I decided to have a go at adding a function to the edit user page
> > for this purpose and it turned out to be fairly straightforward.
> >
> >
> ---------------------------------------------------------------------------------
> > Here is a handy function to make it easy for Grase Admin to set a
> > user's expiry-date to a specific date. Validation of the date entered
> > is not done but mis-entering the expiry-date simply results in it
> > being set it to Jan 01 1970and an expired account. The date then just
> > needs re-entering with more care.
> >
> > Two files need to have code inserted:
> >
> > Insert into /usr/share/grase/www/radmin/
> > edituser.php around line 183:
> >
> /////////////////////////////////////CODE///////////////////////////////////////////
> > if(isset($_POST['Change_Expiry']))
> >     {
> >         $newExpiry = $_POST['Change_Expiry'];
> >         database_update_expirydate($username, $newExpiry)
> > ;//expiry_for_group(getDBUserGroup($username)));
> >         $success[] = T_("Expiry updated");
> >         AdminLog::getInstance()->log("Expirydate for $username updated
> > to $newExpiry");
> >         $smarty->assign("error", $error);
> >         $smarty->assign("success", $success);
> >         require('display.php');
> >         die; // TODO: Recode so don't need die (too many nests?)
> >     }
> >
> ////////////////////////////////////////////////////////////////////////////////////////
> >
> > Insert into /usr/share/grase/www/radmin/templates/edituser.tpl around
> > line 51:
> >
> ///////////////////////////////////CODE//////////////////////////////////////////////
> > <div>
> > <label for='Change_Expiry'>{t}Change Expirydate (Use correct date
> > format){/t}</label>
> > <input type="text" class="default_swap" id="Change_Expiry"
> > name="Change_Expiry" value='{$user.Expiration}' {t}Enter a new
> > expirydate in the same format{/t}"/>
> > <span id='ChangeExpiryInfo'>{t}Entering wrong format will set
> > expiry-date to 1970! (Expiry-time is not needed){/t}</span>
> > </div>
> >
> /////////////////////////////////////////////////////////////////////////////////////////////////////
> >
> >
> > --
> > Bob Hunt--
>

Bob Hunt
20 Clarke Street
Wyndham
NSW 2550
Australia

Phone/fax 61 (0)2 64942030

Thread