Voucher remaining time
-
hi guys,
i just want to know if this is possible?
a client or user can check the remaining minutes of his voucher?
I'm using latest pfsense in virtual box working very fine without any problems.
Thanks
-
Hi Ericson,
not advise release management access to the pfsense users, but you can create an account with limited privilege just to check the status of vouhcer. I believe this would be an alternative.
Rogério
Campinas, São Paulo
Brazil. -
@Ericson:
a client or user can check the remaining minutes of his voucher?
This is a snippet that works fine for me:
$var1=$pagetitle; $var2=$seconds; function secondsToWords($seconds) { $ret = ""; /*** get the days ***/ $days = intval(intval($seconds) / (3600*24)); if($days> 0) { $ret .= "$days days "; } /*** get the hours ***/ $hours = (intval($seconds) / 3600) % 24; if($hours > 0) { $ret .= "$hours hours "; } /*** get the minutes ***/ $minutes = (intval($seconds) / 60) % 60; if($minutes > 0) { $ret .= "$minutes minutes "; } /*** get the seconds ***/ $seconds = intval($seconds) % 60; if ($seconds > 0) { $ret .= "$seconds seconds"; } return $ret; } ?> if (isset($remaining_time)) { echo 'Verbleibende Online Zeit: ' . secondsToWords($remaining_time) . ''; } ?>
The if is useful to prevent the Display for regular (non voucher users)! without hacking pfSense the system doesn't return it for non voucher users.
P.S.: I included this snippet in my Logout page contents and it works fine.
-
thanks for the info guys. :)
-
You could also look at the code involved in pfSense's test Voucher page. It's probably fairly easy to include that in a login or logout page. Or a custom page you upload into the CP.
-
Hi, I use the pfsense version 2.3.5 for i386, but it doesn't show me the remaining time of the vouchers, and the clients ask me for the remaining time, has anyone been able to ?, help.
-
First step: Upgrade. If you need to, get 64-bit hardware.
-
Okay, yes, I updated it to 2.4.4-p3, 1 hour ago I installed it, but I can't show the status of the remaining time to my clients, how I manage to do it, and that it operates, I have read other guides, but none of them works. I hope you can help me with an example php or html code.
-
When you create a voucher that lasts 1 hour or 60 minutes, and the guy that uses this voucher connects at 10h30 - then he will know it ends at 11h30. No big mathematical background needed to find the "11h30" here.
Or I didn't understood the question.Btw : the counters start ticking when they - the voucher users - connect. The fact that they move away from the network doesn't matter. The counter keeps ticking.
-
@Gertjan Could you publish your php code that you managed to work ??, Thanks..
Thank you -
@walter_leon said in Voucher remaining time:
@Gertjan Could you publish your php code that you managed to work ??, Thanks..
What code to make work what ?
If it's he remaining voucher time, I never wrote any code for that.
I rarely use vouchers and if I use them, it's marked on the voucher : "this voucher works for x hours". I'll leave it up to the user to "calculate" the end time.
Better yet ; I probably wouldn't hand over a voucher to some one (a kid ?) who couldn't do that ....