summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-25 11:46:50 +0100
committerSimon Rettberg2019-03-25 11:46:50 +0100
commit03424ad19ac1bb42635a3d6653565aa0dc6ccf5a (patch)
treef3b068d5ca0aff6b897f98bb7eb7a5d097cec749 /modules-available/locationinfo/page.inc.php
parent[dozmod] How about implementing runscript deletion (diff)
downloadslx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.tar.gz
slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.tar.xz
slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.zip
Introduce JS helper for bootstrap confirm dialogs on button-submit
Diffstat (limited to 'modules-available/locationinfo/page.inc.php')
-rw-r--r--modules-available/locationinfo/page.inc.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php
index 3e17976d..d1644ce1 100644
--- a/modules-available/locationinfo/page.inc.php
+++ b/modules-available/locationinfo/page.inc.php
@@ -22,21 +22,26 @@ class Page_LocationInfo extends Page
$action = Request::post('action');
if ($action === 'writePanelConfig') {
$this->writePanelConfig();
+ $show = 'panels';
} elseif ($action === 'writeLocationConfig') {
$this->writeLocationConfig();
$show = 'locations';
- } elseif ($action === 'deleteServer') {
- $this->deleteServer();
} elseif ($action === 'deletePanel') {
$this->deletePanel();
- } elseif ($action === 'checkConnection') {
- $this->checkConnection(Request::post('serverid', 0, 'int'));
- $show = 'backends';
+ $show = 'panels';
} elseif ($action === 'updateServerSettings') {
$this->updateServerSettings();
$show = 'backends';
- } elseif (Request::isPost()) {
- Message::addWarning('main.invalid-action', $action);
+ } else {
+ if (($id = Request::post('del-serverid', false, 'int')) !== false) {
+ $this->deleteServer($id);
+ $show = 'backends';
+ } elseif (($id = Request::post('chk-serverid', false, 'int')) !== false) {
+ $this->checkConnection($id);
+ $show = 'backends';
+ } elseif (Request::isPost()) {
+ Message::addWarning('main.invalid-action', $action);
+ }
}
if (Request::isPost() || $this->show === false) {
if (!empty($show)) {
@@ -95,11 +100,10 @@ class Page_LocationInfo extends Page
/**
* Deletes the server from the db.
*/
- private function deleteServer()
+ private function deleteServer($id)
{
User::assertPermission('backend.edit');
- $id = Request::post('serverid', false, 'int');
- if ($id === false) {
+ if ($id === 0) {
Message::addError('server-id-missing');
return;
}