<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Re: [isf-wifidog] After login go to web-page requested, rather than
portal</title>
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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!<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>You can patch against your current server with something like
this:<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Move the patch file into /var/www/wifidog-auth<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Open terminal and type:<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Consolas;
color:#1F497D'>cd /var/www/wifidog-auth/<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Consolas;
color:#1F497D'>patch -p0 < OriginalUrl.diff<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Make sure you backup before applying this patch!<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Please let me know if this all works correctly and I will Commit
it to the SVN.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Regards,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Robin Jones.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> wifidog-bounces@listes.ilesansfil.org
[mailto:wifidog-bounces@listes.ilesansfil.org] <b>On Behalf Of </b>Robin Jones<br>
<b>Sent:</b> 27 September 2008 00:46<br>
<b>To:</b> WiFiDog Captive Portal; Benoit Grégoire;
wifidog@listes.ilesansfil.org<br>
<b>Subject:</b> Re: [isf-wifidog] After login go to web-page requested,rather
than portal<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div id=idOWAReplyText9391>
<div>
<p class=MsoNormal>this time without the stupid bugs!!!!<o:p></o:p></p>
</div>
</div>
<div>
<div id=idOWAReplyText80234>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><strong><span style='font-family:"Courier New"'>wifidog-auth/wifidog/portal/index.php</span></strong><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><br>
<span style='font-family:"Courier New"'>if($node->getPortalOriginalUrlAllowed()
&& $network->getPortalOriginalUrlAllowed()) <br>
{ <br>
header("Location: " . SESS_ORIGINAL_URL_VAR); <br>
}</span><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><strong><span style='font-family:"Courier New"'>wifidog-auth/wifidog/classes/Network.php</span></strong><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><br>
<span style='font-family:"Courier New"'> /** <br>
* Are nodes allowed to redirect users to the
original requested web page instead of <br>
* the portal? <br>
* <br>
* @return bool True or false <br>
* <br>
* @access public <br>
*/ <br>
public function getPortalOriginalUrlAllowed() <br>
{ <br>
return
(($this->_row['allow_original_URL_redirect'] == 't') ? true : false); <br>
} <br>
<br>
/** <br>
* Set if nodes are allowed to redirect users to
the original requested web page <br>
* instead of the portal? <br>
* <br>
* @param bool $value The new value, true or
false <br>
* <br>
* @return bool True on success, false on failure
<br>
* <br>
* @access public <br>
*/ <br>
public function setPortalOriginalUrlAllowed($value) <br>
{ <br>
// Init values <br>
$retval = true; <br>
<br>
if ($value !=
$this->getPortalOriginalUrlAllowed()) { <br>
$db =
AbstractDb::getObject(); <br>
$value
? $value = 'TRUE' : $value = 'FALSE'; <br>
$retval = $db->execSqlUpdate("UPDATE networks SET
allow_original_URL_redirect = {$value} WHERE network_id =
'{$this->getId()}'", false); <br>
$this->refresh(); <br>
} <br>
<br>
return $retval; <br>
} </span><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><strong><span style='font-family:"Courier New"'>wifidog-auth/wifidog/classes/Node.php</span></strong><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"Courier New"'> /**
redirect users to the original requested web page instead of portal <br>
Must be enabled in the Network configuration to
have any effect <br>
@return a string */ <br>
function getPortalOriginalUrlAllowed() <br>
{ <br>
return (($this->_row['allow_original_URL_redirect']
== 't') ? true : false); <br>
} <br>
<br>
/** redirect users to the original requested web page
instead of portal <br>
Must be enabled in the Network configuration to
have any effect <br>
@return true on success, false on failure */ <br>
function setCustomPortalRedirectUrl($value) <br>
{ <br>
$retval = true; <br>
if ($value !=
$this->getPortalOriginalUrlAllowed()) <br>
{ <br>
$db =
AbstractDb::getObject(); <br>
$value
= $db->escapeString($value); <br>
$retval = $db->execSqlUpdate("UPDATE nodes SET
allow_original_URL_redirect = '{$value}' WHERE node_id =
'{$this->getId()}'", false); <br>
$this->refresh(); <br>
} <br>
return $retval; <br>
} </span><o:p></o:p></p>
</div>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
<div class=MsoNormal align=center style='text-align:center'>
<hr size=2 width="100%" align=center>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Benoit Grégoire [mailto:benoitg@coeus.ca]<br>
<b>Sent:</b> Fri 9/26/2008 11:40 PM<br>
<b>To:</b> wifidog@listes.ilesansfil.org<br>
<b>Cc:</b> Robin Jones; listserv.traffic@sloop.net<br>
<b>Subject:</b> Re: [isf-wifidog] After login go to web-page requested, rather
than portal</span><o:p></o:p></p>
</div>
<div>
<p><span style='font-size:10.0pt'>On 26 September 2008, Robin Jones wrote:<br>
> You can do this in the nodes wifidog.config:<br>
><br>
> # PortalScriptPathFragment (Optional; Default: portal/?
Note: This is<br>
> the script the user will be sent to after a successful login.)<br>
<br>
You can't do it there.<br>
<br>
> This will hopefully be moved to the Auth server in the near future...<br>
<br>
Most of the work is done, all that's required is a new node/network config<br>
similar to the one for custom portal URL. There is already a documented<br>
variable in the code for the original destination URL.<br>
--<br>
Benoit Grégoire<br>
Technologies Coeus inc.</span><o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>