Subversion Repositories oidplus

Compare Revisions

No changes between revisions

Regard whitespace Rev 345 → Rev 346

/trunk/TODO
18,7 → 18,6
* Give the ability to enable/disable RA uploading/deleting
(Alternatively they need to do it in the configuration module and enter '0' and '1' by hand)
- Excel/CSV import tool for bulk data import (as alternative to XML import. Maybe previous Excel->XML import tool?)
- Admin plugin "System info" which shows information like PHP version, Database connection data etc.
 
TINYMCE
- menu entry "formats" is empty. can it be removed?
/trunk/includes/functions.inc.php
90,3 → 90,38
$final_call = $trace[2];
return $final_call['file'].':'.$final_call['line'].'/'.$final_call['function'].'()';
}
 
if (!function_exists('mb_wordwrap')) {
function mb_wordwrap($str, $width = 75, $break = "\n", $cut = false) {
// https://stackoverflow.com/a/4988494/488539
$lines = explode($break, $str);
foreach ($lines as &$line) {
$line = rtrim($line);
if (mb_strlen($line) <= $width) {
continue;
}
$words = explode(' ', $line);
$line = '';
$actual = '';
foreach ($words as $word) {
if (mb_strlen($actual.$word) <= $width) {
$actual .= $word.' ';
} else {
if ($actual != '') {
$line .= rtrim($actual).$break;
}
$actual = $word;
if ($cut) {
while (mb_strlen($actual) > $width) {
$line .= mb_substr($actual, 0, $width).$break;
$actual = mb_substr($actual, $width);
}
}
$actual .= ' ';
}
}
$line .= trim($actual);
}
return implode($break, $lines);
}
}
/trunk/plugins/adminPages/111_systeminfo/OIDplusPageAdminSysteminfo.class.php
0,0 → 1,110
<?php
 
/*
* 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.
*/
 
class OIDplusPageAdminSysteminfo extends OIDplusPagePluginAdmin {
 
public function action($actionID, $params) {
}
 
public function init($html=true) {
}
 
public function gui($id, &$out, &$handled) {
if ($id === 'oidplus:systeminfo') {
$handled = true;
$out['title'] = 'System information';
$out['icon'] = OIDplus::webpath(__DIR__).'icon_big.png';
 
if (!OIDplus::authUtils()::isAdminLoggedIn()) {
$out['icon'] = 'img/error_big.png';
$out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>';
return;
}
 
$out['text'] = '';
 
# ---
 
$out['text'] .= '<h2>OIDplus</h2>';
$sysid_oid = OIDplus::getSystemId(true);
if (!$sysid_oid) $sysid_oid = 'unknown';
$out['text'] .= '<p>System OID: '.$sysid_oid.'</p>';
 
$sys_url = OIDplus::getSystemUrl();
$out['text'] .= '<p>System URL: '.$sys_url.'</p>';
 
$sys_ver = OIDplus::getVersion();
if (!$sys_ver) $sys_ver = 'unknown';
$out['text'] .= '<p>System version: '.$sys_ver.'</p>';
 
$sys_install_type = OIDplus::getInstallType();
$out['text'] .= '<p>Installation type: '.$sys_install_type.'</p>';
 
$sys_title = OIDplus::config()->getValue('system_title');
$out['text'] .= '<p>System title: '.$sys_title.'</p>';
 
# ---
 
$out['text'] .= '<h2>PHP</h2>';
$out['text'] .= '<p>PHP version: '.phpversion().'</p>';
 
# ---
 
$out['text'] .= '<h2>Webserver</h2>';
$out['text'] .= '<p>Server software: '.(isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown').'</p>';
 
# ---
 
$out['text'] .= '<h2>Database</h2>';
$out['text'] .= '<p>Database provider: '.get_class(OIDplus::db()).'</p>';
$out['text'] .= '<p>SQL slang: '.get_class(OIDplus::db()->getSlang()).'</p>';
 
// TODO: can we somehow get the DBMS version, connection string etc?
 
# ---
 
}
}
 
public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
if (!OIDplus::authUtils()::isAdminLoggedIn()) return false;
 
if (file_exists(__DIR__.'/treeicon.png')) {
$tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
} else {
$tree_icon = null; // default icon (folder)
}
 
$json[] = array(
'id' => 'oidplus:systeminfo',
'icon' => $tree_icon,
'text' => 'System information'
);
 
return true;
}
 
public function tree_search($request) {
return false;
}
 
public function implementsFeature($id) {
return false;
}
}
/trunk/plugins/adminPages/111_systeminfo/icon_big.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/plugins/adminPages/111_systeminfo/index.html
--- trunk/plugins/adminPages/111_systeminfo/manifest.xml (nonexistent)
+++ trunk/plugins/adminPages/111_systeminfo/manifest.xml (revision 346)
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<manifest>
+
+ <type>OIDplusPagePluginAdmin</type>
+
+ <info>
+ <name>Colors</name>
+ <author>ViaThinkSoft</author>
+ <version />
+ <descriptionHTML />
+ <oid>1.3.6.1.4.1.37476.2.5.2.4.3.111</oid>
+ </info>
+
+ <php>
+ <mainclass>OIDplusPageAdminSysteminfo</mainclass>
+ </php>
+
+ <css>
+ </css>
+
+ <js>
+ </js>
+
+</manifest>
/trunk/plugins/adminPages/111_systeminfo/treeicon.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/plugins/publicPages/100_whois/whois/rfc/draft-viathinksoft-oidwhois-00.nroff
311,13 → 311,13
(7) "asn1-notation" (OPTIONAL, multiple values allowed) contains one or more possible notations in the ASN.1 syntax, as defined in Recommendation ITU-T X.680 (2015) | ISO/IEC 8824-1:2015, clause 32.3 [X680], e.g. {joint-iso-itu-t(2) example(999)}.
 
.in 7
Note: A line-break as defined in section\03.1 ("Format and Encoding") is allowed to break up lines which are too long. Multiple ASN.1 notations can be distinguished by their opening curly bracket and their closing curly bracket.
Note: A line-break, to break up lines which are too long, as defined in section\03.1 ("Format and Encoding") SHOULD be used. This is no problem because multiple ASN.1 notations can be distinguished by their opening curly bracket and their closing curly bracket.
.in 3
 
(8) "iri-notation" (OPTIONAL, multiple values allowed) contains one or more possible notations in the OID-IRI syntax, as defined in Recommendation ITU-T X.680 (2015) | ISO/IEC 8824-1:2015, clause 34.3 [X680] (but without quotation marks), e.g. /Joint-ISO-ITU-T/Example.
 
.in 7
Note: A line-break as defined in section\03.1 ("Format and Encoding") SHALL NOT be applied to an OID-IRI notation, otherwise, it would be ambiguous if the line-break was placed merely to shorten the line, or if the line-break indicates a new value in case multiple OID-IRI notations are supplied.
Note: A line-break, to break up lines which are too long, as defined in section\03.1 ("Format and Encoding") SHALL NOT be used, otherwise, it would be ambiguous if the line-break was used to shorten the line, or if the line-break indicates a new value in case multiple OID-IRI notations are supplied.
.in 3
 
(9) "identifier" (OPTIONAL, multiple values allowed) contains the alphanumeric identifier ("NameForm") as defined in Recommendation ITU-T X.680 (2015) | ISO/IEC 8824-1:2015, clause 12.3 [X680].
/trunk/plugins/publicPages/100_whois/whois/rfc/draft-viathinksoft-oidwhois-00.txt
459,10 → 459,11
Recommendation ITU-T X.680 (2015) | ISO/IEC 8824-1:2015, clause 32.3
[X680], e.g. {joint-iso-itu-t(2) example(999)}.
 
Note: A line-break as defined in section 3.1 ("Format and
Encoding") is allowed to break up lines which are too long.
Multiple ASN.1 notations can be distinguished by their opening
curly bracket and their closing curly bracket.
Note: A line-break, to break up lines which are too long, as
defined in section 3.1 ("Format and Encoding") SHOULD be used.
This is no problem because multiple ASN.1 notations can be
distinguished by their opening curly bracket and their closing
curly bracket.
 
(8) "iri-notation" (OPTIONAL, multiple values allowed) contains one
or more possible notations in the OID-IRI syntax, as defined in
469,11 → 470,11
Recommendation ITU-T X.680 (2015) | ISO/IEC 8824-1:2015, clause 34.3
[X680] (but without quotation marks), e.g. /Joint-ISO-ITU-T/Example.
 
Note: A line-break as defined in section 3.1 ("Format and
Encoding") SHALL NOT be applied to an OID-IRI notation,
otherwise, it would be ambiguous if the line-break was placed
merely to shorten the line, or if the line-break indicates a new
value in case multiple OID-IRI notations are supplied.
Note: A line-break, to break up lines which are too long, as
defined in section 3.1 ("Format and Encoding") SHALL NOT be used,
otherwise, it would be ambiguous if the line-break was used to
shorten the line, or if the line-break indicates a new value in
case multiple OID-IRI notations are supplied.
 
(9) "identifier" (OPTIONAL, multiple values allowed) contains the
alphanumeric identifier ("NameForm") as defined in Recommendation
497,7 → 498,6
 
(13) "whois-service" (OPTIONAL) contains an IP-address or hostname of
a system that offers a WHOIS service that can supply information
about the OID and/or its subordinate OIDs. If the result is "Found"
 
 
506,6 → 506,7
INTERNET DRAFT OID-WHOIS <Issue Date>
 
 
about the OID and/or its subordinate OIDs. If the result is "Found"
(i.e. the OID is existing in the local database), then the
information "whois-service" is only informational; its existence is
most likely a hint that subordinate OIDs will be found at that WHOIS
556,7 → 557,6
 
 
 
Marschall Expires <Expiry Date> [Page 10]
INTERNET DRAFT OID-WHOIS <Issue Date>
/trunk/plugins/publicPages/100_whois/whois/webwhois.php
246,7 → 246,7
$key = trim($ary[0]);
 
$value = isset($ary[1]) ? trim($ary[1]) : '';
$value = wordwrap($value, OIDplus::config()->getValue('webwhois_output_format_max_line_length', 80) - $longest_key - strlen(':') - OIDplus::config()->getValue('webwhois_output_format_spacer', 2));
$value = mb_wordwrap($value, OIDplus::config()->getValue('webwhois_output_format_max_line_length', 80) - $longest_key - strlen(':') - OIDplus::config()->getValue('webwhois_output_format_spacer', 2));
$value = str_replace("\n", "\n$key:".str_repeat(' ', $longest_key-strlen($key)) . str_repeat(' ', OIDplus::config()->getValue('webwhois_output_format_spacer', 2)), $value);
 
if (!empty($value)) {
265,7 → 265,7
$signature = '';
if (@openssl_sign($cont, $signature, OIDplus::config()->getValue('oidplus_private_key'))) {
$signature = base64_encode($signature);
$signature = wordwrap($signature, 78, "\n", true);
$signature = mb_wordwrap($signature, OIDplus::config()->getValue('webwhois_output_format_max_line_length', 80) - strlen('% '), "\n", true);
$signature = "% -----BEGIN RSA SIGNATURE-----\n".
preg_replace('/^/m', '% ', $signature)."\n".
"% -----END RSA SIGNATURE-----\n";