Subversion Repositories oidplus

Compare Revisions

No changes between revisions

Regard whitespace Rev 447 → Rev 448

/trunk/oidplus_base.css
File deleted
Property changes:
Deleted: svn:mime-type
-text/css
\ No newline at end of property
/trunk/oidplus_base.js
File deleted
Property changes:
Deleted: svn:mime-type
-text/javascript
\ No newline at end of property
/trunk/.project
24,5 → 24,6
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
/trunk/.settings/.jsdtscope
0,0 → 1,16
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="">
<attributes>
<attribute name="provider" value="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
/trunk/.settings/org.eclipse.wst.common.project.facet.core.xml
1,7 → 1,8
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="php.component"/>
<fixed facet="php.core.component"/>
<fixed facet="php.component"/>
<installed facet="php.core.component" version="1"/>
<installed facet="php.component" version="7"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
/trunk/.settings/org.eclipse.wst.jsdt.core.prefs
0,0 → 1,41
eclipse.preferences.version=1
org.eclipse.wst.jsdt.core.compiler.maxProblemPerUnit=100
org.eclipse.wst.jsdt.core.compiler.problem.deprecation=warning
org.eclipse.wst.jsdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.wst.jsdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.wst.jsdt.core.compiler.problem.discouragedReference=warning
org.eclipse.wst.jsdt.core.compiler.problem.duplicateLocalVariables=warning
org.eclipse.wst.jsdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.wst.jsdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.wst.jsdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.wst.jsdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.wst.jsdt.core.compiler.problem.forbiddenReference=error
org.eclipse.wst.jsdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.wst.jsdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.wst.jsdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.wst.jsdt.core.compiler.problem.looseVarDecleration=warning
org.eclipse.wst.jsdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.wst.jsdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.wst.jsdt.core.compiler.problem.nullReference=ignore
org.eclipse.wst.jsdt.core.compiler.problem.optionalSemicolon=warning
org.eclipse.wst.jsdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.wst.jsdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.wst.jsdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.wst.jsdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.wst.jsdt.core.compiler.problem.undefinedField=warning
org.eclipse.wst.jsdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.wst.jsdt.core.compiler.problem.uninitializedGlobalVariable=ignore
org.eclipse.wst.jsdt.core.compiler.problem.uninitializedLocalVariable=warning
org.eclipse.wst.jsdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.wst.jsdt.core.compiler.problem.unresolvedFieldReference=error
org.eclipse.wst.jsdt.core.compiler.problem.unresolvedMethodReference=error
org.eclipse.wst.jsdt.core.compiler.problem.unresolvedTypeReference=error
org.eclipse.wst.jsdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.wst.jsdt.core.compiler.problem.unusedLabel=warning
org.eclipse.wst.jsdt.core.compiler.problem.unusedLocal=warning
org.eclipse.wst.jsdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.wst.jsdt.core.compiler.problem.unusedPrivateMember=warning
semanticValidation=enabled
strictOnKeywordUsage=enabled
/trunk/.settings/org.eclipse.wst.jsdt.ui.superType.container
0,0 → 1,0
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
/trunk/.settings/org.eclipse.wst.jsdt.ui.superType.name
0,0 → 1,0
Window
/trunk/TODO
4,6 → 4,13
- Create a possibility to invoke cronjobs (VTS registration / automatic publishing) via crontab?
- Publish RFC!
 
DESIGN / THEME PLUGINS:
- Add manifests and PHP main classes for the design plugin type
- Create a "Theme" plugin that combines "Colors" and "Design".
- Make a feature-interface to manipulate the CSS URL?
Attention: JS function test_color_theme() has an hardcoded set of parameters and does not follow the arguments set in index.php!
- Add design plugins to the "Plugins" admin section
 
IDEAS FOR NEW FUNCTIONALITIES
- Admin plugin "Attachments" with following functionalities:
* Show every object and its attachments, so that the admin knows what's going on
/trunk/dev/box_texts/box_text_tutorial.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/dev/box_texts/box_text_tutorial.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/dev/box_texts/box_texts.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/dev/setup_bg/setup_bg.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/includes/classes/OIDplus.class.php
144,6 → 144,19
throw new OIDplusException(_L('This is not a correct email address'));
}
});
self::$config->prepareConfigKey('design', 'Which design to use (must exist in plugins/design/)?', 'default', OIDplusConfig::PROTECTION_EDITABLE, function($value) {
$good = true;
if (strpos($value,'/') !== false) $good = false;
if (strpos($value,'\\') !== false) $good = false;
if (strpos($value,'..') !== false) $good = false;
if (!$good) {
throw new OIDplusException(_L('Invalid design folder name. Do only enter a folder name, not an absolute or relative path'));
}
 
if (!is_dir(__DIR__.'/../../plugins/design/'.$value)) {
throw new OIDplusException(_L('The design "%1" does not exist in plugin directory %2',$value,'plugins/design/'));
}
});
self::$config->prepareConfigKey('objecttypes_initialized', 'List of object type plugins that were initialized once', '', OIDplusConfig::PROTECTION_READONLY, function($value) {
// Nothing here yet
});
731,7 → 744,8
$test_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$test_dir = str_replace('\\', '/', $test_dir);
$c = 0;
while (!file_exists($test_dir.'/oidplus_base.js')) {
// We just assume that only the OIDplus base directory contains "oidplus.min.css.php" and not any subsequent directory!
while (!file_exists($test_dir.'/oidplus.min.css.php')) {
$test_dir = dirname($test_dir);
$c++;
if ($c == 1000) return false;
/trunk/includes/classes/OIDplusGui.class.php
74,7 → 74,7
$class = 'lng_flag picture_ghost';
}
$add = (!is_null($goto)) ? '&amp;goto='.urlencode($goto) : '';
$langbox_entries[$code] = '<a '.($useJs ? 'onclick="setLanguage(\''.$code.'\'); return false" ' : '').'href="?lang='.$code.$add.'"><img src="'.OIDplus::getSystemUrl(true).'plugins/language/'.$code.'/'.$flag.'" alt="'.$pluginManifest->getName().'" title="'.$pluginManifest->getName().'" class="'.$class.'" id="lng_flag_'.$code.'"></a> ';
$langbox_entries[$code] = '<span class="lang_flag_bg"><a '.($useJs ? 'onclick="setLanguage(\''.$code.'\'); return false" ' : '').'href="?lang='.$code.$add.'"><img src="'.OIDplus::getSystemUrl(true).'plugins/language/'.$code.'/'.$flag.'" alt="'.$pluginManifest->getName().'" title="'.$pluginManifest->getName().'" class="'.$class.'" id="lng_flag_'.$code.'"></a></span> ';
}
if ($non_default_languages > 0) {
foreach ($langbox_entries as $ent) {
/trunk/includes/oidplus_base.js
0,0 → 1,543
/*
* OIDplus 2.0
* Copyright 2019 Daniel Marschall, ViaThinkSoft
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
/*jshint esversion: 6 */
 
// $('#html').jstree();
 
var current_node = "";
var popstate_running = false;
// DEFAULT_LANGUAGE will be set by oidplus.min.js.php
// language_messages will be set by oidplus.min.js.php
// language_tblprefix will be set by oidplus.min.js.php
// csrf_token will be set by oidplus.min.js.php
 
var pageChangeCallbacks = [];
var pageChangeRequestCallbacks = [];
 
function isInternetExplorer() {
var ua = window.navigator.userAgent;
return ((ua.indexOf("MSIE ") > 0) || (ua.indexOf("Trident/") > 0));
}
 
String.prototype.explode = function (separator, limit) {
// https://stackoverflow.com/questions/4514323/javascript-equivalent-to-php-explode
const array = this.split(separator);
if (limit !== undefined && array.length >= limit) {
array.push(array.splice(limit - 1).join(separator));
}
return array;
};
 
String.prototype.htmlentities = function () {
return this.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');//"
};
 
String.prototype.html_entity_decode = function () {
return $('<textarea />').html(this).text();
};
 
function getMeta(metaName) {
const metas = document.getElementsByTagName('meta');
 
for (let i = 0; i < metas.length; i++) {
if (metas[i].getAttribute('name') === metaName) {
return metas[i].getAttribute('content');
}
}
 
return '';
}
 
function getOidPlusSystemTitle() {
return getMeta('OIDplus-SystemTitle'); // do not translate
}
 
function combine_systemtitle_and_pagetitle(systemtitle, pagetitle) {
// Please also change the function in index.php
if (systemtitle == pagetitle) {
return systemtitle;
} else {
return pagetitle + ' - ' + systemtitle;
}
}
 
function getSystemUrl(relative) {
var url = new URL(window.location.href);
if (relative) {
return url.pathname;
} else {
return url.href.substr(0, url.href.length-url.search.length);
}
}
 
function getTreeLoadURL() {
var url = new URL(window.location.href);
var goto = url.searchParams.get("goto");
return (goto != null) ? "ajax.php?csrf_token="+csrf_token+"&action=tree_load&goto="+encodeURIComponent(goto)
: "ajax.php?csrf_token="+csrf_token+"&action=tree_load";
}
 
function reloadContent() {
// window.location.href = "?goto="+encodeURIComponent(current_node);
if (openOidInPanel(current_node, false)) {
$('#oidtree').jstree("refresh");
}
}
 
function x_rec(x_data, i) {
$('#oidtree').jstree('open_node', x_data[i], function(e, data) {
if (i+1 < x_data.length) {
x_rec(x_data, i+1);
} else {
popstate_running = true; // don't call openOidInPanel again
try {
$('#oidtree').jstree('select_node', x_data[i]);
} catch (err) {
popstate_running = false;
} finally {
popstate_running = false;
}
}
});
}
 
function performCloseQueryCB() {
for (var i=0; i<pageChangeRequestCallbacks.length; i++) {
if (!pageChangeRequestCallbacks[i][0](pageChangeRequestCallbacks[i][1])) return false;
}
pageChangeRequestCallbacks = [];
return true; // may close
}
 
function performCloseCB() {
for (var i=0; i<pageChangeCallbacks.length; i++) {
pageChangeCallbacks[i][0](pageChangeCallbacks[i][1]);
}
pageChangeCallbacks = [];
}
 
function openOidInPanel(id, reselect/*=false*/, anchor/*=''*/, force/*=false*/) {
reselect = (typeof reselect === 'undefined') ? false : reselect;
anchor = (typeof anchor === 'undefined') ? '' : anchor;
force = (typeof force === 'undefined') ? false : force;
 
var mayClose = performCloseQueryCB();
if (!force && !mayClose) return false;
 
performCloseCB();
 
if (reselect) {
$('#oidtree').jstree('deselect_all');
 
popstate_running = true; // don't call openOidInPanel during tree selection
try {
// If the node is already loaded in the tree, select it
if (!$('#oidtree').jstree('select_node', id)) {
// If the node is not loaded, then we try to search it.
// If it can be found, then open all parent nodes and select the node
$.ajax({
url:"ajax.php",
method:"POST",
data:{
csrf_token:csrf_token,
action:"tree_search",
search:id
},
error:function(jqXHR, textStatus, errorThrown) {
console.error(_L("Error: %1",errorThrown));
},
success:function(data) {
if ("error" in data) {
console.error(data);
} else if ((data instanceof Array) && (data.length > 0)) {
x_rec(data, 0);
} else {
console.error(data);
}
}
});
}
} catch (err) {
popstate_running = false;
} finally {
popstate_running = false;
}
}
 
// This loads the actual content
 
// document.title = ""; // <-- we may not do this, otherwise Firefox won't
// show titles in the browser history (right-click
// on back-button), although document.title() is
// set inside the AJAX-callback [FirefoxBug?!]
 
$('#real_title').html("&nbsp;");
$('#real_content').html(_L("Loading..."));
$('#static_link').attr("href", "index.php?goto="+encodeURIComponent(id));
$("#gotoedit").val(id);
 
// Normal opening of a description
fetch("ajax.php?csrf_token="+csrf_token+"&action=get_description&id="+encodeURIComponent(id))
.then(function(response) {
response.json()
.then(function(data) {
if ("error" in data) {
alert(_L("Failed to load content: %1",data.error));
console.error(data.error);
return;
}
 
data.id = id;
 
var state = {
"node_id":id,
"titleHTML":(data.icon ? '<img src="'+data.icon+'" width="48" height="48" alt="'+data.title.htmlentities()+'"> ' : '') + data.title.htmlentities(),
"textHTML":data.text,
"staticlinkHREF":"index.php?goto="+encodeURIComponent(id),
};
if (current_node != id) {
window.history.pushState(state, data.title, "?goto="+encodeURIComponent(id));
} else {
window.history.replaceState(state, data.title, "?goto="+encodeURIComponent(id));
}
 
document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), data.title);
 
if (data.icon) {
$('#real_title').html('<img src="'+data.icon+'" width="48" height="48" alt="'+data.title.htmlentities()+'"> ' + data.title.htmlentities());
} else {
$('#real_title').html(data.title.htmlentities());
}
$('#real_content').html(data.text);
document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), data.title);
current_node = id;
 
if (anchor != '') {
jumpToAnchor(anchor);
}
})
.catch(function(error) {
alert(_L("Failed to load content: %1",error));
console.error(error);
});
})
.catch(function(error) {
alert(_L("Failed to load content: %1",error));
console.error(error);
});
 
return true;
}
 
// This function opens the "parentID" node, and then selects the "childID" node (which should be beneath the parent node)
function openAndSelectNode(childID, parentID) {
if ($('#oidtree').jstree(true).get_node(parentID)) {
$('#oidtree').jstree('open_node', parentID, function(e, data) { // open parent node
if ($('#oidtree').jstree(true).get_node(childID)) { // is the child there?
$('#oidtree').jstree('deselect_all').jstree('select_node', childID); // select it
} else {
// This can happen if the content page contains brand new items which are not in the treeview yet
$("#gotoedit").val(childID);
window.location.href = "?goto="+encodeURIComponent(childID);
}
}, true);
} else {
// This should usually not happen
$("#gotoedit").val(childID);
window.location.href = "?goto="+encodeURIComponent(childID);
}
}
 
$(window).on("popstate", function(e) {
if (!performCloseQueryCB()) {
// TODO: does not work!!! The "back/forward" action will be cancelled, but the browser still thinks it was successful,
// so if you do it again, you will then jump 2 pages back, etc!
// This does also not help:
//window.history.pushState(e.originalEvent.state, e.originalEvent.title, e.originalEvent.url);
//window.history.forward();
return;
}
 
popstate_running = true;
try {
var data = e.originalEvent.state;
 
current_node = data.node_id;
$("#gotoedit").val(current_node);
$('#oidtree').jstree('deselect_all').jstree('select_node', data.node_id);
$('#real_title').html(data.titleHTML);
$('#real_content').html(data.textHTML);
$('#static_link').attr("href", data.staticlinkHREF);
document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), data.titleHTML.html_entity_decode());
} catch (err) {
popstate_running = false;
} finally {
popstate_running = false;
}
});
 
$(document).ready(function () {
/*
window.onbeforeunload = function(e) {
// TODO: This won't be called because TinyMCE overrides it??
// TODO: when the user accepted the query in performCloseQueryCB(), then the message will be shown again by the browser!
if (!performCloseQueryCB()) {
// Cancel the event
e.preventDefault(); // If you prevent default behavior in Mozilla Firefox prompt will always be shown
// Chrome requires returnValue to be set
e.returnValue = '';
} else {
// the absence of a returnValue property on the event will guarantee the browser unload happens
delete e['returnValue'];
}
};
*/
 
// --- JsTree
 
$('#oidtree')
.jstree({
plugins: ['massload','search','conditionalselect'],
'core' : {
'data' : {
"url" : getTreeLoadURL(),
"data" : function (node) {
return { "id" : node.id };
}
},
"multiple": false
},
'conditionalselect' : function (node) {
if (node.original.conditionalselect !== undefined) {
return eval(node.original.conditionalselect);
} else {
return performCloseQueryCB();
}
},
})
.on('ready.jstree', function (e, data) {
var url = new URL(window.location.href);
var goto = url.searchParams.get("goto");
if (goto == null) goto = "oidplus:system"; // the page was not called with ?goto=...
$("#gotoedit").val(goto);
 
// By setting current_node, select_node() will not cause ajax.php?action=get_description to load (since we already loaded the first static content via PHP, for search engines mainly)
// But then we need to set the history state manually
current_node = goto;
window.history.replaceState({
"node_id":goto,
"titleHTML":$('#real_title').html(),
"textHTML":$('#real_content').html(),
"staticlinkHREF":"index.php?goto="+encodeURIComponent(goto),
}, $('#real_title').html(), "?goto="+encodeURIComponent(goto));
 
if (goto != null) data.instance.select_node([goto]);
 
setTimeout(glayoutWorkaroundA, 100);
setTimeout(glayoutWorkaroundB, 100);
})
.on('select_node.jstree', function (node, selected, event) {
mobileNavClose();
 
var id = selected.node.id;
if ((!popstate_running) && (current_node != id)) {
// 4th argument: we force the reload (because in the
// conditional select above, we already asked if
// tinyMCE needs to be saved)
openOidInPanel(id, false, '', true);
}
});
 
// --- Layout
 
document.getElementById('system_title_menu').style.display = "block";
 
var tmpObjectTree = _L("OBJECT TREE").replace(/(.{1})/g,"$1<br>");
tmpObjectTree = tmpObjectTree.substring(0, tmpObjectTree.length-"<br>".length);
 
$('#oidtree').addClass('ui-layout-west');
$('#content_window').addClass('ui-layout-center');
$('#system_title_bar').addClass('ui-layout-north');
glayout = $('#frames').layout({
north__size: 40,
north__slidable: false,
north__closable: false,
north__resizable: false,
west__size: 450,
west__spacing_closed: 20,
west__togglerLength_closed: 230,
west__togglerAlign_closed: "top",
west__togglerContent_closed: tmpObjectTree,
west__togglerTip_closed: _L("Open & Pin Menu"),
west__sliderTip: _L("Slide Open Menu"),
west__slideTrigger_open: "mouseover",
center__maskContents: true // IMPORTANT - enable iframe masking
});
 
$("#gotobox").addClass("mobilehidden");
$("#languageBox").addClass("mobilehidden");
document.getElementById('gotobox').style.display = "block";
$('#gotoedit').keypress(function(event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
if (keycode == '13') {
gotoButtonClicked();
}
});
});
 
function glayoutWorkaroundA() {
// "Bug A": Sometimes, the design is completely destroyed after reloading the page. It does not help when glayout.resizeAll()
// is called at the beginning (e.g. during the ready function), and it does not help if we wait 500ms.
// So we do it all the time. It has probably something to do with slow loading times, since the error
// does only appear when the page is "blank" for a short while while it is loading.
glayout.resizeAll();
setTimeout(glayoutWorkaroundA, 100);
 
// "Bug C": With Firefox (And sometimes with Chrome), there is a gap between the content-window (including scroll bars)
// and the right corner of the screen. Removing the explicit width solves this problem.
document.getElementById("content_window").style.removeProperty("width");
}
 
function glayoutWorkaroundB() {
// "Bug B": Sometimes, after reload, weird space between oidtree and content window, because oidtree has size of 438px
document.getElementById("oidtree").style.width = "450px";
}
 
function mobileNavClose() {
if ($("#system_title_menu").is(":hidden")) {
return;
}
 
$("#oidtree").slideUp("medium").promise().done(function() {
$("#oidtree").addClass("ui-layout-west");
$("#oidtree").show();
// $("#gotobox").hide();
// $("#languageBox").hide();
$("#gotobox").addClass("mobilehidden");
$("#languageBox").addClass("mobilehidden");
});
$("#system_title_menu").removeClass("active");
}
 
function mobileNavOpen() {
$("#oidtree").hide();
$("#oidtree").removeClass("ui-layout-west");
$("#oidtree").slideDown("medium");
// $("#gotobox").show();
// $("#languageBox").show();
$("#gotobox").removeClass("mobilehidden");
$("#languageBox").removeClass("mobilehidden");
$("#system_title_menu").addClass("active");
}
 
function mobileNavButtonClick(sender) {
if ($("#oidtree").hasClass("ui-layout-west")) {
mobileNavOpen();
} else {
mobileNavClose();
}
}
 
function mobileNavButtonHover(sender) {
sender.classList.toggle("hover");
}
 
function gotoButtonClicked() {
openOidInPanel($("#gotoedit").val(), 1);
}
 
function jumpToAnchor(anchor) {
window.location.href = "#" + anchor;
}
 
function getCookie(cname) {
// Source: https://www.w3schools.com/js/js_cookies.asp
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return undefined;
}
 
function setCookie(cname, cvalue, exdays, path) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = exdays == 0 ? "" : "; expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + expires + ";path=" + path;
}
 
function setLanguage(lngid) {
setCookie('LANGUAGE', lngid, 0/*Until browser closes*/, location.pathname);
 
$(".lng_flag").each(function(){
$(this).addClass("picture_ghost");
});
$("#lng_flag_"+lngid).removeClass("picture_ghost");
 
if (isInternetExplorer()) {
// Internet Explorer has problems with sending new cookies to new AJAX requests, so we reload the page completely
window.location.reload();
} else {
reloadContent();
mobileNavClose();
}
}
 
function getCurrentLang() {
// Note: If the argument "?lang=" is used, PHP will automatically set a Cookie, so it is OK when we only check for the cookie
var lang = getCookie('LANGUAGE');
return (typeof lang != "undefined") ? lang : DEFAULT_LANGUAGE;
}
 
function _L() {
var args = Array.prototype.slice.call(arguments);
var str = args.shift();
 
var tmp = "";
if (typeof language_messages[getCurrentLang()] == "undefined") {
tmp = str;
} else {
var msg = language_messages[getCurrentLang()][str];
if (typeof msg != "undefined") {
tmp = msg;
} else {
tmp = str;
}
}
 
tmp = tmp.replace('###', language_tblprefix);
 
var n = 1;
while (args.length > 0) {
var val = args.shift();
tmp = tmp.replace("%"+n, val);
n++;
}
 
tmp = tmp.replace("%%", "%");
 
return tmp;
}
Property changes:
Added: svn:mime-type
+text/javascript
\ No newline at end of property
/trunk/includes/uuid_utils.inc.php
3,7 → 3,7
/*
* UUID utils for PHP
* Copyright 2011-2020 Daniel Marschall, ViaThinkSoft
* Version 2020-10-21
* Version 2020-10-25
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
341,7 → 341,7
}
 
function gen_uuid($prefer_timebased = true) {
if ($prefer_timebased) $uuid = gen_uuid_timebased();
$uuid = $prefer_timebased ? gen_uuid_timebased() : false;
if ($uuid === false) $uuid = gen_uuid_random();
return $uuid;
}
/trunk/index.php
61,11 → 61,15
$sys_title = OIDplus::config()->getValue('system_title');
header('X-OIDplus-SystemTitle:'.$sys_title);
 
$add_css_args = array();
$add_css_args[] = 'theme='.urlencode(OIDplus::config()->getValue('design'));
if (class_exists('OIDplusPageAdminColors')) {
$add_css_args = '?invert='.(OIDplus::config()->getValue('color_invert')).'&h_shift='.(OIDplus::config()->getValue('color_hue_shift')/360).'&s_shift='.(OIDplus::config()->getValue('color_sat_shift')/100).'&v_shift='.(OIDplus::config()->getValue('color_val_shift')/100);
} else {
$add_css_args = '';
$add_css_args[] = 'invert='.(OIDplus::config()->getValue('color_invert'));
$add_css_args[] = 'h_shift='.(OIDplus::config()->getValue('color_hue_shift')/360);
$add_css_args[] = 's_shift='.(OIDplus::config()->getValue('color_sat_shift')/100);
$add_css_args[] = 'v_shift='.(OIDplus::config()->getValue('color_val_shift')/100);
}
$add_css_args = count($add_css_args) > 0 ? '?'.implode('&',$add_css_args) : '';
 
?><!DOCTYPE html>
<html lang="<?php echo substr(OIDplus::getCurrentLang(),0,2); ?>">
/trunk/nginx.conf
39,6 → 39,11
deny all;
}
 
location /setup/includes/ {
root html; # <-- You probably need to adjust this
deny all;
}
 
location /plugins/publicPages/100_whois/whois/cli/ {
root html; # <-- You probably need to adjust this
deny all;
/trunk/oidplus.min.css.php
64,11 → 64,23
$out .= process_file(__DIR__ . '/3p/jquery-ui/jquery-ui'.($do_minify ? '.min' : '').'.css');
$out .= process_file(__DIR__ . '/3p/bootstrap4/css/bootstrap'.($do_minify ? '.min' : '').'.css');
 
// Find out base CSS
if (isset($_REQUEST['theme'])) {
$theme = $_REQUEST['theme'];
if (strpos($theme,'/') !== false) $theme = 'default';
if (strpos($theme,'\\') !== false) $theme = 'default';
if (strpos($theme,'..') !== false) $theme = 'default';
if (!is_dir(__DIR__.'/plugins/design/'.$theme)) $theme = 'default';
} else {
$theme = 'default';
}
$base_css = __DIR__ . '/plugins/design/'.$theme.'/oidplus_base.css';
 
// OIDplus basic definitions
if (file_exists(__DIR__ . '/userdata/styles/oidplus_base.css')) {
$out .= process_file(__DIR__ . '/userdata/styles/oidplus_base.css');
} else {
$out .= process_file(__DIR__ . '/oidplus_base.css');
$out .= process_file($base_css);
}
 
// Then plugins
/trunk/oidplus.min.js.php
60,7 → 60,7
$files[] = 'var csrf_token = '.js_escape($_COOKIE['csrf_token']).';';
}
 
$files[] = process_file(__DIR__ . '/oidplus_base.js');
$files[] = process_file(__DIR__ . '/includes/oidplus_base.js');
 
# ---
 
/trunk/plugins/adminPages/700_colors/OIDplusPageAdminColors.class.php
103,6 → 103,7
$out['text'] .= 'if (g_sat_shift == null) g_sat_shift = g_sat_shift_saved = '.OIDplus::config()->getValue('color_sat_shift').";\n";
$out['text'] .= 'if (g_val_shift == null) g_val_shift = g_val_shift_saved = '.OIDplus::config()->getValue('color_val_shift').";\n";
$out['text'] .= 'if (g_invcolors == null) g_invcolors = g_invcolors_saved = '.OIDplus::config()->getValue('color_invert').";\n";
$out['text'] .= 'g_activetheme = '.js_escape(OIDplus::config()->getValue('design')).";\n";
$out['text'] .= 'setup_color_sliders();';
$out['text'] .= '</script>';
 
/trunk/plugins/adminPages/700_colors/OIDplusPageAdminColors.js
96,7 → 96,7
g_sat_shift = $("#sshift").val();
g_val_shift = $("#vshift").val();
g_invcolors = $("#icolor").val();
changeCSS('oidplus.min.css.php?invert='+$("#icolor").val()+'&h_shift='+$("#hshift").val()/360+'&s_shift='+$("#sshift" ).val()/100+'&v_shift='+$("#vshift" ).val()/100, 0);
changeCSS('oidplus.min.css.php?theme='+g_activetheme+'&invert='+$("#icolor").val()+'&h_shift='+$("#hshift").val()/360+'&s_shift='+$("#sshift" ).val()/100+'&v_shift='+$("#vshift" ).val()/100, 0);
}
 
function changeCSS(cssFile, cssLinkIndex) {
/trunk/plugins/design/default/oidplus_base.css
0,0 → 1,550
/*
* OIDplus 2.0
* Copyright 2019 Daniel Marschall, ViaThinkSoft
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
/*************************************************************************************
** ATTENTION: **
*************************************************************************************
** Please do NOT edit this file, since a software update will override **
** your changes. **
** To do changes to the design, you have following possibilities: **
** - If you just want to change colors, then the color plugin in the admin area **
** could an option for you. **
** - Create userdata/styles/oidplus_add.css (it will be placed after this file), **
** and use the "!important" statements to override style definitions. **
** - You can completely REPLACE oidplus_base.css by **
** creating userdata/styles/oidplus_base.css . This is very dangerous, because **
** you need to regularly check if the official oidplus_base.css gets changed or **
** extended, and you need to apply the changes according to the master file. **
*************************************************************************************/
 
@media print {
/* Printing */
.ui-layout-west, .ui-layout-resizer {
display:none !important;
}
.ui-layout-center {
left:0px !important;
width:100% !important;
}
#oidtree, .ui-layout-center {
position:relative !important;
width:100% !important;
top: 0 !important;
 
}
#content_window {
top: 0 !important;
}
}
 
@media only screen and (max-width: 800px) {
/* Mobile */
.ui-layout-west, .ui-layout-resizer {
display:none !important;
}
.ui-layout-center {
left:0px !important;
width:100% !important;
}
#oidtree, .ui-layout-center {
position:relative !important;
width:100% !important;
padding-right:10px !important;
top: 0 !important;
padding-bottom:80px !important; /* because iPhone Safari bar at the bottom */
/* Attention: If you incrase .lng_flag.margin, then you need to increase this, too */
}
#content_window {
top: 0 !important;
}
#frames {
display:flex;
flex-direction:column;
align-items: flex-start;
}
#system_title_bar {
order:0;
flex:none;
}
#oidtree {
order:1;
flex:none;
}
#content_window {
order:2;
flex:none;
}
#system_title_text {
overflow-x:scroll; /* TODO: at computer browser, you see a scroll bar */
}
}
 
@media only screen and (min-width: 801px) {
/* Desktop */
#system_title_menu {
display:none !important;
}
}
 
#system_title_bar {
width:100% !important;
position:relative !important;
white-space: nowrap;
}
 
body, #frames {
width:100%;
height:100%;
}
 
.wrap {
overflow-x: auto;
margin: 0 auto;
width:100%;
}
 
.gray_footer_font {
color:#808080;
font-size:0.9em;
}
 
label.padding_label {
font-weight: normal !important;
display: inline-block;
clear: left;
width: 100px;
text-align: right;
padding-top: 3px;
margin-right: 8px;
}
 
.box {
width:auto !important;
padding:20px;
background-color:#fff;
border:1px solid #ccc;
border-radius:5px;
margin-top:10px;
}
#titleedit {
width:100%;
}
#system_title_1 {
color:#2D6A9F;
margin-left:5px;
}
#system_title_2 {
color:#2B336F;
font-size:2em;
margin-left:5px;
}
 
/* Mobile menu button */
 
#bar1, #bar2, #bar3 {
width: 27px;
height: 5px;
background-color: #FFA500;
margin: 6px 0;
transition: 0.4s;
margin-left:14px;
}
 
#system_title_menu.active {
background-color: #FFA500;
}
 
.active #bar1 {
-webkit-transform: rotate(-45deg) translate(-7.5px, 7.5px);
transform: rotate(-45deg) translate(-7.5px, 7.5px);
background-color: #000;
}
 
.active #bar2 {
opacity: 0;
background-color: #000;
}
 
.active #bar3 {
-webkit-transform: rotate(45deg) translate(-8px, -8px);
transform: rotate(45deg) translate(-8px, -8px);
background-color: #000;
}
 
.hover #bar1, .hover #bar2, .hover #bar3 {
background-color:#fff;
}
 
#system_title_menu {
width:55px;
height:55px;
padding-top:8px;
text-decoration: none;
font-size: 19px;
display: none; /* will be set to 'block' by JavaScript */
background-color: #000;
float:left;
cursor: pointer;
}
 
/* Title bar */
 
#system_title_bar {
line-height:1.75em;
 
height:55px !important;
 
font-style:italic;
font-weight:bolder;
float:left;
border-bottom:1px;
 
width:100%; /* required for NoScript */
padding-left:5px;/* required for NoScript */
padding-right:5px;/* required for NoScript */
 
padding-left:0px;
margin-left:0px;
 
display:block;
 
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#a0d8ef+0,ddf1f9+65,feffff+100 */
background: #a0d8ef; /* Old browsers */
background: -moz-linear-gradient(left, #a0d8ef 0%, #ddf1f9 65%, #feffff 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(left, #a0d8ef 0%,#ddf1f9 65%,#feffff 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to right, #a0d8ef 0%,#ddf1f9 65%,#feffff 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a0d8ef', endColorstr='#feffff',GradientType=1 ); /* IE6-9 */
 
overflow:hidden;
}
#system_title_bar a {
text-decoration:none;
}
 
/* OID-Tree */
 
@media only screen and (max-width: 800px) {
/* Mobile */
 
#content_window {
padding-left:16px;
padding-top:0px;
}
 
}
@media only screen and (min-width: 801px) {
/* Desktop */
 
#oidtree {
position:absolute;
left:0px;
bottom:0px;
top:55px; /* required for NoScript */
width:400px; /* required for NoScript */
padding-top:5px;
white-space:nowrap; /* required for NoScript */
overflow:scroll; /* required for NoScript */
padding-bottom:10px !important;
}
#content_window {
position:absolute;
left:400px;
right:0px;
bottom:0px;
top:55px; /* required for NoScript */
padding-left:20px;
padding-right:20px;
}
}
 
#oidtree {
padding-top:5px !important;
padding-left:5px;/* required for NoScript */
padding-right:5px;/* required for NoScript */
}
 
html {
margin:0;
padding:0;
height:100%;
font-family:"Helvetica";
}
body {
margin:0px;
padding:0px;
height:100%;
/* Bootstrap adds "Helvetica Neue",Helvetica at the beginning which causes bold font in IE11+Win10 */
font-family:"Arial","sans-serif" !important;
}
 
@media only screen and (min-width: 801px) {
/* Desktop */
body {
overflow:hidden;
}
.borderbox {
border:1px solid silver;
}
}
 
.borderbox {
overflow:auto;
}
 
h1 {
font-size:2.2em;
}
h2 {
font-size:1.6em !important;
}
h3 {
font-size:1.5em !important;
}
 
textarea,input[type="text"],input[type="password"],select {
/* for dark themes, this looks better */
/*background:transparent;*/
background:rgba(255,255,255,0.4);
border: #AAAAAA 1px solid;
}
 
input[type=button], input[type=submit], input[type=reset],
input[type=button]:link, input[type=submit]:link, input[type=reset]:link,
input[type=button]:visited, input[type=submit]:visited, input[type=reset]:visited,
input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover {
border: 1px solid #a2a2a2;
padding-top:2px;
padding-bottom:2px;
padding-left:7px;
padding-right:7px;
text-decoration:none;
background: #ffffff;
color: #0066CC;
}
input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover {
background: #f4f4ff;
}
.hand, input[type=button], input[type=submit], input[type=reset] {
cursor: pointer;
}
 
/**
* Splitter / uiLayout
*/
.ui-layout-pane { /* all 'panes' */
border: 1px solid #BBB;
}
.ui-layout-pane-center { /* content body */
padding: 0;
margin: 0;
}
.ui-layout-pane-west { /* west pane */
padding: 0 10px;
background-color: #f9f9f9 !important;
overflow: auto;
}
.ui-layout-resizer { /* all 'resizer-bars' */
background: #DDD;
top:55px !important; /* DM 13.03.2019 */
}
.ui-layout-resizer-open:hover { /* mouse-over */
background: #9D9;
}
.ui-layout-resizer-north {
background:#2b336f !important;
z-index:10 !important; /* DM 13.03.2019 */
}
.ui-layout-toggler { /* all 'toggler-buttons' */
background: #AAA;
}
.ui-layout-toggler-closed { /* closed toggler-button */
background: #CCC;
border-bottom: 1px solid #BBB;
}
.ui-layout-toggler .content { /* toggler-text */
font-size: 14px;
font-family: "Verdana", "Arial", "Helvetica", "sans-serif";
font-weight: bold;
}
.ui-layout-toggler:hover { /* mouse-over */
background: #DCA;
}
.ui-layout-toggler:hover .content { /* mouse-over */
color: #009;
}
 
/* masks are usually transparent - make them visible (must 'override' default) */
.ui-layout-mask {
background: #C00 !important;
opacity: .20 !important;
filter: alpha(opacity=20) !important;
}
 
/* Language box */
 
@media only screen and (min-width: 801px) {
/* Desktop */
 
#languageBox {
position:absolute;
right:420px;
top:15px;
}
 
}
 
@media only screen and (max-width: 800px) {
/* Mobile */
 
.lng_flag {
margin: 10px;
}
 
}
 
.lng_flag {
cursor: pointer;
border: 1px solid #000 !important;
height: 20px;
}
 
.picture_ghost {
opacity: 0.4;
}
 
/* Goto box */
 
@media only screen and (max-width: 800px) {
/* Mobile */
 
#gotobox {
/*max-width:350px;*/
width:75%;
}
 
.mobilehidden {
display:none !important;
}
 
}
 
@media only screen and (min-width: 801px) {
/* Desktop */
 
#gotobox {
position:absolute;
right:10px;
top:10px;
width:30%;
max-width:400px;
}
 
}
 
#gotoedit {
font-style:italic;
font-weight:bolder;
}
 
#gotobox {
display: none; /* will be set to 'block' by JavaScript */
 
line-height:1.75em;
 
height:55px !important;
 
float:left;
border-bottom:1px;
 
width:100%; /* required for NoScript */
padding-left:5px;/* required for NoScript */
padding-right:5px;/* required for NoScript */
 
padding-left:0px;
margin-left:0px;
}
 
#gotobox input[type="text"] {
width:calc(100% - 45px);
}
 
#gotobox input[type="button"] {
width:40px;
}
 
/* Logbook severities (shared between plugins ra099, ra200, admin600) */
 
.severity_0 {
/* Undefined */
}
 
.severity_1 {
/* Success */
color: DarkGreen;
}
 
.severity_2 {
/* Informational */
color: CornflowerBlue;
}
 
.severity_3 {
/* Warning */
color: DarkGoldenRod;
}
 
.severity_4 {
/* Error */
color: DarkRed;
}
 
.severity_5 {
/* Critical */
color: DarkMagenta;
}
 
/* Tabs */
 
.tab-content {
color: #000;
background-color: #eeeeee;
padding : 15px;
}
 
.nav-link.active {
color: #000;
font-weight: bold;
background-color: #eeeeee !important;
border-radius: 0;
}
 
/* Let Bootstrap 4 look like Bootstrap 3 (more or less) */
/* see https://www.geeksforgeeks.org/difference-between-bootstrap-3-and-bootstrap-4/ */
 
.container {
max-width: unset !important;
}
 
body {
font-size:14px;
}
 
h1, h2, h3 {
margin-top: 20px;
margin-bottom: 10px;
}
Property changes:
Added: svn:mime-type
+text/css
\ No newline at end of property
/trunk/plugins/design/ironbase/oidplus_base.css
0,0 → 1,577
/*
* OIDplus 2.0
* Copyright 2020 Daniel Marschall, ViaThinkSoft
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
/*************************************************************************************
** ATTENTION: **
*************************************************************************************
** Please do NOT edit this file, since a software update will override **
** your changes. **
** To do changes to the design, you have following possibilities: **
** - If you just want to change colors, then the color plugin in the admin area **
** could an option for you. **
** - Create userdata/styles/oidplus_add.css (it will be placed after this file), **
** and use the "!important" statements to override style definitions. **
** - You can completely REPLACE oidplus_base.css by **
** creating userdata/styles/oidplus_base.css . This is very dangerous, because **
** you need to regularly check if the official oidplus_base.css gets changed or **
** extended, and you need to apply the changes according to the master file. **
*************************************************************************************/
 
a:link {
color:#FF5500;
}
 
a:visited {
color:#CC5500;
}
 
a:hover {
color:#FFAA00;
}
 
@media print {
/* Printing */
.ui-layout-west, .ui-layout-resizer {
display:none !important;
}
.ui-layout-center {
left:0px !important;
width:100% !important;
}
#oidtree, .ui-layout-center {
position:relative !important;
width:100% !important;
top: 0 !important;
 
}
#content_window {
top: 0 !important;
}
}
 
@media only screen and (max-width: 800px) {
/* Mobile */
.ui-layout-west, .ui-layout-resizer {
display:none !important;
}
.ui-layout-center {
left:0px !important;
width:100% !important;
}
#oidtree, .ui-layout-center {
position:relative !important;
width:100% !important;
padding-right:10px !important;
top: 0 !important;
padding-bottom:80px !important; /* because iPhone Safari bar at the bottom */
/* Attention: If you incrase .lng_flag.margin, then you need to increase this, too */
}
#content_window {
top: 0 !important;
background:#fbfbfb;
}
#frames {
display:flex;
flex-direction:column;
align-items: flex-start;
}
#system_title_bar {
order:0;
flex:none;
}
#oidtree {
order:1;
flex:none;
background:url(stripes2.gif);
}
#content_window {
order:2;
flex:none;
}
#system_title_text {
overflow-x:scroll; /* TODO: at computer browser, you see a scroll bar */
}
}
 
@media only screen and (min-width: 801px) {
/* Desktop */
#system_title_menu {
display:none !important;
}
}
 
#system_title_bar {
width:100% !important;
position:relative !important;
white-space: nowrap;
}
 
body, #frames {
width:100%;
height:100%;
}
 
.wrap {
overflow-x: auto;
margin: 0 auto;
width:100%;
}
 
.gray_footer_font {
color:#808080;
font-size:0.9em;
}
 
label.padding_label {
font-weight: normal !important;
display: inline-block;
clear: left;
width: 100px;
text-align: right;
padding-top: 3px;
margin-right: 8px;
}
 
.box {
width:auto !important;
padding:20px;
background-color:#fff;
border:1px solid #ccc;
border-radius:5px;
margin-top:10px;
}
#titleedit {
width:100%;
}
#system_title_1 {
color:#111;
margin-left:5px;
}
#system_title_2 {
color:#833;
font-size:2em;
margin-left:5px;
}
 
/* Mobile menu button */
 
#bar1, #bar2, #bar3 {
width: 27px;
height: 5px;
background-color: #FFA500;
margin: 6px 0;
transition: 0.4s;
margin-left:14px;
}
 
#system_title_menu.active {
background-color: #FFA500;
}
 
.active #bar1 {
-webkit-transform: rotate(-45deg) translate(-7.5px, 7.5px);
transform: rotate(-45deg) translate(-7.5px, 7.5px);
background-color: #000;
}
 
.active #bar2 {
opacity: 0;
background-color: #000;
}
 
.active #bar3 {
-webkit-transform: rotate(45deg) translate(-8px, -8px);
transform: rotate(45deg) translate(-8px, -8px);
background-color: #000;
}
 
.hover #bar1, .hover #bar2, .hover #bar3 {
background-color:#fff;
}
 
#system_title_menu {
width:55px;
height:55px;
padding-top:8px;
text-decoration: none;
font-size: 19px;
display: none; /* will be set to 'block' by JavaScript */
background-color: #000;
float:left;
cursor: pointer;
}
 
/* Title bar */
 
#system_title_bar {
line-height:1.75em;
 
height:55px !important;
 
font-weight:bolder;
float:left;
border-bottom:1px;
 
width:100%; /* required for NoScript */
padding-left:5px;/* required for NoScript */
padding-right:5px;/* required for NoScript */
 
padding-left:0px;
margin-left:0px;
 
display:block;
 
background:url(stripes.gif);
 
overflow:hidden;
}
#system_title_bar a {
text-decoration:none;
}
 
/* OID-Tree */
 
.jstree-clicked {
background:#FFD5AA !important;
}
 
.jstree-anchor:hover {
background:#FFE4CA;
}
 
@media only screen and (max-width: 800px) {
/* Mobile */
 
#content_window {
padding-left:16px;
padding-top:0px;
}
 
}
@media only screen and (min-width: 801px) {
/* Desktop */
 
#oidtree {
position:absolute;
left:0px;
bottom:0px;
top:55px; /* required for NoScript */
width:400px; /* required for NoScript */
padding-top:5px;
white-space:nowrap; /* required for NoScript */
overflow:scroll; /* required for NoScript */
padding-bottom:10px !important;
background:url(stripes2.gif);
}
#content_window {
position:absolute;
left:400px;
right:0px;
bottom:0px;
top:55px; /* required for NoScript */
padding-left:20px;
padding-right:20px;
background:#fbfbfb;
}
}
 
#oidtree {
padding-top:5px !important;
padding-left:5px;/* required for NoScript */
padding-right:5px;/* required for NoScript */
}
 
html {
margin:0;
padding:0;
height:100%;
font-family:"Helvetica";
}
body {
margin:0px;
padding:0px;
height:100%;
/* Bootstrap adds "Helvetica Neue",Helvetica at the beginning which causes bold font in IE11+Win10 */
font-family:"Arial","sans-serif" !important;
}
 
@media only screen and (min-width: 801px) {
/* Desktop */
body {
overflow:hidden;
}
.borderbox {
border:1px solid silver;
}
}
 
.borderbox {
overflow:auto;
}
 
h1 {
font-size:2.2em;
}
h2 {
font-size:1.6em !important;
}
h3 {
font-size:1.5em !important;
}
 
textarea,input[type="text"],input[type="password"],select {
/* for dark themes, this looks better */
/*background:transparent;*/
background: #F0F0F0;
border: #AAAAAA 1px solid;
}
 
input[type=button], input[type=submit], input[type=reset],
input[type=button]:link, input[type=submit]:link, input[type=reset]:link,
input[type=button]:visited, input[type=submit]:visited, input[type=reset]:visited,
input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover {
border: 1px solid #a2a2a2;
padding-top:2px;
padding-bottom:2px;
padding-left:7px;
padding-right:7px;
text-decoration:none;
background: #ffffff;
/*color: #0066CC;*/
}
input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover {
background: #FFE4CA;
}
.hand, input[type=button], input[type=submit], input[type=reset] {
cursor: pointer;
}
 
/**
* Splitter / uiLayout
*/
.ui-layout-pane { /* all 'panes' */
border: 1px solid #BBB;
}
.ui-layout-pane-center { /* content body */
padding: 0;
margin: 0;
}
.ui-layout-pane-west { /* west pane */
padding: 0 10px;
background-color: #f9f9f9 !important;
overflow: auto;
}
.ui-layout-resizer { /* all 'resizer-bars' */
background: #DDD;
top:55px !important; /* DM 13.03.2019 */
}
.ui-layout-resizer-open:hover { /* mouse-over */
background: #9D9;
}
.ui-layout-resizer-north:hover {
background: #DDD;
}
.ui-layout-resizer-north {
z-index:10 !important; /* DM 13.03.2019 */
}
.ui-layout-toggler { /* all 'toggler-buttons' */
background: #AAA;
}
.ui-layout-toggler-closed { /* closed toggler-button */
background: #CCC;
border-bottom: 1px solid #BBB;
}
.ui-layout-toggler .content { /* toggler-text */
font-size: 14px;
font-family: "Verdana", "Arial", "Helvetica", "sans-serif";
font-weight: bold;
}
.ui-layout-toggler:hover { /* mouse-over */
background: #DCA;
}
.ui-layout-toggler:hover .content { /* mouse-over */
color: #009;
}
 
/* masks are usually transparent - make them visible (must 'override' default) */
.ui-layout-mask {
background: #C00 !important;
opacity: .20 !important;
filter: alpha(opacity=20) !important;
}
 
/* Language box */
 
@media only screen and (min-width: 801px) {
/* Desktop */
 
#languageBox {
position:absolute;
right:420px;
top:15px;
}
 
}
 
@media only screen and (max-width: 800px) {
/* Mobile */
 
.lng_flag {
margin: 10px;
}
 
}
 
.lng_flag {
cursor: pointer;
border: 1px solid #000 !important;
height: 20px;
}
 
.lang_flag_bg {
/* to avoid that the stripes shine through a ghost image */
background:#f0f0f0;
}
 
.picture_ghost {
opacity: 0.4;
}
 
/* Goto box */
 
@media only screen and (max-width: 800px) {
/* Mobile */
 
#gotobox {
/*max-width:350px;*/
width:75%;
}
 
.mobilehidden {
display:none !important;
}
 
}
 
@media only screen and (min-width: 801px) {
/* Desktop */
 
#gotobox {
position:absolute;
right:10px;
top:10px;
width:30%;
max-width:400px;
}
 
}
 
#gotoedit {
/*
font-style:italic;
font-weight:bolder;
*/
}
 
#gotobox {
display: none; /* will be set to 'block' by JavaScript */
 
line-height:1.75em;
 
height:55px !important;
 
float:left;
border-bottom:1px;
 
width:100%; /* required for NoScript */
padding-left:5px;/* required for NoScript */
padding-right:5px;/* required for NoScript */
 
padding-left:0px;
margin-left:0px;
}
 
#gotobox input[type="text"] {
width:calc(100% - 45px);
}
 
#gotobox input[type="button"] {
width:40px;
}
 
/* Logbook severities (shared between plugins ra099, ra200, admin600) */
 
.severity_0 {
/* Undefined */
}
 
.severity_1 {
/* Success */
color: DarkGreen;
}
 
.severity_2 {
/* Informational */
color: CornflowerBlue;
}
 
.severity_3 {
/* Warning */
color: DarkGoldenRod;
}
 
.severity_4 {
/* Error */
color: DarkRed;
}
 
.severity_5 {
/* Critical */
color: DarkMagenta;
}
 
/* Tabs */
 
.tab-content {
color: #000;
background-color: #f5f5f5;
padding : 15px;
}
 
.nav-link.active {
color: #000;
font-weight: bold;
background-color: #eeeeee !important;
border-radius: 0;
}
 
/* Let Bootstrap 4 look like Bootstrap 3 (more or less) */
/* see https://www.geeksforgeeks.org/difference-between-bootstrap-3-and-bootstrap-4/ */
 
.container {
max-width: unset !important;
}
 
body {
font-size:14px;
}
 
h1, h2, h3 {
margin-top: 20px;
margin-bottom: 10px;
}
/trunk/plugins/design/ironbase/stripes.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/plugins/design/ironbase/stripes2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/plugins/language/dede/messages.xml
2550,6 → 2550,14
</message>
<message>
<source><![CDATA[
Invalid design folder name. Do only enter a folder name, not an absolute or relative path
]]></source>
<target><![CDATA[
Ungültiger Design-Ordnername. Bitte nur einen Ordnernamen (keinen Pfad) eingeben
]]></target>
</message>
<message>
<source><![CDATA[
Invalid email address
]]></source>
<target><![CDATA[
5406,6 → 5414,14
</message>
<message>
<source><![CDATA[
The design "%1" does not exist in plugin directory %2
]]></source>
<target><![CDATA[
Das Design "%1" existiert nicht im Plugin-Verzeichnis %2
]]></target>
</message>
<message>
<source><![CDATA[
The email address %1 was not verified. Please verify it first!
]]></source>
<target><![CDATA[
/trunk/plugins/objectTypes/box_text_tutorial.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/trunk/plugins/objectTypes/box_text_tutorial.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/trunk/plugins/objectTypes/box_texts.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/trunk/setup/setup_bg.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/trunk/setup/setup_base.js
File deleted
Property changes:
Deleted: svn:mime-type
-text/javascript
\ No newline at end of property
/trunk/setup/includes/.htaccess
0,0 → 1,4
Order Deny,Allow
Deny From All
Require all denied
 
/trunk/setup/includes/index.html
--- setup/includes/setup_base.js (nonexistent)
+++ setup/includes/setup_base.js (revision 448)
@@ -0,0 +1,258 @@
+/*
+ * OIDplus 2.0
+ * Copyright 2019 Daniel Marschall, ViaThinkSoft
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// DEFAULT_LANGUAGE will be set by setup.js.php
+// language_messages will be set by setup.js.php
+// language_tblprefix will be set by setup.js.php
+
+min_password_length = 10; // see also plugins/publicPages/092_forgot_password_admin/script.js
+password_salt_length = 10;
+
+function btoa(bin) {
+ var tableStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var table = tableStr.split("");
+ for (var i = 0, j = 0, len = bin.length / 3, base64 = []; i < len; ++i) {
+ var a = bin.charCodeAt(j++), b = bin.charCodeAt(j++), c = bin.charCodeAt(j++);
+ if ((a | b | c) > 255) throw new Error(_L('String contains an invalid character'));
+ base64[base64.length] = table[a >> 2] + table[((a << 4) & 63) | (b >> 4)] +
+ (isNaN(b) ? "=" : table[((b << 2) & 63) | (c >> 6)]) +
+ (isNaN(b + c) ? "=" : table[c & 63]);
+ }
+ return base64.join("");
+};
+
+function hexToBase64(str) {
+ return btoa(String.fromCharCode.apply(null,
+ str.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" ")));
+}
+
+function b64EncodeUnicode(str) {
+ // first we use encodeURIComponent to get percent-encoded UTF-8,
+ // then we convert the percent encodings into raw bytes which
+ // can be fed into btoa.
+ return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
+ function toSolidBytes(match, p1) {
+ return String.fromCharCode('0x' + p1);
+ }));
+}
+
+function generateRandomString(length) {
+ var charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+ retVal = "";
+ for (var i = 0, n = charset.length; i < length; ++i) {
+ retVal += charset.charAt(Math.floor(Math.random() * n));
+ }
+ return retVal;
+}
+
+String.prototype.replaceAll = function(search, replacement) {
+ var target = this;
+ return target.replace(new RegExp(search, 'g'), replacement);
+};
+
+function adminGeneratePassword(password) {
+ var salt = generateRandomString(password_salt_length);
+ return salt+'$'+hexToBase64(sha3_512(salt+password));
+}
+
+function rebuild() {
+ var error = false;
+
+ if (document.getElementById('config') == null) return;
+
+ // Check 1: Has the password the correct length?
+ if (document.getElementById('admin_password').value.length < min_password_length)
+ {
+ document.getElementById('password_warn').innerHTML = '<font color="red">'+_L('Password must be at least %1 characters long',min_password_length)+'</font>';
+ document.getElementById('config').innerHTML = '<b>&lt?php</b><br><br><i>// ERROR: Password must be at least '+min_password_length+' characters long</i>'; // do not translate
+ error = true;
+ } else {
+ document.getElementById('password_warn').innerHTML = '';
+ }
+
+ // Check 2: Do the passwords match?
+ if (document.getElementById('admin_password').value != document.getElementById('admin_password2').value) {
+ document.getElementById('password_warn2').innerHTML = '<font color="red">'+_L('The passwords do not match!')+'</font>';
+ error = true;
+ } else {
+ document.getElementById('password_warn2').innerHTML = '';
+ }
+
+ // Check 3: Ask the database plugins for verification of their data
+ for (var i = 0; i < rebuild_callbacks.length; i++) {
+ var f = rebuild_callbacks[i];
+ if (!f()) {
+ error = true;
+ }
+ }
+
+ // Continue
+ if (!error)
+ {
+ var e = document.getElementById("db_plugin");
+ var strPlugin = e.options[e.selectedIndex].value;
+
+ document.getElementById('config').innerHTML = '<b>&lt?php</b><br><br>' +
+ '<i>// To renew this file, please run setup/ in your browser.</i><br>' + // do not translate
+ '<i>// If you don\'t want to run setup again, you can also change most of the settings directly in this file.</i><br>' + // do not translate
+ '<br>' +
+ 'OIDplus::baseConfig()->setValue(\'CONFIG_VERSION\', 2.1);<br>' +
+ '<br>' +
+ // Passwords are Base64 encoded to avoid that passwords can be read upon first sight,
+ // e.g. if collegues are looking over your shoulder while you accidently open (and quickly close) userdata/baseconfig/config.inc.php
+ 'OIDplus::baseConfig()->setValue(\'ADMIN_PASSWORD\', \'' + adminGeneratePassword(document.getElementById('admin_password').value) + '\'); // salted, base64 encoded SHA3-512 hash<br>' +
+ '<br>' +
+ 'OIDplus::baseConfig()->setValue(\'DATABASE_PLUGIN\', \''+strPlugin+'\');<br>';
+ for (var i = 0; i < rebuild_config_callbacks.length; i++) {
+ var f = rebuild_config_callbacks[i];
+ var cont = f();
+ if (cont) {
+ document.getElementById('config').innerHTML = document.getElementById('config').innerHTML + cont;
+ }
+ }
+ document.getElementById('config').innerHTML = document.getElementById('config').innerHTML +
+ '<br>' +
+ 'OIDplus::baseConfig()->setValue(\'TABLENAME_PREFIX\', \''+document.getElementById('tablename_prefix').value+'\');<br>' +
+ '<br>' +
+ 'OIDplus::baseConfig()->setValue(\'SERVER_SECRET\', \''+generateRandomString(32)+'\');<br>' +
+ '<br>' +
+ 'OIDplus::baseConfig()->setValue(\'RECAPTCHA_ENABLED\', '+(document.getElementById('recaptcha_enabled').checked ? 'true' : 'false')+');<br>' +
+ 'OIDplus::baseConfig()->setValue(\'RECAPTCHA_PUBLIC\', \''+document.getElementById('recaptcha_public').value+'\');<br>' +
+ 'OIDplus::baseConfig()->setValue(\'RECAPTCHA_PRIVATE\', \''+document.getElementById('recaptcha_private').value+'\');<br>' +
+ '<br>' +
+ 'OIDplus::baseConfig()->setValue(\'ENFORCE_SSL\', '+document.getElementById('enforce_ssl').value+');<br>';
+
+ document.getElementById('config').innerHTML = document.getElementById('config').innerHTML.replaceAll(' ', '&nbsp;');
+ }
+
+ // In case something is not good, do not allow the user to continue with the other configuration steps:
+ if (error) {
+ document.getElementById('step2').style.display = "None";
+ document.getElementById('step3').style.display = "None";
+ document.getElementById('step4').style.display = "None";
+ } else {
+ document.getElementById('step2').style.display = "Block";
+ document.getElementById('step3').style.display = "Block";
+ document.getElementById('step4').style.display = "Block";
+ }
+}
+
+function RemoveLastDirectoryPartOf(the_url) {
+ var the_arr = the_url.split('/');
+ if (the_arr.pop() == '') the_arr.pop();
+ return( the_arr.join('/') );
+}
+
+function checkAccess(dir) {
+ var url = '../' + dir;
+ var visibleUrl = RemoveLastDirectoryPartOf(window.location.href) + '/' + dir; // xhr.responseURL not available in IE
+
+ var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4) {
+ if (xhr.status === 200) {
+ document.getElementById('systemCheckCaption').style.display = 'block';
+ document.getElementById('dirAccessWarning').innerHTML = document.getElementById('dirAccessWarning').innerHTML + _L('Attention: The following directory is world-readable: %1 ! You need to configure your web server to restrict access to this directory! (For Apache see <i>.htaccess</i>, for Microsoft IIS see <i>web.config</i>, for Nginx see <i>nginx.conf</i>).','<a target="_blank" href="'+url+'">'+visibleUrl+'</a>') + '<br>';
+ }
+ }
+ };
+
+ xhr.open('GET', url);
+ xhr.send();
+}
+
+function dbplugin_changed() {
+ var e = document.getElementById("db_plugin");
+ var strPlugin = e.options[e.selectedIndex].value;
+
+ for (var i = 0; i < plugin_combobox_change_callbacks.length; i++) {
+ var f = plugin_combobox_change_callbacks[i];
+ f(strPlugin);
+ }
+
+ rebuild();
+}
+
+function performAccessCheck() {
+ document.getElementById("dirAccessWarning").innerHTML = "";
+ checkAccess("userdata/index.html");
+ checkAccess("dev/index.html");
+ checkAccess("includes/index.html");
+ checkAccess("setup/includes/index.html");
+ //checkAccess("plugins/publicPages/100_whois/whois/cli/index.html");
+}
+
+function setupOnLoad() {
+ rebuild();
+ dbplugin_changed();
+ performAccessCheck();
+}
+
+function getCookie(cname) {
+ // Source: https://www.w3schools.com/js/js_cookies.asp
+ var name = cname + "=";
+ var decodedCookie = decodeURIComponent(document.cookie);
+ var ca = decodedCookie.split(';');
+ for(var i = 0; i <ca.length; i++) {
+ var c = ca[i];
+ while (c.charAt(0) == ' ') {
+ c = c.substring(1);
+ }
+ if (c.indexOf(name) == 0) {
+ return c.substring(name.length, c.length);
+ }
+ }
+ return undefined;
+}
+
+function getCurrentLang() {
+ // Note: If the argument "?lang=" is used, PHP will automatically set a Cookie, so it is OK when we only check for the cookie
+ var lang = getCookie('LANGUAGE');
+ return (typeof lang != "undefined") ? lang : DEFAULT_LANGUAGE;
+}
+
+function _L() {
+ var args = Array.prototype.slice.call(arguments);
+ var str = args.shift();
+
+ var tmp = "";
+ if (typeof language_messages[getCurrentLang()] == "undefined") {
+ tmp = str;
+ } else {
+ var msg = language_messages[getCurrentLang()][str];
+ if (typeof msg != "undefined") {
+ tmp = msg;
+ } else {
+ tmp = str;
+ }
+ }
+
+ tmp = tmp.replace('###', language_tblprefix);
+
+ var n = 1;
+ while (args.length > 0) {
+ var val = args.shift();
+ tmp = tmp.replace("%"+n, val);
+ n++;
+ }
+
+ tmp = tmp.replace("%%", "%");
+
+ return tmp;
+}
+
+window.onload = setupOnLoad;
/setup/includes/setup_base.js
Property changes:
Added: svn:mime-type
+text/javascript
\ No newline at end of property
/trunk/setup/setup.min.js.php
57,7 → 57,7
}
}
 
$files[] = __DIR__ . '/setup_base.js';
$files[] = __DIR__ . '/includes/setup_base.js';
 
# ---
 
/trunk/userdata/styles/info.txt
6,8 → 6,12
 
This folder can contain following files:
 
- oidplus_base.css : This file REPLACES the oidplus_base.css file in the root directory.
- oidplus_base.css : This file REPLACES the oidplus_base.css file of the currently active design.
Please see a WARNING below.
*DEPRECATED*: Please use a design plugin (located in plugins/design/)
in order to define individual designs for your system.
Design plugins also allow you to include graphics in the plugin
directory itself (so you don't need "userdata_pub").
 
- oidplus_add.css : This file is added after oidplus_base.css
If you just want to override some styles, then you could write your
/trunk/web.config
62,6 → 62,20
</system.webServer>
</location>
 
<location path="setup/includes">
<system.webServer>
<security>
<authentication>
<!--
To "unlock" this section, run this command:
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/security/authentication/anonymousAuthentication
-->
<anonymousAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</location>
 
<location path="plugins/publicPages/100_whois/whois/cli">
<system.webServer>
<security>