check if demo or not

This commit is contained in:
Ibnu Maksum
2024-06-12 15:39:43 +07:00
parent 987e21b3ce
commit 6a4ac274d1
13 changed files with 28 additions and 152 deletions

View File

@ -24,7 +24,7 @@ switch ($action) {
$router = '';
foreach ($plans as $plan) {
$dvc = Package::getDevice($plan);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->add_plan($plan);
} else {
@ -38,7 +38,7 @@ switch ($action) {
$router = '';
foreach ($plans as $plan) {
$dvc = Package::getDevice($plan);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->add_plan($plan);
} else {
@ -128,7 +128,7 @@ switch ($action) {
if ($d) {
run_hook('delete_plan'); #HOOK
$dvc = Package::getDevice($d);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->remove_plan($d);
} else {
@ -212,7 +212,7 @@ switch ($action) {
$d->save();
$dvc = Package::getDevice($d);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->add_plan($d);
} else {
@ -304,7 +304,7 @@ switch ($action) {
$d->save();
$dvc = Package::getDevice($d);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $d['device'])->update_plan($old, $d);
} else {
@ -408,7 +408,7 @@ switch ($action) {
run_hook('delete_ppoe'); #HOOK
$dvc = Package::getDevice($d);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->remove_plan($d);
} else {
@ -497,7 +497,7 @@ switch ($action) {
$d->save();
$dvc = Package::getDevice($d);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->add_plan($d);
} else {
@ -578,7 +578,7 @@ switch ($action) {
$d->save();
$dvc = Package::getDevice($d);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $d['device'])->update_plan($old, $d);
} else {