<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>&nbsp;</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>&nbsp;</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 &lt; 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>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</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>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<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-&gt;getPortalOriginalUrlAllowed()
&amp;&amp; $network-&gt;getPortalOriginalUrlAllowed())&nbsp; <br>
&nbsp;&nbsp; {&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
header(&quot;Location: &quot; . SESS_ORIGINAL_URL_VAR); <br>
&nbsp;&nbsp; }</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

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

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<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>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

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

</div>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</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>
&gt; You can do this in the nodes wifidog.config:<br>
&gt;<br>
&gt; #&nbsp;&nbsp; PortalScriptPathFragment (Optional; Default: portal/?
Note:&nbsp; This is<br>
&gt; the script the user will be sent to after a successful login.)<br>
<br>
You can't do it there.<br>
<br>
&gt; 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.&nbsp; 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>