[isf-wifidog] After login go to web-page requested, rather than portal
Robin Jones
Robin at networkfusion.co.uk
Ven 26 Sep 19:45:41 EDT 2008
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/4ca0120c/attachment.htm
Plus d'informations sur la liste de diffusion WiFiDog