diff options
author | Jonathan Bauer | 2016-04-01 16:50:13 +0200 |
---|---|---|
committer | Jonathan Bauer | 2016-04-01 16:50:13 +0200 |
commit | dbc0d9614421e064cc62aacf116ebb783c83f2f3 (patch) | |
tree | 091844b8578ff1d9ac18edfd3cee3e63210133d7 /modules/sysconfig | |
parent | [ldapauth] Add homedir conf to ldap wizard (diff) | |
download | slx-admin-dbc0d9614421e064cc62aacf116ebb783c83f2f3.tar.gz slx-admin-dbc0d9614421e064cc62aacf116ebb783c83f2f3.tar.xz slx-admin-dbc0d9614421e064cc62aacf116ebb783c83f2f3.zip |
[merge] merging c3sl / fr - initial commit
Diffstat (limited to 'modules/sysconfig')
27 files changed, 1440 insertions, 205 deletions
diff --git a/modules/sysconfig/addconfig.inc.php b/modules/sysconfig/addconfig.inc.php index e51a7f64..8203e555 100644 --- a/modules/sysconfig/addconfig.inc.php +++ b/modules/sysconfig/addconfig.inc.php @@ -170,7 +170,7 @@ class AddConfig_Start extends AddConfig_Base } } unset($mod); - Render::addDialog(Dictionary::translate("lang_configurationCompilation"), false, 'sysconfig/cfg-start', array( + Render::addDialog(Dictionary::translate("lang_configurationCompilation"), false, 'cfg-start', array( 'step' => 'AddConfig_Finish', 'groups' => array_values($modGroups), 'title' => $title, @@ -213,7 +213,7 @@ class AddConfig_Finish extends AddConfig_Base protected function renderInternal() { - Render::addDialog(Dictionary::translate('lang_configurationCompilation'), false, 'sysconfig/cfg-finish', array( + Render::addDialog(Dictionary::translate('lang_configurationCompilation'), false, 'cfg-finish', array( 'configid' => $this->config->id() )); } diff --git a/modules/sysconfig/addmodule.inc.php b/modules/sysconfig/addmodule.inc.php index a20bda37..bcd8e796 100644 --- a/modules/sysconfig/addmodule.inc.php +++ b/modules/sysconfig/addmodule.inc.php @@ -18,35 +18,6 @@ abstract class AddModule_Base * @var \ConfigModule */ protected $edit = false; - - protected $bag = false; - - private $bagId = false; - - protected function loadBag($createIfNone = true) - { - if ($this->bagId !== false) - return $this->bagId; - $bagId = Request::any('bag', '', 'string'); - $this->bag = Session::get($bagId); - if ($this->bag === false) { - if (!$createIfNone) - return false; - $this->bagId = dechex(rand()); - $this->bag = array(); - } else { - $this->bagId = $bagId; - } - return $this->bagId; - } - - protected function saveBag() - { - if ($this->bagId === false) - return false; - Session::set($this->bagId, $this->bag); - return true; - } /** * @@ -160,7 +131,7 @@ class AddModule_Start extends AddModule_Base $order[] = $module['sortOrder']; } array_multisort($order, SORT_ASC, $title, SORT_ASC, $mods); - Render::addDialog(Dictionary::translate('lang_moduleAdd'), false, 'sysconfig/start', array('modules' => array_values($mods))); + Render::addDialog(Dictionary::translate('lang_moduleAdd'), false, 'start', array('modules' => array_values($mods))); } } diff --git a/modules/sysconfig/addmodule_adauth.inc.php b/modules/sysconfig/addmodule_adauth.inc.php index cba09382..e295630c 100644 --- a/modules/sysconfig/addmodule_adauth.inc.php +++ b/modules/sysconfig/addmodule_adauth.inc.php @@ -25,7 +25,7 @@ class AdAuth_Start extends AddModule_Base $data['server'] = $out[1]; } $data['step'] = 'AdAuth_CheckConnection'; - Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'sysconfig/ad-start', $data); + Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'ad-start', $data); } } @@ -88,7 +88,7 @@ class AdAuth_CheckConnection extends AddModule_Base } else { $data['next'] = 'AdAuth_CheckCredentials'; } - Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'sysconfig/ad_ldap-checkconnection', $data); + Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'ad_ldap-checkconnection', $data); } } @@ -165,7 +165,7 @@ class AdAuth_SelfSearch extends AddModule_Base } else { $data['next'] = 'AdAuth_CheckCredentials'; } - Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'sysconfig/ad-selfsearch', + Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'ad-selfsearch', array_merge($this->taskIds, $data)); } @@ -218,7 +218,7 @@ class AdAuth_HomeAttrCheck extends AddModule_Base protected function renderInternal() { - Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'sysconfig/ad-selfsearch', array_merge($this->taskIds, array( + Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'ad-selfsearch', array_merge($this->taskIds, array( 'edit' => Request::post('edit'), 'title' => Request::post('title'), 'server' => Request::post('server'), @@ -289,7 +289,7 @@ class AdAuth_CheckCredentials extends AddModule_Base protected function renderInternal() { - Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'sysconfig/ad_ldap-checkcredentials', array_merge($this->taskIds, array( + Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'ad_ldap-checkcredentials', array_merge($this->taskIds, array( 'edit' => Request::post('edit'), 'title' => Request::post('title'), 'server' => Request::post('server') . ':' . Request::post('port'), @@ -303,24 +303,23 @@ class AdAuth_CheckCredentials extends AddModule_Base 'certificate' => Request::post('certificate', ''), 'originalbinddn' => Request::post('originalbinddn'), 'prev' => 'AdAuth_Start', - 'next' => 'AdAuth_HomeDir' + 'next' => 'AdAuth_Finish' )) ); } } -class AdAuth_HomeDir extends AddModule_Base +class AdAuth_Finish extends AddModule_Base { - private $searchbase; - private $binddn; - + private $taskIds; + protected function preprocessInternal() { - $this->binddn = Request::post('binddn'); - $this->searchbase = Request::post('searchbase'); - if (empty($this->searchbase)) { + $binddn = Request::post('binddn'); + $searchbase = Request::post('searchbase'); + if (empty($searchbase)) { // If no search base was given, determine it from the dn $originalBindDn = str_replace('\\', '/', trim(Request::post('originalbinddn'))); if (!preg_match('#^([^/]+)/[^/]+$#', $originalBindDn, $out)) { @@ -328,81 +327,25 @@ class AdAuth_HomeDir extends AddModule_Base Util::redirect('?do=SysConfig&action=addmodule&step=AdAuth_Start'); } // $out[1] is the domain // Find the domain in the dn - $i = mb_stripos($this->binddn, '=' . $out[1] . ','); + $i = mb_stripos($binddn, '=' . $out[1] . ','); if ($i === false) { Message::addError('value-invalid', 'binddn', $out[1]); Util::redirect('?do=SysConfig&action=addmodule&step=AdAuth_Start'); } // Now find ',' before it so we get the key - $i = mb_strrpos(mb_substr($this->binddn, 0, $i), ','); + $i = mb_strrpos(mb_substr($binddn, 0, $i), ','); if ($i === false) $i = -1; - $this->searchbase = mb_substr($this->binddn, $i + 1); + $searchbase = mb_substr($binddn, $i + 1); } else { $somedn = Request::post('somedn', false); if (!empty($somedn)) { - $i = stripos($somedn, $this->searchbase); + $i = stripos($somedn, $searchbase); if ($i !== false) { - $this->searchbase = substr($somedn, $i, strlen($this->searchbase)); - } - } - } - } - - protected function renderInternal() - { - $data = array( - 'edit' => Request::post('edit'), - 'title' => Request::post('title'), - 'server' => Request::post('server'), - 'searchbase' => $this->searchbase, - 'binddn' => $this->binddn, - 'bindpw' => Request::post('bindpw'), - 'home' => Request::post('home'), - 'homeattr' => Request::post('homeattr'), - 'ssl' => Request::post('ssl') === 'on', - 'fingerprint' => Request::post('fingerprint'), - 'certificate' => Request::post('certificate', ''), - 'originalbinddn' => Request::post('originalbinddn'), - 'prev' => 'AdAuth_Start', - 'next' => 'AdAuth_Finish' - ); - if ($this->edit !== false) { - foreach (self::getAttributes() as $key) { - if ($this->edit->getData($key)) { - $data[$key . '_c'] = 'checked="checked"'; + $searchbase = substr($somedn, $i, strlen($searchbase)); } } - $data['shareRemapMode_' . $this->edit->getData('shareRemapMode')] = 'selected="selected"'; - $letter = $this->edit->getData('shareHomeDrive'); - } else { - $data['shareDownloads'] = $data['shareMedia'] = $data['shareDocuments'] = 'selected="selected"'; - $letter = 'H:'; } - $data['drives'] = array(); - foreach (range('D', 'Z') as $l) { - $data['drives'][] = array( - 'drive' => $l . ':', - 'selected' => (strtoupper($letter{0}) === $l) ? 'selected="selected"' : '' - ); - } - Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'sysconfig/ad_ldap-homedir', $data); - } - - public static function getAttributes() - { - return array('shareRemapMode', 'shareRemapCreate', 'shareDocuments', 'shareDownloads', 'shareDesktop', 'shareMedia', 'shareOther', 'shareHomeDrive'); - } - -} - -class AdAuth_Finish extends AddModule_Base -{ - - private $taskIds; - - protected function preprocessInternal() - { $title = Request::post('title'); if (empty($title)) $title = 'AD: ' . Request::post('server'); @@ -412,24 +355,13 @@ class AdAuth_Finish extends AddModule_Base $module = $this->edit; $ssl = Request::post('ssl', 'off') === 'on'; $module->setData('server', Request::post('server')); - $module->setData('searchbase', Request::post('searchbase')); - $module->setData('binddn', Request::post('binddn')); + $module->setData('searchbase', $searchbase); + $module->setData('binddn', $binddn); $module->setData('bindpw', Request::post('bindpw')); $module->setData('home', Request::post('home')); $module->setData('homeattr', Request::post('homeattr')); $module->setData('certificate', Request::post('certificate')); $module->setData('ssl', $ssl); - foreach (AdAuth_HomeDir::getAttributes() as $key) { - $value = Request::post($key); - if (is_numeric($value)) { - settype($value, 'integer'); - } elseif ($value === 'on') { - $value = 1; - } elseif ($value === false) { - $value = 0; - } - $module->setData($key, $value); - } if ($ssl) { $module->setData('fingerprint', Request::post('fingerprint', '')); } else { @@ -475,7 +407,7 @@ class AdAuth_Finish extends AddModule_Base protected function renderInternal() { - Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'sysconfig/ad-finish', $this->taskIds); + Render::addDialog(Dictionary::translate('config-module', 'adAuth_title'), false, 'ad-finish', $this->taskIds); } } diff --git a/modules/sysconfig/addmodule_branding.inc.php b/modules/sysconfig/addmodule_branding.inc.php index 336e2a77..67e20892 100644 --- a/modules/sysconfig/addmodule_branding.inc.php +++ b/modules/sysconfig/addmodule_branding.inc.php @@ -10,7 +10,7 @@ class Branding_Start extends AddModule_Base protected function renderInternal() { Render::addScriptBottom('fileselect'); - Render::addDialog(Dictionary::translate('config-module', 'branding_title'), false, 'sysconfig/branding-start', array( + Render::addDialog(Dictionary::translate('config-module', 'branding_title'), false, 'branding-start', array( 'step' => 'Branding_ProcessFile', 'edit' => $this->edit ? $this->edit->id() : false )); @@ -76,7 +76,7 @@ class Branding_ProcessFile extends AddModule_Base $png = base64_encode(file_get_contents($this->task['data']['pngFile'])); if (filesize($this->svgFile) < 1000000) $svg = base64_encode(file_get_contents($this->svgFile)); - Render::addDialog(Dictionary::translate('config-module', 'branding_title'), false, 'sysconfig/branding-check', array( + Render::addDialog(Dictionary::translate('config-module', 'branding_title'), false, 'branding-check', array( 'png' => $png, 'svg' => $svg, 'error' => $this->task['data']['error'], diff --git a/modules/sysconfig/addmodule_custommodule.inc.php b/modules/sysconfig/addmodule_custommodule.inc.php index f7342b7b..023463f7 100644 --- a/modules/sysconfig/addmodule_custommodule.inc.php +++ b/modules/sysconfig/addmodule_custommodule.inc.php @@ -13,7 +13,7 @@ class CustomModule_Start extends AddModule_Base { Session::set('mod_temp', false); Render::addScriptBottom('fileselect'); - Render::addDialog(Dictionary::translate('config-module', 'custom_title'), false, 'sysconfig/custom-upload', array( + Render::addDialog(Dictionary::translate('config-module', 'custom_title'), false, 'custom-upload', array( 'step' => 'CustomModule_ProcessUpload', 'edit' => $this->edit ? $this->edit->id() : false )); @@ -92,7 +92,7 @@ class CustomModule_ProcessUpload extends AddModule_Base $title = basename($_FILES['modulefile']['name']); else $title = ''; - Render::addDialog(Dictionary::translate('config-module', 'custom_title'), false, 'sysconfig/custom-fileselect', array( + Render::addDialog(Dictionary::translate('config-module', 'custom_title'), false, 'custom-fileselect', array( 'step' => 'CustomModule_CompressModule', 'files' => $list, 'edit' => $this->edit ? $this->edit->id() : false, diff --git a/modules/sysconfig/addmodule_ldapauth.inc.php b/modules/sysconfig/addmodule_ldapauth.inc.php index 0dad780b..e17469a0 100644 --- a/modules/sysconfig/addmodule_ldapauth.inc.php +++ b/modules/sysconfig/addmodule_ldapauth.inc.php @@ -21,7 +21,7 @@ class LdapAuth_Start extends AddModule_Base $data['server'] = $out[1]; } $data['step'] = 'LdapAuth_CheckConnection'; - Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'sysconfig/ldap-start', $data); + Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'ldap-start', $data); } } @@ -77,7 +77,7 @@ class LdapAuth_CheckConnection extends AddModule_Base ); $data['prev'] = 'LdapAuth_Start'; $data['next'] = 'LdapAuth_CheckCredentials'; - Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'sysconfig/ad_ldap-checkconnection', $data); + Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'ad_ldap-checkconnection', $data); } } @@ -133,7 +133,7 @@ class LdapAuth_CheckCredentials extends AddModule_Base protected function renderInternal() { - Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'sysconfig/ad_ldap-checkcredentials', array_merge($this->taskIds, array( + Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'ad_ldap-checkcredentials', array_merge($this->taskIds, array( 'edit' => Request::post('edit'), 'title' => Request::post('title'), 'server' => Request::post('server') . ':' . Request::post('port'), @@ -145,73 +145,9 @@ class LdapAuth_CheckCredentials extends AddModule_Base 'fingerprint' => Request::post('fingerprint'), 'certificate' => Request::post('certificate', ''), 'prev' => 'LdapAuth_Start', - 'next' => 'LdapAuth_HomeDir' - )) - ); - } - -} - -class LdapAuth_HomeDir extends AddModule_Base -{ - - private $searchbase; - - protected function preprocessInternal() - { - $this->searchbase = Request::post('searchbase'); - $somedn = Request::post('somedn', false); - if (!empty($somedn)) { - $i = stripos($somedn, $this->searchbase); - if ($i !== false) { - $this->searchbase = substr($somedn, $i, strlen($this->searchbase)); - } - } - } - - protected function renderInternal() - { - $data = array( - 'edit' => Request::post('edit'), - 'title' => Request::post('title'), - 'server' => Request::post('server'), - 'searchbase' => $this->searchbase, - 'binddn' => Request::post('binddn'), - 'bindpw' => Request::post('bindpw'), - 'home' => Request::post('home'), - 'homeattr' => Request::post('homeattr'), - 'ssl' => Request::post('ssl') === 'on', - 'fingerprint' => Request::post('fingerprint'), - 'certificate' => Request::post('certificate', ''), - 'originalbinddn' => Request::post('originalbinddn'), - 'prev' => 'LdapAuth_Start', 'next' => 'LdapAuth_Finish' + )) ); - if ($this->edit !== false) { - foreach (self::getAttributes() as $key) { - if ($this->edit->getData($key)) { - $data[$key . '_c'] = 'checked="checked"'; - } - } - $data['shareRemapMode_' . $this->edit->getData('shareRemapMode')] = 'selected="selected"'; - $letter = $this->edit->getData('shareHomeDrive'); - } else { - $data['shareDownloads'] = $data['shareMedia'] = $data['shareDocuments'] = 'selected="selected"'; - $letter = 'H:'; - } - $data['drives'] = array(); - foreach (range('D', 'Z') as $l) { - $data['drives'][] = array( - 'drive' => $l . ':', - 'selected' => (strtoupper($letter{0}) === $l) ? 'selected="selected"' : '' - ); - } - Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'sysconfig/ad_ldap-homedir', $data); - } - - public static function getAttributes() - { - return array('shareRemapMode', 'shareRemapCreate', 'shareDocuments', 'shareDownloads', 'shareDesktop', 'shareMedia', 'shareOther', 'shareHomeDrive'); } } @@ -232,6 +168,13 @@ class LdapAuth_Finish extends AddModule_Base $module = ConfigModule::getInstance('LdapAuth'); else $module = $this->edit; + $somedn = Request::post('somedn', false); + if (!empty($somedn)) { + $i = stripos($somedn, $searchbase); + if ($i !== false) { + $searchbase = substr($somedn, $i, strlen($searchbase)); + } + } $ssl = Request::post('ssl', 'off') === 'on'; $module->setData('server', Request::post('server')); $module->setData('searchbase', $searchbase); @@ -240,17 +183,6 @@ class LdapAuth_Finish extends AddModule_Base $module->setData('home', Request::post('home')); $module->setData('certificate', Request::post('certificate')); $module->setData('ssl', $ssl); - foreach (LdapAuth_HomeDir::getAttributes() as $key) { - $value = Request::post($key); - if (is_numeric($value)) { - settype($value, 'integer'); - } elseif ($value === 'on') { - $value = 1; - } elseif ($value === false) { - $value = 0; - } - $module->setData($key, $value); - } if ($ssl) { $module->setData('fingerprint', Request::post('fingerprint', '')); } else { @@ -296,7 +228,7 @@ class LdapAuth_Finish extends AddModule_Base protected function renderInternal() { - Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'sysconfig/ldap-finish', $this->taskIds); + Render::addDialog(Dictionary::translate('config-module', 'ldapAuth_title'), false, 'ldap-finish', $this->taskIds); } } diff --git a/modules/sysconfig/addmodule_sshconfig.inc.php b/modules/sysconfig/addmodule_sshconfig.inc.php index e50ca72c..5f0f7222 100644 --- a/modules/sysconfig/addmodule_sshconfig.inc.php +++ b/modules/sysconfig/addmodule_sshconfig.inc.php @@ -18,7 +18,7 @@ class SshConfig_Start extends AddModule_Base } else { $data = array(); } - Render::addDialog(Dictionary::translate('lang_clientSshConfig'), false, 'sysconfig/sshconfig-start', $data + array( + Render::addDialog(Dictionary::translate('lang_clientSshConfig'), false, 'sshconfig-start', $data + array( 'step' => 'SshConfig_Finish', )); } diff --git a/modules/sysconfig/config.json b/modules/sysconfig/config.json new file mode 100644 index 00000000..93209f62 --- /dev/null +++ b/modules/sysconfig/config.json @@ -0,0 +1,4 @@ +{ + "category":"settings", + "enabled":"true" +} diff --git a/modules/sysconfig/module.inc.php b/modules/sysconfig/module.inc.php new file mode 100644 index 00000000..0c06e125 --- /dev/null +++ b/modules/sysconfig/module.inc.php @@ -0,0 +1,396 @@ +<?php + +class Page_SysConfig extends Page +{ + + /** + * Holds all the known configuration modules, with title, description, start class for their wizard, etc. + * @var array + */ + protected static $moduleTypes = array(); + + /** + * Add a known configuration module. Every addmoule_* file should call this + * for its module provided. + * + * @param string $id Internal identifier for the module + * @param string $startClass Class to start wizard for creating such a module + * @param string $title Title of this module type + * @param string $description Description for this module type + * @param string $group Title for group this module type belongs to + * @param bool $unique Can only one such module be added to a config? + * @param int $sortOrder Lower comes first, alphabetical ordering otherwiese + */ + public static function addModule($id, $startClass, $title, $description, $group, $unique, $sortOrder = 0) + { + self::$moduleTypes[$id] = array( + 'startClass' => $startClass, + 'title' => $title, + 'description' => $description, + 'group' => $group, + 'unique' => $unique, + 'sortOrder' => $sortOrder + ); + } + + /** + * + * @return array All registered module types + */ + public static function getModuleTypes() + { + return self::$moduleTypes; + } + + protected function doPreprocess() + { + User::load(); + + if (!User::hasPermission('superadmin')) { + Message::addError('no-permission'); + Util::redirect('?do=Main'); + } + + $action = Request::any('action', 'list'); + + // Load all addmodule classes, as they populate the $moduleTypes array + require_once 'modules/sysconfig/addmodule.inc.php'; + foreach (glob('modules/sysconfig/addmodule_*.inc.php') as $file) { + require_once $file; + } + + // Action: "addmodule" (upload new module) + if ($action === 'addmodule') { + $this->initAddModule(); + AddModule_Base::preprocess(); + } + + if ($action === 'module') { + // Action: "delmodule" (delete module) + if (Request::post('del', 'no') !== 'no') { + $this->delModule(); + } + if (Request::post('download', 'no') !== 'no') { + $this->downloadModule(); + } + if (Request::post('rebuild', 'no') !== 'no') { + $this->rebuildModule(); + } + } + + // Action: "addconfig" (compose config from one or more modules) + if ($action === 'addconfig') { + $this->initAddConfig(); + AddConfig_Base::preprocess(); + } + + if ($action === 'config') { + // Action: "delconfig" (delete config) + if (Request::post('del', 'no') !== 'no') { + $this->delConfig(); + } + // Action "activate" (set sysconfig as active) + if (Request::post('activate', 'no') !== 'no') { + $this->activateConfig(); + } + // Action "rebuild" (rebuild config.tgz from its modules) + if (Request::post('rebuild', 'no') !== 'no') { + $this->rebuildConfig(); + } + } + } + + /** + * Render module; called by main script when this module page should render + * its content. + */ + protected function doRender() + { + Render::setTitle(Dictionary::translate('lang_location')); + + $action = Request::any('action', 'list'); + switch ($action) { + case 'addmodule': + AddModule_Base::render(); + return; + case 'addconfig': + AddConfig_Base::render(); + return; + case 'list': + $this->listConfigs(); + return; + case 'module': + $listid = Request::post('list'); + if ($listid !== false) { + $this->listModuleContents($listid); + return; + } + break; + case 'config': + $listid = Request::post('list'); + if ($listid !== false) { + $this->listConfigContents($listid); + return; + } + break; + } + Message::addError('invalid-action', $action, 'main'); + } + + /** + * List all configurations and configuration modules. + */ + private function listConfigs() + { + // Configs + $res = Database::simpleQuery("SELECT configtgz.configid, configtgz.title, configtgz.filepath, configtgz.status, GROUP_CONCAT(configtgz_x_module.moduleid) AS modlist" + . " FROM configtgz" + . " INNER JOIN configtgz_x_module USING (configid)" + . " GROUP BY configid" + . " ORDER BY title ASC"); + $configs = array(); + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $configs[] = array( + 'configid' => $row['configid'], + 'config' => $row['title'], + 'modlist' => $row['modlist'], + 'current' => readlink(CONFIG_HTTP_DIR . '/default/config.tgz') === $row['filepath'], + 'needrebuild' => ($row['status'] !== 'OK') + ); + } + // Config modules + $res = Database::simpleQuery("SELECT moduleid, title, moduletype, status FROM configtgz_module ORDER BY moduletype ASC, title ASC"); + $modules = array(); + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $modules[] = array( + 'moduleid' => $row['moduleid'], + 'moduletype' => $row['moduletype'], + 'module' => $row['title'], + 'iscustom' => ($row['moduletype'] === 'CustomModule' || $row['moduletype'] === 'Branding'), + 'needrebuild' => ($row['status'] !== 'OK') + ); + } + Render::addTemplate('_page', array( + 'configs' => $configs, + 'modules' => $modules, + 'havemodules' => (count($modules) > 0) + )); + Render::addScriptTop('custom'); + Render::addFooter('<script> $(window).load(function (e) { + forceTable($("#modtable")); + forceTable($("#conftable")); + }); // </script>'); + } + + private function listModuleContents($moduleid) + { + // fetch the data + $row = Database::queryFirst("SELECT title, filepath FROM configtgz_module WHERE moduleid = :moduleid LIMIT 1", array('moduleid' => $moduleid)); + if ($row === false) { + Message::addError('config-invalid', $moduleid); + Util::redirect('?do=SysConfig'); + } + + // find files in that archive + $status = Taskmanager::submit('ListArchive', array( + 'file' => $row['filepath'] + )); + if (isset($status['id'])) + $status = Taskmanager::waitComplete($status, 4000); + if (!Taskmanager::isFinished($status) || Taskmanager::isFailed($status)) { + Taskmanager::addErrorMessage($status); + Util::redirect('?do=SysConfig'); + } + + // Sort files for better display + $dirs = array(); + foreach ($status['data']['entries'] as $file) { + if ($file['isdir']) + continue; + $dirs[dirname($file['name'])][] = $file; + } + ksort($dirs); + $list = array(); + foreach ($dirs as $dir => $files) { + $list[] = array( + 'name' => $dir, + 'isdir' => true + ); + sort($files); + foreach ($files as $file) { + $file['size'] = Util::readableFileSize($file['size']); + $list[] = $file; + } + } + + // render the template + Render::addDialog(Dictionary::translate('lang_contentOf') . ' ' . $row['title'], false, 'custom-filelist', array( + 'files' => $list, + )); + } + + private function listConfigContents($configid) + { + // get config name + $config = Database::queryFirst("SELECT title FROM configtgz WHERE configid = :configid LIMIT 1", array('configid' => $configid)); + if ($config === false) { + Message::addError('config-invalid', $configid); + Util::redirect('?do=SysConfig'); + } + // fetch the data + $res = Database::simpleQuery("SELECT module.moduleid, module.title AS moduletitle" + . " FROM configtgz_module module" + . " INNER JOIN configtgz_x_module USING (moduleid)" + . " WHERE configtgz_x_module.configid = :configid" + . " ORDER BY module.title ASC", array('configid' => $configid)); + + $modules = array(); + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $modules[] = array( + 'module' => $row['moduletitle'], + 'moduleid' => $row['moduleid'] + ); + } + + // render the template + Render::addDialog(Dictionary::translate('lang_contentOf') . ' ' . $config['title'], false, 'config-module-list', array( + 'modules' => $modules + )); + } + + private function activateConfig() + { + $configid = Request::post('activate', 'MISSING'); + $row = Database::queryFirst("SELECT title, filepath FROM configtgz WHERE configid = :configid LIMIT 1", array('configid' => $configid)); + if ($row === false) { + Message::addError('config-invalid', $configid); + Util::redirect('?do=SysConfig'); + } + $task = Taskmanager::submit('LinkConfigTgz', array( + 'destination' => $row['filepath'] + )); + if (isset($task['statusCode']) && $task['statusCode'] === TASK_WAITING) { + $task = Taskmanager::waitComplete($task['id']); + } + if (!isset($task['statusCode']) || $task['statusCode'] === TASK_ERROR) { + Message::addError('task-error', $task['data']['error']); + } elseif ($task['statusCode'] === TASK_FINISHED) { + Message::addSuccess('config-activated', $row['title']); + Event::activeConfigChanged(); + } + Util::redirect('?do=SysConfig'); + } + + private function rebuildConfig() + { + $configid = Request::post('rebuild', 'MISSING'); + $config = ConfigTgz::get($configid); + if ($config === false) { + Message::addError('config-invalid', $configid); + Util::redirect('?do=SysConfig'); + } + $ret = $config->generate(false, 350); // TODO + if ($ret === true) + Message::addSuccess('module-rebuilt', $config->title()); + elseif ($ret === false) + Message::addError('module-rebuild-failed', $config->title()); + else + Message::addInfo('module-rebuilding', $config->title()); + Util::redirect('?do=SysConfig'); + } + + private function delModule() + { + $moduleid = Request::post('del', 'MISSING'); + $row = Database::queryFirst("SELECT title, filepath FROM configtgz_module WHERE moduleid = :moduleid LIMIT 1", array('moduleid' => $moduleid)); + if ($row === false) { + Message::addError('config-invalid', $moduleid); + Util::redirect('?do=SysConfig'); + } + $existing = Database::queryFirst("SELECT title FROM configtgz_x_module" + . " INNER JOIN configtgz USING (configid)" + . " WHERE moduleid = :moduleid LIMIT 1", array('moduleid' => $moduleid)); + if ($existing !== false) { + Message::addError('module-in-use', $row['title'], $existing['title']); + Util::redirect('?do=SysConfig'); + } + $task = Taskmanager::submit('DeleteFile', array( + 'file' => $row['filepath'] + )); + if (isset($task['statusCode']) && $task['statusCode'] === TASK_WAITING) { + $task = Taskmanager::waitComplete($task['id']); + } + if (!isset($task['statusCode']) || $task['statusCode'] === TASK_ERROR) { + Message::addWarning('task-error', $task['data']['error']); + } elseif ($task['statusCode'] === TASK_FINISHED) { + Message::addSuccess('module-deleted', $row['title']); + } + Database::exec("DELETE FROM configtgz_module WHERE moduleid = :moduleid LIMIT 1", array('moduleid' => $moduleid)); + Util::redirect('?do=SysConfig'); + } + + private function downloadModule() + { + $moduleid = Request::post('download', 'MISSING'); + $row = Database::queryFirst("SELECT title, filepath FROM configtgz_module WHERE moduleid = :moduleid LIMIT 1", array('moduleid' => $moduleid)); + if ($row === false) { + Message::addError('config-invalid', $moduleid); + Util::redirect('?do=SysConfig'); + } + if (!Util::sendFile($row['filepath'], $row['title'] . '.tgz')) + Util::redirect('?do=SysConfig'); + exit(0); + } + + private function rebuildModule() + { + $moduleid = Request::post('rebuild', 'MISSING'); + $module = ConfigModule::get($moduleid); + if ($module === false) { + Message::addError('config-invalid', $moduleid); + Util::redirect('?do=SysConfig'); + } + $ret = $module->generate(false, 250); + if ($ret === true) + Message::addSuccess('module-rebuilt', $module->title()); + elseif ($ret === false) + Message::addError('module-rebuild-failed', $module->title()); + else + Message::addInfo('module-rebuilding', $module->title()); + Util::redirect('?do=SysConfig'); + } + + private function delConfig() + { + $configid = Request::post('del', 'MISSING'); + $config = ConfigTgz::get($configid); + if ($config === false) { + Message::addError('config-invalid', $configid); + Util::redirect('?do=SysConfig'); + } + $config->delete(); + Util::redirect('?do=SysConfig'); + } + + private function initAddModule() + { + ConfigModule::loadDb(); + require_once 'modules/sysconfig/addmodule.inc.php'; + $step = Request::any('step', 'AddModule_Start'); + if (!class_exists($step) && preg_match('/^([a-zA-Z0-9]+)_/', $step, $out)) { + require_once 'modules/sysconfig/addmodule_' . strtolower($out[1]) . '.inc.php'; + } + AddModule_Base::setStep($step); + } + + private function initAddConfig() + { + ConfigModule::loadDb(); + require_once 'modules/sysconfig/addconfig.inc.php'; + $step = Request::any('step', 0); + if ($step === 0) + $step = 'AddConfig_Start'; + AddConfig_Base::setStep($step); + } + +} diff --git a/modules/sysconfig/templates/_page.html b/modules/sysconfig/templates/_page.html new file mode 100644 index 00000000..1a2f64d6 --- /dev/null +++ b/modules/sysconfig/templates/_page.html @@ -0,0 +1,227 @@ +<div class="row"> + <div class="col-md-6"> + <div class="panel panel-default"> + <div class="panel-heading"> + {{lang_availableSystem}} + <a class="btn btn-default" data-toggle="modal" data-target="#help-config"><span class="glyphicon glyphicon-question-sign"></span></a> + </div> + <div class="panel-body"> + <form method="post" action="?do=SysConfig"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="config"> + <table id="conftable" class="slx-table" style="max-width:100px !important"> + {{#configs}} + <tr> + <td data-modlist="{{modlist}}" class="slx-pointer slx-width-ignore slx-nowrap"onclick="showmod(this, 'bold')" onmouseover="showmod(this, 'fade')" onmouseout="showmod(this, 'reset')"> + <div class="slx-dyn-ellipsis">{{config}}</div> + </td> + <td> + {{^current}} + <button class="btn btn-primary btn-xs" name="activate" value="{{configid}}"> + <span class="glyphicon glyphicon-flag"></span> + {{lang_activate}} + </button> + {{/current}} + {{#current}} + <span class="btn btn-success btn-xs slx-nopointer"> + <span class="glyphicon glyphicon-ok"></span> + {{lang_active}} + </span> + {{/current}} + </td> + <td class="slx-nowrap"> + <button + {{#needrebuild}} + class="refconf btn btn-primary btn-xs" + {{/needrebuild}} + {{^needrebuild}} + class="refconf btn btn-default btn-xs" + {{/needrebuild}} + name="rebuild" value="{{configid}}" title="{{lang_rebuild}}"><span class="glyphicon glyphicon-refresh"></span></button> + </td> + <td class="slx-nowrap"> + <a class="btn btn-success btn-xs" href="?do=SysConfig&action=addconfig&edit={{configid}}" title="{{lang_edit}}"><span class="glyphicon glyphicon-edit"></span></a> + <button class="btn btn-danger btn-xs" name="del" value="{{configid}}" title="{{lang_delete}}"><span class="glyphicon glyphicon-trash"></span></button> + </td> + </tr> + {{/configs}} + </table> + {{^configs}} + <div class="alert alert-warning"> + {{lang_systemConfigurationNotFound}} + </div> + {{^modules}} + <div class="alert alert-danger"> + {{lang_systemConfigurationAlert}} + </div> + {{/modules}} + {{/configs}} + </form> + </div> + {{#havemodules}} + <div class="panel-footer"> + <a class="btn btn-primary" href="?do=SysConfig&action=addconfig">{{lang_newConfiguration}}</a> + </div> + {{/havemodules}} + </div> + </div> + + <div class="col-md-6"> + <div class="panel panel-default"> + <div class="panel-heading"> + {{lang_availableModules}} + <a class="btn btn-default" data-toggle="modal" data-target="#help-module"><span class="glyphicon glyphicon-question-sign"></span></a> + </div> + <div class="panel-body"> + <form method="post" action="?do=SysConfig"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="module"> + <table id="modtable" class="slx-table" style="max-width:100px !important"> + {{#modules}} + <tr> + <td class="badge slx-nowrap">{{moduletype}}</td> + <td data-id="{{moduleid}}" class="modrow slx-width-ignore slx-nowrap"><div class="slx-dyn-ellipsis">{{module}}</div></td> + <td class="slx-nowrap"> + {{#iscustom}} + <button class="btn btn-default btn-xs" name="list" value="{{moduleid}}" title="{{lang_show}}"><span class="glyphicon glyphicon-eye-open"></span></button> + <!-- a class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit"></span> Bearbeiten</a --> + <button class="btn btn-default btn-xs" name="download" value="{{moduleid}}" title="{{lang_download}}"><span class="glyphicon glyphicon-download-alt"></span></button> + {{/iscustom}} + </td> + <td class="slx-nowrap"> + <button + {{#needrebuild}} + class="refmod btn btn-primary btn-xs" + {{/needrebuild}} + {{^needrebuild}} + class="refmod btn btn-default btn-xs" + {{/needrebuild}} + name="rebuild" value="{{moduleid}}" title="{{lang_rebuild}}"><span class="glyphicon glyphicon-refresh"></span></button> + <a class="btn btn-success btn-xs" href="?do=SysConfig&action=addmodule&step={{moduletype}}_Start&edit={{moduleid}}" title="{{lang_edit}}"><span class="glyphicon glyphicon-edit"></span></a> + <button class="btn btn-danger btn-xs" name="del" value="{{moduleid}}" title="{{lang_delete}}"><span class="glyphicon glyphicon-trash"></span></button> + </td> + </tr> + {{/modules}} + </table> + {{^modules}} + <div class="alert alert-warning">{{lang_configurationModuleNotFound}}</div> + {{/modules}} + </form> + </div> + <div class="panel-footer"> + <a class="btn btn-primary" href="?do=SysConfig&action=addmodule">{{lang_newModule}}</a> + </div> + </div> + </div> +</div> + +<div class="panel panel-default"> + <div class="panel-heading">{{lang_legend}}</div> + <div class="panel-body"> + <p> + <span class="btn btn-default btn-xs" title="{{lang_show}}"><span class="glyphicon glyphicon-eye-open"></span></span> + {{lang_showLong}} + </p> + <p> + <span class="btn btn-default btn-xs" title="{{lang_download}}"><span class="glyphicon glyphicon-download-alt"></span></span> + {{lang_downloadLong}} + </p> + <p> + <span class="btn btn-default btn-xs" title="{{lang_rebuild}}"><span class="glyphicon glyphicon-refresh"></span></span> + {{lang_rebuildLong}} + </p> + <p> + <span class="btn btn-primary btn-xs" title="{{lang_rebuild}}"><span class="glyphicon glyphicon-refresh"></span></span> + {{lang_rebuildOutdatedLong}} + </p> + <p> + <span class="btn btn-success btn-xs" title="{{lang_edit}}"><span class="glyphicon glyphicon-edit"></span></span> + {{lang_editLong}} + </p> + <div> + <span class="btn btn-danger btn-xs" title="{{lang_delete}}"><span class="glyphicon glyphicon-trash"></span></span> + {{lang_deleteLong}} + </div> + </div> +</div> + +<div class="modal fade" id="help-config" tabindex="-1" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header">{{lang_systemConfiguration}}</div> + <div class="modal-body"> + {{lang_helpSystemConfiguration}} + </div> + <div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div> + </div> + </div> +</div> + +<div class="modal fade" id="help-module" tabindex="-1" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header">{{lang_moduleConfiguration}}</div> + <div class="modal-body"> + {{lang_helpModuleConfiguration}} + </div> + <div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div> + </div> + </div> +</div> + +<script type="text/javascript"><!-- + var boldItem = false; + function showmod(e, action) { + var list = $(e).attr('data-modlist'); + list = list.split(','); + if (action === 'bold') { + $(boldItem).removeClass("slx-bold"); + if (boldItem === e) { + action = 'fade'; + boldItem = false; + } + } else if (boldItem !== false) { + return; + } + $('.modrow').each(function () { + var elem = $(this); + elem.removeClass("slx-fade slx-bold"); + if (action === 'reset') + return; + if (action === 'bold' && list.indexOf(elem.attr('data-id')) !== -1) + elem.addClass("slx-bold"); + if (list.indexOf(elem.attr('data-id')) === -1) + elem.addClass("slx-fade"); + }); + if (action === 'bold') { + boldItem = e; + $(e).addClass("slx-bold"); + } + } + + var statusChecks = 0; + function checkBuildStatus() { + var mods = []; + var confs = []; + $(".refmod.btn-primary").each(function (index) { + mods.push($(this).val()); + }); + $(".refconf.btn-primary").each(function (index) { + confs.push($(this).val()); + }); + if (mods.length === 0 && confs.length === 0) return; + if (++statusChecks < 10) setTimeout(checkBuildStatus, 200 + 50 * statusChecks); + console.log("POSTING"); + $.post('?do=SysConfig', { mods: mods.join(), confs: confs.join(), token: TOKEN, action: 'status' }, function (data) { + if (typeof data === 'undefined') return; + if (typeof data.mods === 'object') updateButtonColor($(".refmod.btn-primary"), data.mods); + if (typeof data.confs === 'object') updateButtonColor($(".refconf.btn-primary"), data.confs); + }, 'json'); + } + function updateButtonColor(list,ids) { + list.each(function() { + if (ids.indexOf($(this).val()) >= 0) $(this).removeClass('btn-primary').addClass('btn-default'); + }); + } + document.addEventListener("DOMContentLoaded", checkBuildStatus, false); +// --></script>
\ No newline at end of file diff --git a/modules/sysconfig/templates/ad-finish.html b/modules/sysconfig/templates/ad-finish.html new file mode 100644 index 00000000..f73cad9d --- /dev/null +++ b/modules/sysconfig/templates/ad-finish.html @@ -0,0 +1,29 @@ +<p> + {{lang_adStarted}} +</p> + +<div id="zeug"> + <div data-tm-id="{{tm-config}}" data-tm-log="error" data-tm-callback="ldapCb">{{lang_generateModule}}</div> +</div> +<br> +<div id="back" class="pull-left" style="display:none"> + <a href="?do=SysConfig&action=addmodule&step=AdAuth_Start" class="btn btn-primary">{{lang_restartWizard}}</a> +</div> +<div id="finish" class="pull-right" style="display:none"> + <a href="?do=SysConfig" class="btn btn-primary">{{lang_to}} {{lang_systemConfiguration}}</a> +</div> +<script type="text/javascript"> +function ldapCb(task) +{ + if (!task || !task.statusCode) + return; + if (task.statusCode === 'TASK_FINISHED') { + $('#finish').attr('style', ''); + } + if (task.statusCode === 'TASK_ERROR' || task.statusCode === 'PARENT_FAILED') { + $('#back').attr('style', ''); + } +} +if ('{{tm-config}}' == '') + $('#finish').attr('style', ''); +</script> diff --git a/modules/sysconfig/templates/ad-selfsearch.html b/modules/sysconfig/templates/ad-selfsearch.html new file mode 100644 index 00000000..76952dc3 --- /dev/null +++ b/modules/sysconfig/templates/ad-selfsearch.html @@ -0,0 +1,112 @@ +<p> + {{lang_dnLookup}} +</p> + +<div id="zeug"> + <div data-tm-id="{{self-search}}" data-tm-log="messages" data-tm-callback="selfCb">LDAP Self-Query</div> + <pre style="display:none" id="result"></pre> + <div style="display:none" id="haselect"> + <div class="slx-bold">{{lang_selectHomeAttribute}}</div> + {{lang_homeAttributeExplanation}} + </div> +</div> +<i>{{lang_onProblemSearchBase}}</i> +<br><br> +<div class="pull-left"> + <form role="form" method="post" action="?do=SysConfig&action=addmodule&step={{prev}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <input name="title" value="{{title}}" type="hidden"> + <input name="server" value="{{server}}" type="hidden"> + <input name="searchbase" value="{{searchbase}}" type="hidden"> + <input name="binddn" value="{{binddn}}" type="hidden"> + <input name="bindpw" value="{{bindpw}}" type="hidden"> + <input name="home" value="{{home}}" type="hidden"> + <input name="homeattr" value="{{homeattr}}" type="hidden"> + {{#ssl}} + <input name="ssl" value="on" type="hidden"> + <input type="hidden" name="certificate" value="{{certificate}}"> + {{/ssl}} + <button type="submit" class="btn btn-primary">« {{lang_back}}</button> + </form> +</div> +<div class="pull-right"> + <form id="nextform" role="form" method="post" action="?do=SysConfig&action=addmodule&step={{next}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <input name="title" value="{{title}}" type="hidden"> + <input name="server" value="{{server}}" type="hidden"> + <input name="port" value="{{port}}" type="hidden"> + <input id="searchbase" name="searchbase" value="{{searchbase}}" type="hidden"> + <input id="fulldn" name="binddn" value="" type="hidden"> + <input id="givendn" name="originalbinddn" value="{{binddn}}" type="hidden"> + <input name="bindpw" value="{{bindpw}}" type="hidden"> + <input id="home" name="home" value="{{home}}" type="hidden"> + <input id="homeattr" name="homeattr" value="{{homeattr}}" type="hidden"> + {{#ssl}} + <input name="ssl" value="on" type="hidden"> + <input type="hidden" name="certificate" value="{{certificate}}"> + {{/ssl}} + <input name="fingerprint" value="{{fingerprint}}" type="hidden"> + <button id="nextbutton" type="submit" class="btn btn-primary" style="display:none">{{lang_skip}} »</button> + </form> +</div> +<script type="text/javascript"> + function selfCb(task) + { + if (!task || !task.statusCode || task.statusCode === 'TASK_WAITING' || task.statusCode === 'TASK_PROCESSING') + return; + if (task.statusCode === 'TASK_FINISHED' && task.data && task.data.dn) { + var fulldn = task.data.dn; + var domain = "-"; + var search = $('#searchbase').val(); + if ($('#searchbase').val().length < 2) { + domain = $('#givendn').val().replace(/[\/\\]\S+$/i, ''); + var idx = fulldn.search(new RegExp('\\w+=' + domain + ',', "i")); + console.log(idx); + if (idx !== -1) { + search = fulldn.substring(idx); + } + $('#searchbase').val(search); + } + $('#fulldn').val(fulldn); + $('#result').text("BindDN: " + fulldn + "\nWinDomain: " + domain + "\nSearchBase: " + search).show(); + var attrlist = []; + var tryHomeAttr = false; + {{#tryHomeAttr}} + tryHomeAttr = true; + if (task.data.home && task.data.home.length) attrlist = task.data.home; + {{/tryHomeAttr}} + if (typeof search !== 'string' || search.length === 0 || search.length + 2 >= fulldn.length + || (tryHomeAttr && $('#home').val().length === 0 && $('#homeattr').val().length === 0 && attrlist.length === 0)) { + $('#nextbutton').html('{{lang_continueAnyway}}'); + } else if (attrlist.length > 1 && $('#homeattr').val().length === 0) { + var sel = $('<select>').attr('onchange', 'slxSetHomeAttr(this)').addClass('form-control'); + var best = 0; + for (var i = 1; i < attrlist.length; ++i) { + if (attrlist[i].score > attrlist[best].score) best = i; + } + for (var i = 0; i < attrlist.length; ++i) { + var opt = $('<option>').attr('value', attrlist[i].attr).text(attrlist[i].attr + ' (' + attrlist[i].value + ')'); + if (i === best) opt.attr('selected', 'selected'); + sel.append(opt); + } + $('#haselect').append(sel).append('<br>').show(); + slxSetHomeAttr(sel[0]); + $('#nextbutton').html('{{lang_next}}'); + } else { + if (attrlist.length === 1 && $('#homeattr').val().length === 0) { + $('#homeattr').val(attrlist[0].attr); + } + $('#nextform').submit(); + } + } else { + $('#nextbutton').html('{{lang_continueAnyway}}'); + } + $('#nextbutton').show(); + } + + function slxSetHomeAttr(sel) { + $('#homeattr').val(sel.options[sel.selectedIndex].value); + } +</script> diff --git a/modules/sysconfig/templates/ad-start.html b/modules/sysconfig/templates/ad-start.html new file mode 100644 index 00000000..98546140 --- /dev/null +++ b/modules/sysconfig/templates/ad-start.html @@ -0,0 +1,121 @@ +<p> + {{lang_adText1}} + <br> + {{lang_adText2}} + <br> + {{lang_adText3}} +</p> +<pre>dsquery user -name "Username"</pre> +<p> + {{lang_adText4}} +</p> + +<i>{{lang_asteriskMandatory}}</i> + +<form role="form" method="post" action="?do=SysConfig&action=addmodule&step={{step}}"> + <input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;"> + <input type="password" name="password_fake" id="password_fake" value="" style="display:none;"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_moduleTitle}}</span> + <input tabindex="1" name="title" value="{{title}}" type="text" class="form-control"> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">Server *</span> + <input tabindex="2" name="server" value="{{server}}" type="text" class="form-control" placeholder="dc0.institution.example.com"> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_bindDN}} *</span> + <input tabindex="3" name="binddn" value="{{binddn}}" type="text" class="form-control" placeholder="domain\bwlp *ODER* CN=bwlp,OU=Benutzer,DC=domain,DC=hs-beispiel,DC=de"> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_password}} *</span> + <input tabindex="4" name="bindpw" value="{{bindpw}}" type="{{password_type}}" class="form-control" placeholder="{{lang_password}}"> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_searchBase}}</span> + <input tabindex="5" name="searchbase" value="{{searchbase}}" type="text" class="form-control" placeholder="dc=windows,dc=hs-beispiel,dc=de"> + </div> + <br> + <div class="input-group"> + <span class="input-group-addon slx-ga">Home</span> + <input tabindex="6" name="home" value="{{home}}" type="text" class="form-control" placeholder="\\server.example.com\%s"> + <span class="input-group-btn"> + <a class="btn btn-default" data-toggle="modal" data-target="#help-home"><span class="glyphicon glyphicon-question-sign"></span></a> + </span> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_homeAttr}}</span> + <input tabindex="6" name="homeattr" value="{{homeattr}}" type="text" class="form-control" placeholder="homeDirectory"> + <span class="input-group-btn"> + <a class="btn btn-default" data-toggle="modal" data-target="#help-homeattr"><span class="glyphicon glyphicon-question-sign"></span></a> + </span> + </div> + <br> + <div> + <label> + <input type="checkbox" name="ssl" onchange="$('#cert-box').css('display', this.checked ? '' : 'none')" {{#ssl}}checked{{/ssl}}> {{lang_ssl}} + </label> + </div> + <i>{{lang_sslDescription}}</i> + <br> + <div class="pull-right"> + <button type="submit" class="btn btn-primary">{{lang_next}} »</button> + </div> + <div class="clearfix"></div> + <hr> + <div {{^ssl}}style="display:none"{{/ssl}} id="cert-box"> + <div class="well well-sm" id="wcustom"> + {{lang_customCertificate}} + <pre class="small"> +-----BEGIN CERTIFICATE----- +MIIFfTCCA... +..... +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +..... +-----END CERTIFICATE-----</pre> + <textarea name="certificate" class="form-control small" cols="101" rows="10">{{certificate}}</textarea> + </div> + <div class="pull-right"> + <button type="submit" class="btn btn-primary">{{lang_next}} »</button> + </div> + <div class="clearfix"></div> + </div> +</form> + +<div class="modal fade" id="help-home" tabindex="-1" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header">{{lang_userDirectory}}</div> + <div class="modal-body"> + <p> + {{lang_userDirectoryInfo1}} + </p> + <pre>\\fileserv.uni.example.com\users\%s</pre> + <p> + {{lang_userDirectoryInfo2}} + </p> + <p> + {{lang_userDirectoryInfo3}} + </p> + </div> + <div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div> + </div> + </div> +</div> + +<div class="modal fade" id="help-homeattr" tabindex="-1" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header">{{lang_helpHomeAttrHead}}</div> + <div class="modal-body"> + <p> + {{lang_helpHomeAttrText}} + </p> + </div> + <div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div> + </div> + </div> +</div> diff --git a/modules/sysconfig/templates/ad_ldap-checkconnection.html b/modules/sysconfig/templates/ad_ldap-checkconnection.html new file mode 100644 index 00000000..5925829a --- /dev/null +++ b/modules/sysconfig/templates/ad_ldap-checkconnection.html @@ -0,0 +1,91 @@ +<p> + {{lang_connectionWait}} +</p> + +<div id="zeug"> + <div data-tm-id="{{taskid}}" data-tm-log="messages" data-tm-callback="portScan">Port Check</div> +</div> +<div id="self-signed" style="display:none" class="alert alert-info">{{lang_selfSignedNote}}</div> +<div id="no-valid-cert" style="display:none" class="alert alert-danger">{{lang_noValidCert}}</div> +<div id="no-open-port" style="display:none" class="alert alert-danger">{{lang_noOpenPort}}</div> +<br> +<div class="pull-left"> + <form role="form" method="post" action="?do=SysConfig&action=addmodule&step={{prev}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <input name="title" value="{{title}}" type="hidden"> + <input name="server" value="{{server}}" type="hidden"> + <input name="searchbase" value="{{searchbase}}" type="hidden"> + <input name="binddn" value="{{binddn}}" type="hidden"> + <input name="bindpw" value="{{bindpw}}" type="hidden"> + <input name="home" value="{{home}}" type="hidden"> + <input name="homeattr" value="{{homeattr}}" type="hidden"> + {{#ssl}} + <input name="ssl" value="on" type="hidden"> + <input type="hidden" name="certificate" value="{{certificate}}"> + {{/ssl}} + <button type="submit" class="btn btn-primary">« {{lang_back}}</button> + </form> +</div> +<div class="pull-right"> + <form id="nextform" role="form" method="post" action="?do=SysConfig&action=addmodule&step={{next}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <input name="title" value="{{title}}" type="hidden"> + <input name="server" value="{{server}}" type="hidden"> + <input id="port" name="port" value="" type="hidden"> + <input name="searchbase" value="{{searchbase}}" type="hidden"> + <input name="binddn" value="{{binddn}}" type="hidden"> + <input name="bindpw" value="{{bindpw}}" type="hidden"> + <input name="home" value="{{home}}" type="hidden"> + <input name="homeattr" value="{{homeattr}}" type="hidden"> + {{#ssl}} + <input id="ssl" name="ssl" value="on" type="hidden"> + <input id="fingerprint" name="fingerprint" value="" type="hidden"> + <input id="certificate" type="hidden" name="certificate" value="{{certificate}}"> + {{/ssl}} + <input name="originalbinddn" value="{{binddn}}" type="hidden"> + <button id="nextbutton" type="submit" class="btn btn-primary" style="display:none">{{lang_next}} »</button> + </form> +</div> +<div id="bla"></div> +<script type="text/javascript"> + function isSelfSigned(code) + { + return code == 18 || code == 19 || code == 20 || code == 21; + } + function portScan(task) + { + if (!task || !task.statusCode) + return; + if (task.statusCode === 'TASK_FINISHED' && task.data && task.data.ports) { + var ssl = $('#ssl').length > 0; + var ports = task.data.ports; + var verRes = -1; + var cert = ssl && $('#certificate').val().length > 10; + for (var i = 0; i < ports.length; ++i) { + if (!ports[i].open || !ports[i].port) continue; + if ($.isNumeric($('#port').val()) && $('#port').val() < ports[i].port) continue; // Prefer the global LDAP ports over the specific AD ports + if (ssl) { + if (verRes === -1) verRes = ports[i].verifyResult; + if (ports[i].certFingerprint.length < 10 || ports[i].certificateChain.length < 10) continue; + if (ports[i].verifyResult != 0 && (cert || !isSelfSigned(ports[i].verifyResult))) continue; + verRes = ports[i].verifyResult; + $('#fingerprint').val(ports[i].certFingerprint); + if (!cert && verRes != 0) $('#certificate').val(ports[i].certificateChain); + else if (!cert && verRes == 0) $('#certificate').val('default'); + } + $('#port').val(ports[i].port); + } + if (ssl && verRes != 0 && (cert || !isSelfSigned(verRes))) { + $('#no-valid-cert').css('display', ''); + } else if ($('#port').val() > 0) { + $('#nextbutton').show(); + if (ssl && isSelfSigned(verRes)) $('#self-signed').css('display', ''); + else $('#nextform').submit(); + } else { + $('#no-open-port').css('display', ''); + } + } + } +</script> diff --git a/modules/sysconfig/templates/ad_ldap-checkcredentials.html b/modules/sysconfig/templates/ad_ldap-checkcredentials.html new file mode 100644 index 00000000..0586209b --- /dev/null +++ b/modules/sysconfig/templates/ad_ldap-checkcredentials.html @@ -0,0 +1,67 @@ +<p> + {{lang_connectionWait}} +</p> + +<div id="zeug"> + <div data-tm-id="{{tm-search}}" data-tm-log="messages" data-tm-callback="ldapCb">LDAP Test-Query</div> +</div> +<i>{{lang_onProblemSearchBase}}</i> +<br><br> +<div class="pull-left"> + <form role="form" method="post" action="?do=SysConfig&action=addmodule&step={{prev}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <input name="title" value="{{title}}" type="hidden"> + <input name="server" value="{{server}}" type="hidden"> + <input name="searchbase" value="{{searchbase}}" type="hidden"> + <input name="binddn" value="{{binddn}}" type="hidden"> + <input name="bindpw" value="{{bindpw}}" type="hidden"> + <input name="home" value="{{home}}" type="hidden"> + <input name="homeattr" value="{{homeattr}}" type="hidden"> + {{#ssl}} + <input name="ssl" value="on" type="hidden"> + <input type="hidden" name="certificate" value="{{certificate}}"> + {{/ssl}} + <button type="submit" class="btn btn-primary">« {{lang_back}}</button> + </form> +</div> +<div class="pull-right"> + <form role="form" method="post" action="?do=SysConfig&action=addmodule&step={{next}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <input name="title" value="{{title}}" type="hidden"> + <input name="server" value="{{server}}" type="hidden"> + <input name="searchbase" value="{{searchbase}}" type="hidden"> + <input id="setbase" name="somedn" value="" type="hidden"> + <input name="binddn" value="{{binddn}}" type="hidden"> + <input name="bindpw" value="{{bindpw}}" type="hidden"> + <input name="home" value="{{home}}" type="hidden"> + <input name="homeattr" value="{{homeattr}}" type="hidden"> + {{#ssl}} + <input name="ssl" value="on" type="hidden"> + <input type="hidden" name="certificate" value="{{certificate}}"> + {{/ssl}} + <input name="fingerprint" value="{{fingerprint}}" type="hidden"> + <input name="originalbinddn" value="{{binddn}}" type="hidden"> + <button id="nextbutton" type="submit" class="btn btn-primary" style="display:none">{{lang_skip}} »</button> + </form> +</div> +<script type="text/javascript"> + function ldapCb(task) + { + if (!task || !task.statusCode) + return; + if (task.statusCode === 'TASK_FINISHED') { + if (task.data && task.data.dn) { + $('#setbase').val(task.data.dn); + } + $('#nextbutton').html('Weiter »').show(); + } + if (task.statusCode === 'TASK_ERROR' || task.statusCode === 'PARENT_FAILED') { + $('#nextbutton').html('Trotzdem weiter »'); + } + if (task.statusCode === 'TASK_ERROR') { + $('#nextbutton').show(); + } + } +</script> diff --git a/modules/sysconfig/templates/branding-check.html b/modules/sysconfig/templates/branding-check.html new file mode 100644 index 00000000..8f6ef055 --- /dev/null +++ b/modules/sysconfig/templates/branding-check.html @@ -0,0 +1,26 @@ +<p> + {{lang_brandingInfo}} +</p> +<div class="pull-left"> + {{#svg}} + <img src="data:image/svg+xml;base64,{{svg}}" width="192" height="192"> + {{/svg}} +</div> +<div class="pull-right"> + {{#png}} + <img src="data:image/png;base64,{{png}}"> + {{/png}} +</div> +<div class="clearfix"></div> +<div>{{error}}</div> +<div> + <form role="form" enctype="multipart/form-data" method="post" action="?do=SysConfig&action=addmodule&step={{step}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <div class="form-group"> + <label for="title-id">{{lang_title}}</label> + <input type="text" name="title" value="{{title}}" id ="title-id" class="form-control" placeholder="Name des Moduls"> + </div> + <button type="submit" class="btn btn-primary">{{lang_save}}</button> + </form> +</div> diff --git a/modules/sysconfig/templates/branding-start.html b/modules/sysconfig/templates/branding-start.html new file mode 100644 index 00000000..09b9ca27 --- /dev/null +++ b/modules/sysconfig/templates/branding-start.html @@ -0,0 +1,25 @@ +<p> + {{lang_branding}} +</p> +<form role="form" enctype="multipart/form-data" method="post" action="?do=SysConfig&action=addmodule&step={{step}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <div class="form-group"> + <label for="input-url">{{lang_urlLoad}}</label> + <input class="form-control" type="text" name="url" id="input-url"> + </div> + {{lang_or}} + <div class="form-group"> + <label for="input-file">{{lang_computerLoad}}</label> + <div class="input-group upload-ex"> + <input type="text" class="form-control" readonly placeholder="{{lang_selectFile}}"> + <span class="input-group-btn"> + <span class="btn btn-default btn-file"> + {{lang_browseForFile}}… <input type="file" name="file" id="input-file"> + </span> + </span> + </div> + </div> + <button type="submit" class="btn btn-primary">{{lang_upload}}</button> +</form> + diff --git a/modules/sysconfig/templates/cfg-finish.html b/modules/sysconfig/templates/cfg-finish.html new file mode 100644 index 00000000..a6e51996 --- /dev/null +++ b/modules/sysconfig/templates/cfg-finish.html @@ -0,0 +1,12 @@ +<p> + {{lang_configurationSuccess}} +</p> + +<form role="form" method="post" action="?do=SysConfig"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="config"> + <input type="hidden" name="activate" value="{{configid}}"> + <div class="pull-left"> + <button type="submit" class="btn btn-primary">{{lang_configurationActive}}</button> + </div> +</form> diff --git a/modules/sysconfig/templates/cfg-start.html b/modules/sysconfig/templates/cfg-start.html new file mode 100644 index 00000000..50f366ea --- /dev/null +++ b/modules/sysconfig/templates/cfg-start.html @@ -0,0 +1,39 @@ +<form role="form" method="post" action="?do=SysConfig&action=addconfig&step={{step}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <div class="input-group"> + <span class="input-group-addon">{{lang_name}} *</span> + <input type="text" name="title" value="{{title}}" class="form-control" placeholder="{{lang_configuration}}" autofocus="autofocus"> + </div> + <hr> + <p>{{lang_configurationChoose}}</p> + {{#groups}} + <div class="panel panel-default"> + <div class="slx-litehead">{{group}}</div> + <div class="panel-body"> + {{#modules}} + <div class="input-group"> + <span class="input-group-addon"> + {{#unique}} + <input type="radio" name="module[{{groupid}}]" value="{{moduleid}}" id="module{{moduleid}}" {{#active}}checked{{/active}}> + {{/unique}} + {{^unique}} + <input type="checkbox" name="module[{{moduleid}}]" value="{{moduleid}}" id="module{{moduleid}}" {{#active}}checked{{/active}}> + {{/unique}} + </span> + <label class="form-control" for="module{{moduleid}}">{{title}}</label> + {{#missing}} + <span class="input-group-addon" title="Modul beschÃĪdigt! Bitte neu generieren."><span class="red glyphicon glyphicon-exclamation-sign"></span></span> + {{/missing}} + </div> + {{/modules}} + {{^modules}} + <div class="alert alert-info">{{lang_noModuleOfType}}</div> + {{/modules}} + </div> + </div> + {{/groups}} + <div class="pull-right"> + <button type="submit" class="btn btn-primary">{{lang_next}} »</button> + </div> +</form> diff --git a/modules/sysconfig/templates/config-module-list.html b/modules/sysconfig/templates/config-module-list.html new file mode 100644 index 00000000..6cd77f9e --- /dev/null +++ b/modules/sysconfig/templates/config-module-list.html @@ -0,0 +1,17 @@ +<form method="post" action="?do=SysConfig"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="module"> + <table class="slx-table"> + {{#modules}} + <tr> + <td>{{module}}</td> + <td> + <button class="btn btn-default btn-xs" name="list" value="{{moduleid}}"><span class="glyphicon glyphicon-eye-open"></span> {{lang_show}}</button> + </td> + </tr> + {{/modules}} + </table> + {{^modules}} + <div class="alert alert-warning">{{lang_noContent}}</div> + {{/modules}} +</form>
\ No newline at end of file diff --git a/modules/sysconfig/templates/custom-filelist.html b/modules/sysconfig/templates/custom-filelist.html new file mode 100644 index 00000000..3ad241dd --- /dev/null +++ b/modules/sysconfig/templates/custom-filelist.html @@ -0,0 +1,16 @@ +<input type="hidden" name="modid" value="{{modid}}"> +<input type="hidden" name="token" value="{{token}}"> +<table class="table table-bordered table-condensed"> +{{#files}} + <tr> + {{#isdir}} + <td class="fileEntry isdir" colspan="2">{{name}}</td> + {{/isdir}} + {{^isdir}} + <td class="fileEntry">{{name}}</td> + <td>{{size}}</td> + {{/isdir}} + </tr> + {{/files}} +</table> +<a class="btn btn-primary btn-sm" href="?do=SysConfig">{{lang_back}} «</a> diff --git a/modules/sysconfig/templates/custom-fileselect.html b/modules/sysconfig/templates/custom-fileselect.html new file mode 100644 index 00000000..000c8d10 --- /dev/null +++ b/modules/sysconfig/templates/custom-fileselect.html @@ -0,0 +1,31 @@ +<form role="form" method="post" action="?do=SysConfig&action=addmodule&step={{step}}"> + <input type="hidden" name="modid" value="{{modid}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <div class="input-group"> + <span class="input-group-addon">{{lang_moduleName}}</span> + <input type="text" name="title" value="{{title}}" class="form-control" placeholder="Mein Konfigurationsmodul" autofocus="autofocus"> + </div> + <div class="pull-right"> + <button type="submit" class="btn btn-primary">{{lang_next}} »</button> + </div> + <div class="clearfix"></div> + <hr> + <p>{{lang_checkFileContent}}</p> + <table class="table table-bordered table-condensed"> + {{#files}} + <tr> + {{#isdir}} + <td class="fileEntry isdir" colspan="2">{{name}}</td> + {{/isdir}} + {{^isdir}} + <td class="fileEntry">{{name}}</td> + <td>{{size}}</td> + {{/isdir}} + </tr> + {{/files}} + </table> + <div class="pull-right"> + <button type="submit" class="btn btn-primary">{{lang_next}} »</button> + </div> +</form> diff --git a/modules/sysconfig/templates/custom-upload.html b/modules/sysconfig/templates/custom-upload.html new file mode 100644 index 00000000..c453a97d --- /dev/null +++ b/modules/sysconfig/templates/custom-upload.html @@ -0,0 +1,18 @@ +<p>{{lang_customModuleInfo1}}</p> + +<p>{{lang_customModuleInfo2}}</p> + +<form role="form" enctype="multipart/form-data" method="post" action="?do=SysConfig&action=addmodule&step={{step}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <div class="input-group upload-ex"> + <input type="text" class="form-control" readonly placeholder="{{lang_selectFile}}"> + <span class="input-group-btn"> + <span class="btn btn-default btn-file"> + {{lang_browseForFile}}… <input type="file" name="modulefile"> + </span> + </span> + </div> + <p class="help-block">{{lang_supportedFiles}}: .tar.gz, .tar.bz2, .zip</p> + <button type="submit" class="btn btn-primary">{{lang_upload}}</button> +</form> diff --git a/modules/sysconfig/templates/ldap-finish.html b/modules/sysconfig/templates/ldap-finish.html new file mode 100644 index 00000000..a735e792 --- /dev/null +++ b/modules/sysconfig/templates/ldap-finish.html @@ -0,0 +1,29 @@ +<p> + {{lang_ldapStarted}} +</p> + +<div id="zeug"> + <div data-tm-id="{{tm-config}}" data-tm-log="error" data-tm-callback="ldapCb">{{lang_generateModule}}</div> +</div> +<br> +<div id="back" class="pull-left" style="display:none"> + <a href="?do=SysConfig&action=addmodule&step=LdapAuth_Start" class="btn btn-primary">{{lang_restartWizard}}</a> +</div> +<div id="finish" class="pull-right" style="display:none"> + <a href="?do=SysConfig" class="btn btn-primary">{{lang_toSystemConfiguration}}</a> +</div> +<script type="text/javascript"> +function ldapCb(task) +{ + if (!task || !task.statusCode) + return; + if (task.statusCode === 'TASK_FINISHED') { + $('#finish').attr('style', ''); + } + if (task.statusCode === 'TASK_ERROR' || task.statusCode === 'PARENT_FAILED') { + $('#back').attr('style', ''); + } +} +if ('{{tm-config}}' == '') + $('#finish').attr('style', ''); +</script> diff --git a/modules/sysconfig/templates/ldap-start.html b/modules/sysconfig/templates/ldap-start.html new file mode 100644 index 00000000..7892b63f --- /dev/null +++ b/modules/sysconfig/templates/ldap-start.html @@ -0,0 +1,101 @@ +<p> + {{lang_ldapText1}} + <br> + {{lang_ldapText2}} +</p> + +<form role="form" method="post" action="?do=SysConfig&action=addmodule&step={{step}}"> + <input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;"> + <input type="password" name="password_fake" id="password_fake" value="" style="display:none;"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_moduleTitle}}</span> + <input tabindex="1" name="title" value="{{title}}" type="text" class="form-control"> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">Server *</span> + <input tabindex="2" name="server" value="{{server}}" type="text" class="form-control" placeholder="dc0.institution.example.com"> + <!--span class="input-group-btn"> + <a class="btn btn-default"><span class="glyphicon glyphicon-question-sign"></span></a> + </span--> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_bindDN}}</span> + <input tabindex="3" name="binddn" value="{{binddn}}" type="text" class="form-control" placeholder="CN=bwlp,OU=Benutzer,DC=domain,DC=hs-beispiel,DC=de"> + <!--span class="input-group-btn"> + <a class="btn btn-default"><span class="glyphicon glyphicon-question-sign"></span></a> + </span--> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_password}}</span> + <input tabindex="4" name="bindpw" value="{{bindpw}}" type="{{password_type}}" class="form-control" placeholder="{{lang_password}}"> + <!--span class="input-group-btn"> + <a class="btn btn-default"><span class="glyphicon glyphicon-question-sign"></span></a> + </span--> + </div> + <div class="input-group"> + <span class="input-group-addon slx-ga">{{lang_searchBase}} *</span> + <input tabindex="5" name="searchbase" value="{{searchbase}}" type="text" class="form-control" placeholder="ou=users,dc=hochschule,dc=de"> + <!--span class="input-group-btn"> + <a class="btn btn-default"><span class="glyphicon glyphicon-question-sign"></span></a> + </span--> + </div> + <br> + <div class="input-group"> + <span class="input-group-addon slx-ga">Home</span> + <input tabindex="6" name="home" value="{{home}}" type="text" class="form-control" placeholder="\\server.example.com\%s"> + <span class="input-group-btn"> + <a class="btn btn-default" data-toggle="modal" data-target="#help-home"><span class="glyphicon glyphicon-question-sign"></span></a> + </span> + </div> + <br> + <div> + <label> + <input type="checkbox" name="ssl" onchange="$('#cert-box').css('display', this.checked ? '' : 'none')" {{#ssl}}checked{{/ssl}}> {{lang_ssl}} + </label> + </div> + <i>{{lang_sslDescription}}</i> + <br> + <div class="pull-right"> + <button type="submit" class="btn btn-primary">{{lang_next}} »</button> + </div> + <div class="clearfix"></div> + <hr> + <div {{^ssl}}style="display:none"{{/ssl}} id="cert-box"> + <div class="well well-sm" id="wcustom"> + {{lang_customCertificate}} + <pre class="small"> +-----BEGIN CERTIFICATE----- +MIIFfTCCA... +..... +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +..... +-----END CERTIFICATE-----</pre> + <textarea name="certificate" class="form-control small" cols="101" rows="10">{{certificate}}</textarea> + </div> + <div class="pull-right"> + <button type="submit" class="btn btn-primary">{{lang_next}} »</button> + </div> + <div class="clearfix"></div> + </div> +</form> + +<div class="modal fade" id="help-home" tabindex="-1" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header">{{lang_userDirectory}}</div> + <div class="modal-body"> + <p> + {{lang_userDirectoryInfo1}} + </p> + <pre>\\fileserv.uni.example.com\users\%s</pre> + <p> + {{lang_userDirectoryInfo2}} + </p> + </div> + <div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div> + </div> + </div> +</div> diff --git a/modules/sysconfig/templates/sshconfig-start.html b/modules/sysconfig/templates/sshconfig-start.html new file mode 100644 index 00000000..2aa409d3 --- /dev/null +++ b/modules/sysconfig/templates/sshconfig-start.html @@ -0,0 +1,27 @@ +<form role="form" enctype="multipart/form-data" method="post" action="?do=SysConfig&action=addmodule&step={{step}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <div class="input-group"> + <span class="input-group-addon">{{lang_moduleName}}</span> + <input type="text" name="title" value="{{title}}" class="form-control" autofocus="autofocus"> + </div> + <div class="form-group"> + <label> + <input type="checkbox" name="allowPasswordLogin" value="yes" {{#apl}}checked{{/apl}}> + {{lang_allowPass}} + </label> + <p><i>{{lang_allowPassInfo}}</i></p> + </div> + <div class="form-group"> + <label for="root-key">{{lang_rootKey}}</label> + <input class="form-control" type="text" name="publicKey" value="{{publicKey}}" id="root-key" pattern="[a-z0-9\-]+ +[a-zA-Z0-9=/\+]+ +.*"> + <i>{{lang_rootKeyInfo}}</i> + </div> + <div class="form-group"> + <label for="port">{{lang_listenPort}}</label> + <input class="form-control" type="text" name="listenPort" value="{{listenPort}}" id="port" pattern="\d+"> + <i>{{lang_listenPortInfo}}</i> + </div> + <button type="submit" class="btn btn-primary">{{lang_save}}</button> +</form> + diff --git a/modules/sysconfig/templates/start.html b/modules/sysconfig/templates/start.html new file mode 100644 index 00000000..f55a5501 --- /dev/null +++ b/modules/sysconfig/templates/start.html @@ -0,0 +1,12 @@ +<p>{{lang_moduleChoose}}</p> + +{{#modules}} +<div class="panel panel-default"> + <div class="panel-heading"> + {{title}} <a href="?do=SysConfig&action=addmodule&step={{wizardClass}}" class="pull-right btn btn-primary btn-xs"><span class="glyphicon glyphicon-plus"></span> {{lang_add}}</a> + </div> + <div class="panel-body"> + {{description}} + </div> +</div> +{{/modules}} |