Voucher Show time remaining in Logout page contents
-
Hello,
I am looking for a solution to add the remaining time of the voucher connect.
Anyone have an idea?
-
My guess, not so easy.
Just without deep investigating what is in my mind:- You can show all active vouchers and the remaing time, which is may be easier, but not desired.
- You need to pick up the individual CP session ID and the voucher code and fiddle this somehow into the logout page.
The session ID is not a problem (my guess), as the logout page contains this parameter.
But how does the CP session differs between a login by voucher or by user/password...?
So you need in addition to check how the session was established.
No idea, if the voucher code is somewhere linked with the session ID as long as the session exists. Actually, I dont think so. My idea is that after login the session starts with the timer the voucher role allows, but without a link to code but to voucher role.Again, I did not a deep investigation how the session is established. May be someone else jumps in with a more detailed answer.
Regards
Edit: May another approach is the show the remaining time at login (I know, no one will remember the remaining time later on...)
-
Very feasible, as all the info is known upfront.
Some serious scripting (also called 'programming') is needed, though.
A feature request (can be entered in redmine) ... ?But one issue can't be resolved : the logout page is a pop up window. Most browser do not allow pop up pages anymore (they do, but we, the "users" don't and thus most browsers will refuse to show them).
What about writing a text on the voucher, the paper with the code, that the user should activate pop pages from the host (or IP) = pfSense is way above the vast majority of the portal users ? ( )
So ; what about this (silly I know) solution :
Print on the voucher :
"You obtained a voucher that will last x hours.
This means that, as soon as you start to use the voucher, it will expire x hours after the moment you start using it."When done that, you've transformed the issue.
"As soon as some one drops in and says : my voucher that lasts x hours stopped working after x hours".
All you need to do is : smile at him.More serious would be : print a QR code on the voucher that should be scanned by the user's phone. It should program an event in the phone that warns the user the voucher is about to be expire.
And adapt your captive portal login page, and mention that the user should keep in mind that vouchers expire - and that they should take note of that.
-
@gertjan said in Voucher Show time remaining in Logout page contents:
More serious would be : print a QR code on the voucher that should be scanned by the user's phone. It should program an event in the phone that warns the user the voucher is about to be expire.
Very good idea, but...Scanning a QR code only as a reminder for expiring?
This would make sense if you print a QR code for login and a QR code for expiring.
Anyhow, the problem I see is you can print only a template which needs to be updated at the mobile phone (date/time of scan) which requires an app or something else.
Not sure if you can create a QR code which can do all at the same time when scanned: aquire actual date/and time and create an entry in calendar app...?Regards
-
@fsc830 said in Voucher Show time remaining in Logout page contents:
Scanning a QR code only as a reminder for expiring?
A known scan action is : you scan an URL, so the phone opens up the browser right way with that URL.
What about : the scan programs an event at a day and hour.
I admit, I even don't know if that is possible ;) -
Hello,
If I understand correctly, it's impossible to create a PHP page to see how much time is left? -
@david6464 Yes and no, .
Basically its possible with some programming in PHP.
But as @Gertjan remarked its a challenge for a pop-up logout page.Regards
-
@david6464 said in Voucher Show time remaining in Logout page contents:
If I understand correctly, it's impossible to create a PHP page to see how much time is left?
The page already exist
Here it is :
Enter your voucher code and click on Test.
You, as an admin, can do so.
You could use the (see line 61 in the /status_captiveportal_test.php?zone=YOURZONEID) voucher_auth function code on the logout popup windows that you create yourself.
See lines 61 -> 72 how to parse the results. -
Hello,
Thanks I'll try, I'll let you know