-
- {{setting}}
-
{{defaultvalue}}
+
+
{{setting}}
+ {{^override}}
+
+ {{defaultvalue}}
+
+ {{/override}}
+ {{#override}}
+
+ {{/override}}
{{{item}}}
@@ -47,139 +60,8 @@
{{/categories}}
-
-
-
-
-
-
-
-
-
- {{#users}}
-
- {{/users}}
-
-
-
-
-
-
-
-
Download
+
+
+
Download
-
-
-
-
-
-
-
-
diff --git a/modules-available/internetaccess/lang/de/messages.json b/modules-available/internetaccess/lang/de/messages.json
new file mode 100644
index 00000000..1b075f70
--- /dev/null
+++ b/modules-available/internetaccess/lang/de/messages.json
@@ -0,0 +1,4 @@
+{
+ "settings-updated": "Einstellungen wurden aktualisiert",
+ "invalid-action": "Ung\u00fcltige Aktion: {{0}}"
+}
\ No newline at end of file
diff --git a/modules-available/internetaccess/lang/en/messages.json b/modules-available/internetaccess/lang/en/messages.json
new file mode 100644
index 00000000..6a1af968
--- /dev/null
+++ b/modules-available/internetaccess/lang/en/messages.json
@@ -0,0 +1,4 @@
+{
+ "settings-updated": "Settings have been updated",
+ "invalid-action": "Invalid action: {{0}}"
+}
\ No newline at end of file
diff --git a/modules-available/internetaccess/lang/pt/messages.json b/modules-available/internetaccess/lang/pt/messages.json
new file mode 100644
index 00000000..af5b9b22
--- /dev/null
+++ b/modules-available/internetaccess/lang/pt/messages.json
@@ -0,0 +1,4 @@
+{
+ "settings-updated": "As configura\u00e7\u00f5es foram atualizadas",
+ "invalid-action": "A\u00e7\u00e3o inv\u00e1lida: {{0}}"
+}
\ No newline at end of file
diff --git a/modules-available/locations/baseconfig/hook.json b/modules-available/locations/baseconfig/hook.json
new file mode 100644
index 00000000..c295e0f6
--- /dev/null
+++ b/modules-available/locations/baseconfig/hook.json
@@ -0,0 +1,5 @@
+{
+ "table": "setting_location",
+ "field": "locationid",
+ "tostring": "Location::getName"
+}
\ No newline at end of file
diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php
new file mode 100644
index 00000000..1a01ff24
--- /dev/null
+++ b/modules-available/locations/inc/location.inc.php
@@ -0,0 +1,157 @@
+fetch(PDO::FETCH_ASSOC)) {
+ $rows[] = $row;
+ }
+ return $rows;
+ }
+
+ public static function getName($locationId)
+ {
+ self::getLocationsAssoc();
+ $locationId = (int)$locationId;
+ if (!isset(self::$assocLocationCache[$locationId]))
+ return false;
+ return self::$assocLocationCache[$locationId]['locationname'];
+ }
+
+ public static function getLocationsAssoc()
+ {
+ if (self::$assocLocationCache === false) {
+ $rows = self::queryLocations();
+ $rows = self::buildTree($rows);
+ self::$assocLocationCache = self::flattenTreeAssoc($rows);
+ }
+ return self::$assocLocationCache;
+ }
+
+ private static function flattenTreeAssoc($tree, $depth = 0)
+ {
+ $output = array();
+ foreach ($tree as $node) {
+ $output[(int)$node['locationid']] = array(
+ 'parentlocationid' => (int)$node['parentlocationid'],
+ 'locationname' => $node['locationname'],
+ 'depth' => $depth
+ );
+ if (!empty($node['children'])) {
+ $output += self::flattenTreeAssoc($node['children'], $depth + 1);
+ }
+ }
+ return $output;
+ }
+
+ public static function getLocations($default = 0, $excludeId = 0, $addNoParent = false)
+ {
+ if (self::$flatLocationCache === false) {
+ $rows = self::queryLocations();
+ $rows = self::buildTree($rows);
+ $rows = self::flattenTree($rows);
+ self::$flatLocationCache = $rows;
+ } else {
+ $rows = self::$flatLocationCache;
+ }
+ $del = false;
+ unset($row);
+ foreach ($rows as $key => &$row) {
+ if ($del === false && $row['locationid'] == $excludeId) {
+ $del = $row['depth'];
+ } elseif ($del !== false && $row['depth'] <= $del) {
+ $del = false;
+ }
+ if ($del !== false) {
+ unset($rows[$key]);
+ continue;
+ }
+ if ($row['locationid'] == $default) {
+ $row['selected'] = true;
+ }
+ }
+ if ($addNoParent) {
+ array_unshift($rows, array(
+ 'locationid' => 0,
+ 'locationname' => '-----',
+ 'selected' => $default == 0
+ ));
+ }
+ return array_values($rows);
+ }
+
+ public static function buildTree($elements, $parentId = 0)
+ {
+ $branch = array();
+ $sort = array();
+ foreach ($elements as $element) {
+ if ($element['locationid'] == 0 || $element['locationid'] == $parentId)
+ continue;
+ if ($element['parentlocationid'] == $parentId) {
+ $children = self::buildTree($elements, $element['locationid']);
+ if (!empty($children)) {
+ $element['children'] = $children;
+ }
+ $branch[] = $element;
+ $sort[] = $element['locationname'];
+ }
+ }
+ array_multisort($sort, SORT_ASC, $branch);
+ return $branch;
+ }
+
+ private static function flattenTree($tree, $depth = 0)
+ {
+ $output = array();
+ foreach ($tree as $node) {
+ $output[] = array(
+ 'locationid' => $node['locationid'],
+ 'locationname' => $node['locationname'],
+ 'locationpad' => str_repeat('--', $depth),
+ 'locationspan1' => $depth + 1,
+ 'locationspan2' => 10 - $depth,
+ 'depth' => $depth
+ );
+ if (!empty($node['children'])) {
+ $output = array_merge($output, self::flattenTree($node['children'], $depth + 1));
+ }
+ }
+ return $output;
+ }
+
+ public static function extractIds($tree)
+ {
+ $ids = array();
+ foreach ($tree as $node) {
+ $ids[] = $node['locationid'];
+ if (!empty($node['children'])) {
+ $ids = array_merge($ids, self::extractIds($node['children']));
+ }
+ }
+ return $ids;
+ }
+
+ public static function getFromIp($ip)
+ {
+ $locationId = false;
+ $long = sprintf('%u', ip2long($ip));
+ $net = Database::simpleQuery('SELECT locationid FROM subnet'
+ . ' WHERE :ip BETWEEN startaddr AND endaddr', array('ip' => $long));
+ while ($row = $net->fetch(PDO::FETCH_ASSOC)) {
+ $locations = self::getLocationsAssoc();
+ $id = (int)$row['locationid'];
+ if (!isset($locations[$id])) continue;
+ if ($locationId !== false && $locations[$id]['depth'] <= $locations[$locationId]['depth']) continue;
+ $locationId = $id;
+ }
+ return $locationId;
+ }
+
+}
diff --git a/modules-available/main/lang/de/messages.json b/modules-available/main/lang/de/messages.json
index ec645d05..245d4871 100644
--- a/modules-available/main/lang/de/messages.json
+++ b/modules-available/main/lang/de/messages.json
@@ -1,12 +1,13 @@
{
- "no-permission": "Keine ausreichenden Rechte, um auf diese Seite zuzugreifen",
- "error-write": "Fehler beim Schreiben von {{0}}",
+ "debug-mode": "Der Debug-Modus ist aktiv!",
"empty-field": "Ein Feld wurde nicht ausgef\u00fcllt",
- "value-invalid": "Der Wert {{1}} ist ung\u00fcltig f\u00fcr die Option {{0}} und wurde ignoriert",
"error-read": "Fehler beim Lesen von {{0}}",
- "taskmanager-error": "Verbindung zum Taskmanager fehlgeschlagen",
+ "error-write": "Fehler beim Schreiben von {{0}}",
+ "no-permission": "Keine ausreichenden Rechte, um auf diese Seite zuzugreifen",
+ "no-such-module": "Modul {{0}} existiert nicht oder ist nicht aktiv",
"task-error": "Ausf\u00fchrung fehlgeschlagen: {{0}}",
+ "taskmanager-error": "Verbindung zum Taskmanager fehlgeschlagen",
"taskmanager-format": "Taskmanager hat ung\u00fcltige Daten zur\u00fcckgeliefert",
"token": "Ung\u00fcltiges Token. CSRF Angriff?",
- "debug-mode": "Der Debug-Modus ist aktiv!"
+ "value-invalid": "Der Wert {{1}} ist ung\u00fcltig f\u00fcr die Option {{0}} und wurde ignoriert"
}
\ No newline at end of file
diff --git a/modules-available/main/lang/de/template-tags.json b/modules-available/main/lang/de/template-tags.json
index 8a3120d3..b299cbad 100644
--- a/modules-available/main/lang/de/template-tags.json
+++ b/modules-available/main/lang/de/template-tags.json
@@ -19,5 +19,6 @@
"lang_translations": "\u00dcbersetzungen",
"lang_vmLocationNotSet": "Es ist noch kein Speicherort f\u00fcr die Virtuellen Maschinen festgelegt.",
"lang_warning": "Warnung",
+ "lang_warningDebug": "Debugmodus aktiv!",
"lang_welcome": "Willkommen"
}
\ No newline at end of file
diff --git a/modules-available/main/lang/en/template-tags.json b/modules-available/main/lang/en/template-tags.json
index aeebc998..be03e53e 100644
--- a/modules-available/main/lang/en/template-tags.json
+++ b/modules-available/main/lang/en/template-tags.json
@@ -19,5 +19,6 @@
"lang_translations": "Translations",
"lang_vmLocationNotSet": "A location for the virtual machine is not set yet.",
"lang_warning": "Warning",
+ "lang_warningDebug": "Debug mode active!",
"lang_welcome": "Welcome"
}
\ No newline at end of file
diff --git a/modules-available/main/lang/pt/global-tags.json b/modules-available/main/lang/pt/global-tags.json
index 7c1311ec..a462651b 100644
--- a/modules-available/main/lang/pt/global-tags.json
+++ b/modules-available/main/lang/pt/global-tags.json
@@ -1,4 +1,5 @@
{
"lang_close": "Fechar",
- "lang_next": "Pr\u00f3ximo"
+ "lang_next": "Pr\u00f3ximo",
+ "lang_save": "Salvar"
}
\ No newline at end of file
diff --git a/style/default.css b/style/default.css
index 74997381..9fa2db8d 100644
--- a/style/default.css
+++ b/style/default.css
@@ -342,12 +342,12 @@ nav.sidebar li {
.main
{
- float:right;
- margin-left:240px;
- margin-top:32px;
- min-width:900px;
- position:absolute;
- width:calc(100%-200px);
+ float: right;
+ margin-left: 240px;
+ margin-top: 32px;
+ min-width: 900px;
+ position: absolute;
+ width: calc(100% - 200px);
}
.navbar-inverse,.sidebar-bg
@@ -525,6 +525,16 @@ section{
border-top-left-radius: 0;
}
+.slx-cfg-toggle > input[type=checkbox] ~ label {
+ font-weight: normal;
+}
+
+.slx-cfg-toggle > input[type=checkbox]:checked ~ label {
+ font-weight: bold;
+}
+
+/* what's this?
textarea.form-control .editor-box{
height: 520px;
}
+*/
--
cgit v1.2.3-55-g7522