Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions source/Styles/xb3/jst/index.jst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ $psmMode = $DeviceControl_value['psmMode'];
$LanGwIP['localAddr'] = '';
$LanGwIP['globalAddr'] = '';
$LanGwIP['ulaAddr'] = '';
if(strpos($partnerId, "sky-") !== false) {
$secureWebUIRedirectPartner = (strpos($partnerId, "sky-") !== false) || !strcmp($partnerId, "comcast");
if($secureWebUIRedirectPartner) {
$lan_ip = [];
$bin = exec("which ifconfig");
$xbin=$bin[0].replace(/ /g,'').replace(/\n/g,'');
Expand All @@ -131,7 +132,9 @@ $psmMode = $DeviceControl_value['psmMode'];
else $LanGwIP['ulaAddr'] = trim($tmp[0]);
}
}
$LanGwIPv6 = $LanGwIP['ulaAddr'];
if($LanGwIP['ulaAddr'] != "") {
$LanGwIPv6 = $LanGwIP['ulaAddr'];
}
}
function wan_status(){
$wan_connection=false;
Expand Down Expand Up @@ -176,14 +179,18 @@ function isLocalIPv6($url){
$ip_addr = strpos($SERVER_ADDR, ":") == false ? $LanGwIPv4 : $LanGwIPv6 ;
$SecWebUI = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.Enable");
$LocFqdn = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.LocalFqdn");
if(strpos($partnerId, "sky-") !== false) {
if($secureWebUIRedirectPartner) {
if (strcmp($SecWebUI, "true")==0) {
if (strcmp($url, $LocFqdn)!=0) {
if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) )
if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) ) {
header('Location:https://'+$LocFqdn);
exit(0);
}
}
else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80")) {
header('Location:https://'+$LocFqdn);
exit(0);
}
else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80"))
header('Location:https://'+$LocFqdn);
}
}
if(!strcmp($CaptivePortalEnable, "true")) {
Expand Down
31 changes: 25 additions & 6 deletions source/Styles/xb6/jst/index.jst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ $psmMode = $DeviceControl_value['psmMode'];
$LanGwIP['localAddr'] = '';
$LanGwIP['globalAddr'] = '';
$LanGwIP['ulaAddr'] = '';
if(strpos($partnerId, "sky-") !== false) {
$secureWebUIRedirectPartner = (strpos($partnerId, "sky-") !== false) || !strcmp($partnerId, "comcast");
if($secureWebUIRedirectPartner) {
Comment thread
Thanusha-D marked this conversation as resolved.
$lan_ip = [];
$bin = exec("which ifconfig");
$xbin=$bin[0].replace(/ /g,'').replace(/\n/g,'');
Expand All @@ -123,7 +124,9 @@ $psmMode = $DeviceControl_value['psmMode'];
else $LanGwIP['ulaAddr'] = trim($tmp[0]);
}
}
$LanGwIPv6 = $LanGwIP['ulaAddr'];
if($LanGwIP['ulaAddr'] != "") {
$LanGwIPv6 = $LanGwIP['ulaAddr'];
}
}

if(!$isMSO) {
Expand All @@ -135,18 +138,34 @@ if(!$isMSO) {
exit(0);
}*/

function isLocalIPv6($url){
//'IPv6 LAN globalAddr' can be same as 'Remote Management Address (IPv6)'
//find local LAN access using SERVER_PORT
$isLocalAddr = false;
$isLocalAddr = ((strcmp($url,$LanGwIPv6)==0)
|| (strcmp($url,$LanGwIP['localAddr'])==0)
|| (strcmp($url,$LanGwIP['globalAddr'])==0)
|| (strcmp($url,$LanGwIP['ulaAddr'])==0));
$isLocalAddr = ($isLocalAddr && ($_SERVER['SERVER_PORT'] == "80" || $_SERVER['SERVER_PORT'] == "443"));
return $isLocalAddr;
}

$SERVER_ADDR = $_SERVER['SERVER_ADDR'];
$ip_addr = strpos($SERVER_ADDR, ":") == false ? $LanGwIPv4 : $LanGwIPv6 ;
$SecWebUI = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.Enable");
$LocFqdn = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.LocalFqdn");
if(strpos($partnerId, "sky-") !== false) {
if($secureWebUIRedirectPartner) {
if (strcmp($SecWebUI, "true")==0) {
if (strcmp($url, $LocFqdn)!=0) {
if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) )
header('Location:https://'+$LocFqdn);
if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) ) {
header('Location:https://'+$LocFqdn);
exit(0);
}
}
else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80"))
else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80")) {
header('Location:https://'+$LocFqdn);
exit(0);
}
}
}

Expand Down
Loading