Security

Reply
Regular Contributor I

Guest "timed" sponsored access

Customer would like to have 1 SSID for guests, during the hours 7:30am-3pm have it be sponsored access, then after 3pm be self registration. Is this logic possible to set up with 1 SSID?

Regards,

Josh
___________
ACMP, ACCP
Aruba

Re: Guest "timed" sponsored access

This is possible with a bit of configuration.

 

You will first need to set up two provisioning workflows:  one for sponsored access, and a second for the self registration.  (These use different settings for each, and so they should be separate instances.)

 

Once you have these working, you can create a landing page which will redirect to the appropriate page based on the time of day.

 

This landing page should be configured as the captive portal in your SSID settings.

 

To create the landing page, start by creating a new Web Login page and apply the following settings:

 

  • [x] Provide a custom login form
  • In the Header HTML, put something like the following:

{* Work out where to go based on time of day: *}

{assign var=_now value="Hi"|date}
{if $_now >= 730 && $_now < 1500}
 {assign var=_redirect value=SPONSORED_ACCESS_PAGE_NAME}
{else}
 {assign var=_redirect value=SELF_REGISTRATION_PAGE_NAME}
{/if}

 

{* Generate the redirection here *}

<meta http-equiv="Refresh" content="0;URL={$_redirect|rawurlencode}.php{if $smarty.server.QUERY_STRING}?{$smarty.server.QUERY_STRING|rawurlencode}{/if}"/>

 

 

Update the page names accordingly, and you should be set.

 

You can adjust the (24-hour) times by changing the if statement.

 

Note also that the query string is passed through to the target and is encoded to prevent XSS problems.

 

 

MVP

Re: Guest "timed" sponsored access

Very good stuff Amigodave! This flexibility of entering your own code like this is part of what makes Amigopod/CP Guest such a great product!

 

To add some "security" to this you can also make sure that people doesn't use the direct URL for non-sponsored selfregistration during opening hours. Edit the non-sponsored self-registration page, click "Advanced editor". Under Access Control -> Timed Access input: 

 

** edit - I got it backwards :) This should work

weekdays 15:00 to 07:29

 

 


Regards
John Solberg

-ACMX #316 :: ACCP-
Intelecom - Norway
----------------------------
Remember to Kudo if a post helped you! || Problem Solved? Click "Accept as Solution" in a post!
Regular Contributor I

Re: Guest "timed" sponsored access

Thanks amigodave! This is exactly what I'm looking for.

Regards,

Josh
___________
ACMP, ACCP
New Contributor

Re: Guest "timed" sponsored access

Is there any way to set this to "If weekday" or "If weekend"?  I've found out that this works great (as advertised!) but it does the same thing on Saturday and Sunday.  Ideally we'd allow the "open" option after 3pm, before 7am, and on weekends.  

 

Brian

New Contributor

Re: Guest "timed" sponsored access

I found the answer once I found out to search for this "smarty" language...  It seems a bit clunky, but works.  

 


{assign var=_now value="Hi"|date}
{assign var=weekday value=$smarty.now|date_format:"%u"}
{if $weekday == 6}
{assign var=_redirect value=GUEST_REGISTRATION_PAGE}
{elseif $weekday == 7}
{assign var=_redirect value=GUEST_REGISTRATION_PAGE}
{elseif $_now >= 700 && $_now < 1530}
{assign var=_redirect value=SPONSORED_ACCESS_PAGE}
{else}
{assign var=_redirect value=GUEST_REGISTRATION_PAGE}
{/if}

{* Generate the redirection here *}
<meta http-equiv="Refresh" content="0;URL={$_redirect|rawurlencode}.php{if $smarty.server.QUERY_STRING}?{$smarty.server.QUERY_STRING|rawurlencode}{/if}"/>

New Contributor

Re: Guest "timed" sponsored access

OK programming-heads what is the AND statement I can add to that so the sponsored page only applies for Mon-Fri????

 

Thanks in advance!

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: