Skip to content

Commit c4288d6

Browse files
authored
Merge pull request #8 from rdkcentral/feature/issue-5
XER10-1251 : [XER10_UK][Secure GUI]Default gateway ip not redirecting.
2 parents efa194f + 3186858 commit c4288d6

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

source/Styles/xb6/jst/index.jst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,32 @@ $psmMode = $DeviceControl_value['psmMode'];
9696
$LanGwIPv6 = $ipv6addr;
9797
}
9898
}
99+
100+
//$LanGwIPv6
101+
$LanGwIP = [];
102+
$LanGwIP['localAddr'] = '';
103+
$LanGwIP['globalAddr'] = '';
104+
$LanGwIP['ulaAddr'] = '';
105+
if(strpos($partnerId, "sky-") !== false) {
106+
$lan_ip = [];
107+
$bin = exec("which ifconfig");
108+
$xbin=$bin[0].replace(/ /g,'').replace(/\n/g,'');
109+
$out = exec($xbin+" brlan0");
110+
for($k in $out){
111+
$v = $out[$k];
112+
if (strpos($v, 'inet6 addr')){
113+
$tmp = explode('Scope', $v);
114+
$tmp = explode('addr:', $tmp[0]);
115+
$tmp = explode('%', $tmp[1]);
116+
$tmp = explode('/', $tmp[0]);
117+
if(strpos($v, 'inet6 addr: fe80')) $LanGwIP['localAddr'] = trim($tmp[0]);
118+
else if(strpos($v, 'inet6 addr: 2')) $LanGwIP['globalAddr'] = trim($tmp[0]);
119+
else $LanGwIP['ulaAddr'] = trim($tmp[0]);
120+
}
121+
}
122+
$LanGwIPv6 = $LanGwIP['ulaAddr'];
123+
}
124+
99125
if(!$isMSO) {
100126
setStr("Device.DeviceInfo.X_RDKCENTRAL-COM_UI_ACCESS","ui_access",true);
101127
//If Cloud redirection is set, then everything through local GW should be redirected
@@ -104,6 +130,23 @@ if(!$isMSO) {
104130
header("Location: $Cloud_WebURL");
105131
exit(0);
106132
}*/
133+
134+
$SERVER_ADDR = $_SERVER['SERVER_ADDR'];
135+
$ip_addr = strpos($SERVER_ADDR, ":") == false ? $LanGwIPv4 : $LanGwIPv6 ;
136+
$SecWebUI = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.Enable");
137+
$LocFqdn = getStr("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SecureWebUI.LocalFqdn");
138+
if(strpos($partnerId, "sky-") !== false) {
139+
if (strcmp($SecWebUI, "true")==0) {
140+
if (strcmp($url, $LocFqdn)!=0) {
141+
if( (strcmp($url,$ip_addr)==0) || isLocalIPv6($url) )
142+
header('Location:https://'+$LocFqdn);
143+
}
144+
else if ((strcmp($url, $LocFqdn)==0) && ($_SERVER["SERVER_PORT"]=="80"))
145+
header('Location:https://'+$LocFqdn);
146+
}
147+
}
148+
149+
107150
if(!strcmp($CaptivePortalEnable, "true")) {
108151
$SERVER_ADDR = $_SERVER['SERVER_ADDR'];
109152
$ip_addr = strpos($SERVER_ADDR, ":") == false ? $LanGwIPv4 : $LanGwIPv6 ;

0 commit comments

Comments
 (0)