Skip to content
Merged
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
43 changes: 43 additions & 0 deletions source/Styles/xb6/jst/index.jst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?%
/*
If not stated otherwise in this file or this component's Licenses.txt file the

Check failure on line 3 in source/Styles/xb6/jst/index.jst

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'MIT' license found in local file 'source/Styles/xb6/jst/index.jst' (Match: rdkb/components/opensource/ccsp/webui/rdkb/components/opensource/ccsp/webui/1912, 403 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/webui/+archive/rdk-dev-1912.tar.gz, file: source/Styles/xb6/code/index.php)

Check failure on line 3 in source/Styles/xb6/jst/index.jst

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/Styles/xb6/jst/index.jst' (Match: rdkb/components/opensource/ccsp/webui/rdkb/components/opensource/ccsp/webui/1, 403 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/webui/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/Styles/xb6/code/index.php)
following copyright and licenses apply:

Copyright 2018 RDK Management
Expand Down Expand Up @@ -96,6 +96,32 @@
$LanGwIPv6 = $ipv6addr;
}
}

//$LanGwIPv6
$LanGwIP = [];
$LanGwIP['localAddr'] = '';
$LanGwIP['globalAddr'] = '';
$LanGwIP['ulaAddr'] = '';
if(strpos($partnerId, "sky-") !== false) {
$lan_ip = [];
$bin = exec("which ifconfig");
$xbin=$bin[0].replace(/ /g,'').replace(/\n/g,'');
$out = exec($xbin+" brlan0");
for($k in $out){
$v = $out[$k];
if (strpos($v, 'inet6 addr')){
$tmp = explode('Scope', $v);
$tmp = explode('addr:', $tmp[0]);
$tmp = explode('%', $tmp[1]);
$tmp = explode('/', $tmp[0]);
if(strpos($v, 'inet6 addr: fe80')) $LanGwIP['localAddr'] = trim($tmp[0]);
else if(strpos($v, 'inet6 addr: 2')) $LanGwIP['globalAddr'] = trim($tmp[0]);
else $LanGwIP['ulaAddr'] = trim($tmp[0]);
}
}
$LanGwIPv6 = $LanGwIP['ulaAddr'];
}

if(!$isMSO) {
setStr("Device.DeviceInfo.X_RDKCENTRAL-COM_UI_ACCESS","ui_access",true);
//If Cloud redirection is set, then everything through local GW should be redirected
Expand All @@ -104,6 +130,23 @@
header("Location: $Cloud_WebURL");
exit(0);
}*/

$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 (strcmp($SecWebUI, "true")==0) {
if (strcmp($url, $LocFqdn)!=0) {
if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) )
header('Location:https://'+$LocFqdn);
}
else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80"))
header('Location:https://'+$LocFqdn);
}
}


if(!strcmp($CaptivePortalEnable, "true")) {
$SERVER_ADDR = $_SERVER['SERVER_ADDR'];
$ip_addr = strpos($SERVER_ADDR, ":") == false ? $LanGwIPv4 : $LanGwIPv6 ;
Expand Down
Loading