2015-03-07 - Re: [GRASE-Hotspot] Adjust a User’s expiry date

Header Data

From: Edward Allen <yb***j@gmail.com>
Message Hash: ff5198330e9c9370b8fe3c2ddb025a74d61336977280823d7df647745091d027
Message ID: <bd26886d-3086-4d08-86ca-5dcac32013d6@grasehotspot.org>
Reply To: <CAA-jMMQZzVLxVsWYKZeCUp6VkFu=SRd2Fi=JnRH8iCNdu523-g@mail.gmail.com>
UTC Datetime: 2015-03-07 11:47:58 UTC
Raw Date: Sat, 07 Mar 2015 10:47:58 -0800

Raw message

Some interesting thoughts and ideas in this thread

How did all this work out?


I have few questions

How to let users expire at the end of each month like ISP instead of a 
month after the account is created or used?
Could there be a checkbox on USERs page thats used to do bulk renewal or 
locking or updating on a whole.

i want to do monthly recurring users but if they not updated on some issues 
they shouldnt roll over to next month.


On Wednesday, 14 November 2012 23:21:24 UTC-5, bob.hunt.52 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
>
>

Thread