Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 977 → Rev 978

/trunk/TODO
7,10 → 7,6
- a possibility to export&transfer all data between OIDplus'es: Attention: Do not use this XML Export/Import to exchange, backup or restore data between OIDplus systems!
- a possibility to 'construct' my own object types in UI (1: specify list of their fields and 2: choose "oid-like/forward" com.example.api or "domain-like/reverse" api.example.com naming scheme), so they would appear as the whole new type
 
In re OIDplusObject:
- Performance tests with new object cache (which contains more fields e.g. description and comment field)
- After a "delete from ###objects", "update ###objects", or "insert into ###objects", call OIDplusObject::resetObjectInformationCache()
 
Databases:
- Let plugins create tables for all DBMS by including a "create table" function with abstract types in the SQL slang plugins (similar to Medoo)
 
/trunk/includes/classes/OIDplus.class.php
1774,6 → 1774,7
OIDplus::db()->query("update ###log_object set id = ? where id = ?", array($idb, $ida));
OIDplus::logger()->log("[INFO]A!", "Object name '$ida' has been changed to '$idb' during re-canonization");
OIDplus::db()->transaction_commit();
OIDplusObject::resetObjectInformationCache();
}
}
}
/trunk/plugins/viathinksoft/adminPages/400_oidinfo_export/OIDplusPageAdminOIDInfoExport.class.php
966,13 → 966,14
}
}
 
OIDplus::db()->transaction_begin();
 
$obj_test = OIDplusObject::findFitting($id);
if ($obj_test) {
if ($replaceExistingOIDs) {
// TODO: better do this (and the following insert) as transaction
OIDplus::db()->query("delete from ###objects where id = ?", array($id));
OIDplus::db()->query("delete from ###asn1id where oid = ?", array($id));
OIDplus::db()->query("delete from ###iri where oid = ?", array($id));
OIDplus::db()->query("delete from ###objects where id = ?", array($id));
} else {
//$errors[] = "Ignore OID '$dot_notation' because it already exists";
//$count_errors++;
983,6 → 984,9
 
OIDplus::db()->query("insert into ###objects (id, parent, title, description, confidential, ra_email) values (?, ?, ?, ?, ?, ?)", array($id, $parent, $title, $info, 0, $ra));
 
OIDplus::db()->transaction_commit();
OIDplusObject::resetObjectInformationCache();
 
$this_oid_has_warnings = false;
 
// ---------------------------------------------------------------------
1037,7 → 1041,10
}
 
// De-orphanize
//if ($orphan_mode === self::ORPHAN_AUTO_DEORPHAN) OIDplus::db()->query("update ###objects set parent = 'oid:' where parent like 'oid:%' and parent not in (select id from ###objects)");
//if ($orphan_mode === self::ORPHAN_AUTO_DEORPHAN) {
// OIDplus::db()->query("update ###objects set parent = 'oid:' where parent like 'oid:%' and parent not in (select id from ###objects)");
// OIDplusObject::resetObjectInformationCache();
//}
foreach ($ok_oids as $id) {
// De-orphanize if neccessary
if ($orphan_mode === self::ORPHAN_AUTO_DEORPHAN) {
1046,6 → 1053,7
$errors[] = _L("%1 was de-orphaned (placed as root OID) because its parent is not existing.",$id);
$count_warnings++;
OIDplus::db()->query("update ###objects set parent = 'oid:' where id = ? and parent not in (select id from ###objects)", array($id));
OIDplusObject::resetObjectInformationCache();
}
}
 
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php
41,6 → 41,7
private function ra_change_rec($id, $old_ra, $new_ra) {
if (is_null($old_ra)) $old_ra = '';
OIDplus::db()->query("update ###objects set ra_email = ?, updated = ".OIDplus::db()->sqlDate()." where id = ? and ".OIDplus::db()->getSlang()->isNullFunction('ra_email',"''")." = ?", array($new_ra, $id, $old_ra));
OIDplusObject::resetObjectInformationCache();
 
$res = OIDplus::db()->query("select id from ###objects where parent = ? and ".OIDplus::db()->getSlang()->isNullFunction('ra_email',"''")." = ?", array($id, $old_ra));
while ($row = $res->fetch_array()) {
83,6 → 84,7
 
// Delete object
OIDplus::db()->query("delete from ###objects where id = ?", array($id));
OIDplusObject::resetObjectInformationCache();
 
// Delete orphan stuff
foreach (OIDplus::getEnabledObjectTypes() as $ot) {
96,6 → 98,7
$id_to_delete = $row['id'];
OIDplus::logger()->log("[CRIT]OIDRA($id_to_delete)!", "Lost ownership of object '$id_to_delete' because one of the superior objects ('$id') was recursively deleted");
OIDplus::db()->query("delete from ###objects where id = ?", array($id_to_delete));
OIDplusObject::resetObjectInformationCache();
}
} while (true);
}
211,14 → 214,17
if (isset($params['confidential'])) {
$confidential = $params['confidential'] == 'true';
OIDplus::db()->query("UPDATE ###objects SET confidential = ? WHERE id = ?", array($confidential, $id));
OIDplusObject::resetObjectInformationCache();
}
 
if (isset($params['comment'])) {
$comment = $params['comment'];
OIDplus::db()->query("UPDATE ###objects SET comment = ? WHERE id = ?", array($comment, $id));
OIDplusObject::resetObjectInformationCache();
}
 
OIDplus::db()->query("UPDATE ###objects SET updated = ".OIDplus::db()->sqlDate()." WHERE id = ?", array($id));
OIDplusObject::resetObjectInformationCache();
 
$status = 0;
 
271,14 → 277,17
if (isset($params['title'])) {
$title = $params['title'];
OIDplus::db()->query("UPDATE ###objects SET title = ? WHERE id = ?", array($title, $id));
OIDplusObject::resetObjectInformationCache();
}
 
if (isset($params['description'])) {
$description = $params['description'];
OIDplus::db()->query("UPDATE ###objects SET description = ? WHERE id = ?", array($description, $id));
OIDplusObject::resetObjectInformationCache();
}
 
OIDplus::db()->query("UPDATE ###objects SET updated = ".OIDplus::db()->sqlDate()." WHERE id = ?", array($id));
OIDplusObject::resetObjectInformationCache();
 
foreach (OIDplus::getPagePlugins() as $plugin) {
if ($plugin->implementsFeature('1.3.6.1.4.1.37476.2.5.2.3.3')) {
403,6 → 412,7
}
 
OIDplus::db()->query("INSERT INTO ###objects (id, parent, ra_email, confidential, comment, created, title, description) VALUES (?, ?, ?, ?, ?, ".OIDplus::db()->sqlDate().", ?, ?)", array($id, $parent, $ra_email, $confidential, $comment, $title, $description));
OIDplusObject::resetObjectInformationCache();
 
// Set ASN.1 IDs und IRIs
if ($obj::ns() == 'oid') {
/trunk/plugins/viathinksoft/publicPages/200_viathinksoft_freeoid/OIDplusPagePublicFreeOID.class.php
142,6 → 142,7
}
 
OIDplus::db()->query("insert into ###objects (id, ra_email, parent, title, description, confidential, created) values (?, ?, ?, ?, ?, ?, ".OIDplus::db()->sqlDate().")", array('oid:'.$new_oid, $email, self::getFreeRootOid(true), $title, $description, false));
OIDplusObject::resetObjectInformationCache();
} catch (Exception $e) {
$ra->delete();
throw $e;
/trunk/plugins/viathinksoft/raPages/102_change_email/OIDplusPageRaChangeEMail.class.php
71,6 → 71,7
OIDplus::logger()->log("[INFO]OID(".$row['id'].")+SUPOID(".$row['id'].")", "Admin changed email address of RA '$old_email' (owner of ".$row['id'].") to '$new_email'");
}
OIDplus::db()->query("update ###objects set ra_email = ? where ra_email = ?", array($new_email, $old_email));
OIDplusObject::resetObjectInformationCache();
 
// Re-login
if ($ra_was_logged_in) {
158,6 → 159,7
OIDplus::logger()->log("[INFO]OID(".$row['id'].")+SUPOID(".$row['id'].")", "RA '$old_email' (owner of ".$row['id'].") has changed their email address to '$new_email'");
}
OIDplus::db()->query("update ###objects set ra_email = ? where ra_email = ?", array($new_email, $old_email));
OIDplusObject::resetObjectInformationCache();
 
// Re-login
if ($ra_was_logged_in) {