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

Header Data

From: Tim White <ti***8@gmail.com>
Message Hash: 30dcb893543fd60f5cf806b238e6d1e98051c791494e3a613050058301d4b367
Message ID: <50A48B12.1090404@gmail.com>
Reply To: <CAA-jMMQZzVLxVsWYKZeCUp6VkFu=SRd2Fi=JnRH8iCNdu523-g@mail.gmail.com>
UTC Datetime: 2012-11-14 23:26:26 UTC
Raw Date: Thu, 15 Nov 2012 16:26:26 +1000

Raw message

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
> 20 Clarke Street
> Wyndham
> NSW 2550
> Australia
>
> Phone/fax 61 (0)2 64942030
>
>
>
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
>
>
> _______________________________________________
> Grase-hotspot mailing list
> Gr***t@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/grase-hotspot


Thread