/trunk/ajax.php |
---|
143,7 → 143,7 |
OIDplus::db()->query("delete from ".OIDPLUS_TABLENAME_PREFIX."objects where id = ?", array($id)); |
// Delete orphan stuff |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
do { |
$res = OIDplus::db()->query("select id from ".OIDPLUS_TABLENAME_PREFIX."objects where parent <> ? and parent like ? and parent not in (select id from ".OIDPLUS_TABLENAME_PREFIX."objects where id like ?)", array($ot::root(), $ot::root().'%', $ot::root().'%')); |
/trunk/img/object_big.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/includes/classes/OIDplusDataBase.class.php |
---|
File deleted |
/trunk/includes/classes/OIDplus.class.php |
---|
22,21 → 22,15 |
class OIDplus { |
private static /*OIDplusPagePlugin[][]*/ $pagePlugins = array(); |
private static /*OIDplusAuthPlugin[][]*/ $authPlugins = array(); |
private static /*OIDplusObject[]*/ $objectTypes = array(); |
private static /*OIDplusObject[]*/ $disabledObjectTypes = array(); |
private static /*OIDplusDatabase[]*/ $dbPlugins = array(); |
private static /*OIDplusObjectTypePlugin[]*/ $objectTypePlugins = array(); |
private static /*string[]*/ $enabledObjectTypes = array(); |
private static /*string[]*/ $disabledObjectTypes = array(); |
private static /*OIDplusDatabasePlugin[]*/ $dbPlugins = array(); |
private function __construct() { |
} |
public static function db() { |
if (!isset(self::$dbPlugins[OIDPLUS_DATABASE_PLUGIN])) { |
throw new Exception("Database plugin '".htmlentities(OIDPLUS_DATABASE_PLUGIN)."' not found. Please check config.inc.php or run <a href=\"setup/\">setup</a> again."); |
} |
$obj = self::$dbPlugins[OIDPLUS_DATABASE_PLUGIN]; |
if (!$obj->isConnected()) $obj->connect(); |
return $obj; |
} |
# --- Singleton classes |
public static function config() { |
static $config = null; |
78,34 → 72,9 |
return $sesHandler; |
} |
public static function system_url($relative=false) { |
if (!isset($_SERVER["REQUEST_URI"])) return false; |
# --- Database Plugin |
$test_dir = dirname($_SERVER['SCRIPT_FILENAME']); |
$c = 0; |
while (!file_exists($test_dir.'/oidplus_base.js')) { |
$test_dir = dirname($test_dir); |
$c++; |
if ($c == 1000) return false; |
} |
$res = dirname($_SERVER['REQUEST_URI'].'xxx'); |
for ($i=1; $i<=$c; $i++) { |
$res = dirname($res); |
} |
if ($res == '/') $res = ''; |
$res .= '/'; |
if (!$relative) { |
$res = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]" . $res; // TODO: also add port? |
} |
return $res; |
} |
private static function registerDatabasePlugin(OIDplusDatabase $plugin) { |
private static function registerDatabasePlugin(OIDplusDatabasePlugin $plugin) { |
$name = $plugin->name(); |
if ($name === false) return false; |
118,6 → 87,17 |
return self::$dbPlugins; |
} |
public static function db() { |
if (!isset(self::$dbPlugins[OIDPLUS_DATABASE_PLUGIN])) { |
throw new Exception("Database plugin '".htmlentities(OIDPLUS_DATABASE_PLUGIN)."' not found. Please check config.inc.php or run <a href=\"setup/\">setup</a> again."); |
} |
$obj = self::$dbPlugins[OIDPLUS_DATABASE_PLUGIN]; |
if (!$obj->isConnected()) $obj->connect(); |
return $obj; |
} |
# --- Page plugin |
private static function registerPagePlugin(OIDplusPagePlugin $plugin) { |
$type = $plugin->type(); |
if ($type === false) return false; |
131,11 → 111,6 |
return true; |
} |
private static function registerAuthPlugin(OIDplusAuthPlugin $plugin) { |
self::$authPlugins[] = $plugin; |
return true; |
} |
public static function getPagePlugins($type) { |
if ($type == '*') { |
$res = array(); |
149,10 → 124,28 |
return $res; |
} |
# --- Auth plugin |
private static function registerAuthPlugin(OIDplusAuthPlugin $plugin) { |
self::$authPlugins[] = $plugin; |
return true; |
} |
public static function getAuthPlugins() { |
return self::$authPlugins; |
} |
# --- Object type plugin |
private static function registerObjectTypePlugin(OIDplusObjectTypePlugin $plugin) { |
self::$objectTypePlugins[] = $plugin; |
$ot = $plugin::getObjectTypeClassName(); |
self::registerObjectType($ot); |
return true; |
} |
private static function registerObjectType($ot) { |
$ns = $ot::ns(); |
159,7 → 152,7 |
if (empty($ns)) die("Attention: Empty NS at $ot\n"); |
$ns_found = false; |
foreach (OIDplus::getRegisteredObjectTypes() as $test_ot) { |
foreach (array_merge(OIDplus::getEnabledObjectTypes(), OIDplus::getDisabledObjectTypes()) as $test_ot) { |
if ($test_ot::ns() == $ns) { |
$ns_found = true; |
break; |
189,8 → 182,8 |
} |
if ($do_enable) { |
self::$objectTypes[] = $ot; |
usort(self::$objectTypes, function($a, $b) { |
self::$enabledObjectTypes[] = $ot; |
usort(self::$enabledObjectTypes, function($a, $b) { |
$enabled = OIDplus::config()->getValue("objecttypes_enabled"); |
$enabled_ary = explode(';', $enabled); |
219,70 → 212,38 |
} |
} |
public static function getRegisteredObjectTypes() { |
return self::$objectTypes; |
public static function getObjectTypePlugins() { |
return self::$objectTypePlugins; |
} |
public static function getDisabledObjectTypes() { |
return self::$disabledObjectTypes; |
public static function getObjectTypePluginsEnabled() { |
$res = array(); |
foreach (self::$objectTypePlugins as $plugin) { |
$ot = $plugin::getObjectTypeClassName(); |
if (in_array($ot, self::$enabledObjectTypes)) $res[] = $plugin; |
} |
return $res; |
} |
private static $system_id_cache = null; |
public static function system_id($oid=false) { |
if (!is_null(self::$system_id_cache)) { |
$out = self::$system_id_cache; |
} else { |
$out = false; |
if (self::pkiStatus(true)) { |
$pubKey = OIDplus::config()->getValue('oidplus_public_key'); |
if (preg_match('@BEGIN PUBLIC KEY\-+(.+)\-+END PUBLIC KEY@ismU', $pubKey, $m)) { |
$out = smallhash(base64_decode($m[1])); |
public static function getObjectTypePluginsDisabled() { |
$res = array(); |
foreach (self::$objectTypePlugins as $plugin) { |
$ot = $plugin::getObjectTypeClassName(); |
if (in_array($ot, self::$disabledObjectTypes)) $res[] = $plugin; |
} |
return $res; |
} |
self::$system_id_cache = $out; |
} |
return ($oid ? '1.3.6.1.4.1.37476.30.9.' : '').$out; |
} |
public static function pkiStatus($try_generate=true) { |
if (!function_exists('openssl_pkey_new')) return false; |
$privKey = OIDplus::config()->getValue('oidplus_private_key'); |
$pubKey = OIDplus::config()->getValue('oidplus_public_key'); |
if ($try_generate && !verify_private_public_key($privKey, $pubKey)) { |
OIDplus::logger()->log("A!", "Generating new SystemID using a new key pair"); |
$config = array( |
"digest_alg" => "sha512", |
"private_key_bits" => 2048, |
"private_key_type" => OPENSSL_KEYTYPE_RSA, |
); |
// Create the private and public key |
$res = openssl_pkey_new($config); |
// Extract the private key from $res to $privKey |
openssl_pkey_export($res, $privKey); |
// Extract the public key from $res to $pubKey |
$pubKey = openssl_pkey_get_details($res)["key"]; |
// Save the key pair to database |
OIDplus::config()->setValue('oidplus_private_key', $privKey); |
OIDplus::config()->setValue('oidplus_public_key', $pubKey); |
// Log the new system ID |
if (preg_match('@BEGIN PUBLIC KEY\-+(.+)\-+END PUBLIC KEY@ismU', $pubKey, $m)) { |
$system_id = smallhash(base64_decode($m[1])); |
OIDplus::logger()->log("A!", "Your SystemID is now $system_id"); |
public static function getEnabledObjectTypes() { |
return self::$enabledObjectTypes; |
} |
} |
return verify_private_public_key($privKey, $pubKey); |
public static function getDisabledObjectTypes() { |
return self::$disabledObjectTypes; |
} |
# --- Initialization of OIDplus |
public static function init($html=true) { |
define('OIDPLUS_HTML_OUTPUT', $html); |
336,7 → 297,7 |
foreach ($ary as $a) include $a; |
foreach (get_declared_classes() as $c) { |
if (is_subclass_of($c, 'OIDplusDataBase')) { |
if (is_subclass_of($c, 'OIDplusDataBasePlugin')) { |
self::registerDatabasePlugin(new $c()); |
} |
} |
355,7 → 316,7 |
// Initialize public / private keys |
OIDplus::pkiStatus(true); |
OIDplus::getPkiStatus(true); |
// Register plugins |
379,8 → 340,8 |
if (is_subclass_of($c, 'OIDplusAuthPlugin')) { |
self::registerAuthPlugin(new $c()); |
} |
if (is_subclass_of($c, 'OIDplusObject')) { |
self::registerObjectType($c); |
if (is_subclass_of($c, 'OIDplusObjectTypePlugin')) { |
self::registerObjectTypePlugin(new $c()); |
} |
} |
391,6 → 352,91 |
} |
} |
# --- System URL, System ID, PKI, and other functions |
public static function getSystemUrl($relative=false) { |
if (!isset($_SERVER["SCRIPT_NAME"])) return false; |
$test_dir = dirname($_SERVER['SCRIPT_FILENAME']); |
$c = 0; |
while (!file_exists($test_dir.'/oidplus_base.js')) { |
$test_dir = dirname($test_dir); |
$c++; |
if ($c == 1000) return false; |
} |
$res = dirname($_SERVER['SCRIPT_NAME'].'xxx'); |
for ($i=1; $i<=$c; $i++) { |
$res = dirname($res); |
} |
if ($res == '/') $res = ''; |
$res .= '/'; |
if (!$relative) { |
$res = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]" . $res; // TODO: also add port? |
} |
return $res; |
} |
private static $system_id_cache = null; |
public static function getSystemId($oid=false) { |
if (!is_null(self::$system_id_cache)) { |
$out = self::$system_id_cache; |
} else { |
$out = false; |
if (self::getPkiStatus(true)) { |
$pubKey = OIDplus::config()->getValue('oidplus_public_key'); |
if (preg_match('@BEGIN PUBLIC KEY\-+(.+)\-+END PUBLIC KEY@ismU', $pubKey, $m)) { |
$out = smallhash(base64_decode($m[1])); |
} |
} |
self::$system_id_cache = $out; |
} |
return ($oid ? '1.3.6.1.4.1.37476.30.9.' : '').$out; |
} |
public static function getPkiStatus($try_generate=true) { |
if (!function_exists('openssl_pkey_new')) return false; |
$privKey = OIDplus::config()->getValue('oidplus_private_key'); |
$pubKey = OIDplus::config()->getValue('oidplus_public_key'); |
if ($try_generate && !verify_private_public_key($privKey, $pubKey)) { |
OIDplus::logger()->log("A!", "Generating new SystemID using a new key pair"); |
$config = array( |
"digest_alg" => "sha512", |
"private_key_bits" => 2048, |
"private_key_type" => OPENSSL_KEYTYPE_RSA, |
); |
// Create the private and public key |
$res = openssl_pkey_new($config); |
// Extract the private key from $res to $privKey |
openssl_pkey_export($res, $privKey); |
// Extract the public key from $res to $pubKey |
$pubKey = openssl_pkey_get_details($res)["key"]; |
// Save the key pair to database |
OIDplus::config()->setValue('oidplus_private_key', $privKey); |
OIDplus::config()->setValue('oidplus_public_key', $pubKey); |
// Log the new system ID |
if (preg_match('@BEGIN PUBLIC KEY\-+(.+)\-+END PUBLIC KEY@ismU', $pubKey, $m)) { |
$system_id = smallhash(base64_decode($m[1])); |
OIDplus::logger()->log("A!", "Your SystemID is now $system_id"); |
} |
} |
return verify_private_public_key($privKey, $pubKey); |
} |
public static function getInstallType() { |
if (!file_exists(__DIR__ . '/../../oidplus_version.txt') && !is_dir(__DIR__ . '/../../.svn')) { |
return 'unknown'; |
444,7 → 490,7 |
$timeout = 2; |
$already_ssl = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == "on"); |
$ssl_port = 443; |
$cookie_path = OIDplus::system_url(true); |
$cookie_path = OIDplus::getSystemUrl(true); |
if (empty($cookie_path)) $cookie_path = '/'; |
if (php_sapi_name() == 'cli') return false; |
/trunk/includes/classes/OIDplusConfig.class.php |
---|
121,7 → 121,7 |
foreach ($ary as $ot_check) { |
$ns_found = false; |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
if ($ot::ns() == $ot_check) { |
$ns_found = true; |
break; |
/trunk/includes/classes/OIDplusDataBasePlugin.class.php |
---|
0,0 → 1,96 |
<?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. |
*/ |
if (!defined('IN_OIDPLUS')) die(); |
abstract class OIDplusDataBasePlugin extends OIDplusPlugin { |
protected $connected = false; |
public abstract static function name(); |
public abstract function query($sql, $prepared_args=null); |
public abstract function num_rows($res); |
public abstract function fetch_array($res); |
public abstract function fetch_object($res); |
public abstract function insert_id(); |
public abstract function error(); |
public abstract function transaction_begin(); |
public abstract function transaction_commit(); |
public abstract function transaction_rollback(); |
// TODO: better create some kind of Object-Type-API that does the sorting. But this means, the sorting won't be done with SQL |
public function natOrder($fieldname, $maxdepth=100) { // TODO: also "desc" and "asc" support? |
/* |
CREATE FUNCTION SPLIT_STRING(str VARCHAR(255), delim VARCHAR(12), pos INT) |
RETURNS VARCHAR(255) |
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(str, delim, pos), |
LENGTH(SUBSTRING_INDEX(str, delim, pos-1)) + 1), delim, ''); |
*/ |
$out = array(); |
$out[] = "(REPLACE(SUBSTRING(SUBSTRING_INDEX($fieldname, ':', 1),LENGTH(SUBSTRING_INDEX($fieldname, ':', 0)) + 1),':', '')) asc"; // first sort by NS (namespace) |
for ($i=1; $i<=$maxdepth; $i++) { |
// $out[] = "LENGTH(SPLIT_STRING($fieldname, '.', $i) asc"; |
// $out[] = "SPLIT_STRING($fieldname, '.', $i) asc"; |
$out[] = "LENGTH(REPLACE(SUBSTRING(SUBSTRING_INDEX($fieldname, '.', $i),LENGTH(SUBSTRING_INDEX($fieldname, '.', $i-1)) + 1),'.', '')) asc"; |
$out[] = "(REPLACE(SUBSTRING(SUBSTRING_INDEX($fieldname, '.', $i),LENGTH(SUBSTRING_INDEX($fieldname, '.', $i-1)) + 1),'.', '')) asc"; |
} |
return implode(', ', $out); |
} |
protected function afterConnect($html) { |
// Check if database tables are existing |
$table_names = array('objects', 'asn1id', 'iri', 'ra', 'config'); |
foreach ($table_names as $tablename) { |
if (!$this->query("DESCRIBE ".OIDPLUS_TABLENAME_PREFIX.$tablename)) { |
if ($html) { |
echo '<h1>Error</h1><p>Table <b>'.OIDPLUS_TABLENAME_PREFIX.$tablename.'</b> does not exist.</p>'; |
if (is_dir(__DIR__.'/../../../setup')) { |
echo '<p>Please run <a href="setup/">setup</a> again.</p>'; |
} |
} else { |
echo 'Error: Table '.OIDPLUS_TABLENAME_PREFIX.$tablename.' does not exist.'; |
if (is_dir(__DIR__.'/../../../setup')) { |
echo ' Please run setup again.'; |
} |
} |
die(); |
} |
} |
// Do the database table tables need an update? |
// Note: The config setting "database_version" is inserted in setup/sql/...sql, not in the OIDplus core init |
$res = $this->query("SELECT value FROM ".OIDPLUS_TABLENAME_PREFIX."config WHERE name = 'database_version'"); |
$row = $this->fetch_array($res); |
$version = $row['value']; |
if ($version == 200) { |
$this->transaction_begin(); |
$this->query("ALTER TABLE ".OIDPLUS_TABLENAME_PREFIX."objects ADD comment varchar(255) NULL"); |
$version = 201; |
$this->query("UPDATE ".OIDPLUS_TABLENAME_PREFIX."config SET value = '$version' WHERE name = 'database_version'"); |
$this->transaction_commit(); |
} |
} |
public function isConnected() { |
return $this->connected; |
} |
} |
/trunk/includes/classes/OIDplusGui.class.php |
---|
277,7 → 277,7 |
$res = null; |
$row = null; |
$matches_any_registered_type = false; |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
if ($obj = $ot::parse($id)) { |
$matches_any_registered_type = true; |
if ($obj->isRoot()) { |
295,6 → 295,7 |
return $out; |
} else { |
$obj->getContentPage($out['title'], $out['text'], $out['icon']); |
if (empty($out['title'])) $out['title'] = explode(':',$id,2)[1]; |
$parent = $obj->getParent(); |
break; |
} |
/trunk/includes/classes/OIDplusObject.class.php |
---|
23,10 → 23,10 |
define('UUID_NAMEBASED_NS_OidPlusMisc', 'ad1654e6-7e15-11e4-9ef6-78e3b5fc7f22'); |
abstract class OIDplusObject extends OIDplusPlugin { |
abstract class OIDplusObject { |
public static function parse($node_id) { // please overwrite this function! |
// TODO: in case we are not calling this class directly, check if function is overwritten and throw exception otherwise |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
if ($obj = $ot::parse($node_id)) return $obj; |
} |
return null; |
39,7 → 39,7 |
if ($this->ns() != 'oid') { |
// Creates an OIDplus-Hash-OID |
// If the object type has a better way of defining an OID, please override this method! |
$sid = OIDplus::system_id(true); |
$sid = OIDplus::getSystemId(true); |
if (!empty($sid)) { |
$oid = $sid . '.' . smallhash($this->nodeId()); |
$ids[] = array('oid', $oid, 'OIDplus Information Object ID'); |
/trunk/includes/classes/OIDplusObjectTypePlugin.class.php |
---|
0,0 → 1,27 |
<?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. |
*/ |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusObjectTypePlugin extends OIDplusPlugin { |
public static function getObjectTypeClassName() {} |
} |
/trunk/includes/classes/OIDplusSessionHandler.class.php |
---|
39,7 → 39,7 |
// Uses a secure connection (HTTPS) if possible |
@ini_set('session.cookie_secure', OIDPLUS_SSL_AVAILABLE); |
$path = OIDplus::system_url(true); |
$path = OIDplus::getSystemUrl(true); |
if (!empty($path)) { |
@ini_set('session.cookie_path', $path); |
} |
/trunk/includes/oidplus.inc.php |
---|
49,7 → 49,8 |
require_once __DIR__ . '/classes/OIDplusPlugin.class.php'; |
require_once __DIR__ . '/classes/OIDplusAuthPlugin.class.php'; |
require_once __DIR__ . '/classes/OIDplusPagePlugin.class.php'; |
require_once __DIR__ . '/classes/OIDplusDataBase.class.php'; |
require_once __DIR__ . '/classes/OIDplusDataBasePlugin.class.php'; |
require_once __DIR__ . '/classes/OIDplusObjectTypePlugin.class.php'; |
require_once __DIR__ . '/classes/OIDplusConfig.class.php'; |
require_once __DIR__ . '/classes/OIDplusGui.class.php'; |
require_once __DIR__ . '/classes/OIDplusTree.class.php'; |
/trunk/index.php |
---|
77,11 → 77,11 |
} |
} |
$sysid_oid = OIDplus::system_id(true); |
$sysid_oid = OIDplus::getSystemId(true); |
if (!$sysid_oid) $sysid_oid = 'unknown'; |
header('X-OIDplus-SystemID:'.$sysid_oid); |
$sys_url = OIDplus::system_url(); |
$sys_url = OIDplus::getSystemUrl(); |
header('X-OIDplus-SystemURL:'.$sys_url); |
$sys_ver = OIDplus::getVersion(); |
/trunk/plugins/adminPages/120_registration/plugin.inc.php |
---|
70,6 → 70,10 |
$out['text'] = file_get_contents(__DIR__ . '/info.tpl'). |
'<p><input type="button" onclick="openOidInPanel(\'oidplus:srvreg_status\');" value="Check status of the registration and collected data"></p>'; |
if (defined('REGISTRATION_HIDE_SYSTEM') && REGISTRATION_HIDE_SYSTEM) { |
$out['text'] .= '<p><font color="red"><b>Attention!</b> <code>REGISTRATION_HIDE_SYSTEM</code> is set in the local configuration file! Therefore, this system will not register itself, despire the settings below.</font></p>'; |
} |
if (!function_exists('openssl_sign')) { |
$out['text'] .= '<p><font color="red">Error: OpenSSL plugin is missing in PHP. You cannot (un)register your OIDplus instance.</font></p>'; |
} else { |
122,7 → 126,7 |
$payload = array( |
"query" => $query, // we must repeat the query because we want to sign it |
"system_id" => OIDplus::system_id(false) |
"system_id" => OIDplus::getSystemId(false) |
); |
$signature = ''; |
156,7 → 160,7 |
$privacy_level = OIDplus::config()->getValue('reg_privacy'); |
} |
$system_url = OIDplus::system_url(); |
$system_url = OIDplus::getSystemUrl(); |
// It is very important that we set the ping time NOW, because ViaThinkSoft might contact us during the ping, |
// and this would cause an endless loop! |
165,12 → 169,12 |
if ($privacy_level == 2) { |
// The user wants to unregister |
// but we only unregister if we are registered. Check this "anonymously" (i.e. without revealing our system ID) |
if (in_array(OIDplus::system_id(false), explode(';',file_get_contents('https://oidplus.viathinksoft.com/reg2/query.php?query='.QUERY_LISTALLSYSTEMIDS_V1)))) { |
if (in_array(OIDplus::getSystemId(false), explode(';',file_get_contents('https://oidplus.viathinksoft.com/reg2/query.php?query='.QUERY_LISTALLSYSTEMIDS_V1)))) { |
$query = QUERY_UNREGISTER_V1; |
$payload = array( |
"query" => $query, // we must repeat the query because we want to sign it |
"system_id" => OIDplus::system_id(false) |
"system_id" => OIDplus::getSystemId(false) |
); |
$signature = ''; |
210,7 → 214,7 |
$query = QUERY_REGISTER_V1; |
$root_oids = array(); |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
if ($ot::ns() == 'oid') { |
$res = OIDplus::db()->query("select id from ".OIDPLUS_TABLENAME_PREFIX."objects where " . |
"parent = 'oid:' " . |
223,7 → 227,7 |
$payload = array( |
"query" => $query, // we must repeat the query because we want to sign it |
"privacy_level" => $privacy_level, |
"system_id" => OIDplus::system_id(false), |
"system_id" => OIDplus::getSystemId(false), |
"public_key" => OIDplus::config()->getValue('oidplus_public_key'), |
"system_url" => $system_url, |
"hide_system_url" => 0, |
262,7 → 266,7 |
OIDplus::config()->setValue('oidplus_public_key', ''); |
// Try to generate a new system ID |
OIDplus::pkiStatus(true); |
OIDplus::getPkiStatus(true); |
// Enforce a new registration attempt at the next run |
// We will not try again here, because that might lead to an endless loop if the VTS server would always return 'HASH_CONFLCIT' |
282,12 → 286,12 |
// REGISTRATION_HIDE_SYSTEM is an undocumented constant that can be put in the config.inc.php files of a test system accessing the same database as the productive system that is registered. |
// This avoids that the URL of the productive system is overridden with the test system URL (since they use the same database, they also have the same system ID) |
if (function_exists('openssl_sign') && !defined('REGISTRATION_HIDE_SYSTEM')) { |
if (function_exists('openssl_sign') && (!defined('REGISTRATION_HIDE_SYSTEM') || !REGISTRATION_HIDE_SYSTEM)) { |
// Show registration wizard once |
if ($html && (OIDplus::config()->getValue('reg_wizard_done') != '1')) { |
if (basename($_SERVER['SCRIPT_NAME']) != 'registration.php') { |
if ($system_url = OIDplus::system_url()) { |
if ($system_url = OIDplus::getSystemUrl()) { |
header('Location:'.$system_url.'plugins/'.basename(dirname(__DIR__)).'/'.basename(__DIR__).'/registration.php'); |
} else { |
header('Location:plugins/'.basename(dirname(__DIR__)).'/'.basename(__DIR__).'/registration.php'); |
/trunk/plugins/adminPages/120_registration/registration.php |
---|
68,7 → 68,7 |
echo '</noscript>'; |
echo '<script> grecaptcha.render(document.getElementById("g-recaptcha"), { "sitekey" : "'.RECAPTCHA_PUBLIC.'" }); </script>'; |
echo '<p>Before logging in, please solve the following CAPTCHA</p>'; |
echo '<p>If the CAPTCHA does not work (e.g. because of wrong keys, please run <a href="<?php echo OIDplus::system_url(); ?>setup/">setup part 1</a> again or edit includes/config.inc.php).</p>'; |
echo '<p>If the CAPTCHA does not work (e.g. because of wrong keys, please run <a href="<?php echo OIDplus::getSystemUrl(); ?>setup/">setup part 1</a> again or edit includes/config.inc.php).</p>'; |
echo '<div id="g-recaptcha" class="g-recaptcha" data-sitekey="'.RECAPTCHA_PUBLIC.'"></div>'; |
if (isset($_REQUEST['sent'])) { |
89,7 → 89,7 |
<p>Please enter the administrator password you have entered before.</p> |
<p><input type="password" name="admin_password" value=""> (<a href="<?php echo OIDplus::system_url(); ?>setup/">Forgot?</a>) <?php |
<p><input type="password" name="admin_password" value=""> (<a href="<?php echo OIDplus::getSystemUrl(); ?>setup/">Forgot?</a>) <?php |
if (isset($_REQUEST['sent'])) { |
if (!OIDplusAuthUtils::adminCheckPassword($_REQUEST['admin_password'])) { |
157,7 → 157,7 |
$enabled_ary = array(); |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
echo '<input type="checkbox" name="enable_ot_'.$ot::ns().'" id="enable_ot_'.$ot::ns().'"'; |
if (isset($_REQUEST['sent'])) { |
if (isset($_REQUEST['enable_ot_'.$ot::ns()])) { |
283,7 → 283,7 |
<p><u>Your OIDplus system ID (derived from the public key) is:</u></p> |
1.3.6.1.4.1.37476.30.9.<b><?php |
echo htmlentities(OIDplus::system_id()); |
echo htmlentities(OIDplus::getSystemId()); |
?></b> |
<p><u>Your public key is</u></p> |
/trunk/plugins/adminPages/400_oidinfo_export/oidinfo_export.php |
---|
30,7 → 30,7 |
#echo "You need to log in as administrator.\n"; |
#die(); |
} else { |
echo '<p>You need to <a href="'.OIDplus::system_url().'?goto=oidplus:login">log in</a> as administrator.</p>'; |
echo '<p>You need to <a href="'.OIDplus::getSystemUrl().'?goto=oidplus:login">log in</a> as administrator.</p>'; |
die(); |
} |
} |
/trunk/plugins/adminPages/400_oidinfo_export/plugin.inc.php |
---|
159,7 → 159,7 |
$elements['information'] .= '<br/><br/>'; |
} |
$elements['information'] .= 'See <a href="'.OIDplus::system_url(false).'?goto='.urlencode($id).'">more information</a>.'; // TODO: system_url() geht nicht bei CLI |
$elements['information'] .= 'See <a href="'.OIDplus::getSystemUrl(false).'?goto='.urlencode($id).'">more information</a>.'; // TODO: system_url() geht nicht bei CLI |
if (explode(':',$id,2)[0] != 'oid') { |
$elements['information'] = "Object: $id\n\n" . $elements['information']; |
268,7 → 268,7 |
if (stripos($url,'www.') === 0) { |
$url .= 'http://' . $url; |
} else { |
$url = OIDplus::system_url() . $url; |
$url = OIDplus::getSystemUrl() . $url; |
} |
} |
return $treffer[1].$url.$treffer[4]; |
/trunk/plugins/adminPages/800_plugins/plugin.inc.php |
---|
242,8 → 242,8 |
} |
if ($show_obj_active || $show_obj_inactive) { |
$enabled = $show_obj_active ? OIDplus::getRegisteredObjectTypes() : array(); |
$disabled = $show_obj_inactive ? OIDplus::getDisabledObjectTypes() : array(); |
$enabled = $show_obj_active ? OIDplus::getObjectTypePluginsEnabled() : array(); |
$disabled = $show_obj_inactive ? OIDplus::getObjectTypePluginsDisabled() : array(); |
if (count($plugins = array_merge($enabled, $disabled)) > 0) { |
$out['text'] .= '<h2>Object types</h2>'; |
$out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
254,13 → 254,13 |
$out['text'] .= ' <th width="25%">Plugin version</th>'; |
$out['text'] .= ' <th width="25%">Plugin author</th>'; |
$out['text'] .= ' </tr>'; |
foreach ($plugins as $pluginName) { |
foreach ($plugins as $plugin) { |
$out['text'] .= ' <tr>'; |
$pluginInfo = $pluginName::getPluginInformation(); |
if (in_array($pluginName, $enabled)) { |
$out['text'] .= '<td><a '.oidplus_link('oidplus:system_plugins.$'.$pluginName).'>'.htmlentities($pluginName).'</a></td>'; |
$pluginInfo = $plugin::getPluginInformation(); |
if (in_array($plugin, $enabled)) { |
$out['text'] .= '<td><a '.oidplus_link('oidplus:system_plugins.$'.get_class($plugin)).'>'.htmlentities(get_class($plugin)).'</a></td>'; |
} else { |
$out['text'] .= '<td><a '.oidplus_link('oidplus:system_plugins.$'.$pluginName).'><font color="gray">'.htmlentities($pluginName).' (disabled)</font></a></td>'; |
$out['text'] .= '<td><a '.oidplus_link('oidplus:system_plugins.$'.get_class($plugin)).'><font color="gray">'.htmlentities(get_class($plugin)).' (disabled)</font></a></td>'; |
} |
if (!isset($pluginInfo['name']) || empty($pluginInfo['name'])) $pluginInfo['name'] = 'n/a'; |
if (!isset($pluginInfo['author']) || empty($pluginInfo['author'])) $pluginInfo['author'] = 'n/a'; |
411,23 → 411,21 |
} |
} |
$obj_plugins = array(); |
$enabled = OIDplus::getRegisteredObjectTypes(); |
$disabled = OIDplus::getDisabledObjectTypes(); |
$enabled = OIDplus::getObjectTypePluginsEnabled(); |
$disabled = OIDplus::getObjectTypePluginsDisabled(); |
foreach (array_merge($enabled, $disabled) as $plugin) { |
$pluginInfo = $plugin::getPluginInformation(); |
$txt = (!isset($pluginInfo['name']) || empty($pluginInfo['name'])) ? $plugin : $pluginInfo['name']; |
// $txt = htmlentities($plugin::objectTypeTitle()).' ('.htmlentities($plugin::ns()).')'; |
if (in_array($plugin, $enabled)) { |
$obj_plugins[] = array( |
'id' => 'oidplus:system_plugins.$'.$plugin, |
'id' => 'oidplus:system_plugins.$'.get_class($plugin), |
'icon' => $tree_icon_obj_active, |
'text' => $txt, |
); |
} else { |
$obj_plugins[] = array( |
'id' => 'oidplus:system_plugins.$'.$plugin, |
'id' => 'oidplus:system_plugins.$'.get_class($plugin), |
'icon' => $tree_icon_obj_inactive, |
'text' => '<font color="gray">'.$txt.'</font>', |
); |
/trunk/plugins/database/mysqli/plugin.inc.php |
---|
32,7 → 32,7 |
} |
} |
class OIDplusDataBaseMySQLi extends OIDplusDataBase { |
class OIDplusDataBasePluginMySQLi extends OIDplusDataBasePlugin { |
private $mysqli; |
private $last_query; |
private $prepare_cache = array(); |
/trunk/plugins/database/odbc/plugin.inc.php |
---|
19,7 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusDataBaseODBC extends OIDplusDataBase { |
class OIDplusDataBasePluginODBC extends OIDplusDataBasePlugin { |
private $odbc; |
private $last_query; |
private $prepare_cache = array(); |
/trunk/plugins/database/pdo/plugin.inc.php |
---|
19,7 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusDataBasePDO extends OIDplusDataBase { |
class OIDplusDataBasePluginPDO extends OIDplusDataBasePlugin { |
private $pdo; |
private $last_query; |
private $prepare_cache = array(); |
/trunk/plugins/objectTypes/doi/plugin.inc.php |
---|
19,8 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusDoi extends OIDplusObject { |
private $doi; |
class OIDplusObjectTypePluginDoi extends OIDplusObjectTypePlugin { |
public static function getPluginInformation() { |
$out = array(); |
31,6 → 30,15 |
return $out; |
} |
public static function getObjectTypeClassName() { |
return 'OIDplusDoi'; |
} |
} |
class OIDplusDoi extends OIDplusObject { |
private $doi; |
public function __construct($doi) { |
// TODO: syntax checks |
$this->doi = $doi; |
/trunk/plugins/objectTypes/gs1/plugin.inc.php |
---|
19,8 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusGs1 extends OIDplusObject { |
private $number; |
class OIDplusObjectTypePluginGs1 extends OIDplusObjectTypePlugin { |
public static function getPluginInformation() { |
$out = array(); |
31,6 → 30,15 |
return $out; |
} |
public static function getObjectTypeClassName() { |
return 'OIDplusGs1'; |
} |
} |
class OIDplusGs1 extends OIDplusObject { |
private $number; |
public function __construct($number) { |
// TODO: syntax checks |
$this->number = $number; |
/trunk/plugins/objectTypes/guid/plugin.inc.php |
---|
19,8 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusGuid extends OIDplusObject { |
private $guid; |
class OIDplusObjectTypePluginGuid extends OIDplusObjectTypePlugin { |
public static function getPluginInformation() { |
$out = array(); |
31,6 → 30,15 |
return $out; |
} |
public static function getObjectTypeClassName() { |
return 'OIDplusGuid'; |
} |
} |
class OIDplusGuid extends OIDplusObject { |
private $guid; |
public function __construct($guid) { |
if (uuid_valid($guid)) { |
$this->guid = uuid_canonize($guid); // It is a real GUID (leaf node) |
/trunk/plugins/objectTypes/ipv4/plugin.inc.php |
---|
19,10 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusIpv4 extends OIDplusObject { |
private $ipv4; |
private $bare; |
private $cidr; |
class OIDplusObjectTypePluginIpv4 extends OIDplusObjectTypePlugin { |
public static function getPluginInformation() { |
$out = array(); |
33,6 → 30,17 |
return $out; |
} |
public static function getObjectTypeClassName() { |
return 'OIDplusIpv4'; |
} |
} |
class OIDplusIpv4 extends OIDplusObject { |
private $ipv4; |
private $bare; |
private $cidr; |
public function __construct($ipv4) { |
$this->ipv4 = $ipv4; |
/trunk/plugins/objectTypes/ipv6/plugin.inc.php |
---|
19,10 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusIpv6 extends OIDplusObject { |
private $ipv6; |
private $bare; |
private $cidr; |
class OIDplusObjectTypePluginIpv6 extends OIDplusObjectTypePlugin { |
public static function getPluginInformation() { |
$out = array(); |
33,6 → 30,17 |
return $out; |
} |
public static function getObjectTypeClassName() { |
return 'OIDplusIpv6'; |
} |
} |
class OIDplusIpv6 extends OIDplusObject { |
private $ipv6; |
private $bare; |
private $cidr; |
public function __construct($ipv6) { |
$this->ipv6 = $ipv6; |
/trunk/plugins/objectTypes/java/plugin.inc.php |
---|
19,8 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusJava extends OIDplusObject { |
private $java; |
class OIDplusObjectTypePluginJava extends OIDplusObjectTypePlugin { |
public static function getPluginInformation() { |
$out = array(); |
31,6 → 30,15 |
return $out; |
} |
public static function getObjectTypeClassName() { |
return 'OIDplusJava'; |
} |
} |
class OIDplusJava extends OIDplusObject { |
private $java; |
public function __construct($java) { |
// TODO: syntax checks |
$this->java = $java; |
/trunk/plugins/objectTypes/oid/plugin.inc.php |
---|
19,10 → 19,9 |
if (!defined('IN_OIDPLUS')) die(); |
include __DIR__ . '/WeidOidConverter.class.php'; |
require_once __DIR__ . '/WeidOidConverter.class.php'; |
class OIDplusOid extends OIDplusObject { |
private $oid; |
class OIDplusObjectTypePluginOid extends OIDplusObjectTypePlugin { |
public static function getPluginInformation() { |
$out = array(); |
33,6 → 32,15 |
return $out; |
} |
public static function getObjectTypeClassName() { |
return 'OIDplusOid'; |
} |
} |
class OIDplusOid extends OIDplusObject { |
private $oid; |
public function __construct($oid) { |
$bak_oid = $oid; |
/trunk/plugins/objectTypes/other/plugin.inc.php |
---|
19,8 → 19,7 |
if (!defined('IN_OIDPLUS')) die(); |
class OIDplusOther extends OIDplusObject { |
private $other; |
class OIDplusObjectTypePluginOther extends OIDplusObjectTypePlugin { |
public static function getPluginInformation() { |
$out = array(); |
31,6 → 30,15 |
return $out; |
} |
public static function getObjectTypeClassName() { |
return 'OIDplusOther'; |
} |
} |
class OIDplusOther extends OIDplusObject { |
private $other; |
public function __construct($other) { |
// No syntax checks |
$this->other = $other; |
/trunk/plugins/publicPages/000_objects/plugin.inc.php |
---|
56,7 → 56,7 |
if (strpos($out['text'], '%%OBJECT_TYPE_LIST%%') !== false) { |
$tmp = '<ul>'; |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
$tmp .= '<li><a '.oidplus_link($ot::root()).'>'.htmlentities($ot::objectTypeTitle()).'</a></li>'; |
} |
$tmp .= '</ul>'; |
80,7 → 80,7 |
} |
$objTypesChildren = array(); |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
$icon = 'plugins/objectTypes/'.$ot::ns().'/img/treeicon_root.png'; |
$json[] = array('id' => $ot::root(), 'icon' => $icon, 'text' => $ot::objectTypeTitle()); |
152,7 → 152,7 |
} |
$objTypesChildren = array(); |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
$child = array('id' => $ot::root(), |
'text' => $ot::objectTypeTitle(), |
'state' => array("opened" => true), |
/trunk/plugins/publicPages/091_forgot_password/plugin.inc.php |
---|
60,7 → 60,7 |
OIDplus::logger()->log("RA($email)!", "A new password for '$email' was requested (forgot password)"); |
$timestamp = time(); |
$activate_url = OIDplus::system_url() . '?goto='.urlencode('oidplus:reset_password$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()::makeAuthKey('reset_password;'.$email.';'.$timestamp)); |
$activate_url = OIDplus::getSystemUrl() . '?goto='.urlencode('oidplus:reset_password$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()::makeAuthKey('reset_password;'.$email.';'.$timestamp)); |
$message = $this->getForgotPasswordText($_POST['email']); |
$message = str_replace('{{ACTIVATE_URL}}', $activate_url, $message); |
180,7 → 180,7 |
$message = file_get_contents(__DIR__ . '/forgot_password.tpl'); |
// Resolve stuff |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::system_url(), $message); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::getSystemUrl(), $message); |
$message = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $message); |
// {{ACTIVATE_URL}} will be resolved in ajax.php |
/trunk/plugins/publicPages/100_whois/plugin.inc.php |
---|
57,7 → 57,7 |
private function getExampleId() { |
$firsts = array(); |
$first_ns = null; |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
if (is_null($first_ns)) $first_ns = $ot::ns(); |
$res = OIDplus::db()->query("SELECT id FROM ".OIDPLUS_TABLENAME_PREFIX."objects WHERE parent = ? ORDER BY id", array($ot::ns().':')); |
if ($row = OIDplus::db()->fetch_array($res)) |
/trunk/plugins/publicPages/100_whois/whois/webwhois.php |
---|
236,7 → 236,7 |
echo $cont; |
if (OIDplus::pkiStatus(true)) { |
if (OIDplus::getPkiStatus(true)) { |
$signature = ''; |
if (openssl_sign($cont, $signature, OIDplus::config()->getValue('oidplus_private_key'))) { |
$signature = base64_encode($signature); |
275,7 → 275,7 |
} |
$ary = array('whois' => $ary); // we need this named root, otherwise PHP will name the sections "0", "1", "2" if the array is not sequencial (e.g. because "signature" is added) |
if (OIDplus::pkiStatus(true)) { |
if (OIDplus::getPkiStatus(true)) { |
$cont = json_encode($ary); |
$signature = ''; |
if (openssl_sign($cont, $signature, OIDplus::config()->getValue('oidplus_private_key'))) { |
300,7 → 300,7 |
} |
$xml .= '</section></whois>'; |
if (OIDplus::pkiStatus(true)) { |
if (OIDplus::getPkiStatus(true)) { |
$cont = $xml; |
$signature = ''; |
if (openssl_sign($cont, $signature, OIDplus::config()->getValue('oidplus_private_key'))) { |
/trunk/plugins/publicPages/200_viathinksoft_freeoid/plugin.inc.php |
---|
71,10 → 71,10 |
OIDplus::logger()->log("OID(oid:$root_oid)+RA($email)!", "Requested a free OID for email '$email' to be placed into root '$root_oid'"); |
$timestamp = time(); |
$activate_url = OIDplus::system_url() . '?goto='.urlencode('oidplus:com.viathinksoft.freeoid.activate_freeoid$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()::makeAuthKey('com.viathinksoft.freeoid.activate_freeoid;'.$email.';'.$timestamp)); |
$activate_url = OIDplus::getSystemUrl() . '?goto='.urlencode('oidplus:com.viathinksoft.freeoid.activate_freeoid$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()::makeAuthKey('com.viathinksoft.freeoid.activate_freeoid;'.$email.';'.$timestamp)); |
$message = file_get_contents(__DIR__ . '/request_msg.tpl'); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::system_url(), $message); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::getSystemUrl(), $message); |
$message = str_replace('{{SYSTEM_TITLE}}', OIDplus::config()->systemTitle(), $message); |
$message = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $message); |
$message = str_replace('{{ACTIVATE_URL}}', $activate_url, $message); |
156,7 → 156,7 |
$message .= "URL for more information: $url\n"; |
$message .= "OID Name: $title\n"; |
$message .= "\n"; |
$message .= "More details: ".OIDplus::system_url()."?goto=oid:$new_oid\n"; |
$message .= "More details: ".OIDplus::getSystemUrl()."?goto=oid:$new_oid\n"; |
my_mail($email, OIDplus::config()->systemTitle()." - OID $new_oid registered", $message, OIDplus::config()->globalCC()); |
163,7 → 163,7 |
// Send delegation information to user |
$message = file_get_contents(__DIR__ . '/allocated_msg.tpl'); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::system_url(), $message); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::getSystemUrl(), $message); |
$message = str_replace('{{SYSTEM_TITLE}}', OIDplus::config()->systemTitle(), $message); |
$message = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $message); |
$message = str_replace('{{NEW_OID}}', $new_oid, $message); |
/trunk/plugins/publicPages/300_search/plugin.inc.php |
---|
89,7 → 89,7 |
</script> |
Search in: <select name="namespace" id="namespace" onchange="searchNsSelect(this.value);"><br><br>'; |
foreach (OIDplus::getRegisteredObjectTypes() as $ot) { |
foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
$out['text'] .= '<option value="'.htmlentities($ot::ns()).'"'.(($ns == $ot::ns()) ? ' selected' : '').'>'.htmlentities($ot::objectTypeTitle()).'</option>'; |
} |
$out['text'] .= '<option value="oidplus:ra"'.(($ns == 'oidplus:ra') ? ' selected' : '').'>Registration Authority</option> |
/trunk/plugins/raPages/092_invite/plugin.inc.php |
---|
61,7 → 61,7 |
OIDplus::logger()->log("RA($email)!", "RA '$email' has been invited"); |
$timestamp = time(); |
$activate_url = OIDplus::system_url() . '?goto='.urlencode('oidplus:activate_ra$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()::makeAuthKey('activate_ra;'.$email.';'.$timestamp)); |
$activate_url = OIDplus::getSystemUrl() . '?goto='.urlencode('oidplus:activate_ra$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()::makeAuthKey('activate_ra;'.$email.';'.$timestamp)); |
$message = $this->getInvitationText($email); |
$message = str_replace('{{ACTIVATE_URL}}', $activate_url, $message); |
238,7 → 238,7 |
$message = file_get_contents(__DIR__ . '/invite_msg.tpl'); |
// Resolve stuff |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::system_url(), $message); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::getSystemUrl(), $message); |
$message = str_replace('{{OID_LIST}}', implode("\n", $list_of_oids), $message); |
$message = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $message); |
$message = str_replace('{{PARTY}}', OIDplus::authUtils()::isAdminLoggedIn() ? 'the system administrator' : 'a superior Registration Authority', $message); |
/trunk/plugins/raPages/102_change_email/plugin.inc.php |
---|
88,10 → 88,10 |
OIDplus::logger()->log("RA($old_email)!+RA($new_email)!", "Requested email change from '$old_email' to '$new_email'"); |
$timestamp = time(); |
$activate_url = OIDplus::system_url() . '?goto='.urlencode('oidplus:activate_new_ra_email$'.$old_email.'$'.$new_email.'$'.$timestamp.'$'.OIDplus::authUtils()::makeAuthKey('activate_new_ra_email;'.$old_email.';'.$new_email.';'.$timestamp)); |
$activate_url = OIDplus::getSystemUrl() . '?goto='.urlencode('oidplus:activate_new_ra_email$'.$old_email.'$'.$new_email.'$'.$timestamp.'$'.OIDplus::authUtils()::makeAuthKey('activate_new_ra_email;'.$old_email.';'.$new_email.';'.$timestamp)); |
$message = file_get_contents(__DIR__ . '/change_request_email.tpl'); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::system_url(), $message); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::getSystemUrl(), $message); |
$message = str_replace('{{SYSTEM_TITLE}}', OIDplus::config()->systemTitle(), $message); |
$message = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $message); |
$message = str_replace('{{OLD_EMAIL}}', $old_email, $message); |
153,7 → 153,7 |
OIDplus::logger()->log("RA($new_email)!", "RA '$old_email' has changed its email address to '$new_email'"); |
$message = file_get_contents(__DIR__ . '/email_change_confirmation.tpl'); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::system_url(), $message); |
$message = str_replace('{{SYSTEM_URL}}', OIDplus::getSystemUrl(), $message); |
$message = str_replace('{{SYSTEM_TITLE}}', OIDplus::config()->systemTitle(), $message); |
$message = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $message); |
$message = str_replace('{{OLD_EMAIL}}', $old_email, $message); |
/trunk/sitemap.php |
---|
33,7 → 33,7 |
foreach (OIDplus::getPagePlugins('public') as $plugin) { |
if (get_class($plugin) == 'OIDplusPagePublicObjects') { |
foreach ($nonConfidential as $id) { |
echo OIDplus::system_url().'?goto='.urlencode($id)."\n"; |
echo OIDplus::getSystemUrl().'?goto='.urlencode($id)."\n"; |
} |
} else { |
$plugin->tree($json, null, true, null); |
46,7 → 46,7 |
function _rec($json) { |
foreach ($json as $x) { |
if (isset($x['id']) && $x['id']) { |
echo OIDplus::system_url().'?goto='.urlencode($x['id'])."\n"; |
echo OIDplus::getSystemUrl().'?goto='.urlencode($x['id'])."\n"; |
} |
if (isset($x['children'])) { |
_rec($x['children']); |
/trunk/update/includes/phpsvnclient.class.php |
---|
527,6 → 527,7 |
$revlogs = array(); |
$array = array(); |
if (!isset($arrOutput['children'])) $arrOutput['children'] = array(); |
foreach ($arrOutput['children'] as $value) { |
/* |
<S:log-item> |
577,6 → 578,7 |
$dirs = array(); |
$dirsDelete = array(); |
if (!isset($array['objects'])) $array['objects'] = array(); |
foreach ($array['objects'] as $objects) { |
// This section was completely changed by Daniel Marschall |
if ($objects['type'] == "file") { |