pfSense Gold Subscription

Author Topic: Customization of authentication page  (Read 11083 times)

0 Members and 1 Guest are viewing this topic.

Offline pfsenseo

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Customization of authentication page
« on: October 25, 2011, 07:14:25 am »
Hello community,

I've modified the login and others pages of my pfsense 2.0 captive Portal.

Can someone explain to me how to reset the authentication page to the original ??
And others.

Thanks in advance to any guru !



Offline wallabybob

  • Hero Member
  • *****
  • Posts: 5262
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #1 on: October 25, 2011, 06:30:15 pm »
If I recall correctly there is no "original" captive portal authentication page: right from installation the pfSense administrator has had to supply one.

Offline Gertjan

  • Sr. Member
  • ****
  • Posts: 337
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #2 on: October 28, 2011, 08:47:19 am »
Sure about that ??

Something that seems to be a default page is present in
/etc/inc/captiveportal.inc

Look for
function get_default_captive_portal_html()
starting at line 52  ;)

Offline pfsenseo

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #3 on: October 28, 2011, 05:12:33 pm »
Firstly  thanks a lot to you wallabybob & Gertjan !

My question is how to restore those two screen :

pfsense 2.0 default captive portal:


and this one (when credential are incorrect):


I've personalized them on my pfsense 2 and would like to restore them ??

Thanks in advance for your help.



Offline Gertjan

  • Sr. Member
  • ****
  • Posts: 337
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #4 on: October 28, 2011, 05:37:45 pm »
Don't have my pfSense nearby, so I propose you what I should do (try):
If memory serves me well, the html code for these portal login pages are stored in the config file.
Export the config file - it's an XML file.
Edit it, empty the part that contains YOUR html code.
Don't touch anything else.
Import it back in pfSense.

The field will be empty, pfSEnse will propose the build-in pages, as shown above.

Btw: this was valid for 1.2.3 - I'm using 2.0 Release for 2 days now, and still under a shock. pfSense was amazing, now it became incredible ...

Offline proff_g33k

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #5 on: September 21, 2012, 03:35:46 am »
what you upload customized login and logout page is stored inside

login page
/var/etc/captiveportal.html

logout page
/var/etc/captiveportal-logout.html

and error page

/var/etc/captiveportal-error.html

you can browse it in
diagnostic->edit file
and also you can change it from there.

I have tried to delete these files but it recovered automatically,
I'm not sure how to do this but there is something you can do with these files

what you upload via file manager is stored at,
/var/db/cpelements/captiveportal-logout.html

and php file is at
/usr/local/captiveportal/index.php

« Last Edit: September 21, 2012, 04:35:59 am by proff_g33k »

Offline Gertjan

  • Sr. Member
  • ****
  • Posts: 337
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #6 on: September 21, 2012, 05:02:36 am »
Editing these files will do the job ...
But you will be in for a surprise when you reboot the system.

Keep in mind: ALL settings of pfSEnse are stored in one file: /cf/conf/config.xml - also these login pages.
All "setting files", like the 'portal login html page' will be recreated on system start.
 

Offline tomdlgns

  • Sr. Member
  • ****
  • Posts: 334
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #7 on: September 30, 2012, 10:44:46 am »
Editing these files will do the job ...
But you will be in for a surprise when you reboot the system.

Keep in mind: ALL settings of pfSEnse are stored in one file: /cf/conf/config.xml - also these login pages.
All "setting files", like the 'portal login html page' will be recreated on system start.
 


what is the surprise after a reboot? pages dont save?

i am looking to edit the current file (and make a backup of the file plus my config before i upload new files) and came across this thread in a search.

Offline Gertjan

  • Sr. Member
  • ****
  • Posts: 337
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #8 on: October 02, 2012, 12:47:03 am »
what is the surprise after a reboot? pages dont save?

Well... of course - they do save. As long as you stick with the pfsense way of entering them: using the pfsense PHP web interface.

But when you edit the default login page and the error page directly, they aren't stored in the the /cf/conf/config.xml file.
Try so, and reboot.
You see what's happens  ;)

Offline carcar

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #9 on: October 23, 2012, 12:28:30 am »
hi there!
Can I have also a GUIDE on how to edit my captiveportal.html file permanently? Always having problem during system reboot, it will revert to its original file.

thanks!
Editing these files will do the job ...
But you will be in for a surprise when you reboot the system.

Keep in mind: ALL settings of pfSEnse are stored in one file: /cf/conf/config.xml - also these login pages.
All "setting files", like the 'portal login html page' will be recreated on system start.
 



Offline wallabybob

  • Hero Member
  • *****
  • Posts: 5262
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #10 on: October 23, 2012, 01:00:00 am »
Can I have also a GUIDE on how to edit my captiveportal.html file permanently? Always having problem during system reboot, it will revert to its original file.
Why can't you use a custom portal page? (See Services -> Captive Portal, on the Captive Portal tab scroll down to Portal Page Contents (near the bottom).)

Offline carcar

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Customization of authentication page
« Reply #11 on: October 25, 2012, 09:31:15 am »
Thank you... works fine now  :o
Can I have also a GUIDE on how to edit my captiveportal.html file permanently? Always having problem during system reboot, it will revert to its original file.
Why can't you use a custom portal page? (See Services -> Captive Portal, on the Captive Portal tab scroll down to Portal Page Contents (near the bottom).)