|
@@ -25,56 +25,56 @@
|
|
|
checkValue("WifiDhcpClient");
|
|
|
checkValue("TelcomEnabled");
|
|
|
WifiMode_changed();
|
|
|
- if(isset($_POST['Eth0DhcpClient'])){
|
|
|
- $json['Eth0DhcpClient'] = $_POST['Eth0DhcpClient'];
|
|
|
+ if(isset($_REQUEST['Eth0DhcpClient'])){
|
|
|
+ $json['Eth0DhcpClient'] = $_REQUEST['Eth0DhcpClient'];
|
|
|
}
|
|
|
- if(isset($_POST['Eth0IpAddress'])){
|
|
|
- $json['Eth0IpAddress'] = $_POST['Eth0IpAddress'];
|
|
|
+ if(isset($_REQUEST['Eth0IpAddress'])){
|
|
|
+ $json['Eth0IpAddress'] = $_REQUEST['Eth0IpAddress'];
|
|
|
}
|
|
|
- if(isset($_POST['Eth0SubmaskAddress'])){
|
|
|
- $json['Eth0SubmaskAddress'] = $_POST['Eth0SubmaskAddress'];
|
|
|
+ if(isset($_REQUEST['Eth0SubmaskAddress'])){
|
|
|
+ $json['Eth0SubmaskAddress'] = $_REQUEST['Eth0SubmaskAddress'];
|
|
|
}
|
|
|
- if(isset($_POST['Eth0GatewayAddress'])){
|
|
|
- $json['Eth0GatewayAddress'] = $_POST['Eth0GatewayAddress'];
|
|
|
+ if(isset($_REQUEST['Eth0GatewayAddress'])){
|
|
|
+ $json['Eth0GatewayAddress'] = $_REQUEST['Eth0GatewayAddress'];
|
|
|
}
|
|
|
- if(isset($_POST['WifiMode'])){
|
|
|
- $json['WifiMode'] = $_POST['WifiMode'];
|
|
|
+ if(isset($_REQUEST['WifiMode'])){
|
|
|
+ $json['WifiMode'] = $_REQUEST['WifiMode'];
|
|
|
}
|
|
|
- if(isset($_POST['WifiSsid'])){
|
|
|
- $json['WifiSsid'] = $_POST['WifiSsid'];
|
|
|
+ if(isset($_REQUEST['WifiSsid'])){
|
|
|
+ $json['WifiSsid'] = str_replace("&","&",str_replace(""",'"',str_replace("'","'",str_replace("<","<",str_replace(">",">",$_REQUEST['WifiSsid'])))));
|
|
|
}
|
|
|
- if(isset($_POST['WifiPassword'])){
|
|
|
- $json['WifiPassword'] = $_POST['WifiPassword'];
|
|
|
+ if(isset($_REQUEST['WifiPassword'])){
|
|
|
+ $json['WifiPassword'] = str_replace("&","&",str_replace(""",'"',str_replace("'","'",str_replace("<","<",str_replace(">",">",$_REQUEST['WifiPassword'])))));
|
|
|
}
|
|
|
- if(isset($_POST['WifiDhcpServer'])){
|
|
|
- $json['WifiDhcpServer'] = $_POST['WifiDhcpServer'];
|
|
|
+ if(isset($_REQUEST['WifiDhcpServer'])){
|
|
|
+ $json['WifiDhcpServer'] = $_REQUEST['WifiDhcpServer'];
|
|
|
}
|
|
|
- if(isset($_POST['WifiDhcpClient'])){
|
|
|
- $json['WifiDhcpClient'] = $_POST['WifiDhcpClient'];
|
|
|
+ if(isset($_REQUEST['WifiDhcpClient'])){
|
|
|
+ $json['WifiDhcpClient'] = $_REQUEST['WifiDhcpClient'];
|
|
|
}
|
|
|
- if(isset($_POST['WifiIpAddress'])){
|
|
|
- $json['WifiIpAddress'] = $_POST['WifiIpAddress'];
|
|
|
+ if(isset($_REQUEST['WifiIpAddress'])){
|
|
|
+ $json['WifiIpAddress'] = $_REQUEST['WifiIpAddress'];
|
|
|
}
|
|
|
- if(isset($_POST['WifiSubmaskAddress'])){
|
|
|
- $json['WifiSubmaskAddress'] = $_POST['WifiSubmaskAddress'];
|
|
|
+ if(isset($_REQUEST['WifiSubmaskAddress'])){
|
|
|
+ $json['WifiSubmaskAddress'] = $_REQUEST['WifiSubmaskAddress'];
|
|
|
}
|
|
|
- if(isset($_POST['WifiGatewayAddress'])){
|
|
|
- $json['WifiGatewayAddress'] = $_POST['WifiGatewayAddress'];
|
|
|
+ if(isset($_REQUEST['WifiGatewayAddress'])){
|
|
|
+ $json['WifiGatewayAddress'] = $_REQUEST['WifiGatewayAddress'];
|
|
|
}
|
|
|
- if(isset($_POST['TelcomApn'])){
|
|
|
- $json['TelcomApn'] = $_POST['TelcomApn'];
|
|
|
+ if(isset($_REQUEST['TelcomApn'])){
|
|
|
+ $json['TelcomApn'] = str_replace("&","&",str_replace(""",'"',str_replace("'","'",str_replace("<","<",str_replace(">",">",$_REQUEST['TelcomApn'])))));
|
|
|
}
|
|
|
- if(isset($_POST['TelcomChapPapId'])){
|
|
|
- $json['TelcomChapPapId'] = $_POST['TelcomChapPapId'];
|
|
|
+ if(isset($_REQUEST['TelcomChapPapId'])){
|
|
|
+ $json['TelcomChapPapId'] = str_replace("&","&",str_replace(""",'"',str_replace("'","'",str_replace("<","<",str_replace(">",">",$_REQUEST['TelcomChapPapId'])))));
|
|
|
}
|
|
|
- if(isset($_POST['TelcomChapPapPwd'])){
|
|
|
- $json['TelcomChapPapPwd'] = $_POST['TelcomChapPapPwd'];
|
|
|
+ if(isset($_REQUEST['TelcomChapPapPwd'])){
|
|
|
+ $json['TelcomChapPapPwd'] = str_replace("&","&",str_replace(""",'"',str_replace("'","'",str_replace("<","<",str_replace(">",">",$_REQUEST['TelcomChapPapPwd'])))));
|
|
|
}
|
|
|
- if(isset($_POST['TelcomIpAddress'])){
|
|
|
- $json['TelcomIpAddress'] = $_POST['TelcomIpAddress'];
|
|
|
+ if(isset($_REQUEST['TelcomIpAddress'])){
|
|
|
+ $json['TelcomIpAddress'] = $_REQUEST['TelcomIpAddress'];
|
|
|
}
|
|
|
- if(isset($_POST['TelcomEnabled'])){
|
|
|
- $json['TelcomEnabled'] = $_POST['TelcomEnabled'];
|
|
|
+ if(isset($_REQUEST['TelcomEnabled'])){
|
|
|
+ $json['TelcomEnabled'] = $_REQUEST['TelcomEnabled'];
|
|
|
}
|
|
|
|
|
|
// ob_start();
|
|
@@ -90,7 +90,8 @@
|
|
|
exit;
|
|
|
}
|
|
|
else{
|
|
|
- $jsone['result'] = "Error";
|
|
|
+// $jsone['result'] = "Error";
|
|
|
+ $jsone['result'] = $str_json;
|
|
|
$jsone['message'] = "Something went wrong on machine";
|
|
|
echo json_encode($jsone);
|
|
|
return false;
|
|
@@ -100,8 +101,8 @@
|
|
|
}
|
|
|
|
|
|
function checkip($id){
|
|
|
- $ip=$_POST[$id];
|
|
|
- if($_POST[$id] != ""){
|
|
|
+ $ip=$_REQUEST[$id];
|
|
|
+ if($_REQUEST[$id] != ""){
|
|
|
if(ip2long($ip)){
|
|
|
|
|
|
}
|
|
@@ -115,14 +116,14 @@
|
|
|
}
|
|
|
|
|
|
function checkValue($id){
|
|
|
- if($_POST[$id] != ""){
|
|
|
- if(strlen($_POST[$id])!=1){
|
|
|
+ if($_REQUEST[$id] != ""){
|
|
|
+ if(strlen($_REQUEST[$id])!=1){
|
|
|
$jsone['result'] = "Fail";
|
|
|
$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
|
|
|
echo json_encode($jsone);
|
|
|
exit;
|
|
|
}
|
|
|
- if(!ereg("[0-9]",$_POST[$id])){
|
|
|
+ if(!ereg("[0-9]",$_REQUEST[$id])){
|
|
|
$jsone['result'] = "Fail";
|
|
|
$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
|
|
|
echo json_encode($jsone);
|
|
@@ -132,21 +133,21 @@
|
|
|
}
|
|
|
|
|
|
function WifiMode_changed(){
|
|
|
- if($_POST['WifiMode']=="0"){
|
|
|
-// $_POST['WifiDhcpServer']=1;
|
|
|
-// $_POST['WifiDhcpClient']=1;
|
|
|
- $_POST['WifiSsid']="";
|
|
|
- $_POST['WifiPassword']="";
|
|
|
- }
|
|
|
- if($_POST['WifiMode']=="1"){
|
|
|
-// $_POST['WifiDhcpServer']=1;
|
|
|
-// $_POST['WifiDhcpClient']=0;
|
|
|
- }
|
|
|
- if($_POST['WifiMode']=="2"){
|
|
|
-// $_POST['WifiDhcpServer']=0;
|
|
|
-// $_POST['WifiDhcpClient']=1;
|
|
|
- $_POST['WifiSsid']="";
|
|
|
- $_POST['WifiPassword']="";
|
|
|
+ if($_REQUEST['WifiMode']=="0"){
|
|
|
+// $_REQUEST['WifiDhcpServer']=1;
|
|
|
+// $_REQUEST['WifiDhcpClient']=1;
|
|
|
+ $_REQUEST['WifiSsid']="";
|
|
|
+ $_REQUEST['WifiPassword']="";
|
|
|
+ }
|
|
|
+ if($_REQUEST['WifiMode']=="1"){
|
|
|
+// $_REQUEST['WifiDhcpServer']=1;
|
|
|
+// $_REQUEST['WifiDhcpClient']=0;
|
|
|
+ }
|
|
|
+ if($_REQUEST['WifiMode']=="2"){
|
|
|
+// $_REQUEST['WifiDhcpServer']=0;
|
|
|
+// $_REQUEST['WifiDhcpClient']=1;
|
|
|
+ $_REQUEST['WifiSsid']="";
|
|
|
+ $_REQUEST['WifiPassword']="";
|
|
|
}
|
|
|
}
|
|
|
|