[isf-wifidog] After login go to web-page requested, rather than portal

Robin Jones Robin at networkfusion.co.uk
Sam 27 Sep 15:16:17 EDT 2008


Someone can test this for me if they want, it is support for Original URL redirection and is programmatically correct, but unfortunately I have no nodes or users to test it against!

 

You can patch against your current server with something like this:

 

Move the patch file into /var/www/wifidog-auth

Open terminal and type:

cd /var/www/wifidog-auth/

patch -p0 < OriginalUrl.diff

 

 

 

Make sure you backup before applying this patch!

Please let me know if this all works correctly and I will Commit it to the SVN.

 

 

Regards,

 

Robin Jones.

 

From: wifidog-bounces at listes.ilesansfil.org [mailto:wifidog-bounces at listes.ilesansfil.org] On Behalf Of Robin Jones
Sent: 27 September 2008 00:46
To: WiFiDog Captive Portal; Benoit Grégoire; wifidog at listes.ilesansfil.org
Subject: Re: [isf-wifidog] After login go to web-page requested,rather than portal

 

this time without the stupid bugs!!!!

 

 

 

wifidog-auth/wifidog/portal/index.php


if($node->getPortalOriginalUrlAllowed() && $network->getPortalOriginalUrlAllowed())  
   {  
           header("Location: " . SESS_ORIGINAL_URL_VAR); 
   }

 

 

wifidog-auth/wifidog/classes/Network.php


      /** 
      * Are nodes allowed to redirect users to the original requested web page instead of 
      * the portal? 
      * 
      * @return bool True or false 
      * 
      * @access public 
      */ 
     public function getPortalOriginalUrlAllowed() 
     { 
         return (($this->_row['allow_original_URL_redirect'] == 't') ? true : false); 
     } 
  
     /** 
      * Set if nodes are allowed to redirect users to the original requested web page 
      * instead of the portal? 
      * 
      * @param bool $value The new value, true or false 
      * 
      * @return bool True on success, false on failure 
      * 
      * @access public 
      */ 
     public function setPortalOriginalUrlAllowed($value) 
     { 
         // Init values 
         $retval = true; 
  
         if ($value != $this->getPortalOriginalUrlAllowed()) { 
             $db = AbstractDb::getObject(); 
             $value ? $value = 'TRUE' : $value = 'FALSE'; 
             $retval = $db->execSqlUpdate("UPDATE networks SET allow_original_URL_redirect = {$value} WHERE network_id = '{$this->getId()}'", false); 
             $this->refresh(); 
         } 
  
         return $retval; 
     } 

 

 

 

wifidog-auth/wifidog/classes/Node.php

 

 

   /** redirect users to the original requested web page instead of portal 
      Must be enabled in the Network configuration to have any effect 
      @return a string */ 
     function getPortalOriginalUrlAllowed() 
     { 
         return (($this->_row['allow_original_URL_redirect'] == 't') ? true : false); 
     } 
  
     /** redirect users to the original requested web page instead of portal 
      Must be enabled in the Network configuration to have any effect 
      @return true on success, false on failure */ 
     function setCustomPortalRedirectUrl($value) 
     { 
         $retval = true; 
         if ($value != $this->getPortalOriginalUrlAllowed()) 
         { 
             $db = AbstractDb::getObject(); 
             $value = $db->escapeString($value); 
             $retval = $db->execSqlUpdate("UPDATE nodes SET allow_original_URL_redirect = '{$value}' WHERE node_id = '{$this->getId()}'", false); 
             $this->refresh(); 
         } 
         return $retval; 
     } 

 

________________________________

From: Benoit Grégoire [mailto:benoitg at coeus.ca]
Sent: Fri 9/26/2008 11:40 PM
To: wifidog at listes.ilesansfil.org
Cc: Robin Jones; listserv.traffic at sloop.net
Subject: Re: [isf-wifidog] After login go to web-page requested, rather than portal

On 26 September 2008, Robin Jones wrote:
> You can do this in the nodes wifidog.config:
>
> #   PortalScriptPathFragment (Optional; Default: portal/? Note:  This is
> the script the user will be sent to after a successful login.)

You can't do it there.

> This will hopefully be moved to the Auth server in the near future...

Most of the work is done, all that's required is a new node/network config
similar to the one for custom portal URL.  There is already a documented
variable in the code for the original destination URL.
--
Benoit Grégoire
Technologies Coeus inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listes.ilesansfil.org/pipermail/wifidog/attachments/20080927/6624b8de/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OriginalUrl.diff
Type: application/octet-stream
Size: 8707 bytes
Desc: OriginalUrl.diff
Url : http://listes.ilesansfil.org/pipermail/wifidog/attachments/20080927/6624b8de/attachment-0001.obj 


Plus d'informations sur la liste de diffusion WiFiDog