Subversion Repositories oidplus

Compare Revisions

No changes between revisions

Regard whitespace Rev 1435 → Rev 1436

/trunk/changelog.json.php
3,6 → 3,15
"dummy": "<?php die(base64_decode('IgogICAgfQpdCg==')); /* for security reasons, do not show the current version @phpstan-ignore-line */ ?>"
},
{
"version": "2.0.1.5",
"date": "2023-11-15 22:01:00 +0100",
"author": "Daniel Marschall (ViaThinkSoft)",
"changes": [
"Software update: Fixed problem with outdated changelog due to caching (GitHub issue #38)",
"Various smaller improvements"
]
},
{
"version": "2.0.1.4",
"date": "2023-11-15 14:56:00 +0100",
"author": "Daniel Marschall (ViaThinkSoft)",
/trunk/dev/logger/verify_maskcodes.phps
31,6 → 31,8
 
// ---
 
$errors_found = false;
 
$cntfiles = 0;
$cntcodes = 0;
$it = new RecursiveDirectoryIterator($dir);
53,6 → 55,7
if (OIDplusLogger::parse_maskcode($str) === false) {
$file = substr($file, strlen($dir));
echo "Invalid maskcode '$str' in file '$file'\n";
$errors_found = true;
} else {
if (VERBOSE) echo 'Valid: '.$str."\n";
}
61,6 → 64,8
}
echo "Done. Checked $cntcodes mask codes in $cntfiles files.\n";
 
exit($errors_found ? 1 : 0);
 
# ---
 
/**
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/dev/release.sh
20,12 → 20,18
echo "==============================="
echo ""
 
# TODO: Maybe we should also check for the word "SPONGE" and do not let commit if it is there (see TempleOS)
 
# Please make sure to do all these steps before committing ANYTHING:
 
DIR=$( dirname "$0" )
 
# 0. Search for SPONGE (why Sponge? See TempleOS)
echo "0. Checking for forgotten sponges"
grep -r "SPONGE" | grep -v "\.svn/pristine" | grep -v "dev/release.sh"
if [ $? -eq 0 ]; then
echo "STOP! There are missing files. Please fix this problem (remove them from the SVN)"
exit 1
fi
 
# 1. Recommended: Run dev/vendor_update.sh and make sure new/deleted files are added/deleted from the SVN/Git working copy
echo "1. Run composer vendor update? (Recommended to do regularly)"
select yn in "Yes" "No"; do
75,8 → 81,16
fi
done
 
# 4. Run phpstan
echo "4. Running PHPSTAN..."
# 4. Run dev/logger/verify_maskcodes.phps
echo "4. Verify OIDplus Logger Maskcodes..."
"$DIR"/logger/verify_maskcodes.phps
if [ $? -ne 0 ]; then
echo "Please fix the issues and run release script again"
exit 1
fi
 
# 5. Run phpstan
echo "5. Running PHPSTAN..."
cd "$DIR"/.. && phpstan
echo "Is PHPSTAN output OK?"
select yn in "Yes" "No"; do
86,8 → 100,8
esac
done
 
# 5. Only if you want to start a new release: Add new entry to the top of changelog.json.php
echo "5. Please edit changelog.json.php (add '-dev' for non-stable versions)"
# 6. Only if you want to start a new release: Add new entry to the top of changelog.json.php
echo "6. Please edit changelog.json.php (add '-dev' for non-stable versions)"
sleep 2
while true; do
nano "$DIR"/../changelog.json.php
100,24 → 114,24
fi
done
 
# 6. Run plugins/viathinksoft/adminPages/902_systemfile_check/private/gen_serverside_v3
echo "6. Generate system file check checksum file..."
# 7. Run plugins/viathinksoft/adminPages/902_systemfile_check/private/gen_serverside_v3
echo "7. Generate system file check checksum file..."
"$DIR"/../plugins/viathinksoft/adminPages/902_systemfile_check/private/gen_serverside_v3
 
# 7. Commit to SVN or GIT
# 8. Commit to SVN or GIT
if [ -d "$DIR"/../.svn ]; then
echo "7. Committing to SVN"
echo "8. Committing to SVN"
svn commit
elif [ -d "$DIR"/../.git ]; then
echo "7. ALL GOOD! PLEASE NOW COMMIT TO GIT"
echo "8. ALL GOOD! PLEASE NOW COMMIT TO GIT"
else
echo "7. ALL GOOD! YOU CAN RELEASE IT"
echo "8. ALL GOOD! YOU CAN RELEASE IT"
fi
exit 0
 
# 8. (ViaThinkSoft internal / runs automatically) Sync SVN to GitHub
# 9. (ViaThinkSoft internal / runs automatically) Sync SVN to GitHub
 
# 9. (ViaThinkSoft internal / runs automatically) Run plugins/viathinksoft/adminPages/900_software_update/private/gen_serverside_git
# 10. (ViaThinkSoft internal / runs automatically) Run plugins/viathinksoft/adminPages/900_software_update/private/gen_serverside_git
# or plugins/viathinksoft/adminPages/900_software_update/private/gen_serverside_svn
# depending wheather you want to use GIT or SVN as your development base
# (Repos are read from includes/edition.ini)
/trunk/includes/classes/OIDplus.class.php
1945,24 → 1945,27
}
 
/**
* @param string $infoFile Path to a changelog.json.php file (It must be in its source code form!)
* @param string|array $infoFile Path or content of a changelog.json.php file (It must be in its source code form!)
* @param bool $allow_dev_version If set to false, then versions ending with "-dev" will be ignored
* @return false|string
*/
public static function getVersion(string $infoFile = __DIR__.'/../../changelog.json.php', bool $allow_dev_version=true) {
static $cachedVersion = [];
if ($cachedVersion[$infoFile] ?? false) {
return $cachedVersion[$infoFile];
}
 
public static function getVersion($infoFile = __DIR__.'/../../changelog.json.php', bool $allow_dev_version=true) {
if (is_array($infoFile)) {
$json = $infoFile;
} else {
if (strlen($infoFile) > 255) {
$cont = $infoFile;
} else {
if ((stripos($infoFile,'http://')===0) || (stripos($infoFile,'https://')===0)) {
$cont = @url_get_contents($infoFile);
} else {
$cont = @file_get_contents($infoFile);
}
}
if ($cont === false) return false;
$json = @json_decode($cont, true);
if ($json === null) return false;
}
$latest_version = false;
foreach ($json as $v) {
if (isset($v['version'])) {
1971,7 → 1974,7
break; // the first item is the latest version
}
}
return ($cachedVersion[$infoFile] = $latest_version);
return $latest_version;
 
/*
 
1981,7 → 1984,7
if (is_dir($svn_dir = OIDplus::findSvnFolder())) {
$ver = get_svn_revision($svn_dir);
if ($ver)
return ($cachedVersion[$infoFile] = 'svn-'.$ver);
return ($cachedVersion[$infoFile] = '2.0.0.'.$ver);
}
}
 
1988,22 → 1991,9
if ($installType === 'git-wc') {
$ver = OIDplus::getGitsvnRevision();
if ($ver)
return ($cachedVersion[$infoFile] = 'svn-'.$ver);
return ($cachedVersion[$infoFile] = '2.0.0.'.$ver);
}
 
if ($installType === 'manual') {
$cont = '';
if (file_exists($filename = OIDplus::localpath().'oidplus_version.txt'))
$cont = file_get_contents($filename);
if (file_exists($filename = OIDplus::localpath().'.version.php'))
$cont = file_get_contents($filename);
$m = array();
if (preg_match('@Revision (\d+)@', $cont, $m)) // do not translate
return ($cachedVersion[$infoFile] = 'svn-'.$m[1]); // do not translate
}
 
return ($cachedVersion[$infoFile] = false); // version ambigous or unknown
 
*/
}
 
/trunk/plugins/viathinksoft/adminPages/100_wellknown_oids/OIDplusPageAdminWellKnownOIDs.class.php
52,7 → 52,9
 
$out['text'] = '<p>'._L('Well-known OIDs are OIDs of Registration Authorities which are assigning OIDs to customers, i.e. they are most likely to be used by OIDplus users as their root OID. Well-known OIDs have the following purposes:').'<ol>';
$out['text'] .= '<li>'._L('When a new OIDplus user creates his root OID into OIDplus, then the ASN.1 identifiers and Unicode labels of the superior OIDs are automatically added.').'</li>';
if (OIDplus::getEditionInfo()['vendor'] == 'ViaThinkSoft') {
$out['text'] .= '<li>'._L('In the automatic oid-info.com publishing, well-known OIDs will not be transmitted (because it is unlikely that RAs of well-known OIDs will be using OIDplus in combination with automatic publishing to oid-info.com). Instead, all children inside these well-known OIDs are most likely to be yours, so these will be reported to oid-info.com instead.').'</li>';
}
// $out['text'] .= '<li>'._L('In OID-WHOIS, if a user requests information about an unknown OID which is inside a well-known OID, then OID-WHOIS will output information at which place more information can be retrieved from.').'</li>';
$out['text'] .= '</ol></p>';
 
/trunk/plugins/viathinksoft/adminPages/400_oidinfo_export/OIDplusPageAdminOIDInfoExport.class.php
644,6 → 644,7
$tabcont .= '<p><input type="button" onclick="window.open(\''.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'oidinfo_export.php?online=1\',\'_blank\')" value="'._L('Generate XML (only OIDs which do not exist at oid-info.com)').'"></p>';
$tabcont .= '<p><a href="http://oid-info.com/submit.htm" target="_blank">'._L('Upload XML files manually to oid-info.com').'</a></p>';
$tabcont .= '<br><p>'._L('Attention: Do not use this XML Export/Import to exchange, backup or restore data between OIDplus systems!<br>It will cause various loss of information, e.g. because Non-OIDs like GUIDs are converted in OIDs and can\'t be converted back.').'</p>';
if (OIDplus::getEditionInfo()['vendor'] == 'ViaThinkSoft') {
$tabcont .= '<h2>'._L('Automatic export to oid-info.com').'</h2>';
$privacy_level = OIDplus::config()->getValue('reg_privacy');
if ($privacy_level == 0) {
651,6 → 652,7
} else {
$tabcont .= '<p>'._L('If you set the privacy option to "0" (your system is registered), then all your OIDs will be automatically exported to oid-info.com.').' (<a '.OIDplus::gui()->link('oidplus:srv_registration').'>'._L('Change preference').'</a>)</p>';
}
}
$tabcont .= '<h2>'._L('Comparison with oid-info.com').'</h2>';
$tabcont .= '<p><a '.OIDplus::gui()->link('oidplus:oidinfo_compare_export').'>'._L('List OIDs in your system which are missing at oid-info.com').'</a></p>';
$out['text'] .= OIDplus::gui()->tabContentPage('export', $tabcont, $tab === 'export');
/trunk/plugins/viathinksoft/adminPages/900_software_update/OIDplusPageAdminSoftwareUpdate.class.php
294,7 → 294,7
}
 
$local_installation = OIDplus::getVersion();
$newest_version = $this->getLatestRevision(false);
$newest_version = $this->getLatestVersion(false);
 
$out['text'] .= _L('Local installation: %1',($local_installation ?: _L('unknown'))).'<br>';
$out['text'] .= _L('Latest published version: %1',($newest_version ?: _L('unknown'))).'<br><br>';
455,8 → 455,6
$tex = str_pad($tex, 48, ' ', STR_PAD_RIGHT);
$content .= trim($tex . str_replace("\n", "\n".str_repeat(' ', strlen($tex)), $comment));
$content .= "\n";
 
 
}
 
return $content;
469,10 → 467,10
* @param bool $allow_dev_version
* @return false|string
*/
private function getLatestRevision(bool $allow_dev_version=true) {
private function getLatestVersion(bool $allow_dev_version=true) {
try {
$master_changelog = OIDplus::getEditionInfo()['master_changelog'];
return OIDplus::getVersion($master_changelog, $allow_dev_version);
$json = $this->changeLogJson();
return OIDplus::getVersion($json, $allow_dev_version);
} catch (\Exception $e) {
return false;
}
549,7 → 547,7
$out_msg = _L('OIDplus could not determine the latest version.').' '.$reason;
} else {
$local_installation = OIDplus::getVersion();
$newest_version = $this->getLatestRevision(false);
$newest_version = $this->getLatestVersion(false);
 
$requireInfo = ($installType === 'svn-wc') ? _L('shell access with svn/svnversion tool, or PDO/SQLite3 PHP extension') : _L('shell access with Git client');
$updateCommand = ($installType === 'svn-wc') ? 'svn update' : 'git pull';
574,7 → 572,7
$out_msg = _L('OIDplus could not determine the latest version.').' '.$reason;
} else {
$local_installation = OIDplus::getVersion();
$newest_version = $this->getLatestRevision(false);
$newest_version = $this->getLatestVersion(false);
 
if (!$newest_version) {
$out_stat = 'WARN';
/trunk/plugins/viathinksoft/adminPages/902_systemfile_check/checksums.json
Cannot display: file marked as a binary type.
svn:mime-type = application/json
/trunk/plugins/viathinksoft/language/dede/messages.xml
2297,7 → 2297,7
Downloading update beginning from version %1 up to %2...
]]></source>
<target><![CDATA[
Updates version %1 bis %2 herunterladen...
Updates für Version %1 nach %2 herunterladen...
]]></target>
</message>
<message>
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php
1335,23 → 1335,36
if (!$objParent) return '';
$parentNS = $objParent::ns();
 
// http://oid-info.com/cgi-bin/display?a=list-by-category&category=Not%20allocating%20identifiers
// http://oid-info.com/cgi-bin/display?a=list-by-category&category=Not%20allocating%20identifiers (15 Nov 2023)
$no_asn1 = array(
'oid:0.2.228',
'oid:1.3.6.1.4.1',
'oid:1.3.6.1.4.1.37476.9000',
'oid:1.3.6.1.4.1.37553.8.8',
'oid:2.16.276.1',
'oid:2.16.756',
'oid:2.16.756.1',
'oid:2.16.756.5'
//'oid:2.25', // according to Olivier, it is OK that UUID owners define their own ASN.1 ID, since the ASN.1 ID is not required to be unique
//'oid:1.2.840.113556.1.8000.2554' // Adhoc (GUID/UUID-based) customer use. It is probably the same case as the UUID OIDs, after all, these are UUIDs, too.
//'oid:1.2.840.113556.1.8000.2554', // Adhoc (GUID/UUID-based) customer use. It is probably the same case as the UUID OIDs, after all, these are UUIDs, too.
//'oid:1.3.6.1.4.1.54392.1', // Another UUID-to-OID method
//'oid:1.3.6.1.4.1.54392.2', // Another UUID-to-OID method
//'oid:1.3.6.1.4.1.54392.3', // Another UUID-to-OID method
);
 
// http://oid-info.com/cgi-bin/display?a=list-by-category&category=Not%20allocating%20Unicode%20labels
// http://oid-info.com/cgi-bin/display?a=list-by-category&category=Not%20allocating%20Unicode%20labels (15 Nov 2023)
$no_iri = array(
'oid:0.2.228',
'oid:1.2.36',
'oid:1.2.250.1',
'oid:1.3',
'oid:1.3.6.1.4.1',
'oid:1.3.6.1.4.1.37476.9000',
'oid:1.3.6.1.4.1.37553.8.8',
'oid:2.16.276.1',
'oid:2.16.756',
'oid:2.16.756.1',
'oid:2.16.756.5',
'oid:2.25'
);