Is it possible to show the voucher timer as a pop up small window?
-
Hi dpa & Thanks a lot for this information.
But please please could you show up also your captiveportal-vars.php ? It would be very interesting for the understanding of the code, especially for Newbies like me :)
Thanks for your efforts !
-
Hi Neobauer,
The include php file is simply a collection of variables that I used for the custom captive portal and other files. Below is the general format:
$var1='First variable';
$var2='Second variable';?>
-
Hi dpa,
does it mean that we don't have to include the 'captiveportal-vars.php to let this work ?You mentioned at the beginning that you don't like pop up windows.
May I know/see please how you valide the form in the login page ? meaning target windows ?And last question, can we see the css file just for testing ?
Thanks a lot !
-
Tell me if I have this wrong:
1. Create a script that echoes the "time_remaining" variable
2. Create a custom php/html page for the logout that shows the data from step #1 (Is this the code from above?)
3. Modify captiveportal.inc to disable popup and enable the custom page from step#2 -
1. Create a script that echoes the "time_remaining" variable
2. Create a custom php/html page for the logout that shows the data from step #1 (Is this the code from above?)Are not 1. and 2. the code from above ?
3. Modify captiveportal.inc to disable popup and enable the custom page from step#2
How please ?
A step by step guide will be really very helpful for All. Thanks !
And sorry for my too many questions. I'm not really experienced with PHP Coding. Thanks for understanding. -
I tried running the script but only got a bunch of empty variables showing, along with the little bit of html text. Uncertain as to what the constant variable php is for…?
-
Hi guys,
I'm sorry you're having a hard time figuring this out. And I can't easily remember the step by step procedure how I did it as I already moved to Unifi.
But I guess you can try these steps as a start:
1. Enable logout popup window.
2. Locate the default script for the logout and echo this variable $remaining_time anywhere in the script.See if that outputs the remaining time for that voucher. Post back the result here.
Kind regards,
-
I seem to have got it to work for the most part. I commented out the top part about /include_once('captiveportal-vars.php');/
Then I added a little html code to make the time remaining large (just for testing) and then uploaded to the captive portal "Logout page contents" at the very bottom.Still trying to get the "click to continue" to go to the url we want…
-
Thanks dpa! perpectly working!
1.enable logout popup window on cp
2.create php file, name it captiveportal-vars.php and paste this code inside
```$var1=$pagetitle;
$var2=$seconds;?>
then upload it on your cp file manager. 3.create a html or php file again and name it what ever you want and paste this code inside.
include_once('captiveportal-vars.php');
?>".$pagetitle."");?>
Login Successful! Thank you for using our service.
function secondsToWords($seconds)
{
$ret = "";/*** get the days **/
$days = intval(intval($seconds) / (360024));
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;
}
?>Remaining Time:
then save and upload it on Logout page contents (buttom part of cp). again thank you dpa!
-
I seem to have got it to work for the most part. I commented out the top part about /include_once('captiveportal-vars.php');/
Then I added a little html code to make the time remaining large (just for testing) and then uploaded to the captive portal "Logout page contents" at the very bottom.Still trying to get the "click to continue" to go to the url we want…
try this instead of href="$redirurl"
[Click to continue](<?=$my_redirurl;?>)
-
Hi!
Glad it worked. But to clarify, this code below can be omitted and is not important.
include_once('captiveportal-vars.php');
?>The only part of this script that the above code is of use is this line:
".$pagetitle."");?>
which can be replaced with a basic html:
<title>Your own page title</title>
And yes probably newer versions of pf uses $my_redirurl instead of $redirurl
Kind regards,
-
Hi All,
Thanks for those updates. I will try it also during the day and provide feedback.
May I know which version of Pfsense you are using ? I'm on 2.1.5. -
@dpa:
Hi!
Glad it worked. But to clarify, this code below can be omitted and is not important.
include_once('captiveportal-vars.php');
?>The only part of this script that the above code is of use is this line:
".$pagetitle."");?>
which can be replaced with a basic html:
<title>Your own page title</title>
And yes probably newer versions of pf uses $my_redirurl instead of $redirurl
Kind regards,
sir can i request? i want the remaining time showing countdown on realtime.
i know you can do that. i am not good in js so can you please do this for us?
thank you very much!@neobauer im also running v2.1.5
-
how about displaying the time remaining when using the Max-Daily-Session function? can anyone help me here? :\
-
@romeomarco09
you could publish the php or the files you used for this case.