Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1448 → Rev 1449

/trunk/plugins/frdl/publicPages/altids/OIDplusPagePublicAltIds.class.php
139,6 → 139,24
}
 
/**
* Acts like in_array(), but allows includes prefilterQuery, e.g. `mac:AA-BB-CC-DD-EE-FF` can be found in an array containing `mac:AABBCCDDEEFF`.
* @param string $needle
* @param array $haystack
* @return bool
*/
private static function special_in_array(string $needle, array $haystack) {
$needle_prefiltered = OIDplus::prefilterQuery($needle,false);
foreach ($haystack as $straw) {
$straw_prefiltered = OIDplus::prefilterQuery($straw, false);
if ($needle == $straw) return true;
else if ($needle == $straw_prefiltered) return true;
else if ($needle_prefiltered == $straw) return true;
else if ($needle_prefiltered == $straw_prefiltered) return true;
}
return false;
}
 
/**
* @param string $id
* @return string[]
* @throws \ViaThinkSoft\OIDplus\OIDplusException
167,7 → 185,14
$res = array_merge($res, $rev_lookup[$id]);
}
foreach($alt_ids as $original => $altIds){
if($id === $original || in_array($id, $altIds) ){
// Why self::special_in_array() instead of in_array()? Consider the following testcase:
// "oid:1.3.6.1.4.1.37553.8.8.2" defines alt ID "mac:63-CF-E4-AE-C5-66" which is NOT canonized!
// You must be able to enter "mac:63-CF-E4-AE-C5-66" in the search box, which gets canonized
// to mac:63CFE4AEC566 and must be solved to "oid:1.3.6.1.4.1.37553.8.8.2" by this plugin.
// Therefore we use self::special_in_array().
// However, it is mandatory, that previously saveAltIdsForQuery("oid:1.3.6.1.4.1.37553.8.8.2") was called once!
// Please also note that the "weid:" to "oid:" converting is handled by prefilterQuery(), but only if the OID plugin is installed.
if($id === $original || self::special_in_array($id, $altIds) ){
$res = array_merge($res, $altIds);
$res = array_merge($res, [$original]);
}
/trunk/plugins/frdl/publicPages/altids/manifest.xml
10,7 → 10,7
<name>AltIds Tracking and Reverse Lookup</name>
<author>Frdlweb</author>
<license>MIT</license>
<version>1.0.3+viathinksoft20231226</version>
<version>1.0.3+viathinksoft20240121</version>
<descriptionHTML>
<![CDATA[
<a href="https://github.com/frdl/oidplus-plugin-alternate-id-tracking" target="_blank">AltIds Tracking and Reverse Lookup</a><br/>
/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
721,7 → 721,7
Attention: In case you are cloning a system, e.g. in order to create a staging environment, please DO NOT copy the private key, as this would cause two systems to have the same System ID.
]]></source>
<target><![CDATA[
Achtung: Falls Sie ein System klonen möchten, z.B. um eine Test-Umgebung einzurichten, kopieren Sie bitte NICHT den Privaten Schlüssel, da dies dazu führen würde, dass zwei Systeme die gleiche System ID erhalten würden.
Achtung: Falls Sie ein System klonen möchten, z.B. um eine Test-Umgebung einzurichten, kopieren Sie bitte NICHT den privaten Schlüssel, da dies dazu führen würde, dass zwei Systeme die gleiche System ID erhalten würden.
]]></target>
</message>
<message>
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php
1428,7 → 1428,7
$max_ent = 0;
while ($row = $result->fetch_object()) {
$max_ent++;
if ($max_ent > 1000) return _L('There are too many child items to display'); // TODO: we need to find a solution for this!!!
if ($max_ent > 1000) break; // TODO: we need to find a solution for this!!!
$obj = OIDplusObject::parse($row->id);
if ($obj) $rows[] = array($obj,$row);
}
1596,6 → 1596,8
$output .= '<p>'._L('%1 items are hidden. Please <a %2>log in</a> to see them.',$items_hidden,OIDplus::gui()->link('oidplus:login')).'</p>';
}
 
if ($max_ent > 1000) $output .= '<p>'._L('There are too many child items to display') . '</p>'; // TODO: we need to find a solution for this!!!
 
return $output;
}