summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorSimon Rettberg2015-09-04 19:03:53 +0200
committerSimon Rettberg2015-09-04 19:03:53 +0200
commit5435b8d135d2003945e2361d1c82f583570dfdde (patch)
treeee324f7754e9d9fd1fe4a5b3f3def1e56b8eeb30 /modules
parentFix db update by adding missing return statement... (diff)
downloadslx-admin-5435b8d135d2003945e2361d1c82f583570dfdde.tar.gz
slx-admin-5435b8d135d2003945e2361d1c82f583570dfdde.tar.xz
slx-admin-5435b8d135d2003945e2361d1c82f583570dfdde.zip
Many changes
Diffstat (limited to 'modules')
-rw-r--r--modules/backup.inc.php2
-rw-r--r--modules/sysconfig/addmodule_adauth.inc.php33
-rw-r--r--modules/systemstatus.inc.php30
3 files changed, 60 insertions, 5 deletions
diff --git a/modules/backup.inc.php b/modules/backup.inc.php
index 2a44997a..02b02b0e 100644
--- a/modules/backup.inc.php
+++ b/modules/backup.inc.php
@@ -97,7 +97,7 @@ class Page_Backup extends Page
$parent = $task['id'];
}
EventLog::info('Creating backup, v' . Database::getExpectedSchemaVersion() . ' on ' . Property::getServerIp());
- // Finally run backup
+ // Finally run restore
$task = Taskmanager::submit('BackupRestore', array(
'mode' => 'restore',
'backupFile' => $tempfile,
diff --git a/modules/sysconfig/addmodule_adauth.inc.php b/modules/sysconfig/addmodule_adauth.inc.php
index c9b42ee5..1b04eab0 100644
--- a/modules/sysconfig/addmodule_adauth.inc.php
+++ b/modules/sysconfig/addmodule_adauth.inc.php
@@ -31,6 +31,9 @@ class AdAuth_Start extends AddModule_Base
'ssl' => Request::post('ssl')
);
}
+ if (preg_match('/^(.*)\:(636|3269|389|3268)$/', $data['server'], $out)) {
+ $data['server'] = $out[1];
+ }
$data['step'] = 'AdAuth_CheckConnection';
Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'sysconfig/ad-start', $data);
}
@@ -211,14 +214,17 @@ class AdAuth_Finish extends AddModule_Base
$module = ConfigModule::getInstance('AdAuth');
else
$module = $this->edit;
+ $ssl = Request::post('ssl', 'off') === 'on';
$module->setData('server', Request::post('server'));
$module->setData('searchbase', $searchbase);
$module->setData('binddn', $binddn);
$module->setData('bindpw', Request::post('bindpw'));
$module->setData('home', Request::post('home'));
- $module->setData('ssl', Request::post('ssl', 'off') === 'on');
- if (Request::post('fingerprint')) {
- $module->setData('fingerprint', Request::post('fingerprint'));
+ $module->setData('ssl', $ssl);
+ if ($ssl) {
+ $module->setData('fingerprint', Request::post('fingerprint', ''));
+ } else {
+ $module->setData('fingerprint', '');
}
if ($this->edit !== false)
$ret = $module->update($title);
@@ -228,7 +234,8 @@ class AdAuth_Finish extends AddModule_Base
Message::addError('value-invalid', 'any', 'any');
$tgz = false;
} else {
- $tgz = $module->generate($this->edit === false, NULL, 200);
+ $parent = $this->stopOldInstance();
+ $tgz = $module->generate($this->edit === false, $parent);
}
if ($tgz === false) {
AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render()
@@ -238,6 +245,24 @@ class AdAuth_Finish extends AddModule_Base
'tm-config' => $tgz,
);
}
+
+ private function stopOldInstance()
+ {
+ if ($this->edit === false)
+ return NULL;
+ $list = ConfigTgz::getAllForModule($this->edit->id());
+ if (!is_array($list))
+ return NULL;
+ $parent = NULL;
+ foreach ($list as $tgz) {
+ if (!$tgz->isActive())
+ continue;
+ $task = Trigger::ldadp($tgz->id(), $parent);
+ if (isset($task['id']))
+ $parent = $task['id'];
+ }
+ return $parent;
+ }
protected function renderInternal()
{
diff --git a/modules/systemstatus.inc.php b/modules/systemstatus.inc.php
index e80179ad..a477b252 100644
--- a/modules/systemstatus.inc.php
+++ b/modules/systemstatus.inc.php
@@ -208,6 +208,36 @@ class Page_SystemStatus extends Page
echo '<pre>', htmlspecialchars(substr($data, strpos($data, "\n") + 1)), '</pre>';
}
+ protected function ajaxNetstat()
+ {
+ $taskId = Taskmanager::submit('Netstat');
+ if ($taskId === false)
+ return;
+ $status = Taskmanager::waitComplete($taskId, 3500);
+
+ if (isset($status['data']['messages']))
+ $data = $status['data']['messages'];
+ else
+ $data = 'Taskmanager error';
+
+ echo '<pre>', htmlspecialchars($data), '</pre>';
+ }
+
+ protected function ajaxPsList()
+ {
+ $taskId = Taskmanager::submit('PsList');
+ if ($taskId === false)
+ return;
+ $status = Taskmanager::waitComplete($taskId, 3500);
+
+ if (isset($status['data']['messages']))
+ $data = $status['data']['messages'];
+ else
+ $data = 'Taskmanager error';
+
+ echo '<pre>', htmlspecialchars($data), '</pre>';
+ }
+
private function usageColor($percent)
{
if ($percent <= 50) {