diff options
| author | Simon Rettberg | 2016-05-11 19:00:30 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2016-05-11 19:00:30 +0200 |
| commit | 1cc1c2ed092c46eb35893c1d85accb24cf43d7f9 (patch) | |
| tree | 95c1302f4a1ae441e174a1dca64133e2873f8297 /inc/configmodule/sshconfig.inc.php | |
| parent | Add PhpStorm prefs (diff) | |
| download | slx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.tar.gz slx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.tar.xz slx-admin-1cc1c2ed092c46eb35893c1d85accb24cf43d7f9.zip | |
Still working in modularization cleanup and refinement
Diffstat (limited to 'inc/configmodule/sshconfig.inc.php')
| -rw-r--r-- | inc/configmodule/sshconfig.inc.php | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/inc/configmodule/sshconfig.inc.php b/inc/configmodule/sshconfig.inc.php deleted file mode 100644 index 853acf6a..00000000 --- a/inc/configmodule/sshconfig.inc.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -ConfigModule::registerModule( - ConfigModule_SshConfig::MODID, // ID - Dictionary::translate('config-module', 'sshconfig_title'), // Title - Dictionary::translate('config-module', 'sshconfig_description'), // Description - Dictionary::translate('config-module', 'group_sshconfig'), // Group - true // Only one per config? -); - -class ConfigModule_SshConfig extends ConfigModule -{ - const MODID = 'SshConfig'; - const VERSION = 1; - - protected function generateInternal($tgz, $parent) - { - if (!$this->validateConfig()) - return false; - $config = $this->moduleData + array( - 'filename' => $tgz, - 'failOnParentFail' => false, - 'parent' => $parent - ); - // Create config module, which will also check if the pubkey is valid - return Taskmanager::submit('SshdConfigGenerator', $config); - } - - protected function moduleVersion() - { - return self::VERSION; - } - - protected function validateConfig() - { - return isset($this->moduleData['publicKey']) && isset($this->moduleData['allowPasswordLogin']) && isset($this->moduleData['listenPort']); - } - - public function setData($key, $value) - { - switch ($key) { - case 'publicKey': - break; - case 'allowPasswordLogin': - if ($value === true || $value === 'yes') - $value = 'yes'; - elseif ($value === false || $value === 'no') - $value = 'no'; - else - return false; - break; - case 'listenPort': - if (!is_numeric($value) || $value < 1 || $value > 65535) - return false; - break; - default: - return false; - } - $this->moduleData[$key] = $value; - return true; - } - -} |
