update dhcp check
This commit is contained in:
@@ -159,6 +159,8 @@ class ConfigController extends Controller {
|
||||
|
||||
public function actionIndex() {
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_MAY_CHU");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
@@ -260,6 +262,8 @@ class ConfigController extends Controller {
|
||||
return true;
|
||||
} else {
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_NHAN_DIEN");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
@@ -424,6 +428,8 @@ class ConfigController extends Controller {
|
||||
|
||||
public function actionCauHinhThietBi() {
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_THIET_BI");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
|
||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||
'http' => [
|
||||
@@ -529,9 +535,9 @@ class ConfigController extends Controller {
|
||||
if (Yii::$app->request->post()) {
|
||||
Yii::$app->response->format = "json";
|
||||
$post = Yii::$app->request->post();
|
||||
if (!isset($this->subnet[$post['subnet_mask']]))
|
||||
if (!$post['dhcp'] && !isset($this->subnet[$post['subnet_mask']]))
|
||||
return ["status" => false];
|
||||
$post['subnet_mask'] = $this->subnet[$post['subnet_mask']];
|
||||
$post['subnet_mask'] = isset($this->subnet[$post['subnet_mask']]) ? $this->subnet[$post['subnet_mask']] : "";
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
|
||||
Reference in New Issue
Block a user