Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 222 → Rev 223

/trunk/TODO
7,7 → 7,6
do we need an explicit consent at the login form?
do we need a consent for the cookie SSL_CHECK?
- Verify that logger works correctly, check if all logmasks are correct
- remove backtick operators due to sql compatibility
- the inactivity timer is much too fast!
- Does the admin feature "600_log" also show all log events from all Objects and all RAs?
- at a lot of forms, if you press "enter", the "form" will not be submitted (e.g. "create ra" plugin), cannot reproduce?
/trunk/includes/classes/OIDplusDataBase.class.php
58,7 → 58,7
// 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 (!$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')) {
77,14 → 77,14
// 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'");
$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");
$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->query("UPDATE ".OIDPLUS_TABLENAME_PREFIX."config SET value = '$version' WHERE name = 'database_version'");
$this->transaction_commit();
}
}
/trunk/plugins/adminPages/110_system_config/plugin.inc.php
91,7 → 91,7
 
OIDplus::config(); // <-- make sure that the config table is loaded/filled correctly before we do a select
 
$result = OIDplus::db()->query("select * from ".OIDPLUS_TABLENAME_PREFIX."config where `visible` = 1 order by name");
$result = OIDplus::db()->query("select * from ".OIDPLUS_TABLENAME_PREFIX."config where visible = 1 order by name");
while ($row = OIDplus::db()->fetch_object($result)) {
$output .= '<tr>';
$output .= ' <td>'.htmlentities($row->name).'</td>';
/trunk/setup/struct_empty.sql.php
20,6 → 20,8
$prefix = isset($_REQUEST['prefix']) ? $_REQUEST['prefix'] : '';
$database = isset($_REQUEST['database']) ? $_REQUEST['database'] : '';
 
define('MYSQL_SYNTAX', false);
 
$cont = trim(file_get_contents(__DIR__.'/sql/struct.sql'))."\n\n".
trim(file_get_contents(__DIR__.'/sql/wellknown_country.sql'))."\n\n".
trim(file_get_contents(__DIR__.'/sql/wellknown_other.sql'))."\n\n";
26,7 → 28,7
 
$table_names = array('objects', 'asn1id', 'iri', 'ra', 'config', 'log', 'log_user', 'log_object');
foreach ($table_names as $table) {
$cont = str_replace('`'.$table.'`', '`'.$prefix.$table.'`', $cont);
$cont = str_replace('`'.$table.'`', MYSQL_SYNTAX ? '`'.$prefix.$table.'`' : $prefix.$table, $cont);
}
 
if (php_sapi_name() != 'cli') {
35,7 → 37,12
}
 
if (!empty($database)) {
if (MYSQL_SYNTAX) {
echo "CREATE DATABASE IF NOT EXISTS `$database`;\n\n";
echo "USE `$database`;\n\n";
} else {
echo "CREATE DATABASE IF NOT EXISTS $database;\n\n";
echo "USE $database;\n\n";
}
}
echo $cont;
/trunk/setup/struct_with_examples.sql.php
20,6 → 20,8
$prefix = isset($_REQUEST['prefix']) ? $_REQUEST['prefix'] : '';
$database = isset($_REQUEST['database']) ? $_REQUEST['database'] : '';
 
define('MYSQL_SYNTAX', false);
 
$cont = trim(file_get_contents(__DIR__.'/sql/struct.sql'))."\n\n".
trim(file_get_contents(__DIR__.'/sql/wellknown_country.sql'))."\n\n".
trim(file_get_contents(__DIR__.'/sql/wellknown_other.sql'))."\n\n".
27,7 → 29,7
 
$table_names = array('objects', 'asn1id', 'iri', 'ra', 'config', 'log', 'log_user', 'log_object');
foreach ($table_names as $table) {
$cont = str_replace('`'.$table.'`', '`'.$prefix.$table.'`', $cont);
$cont = str_replace('`'.$table.'`', MYSQL_SYNTAX ? '`'.$prefix.$table.'`' : $prefix.$table, $cont);
}
 
if (php_sapi_name() != 'cli') {
36,7 → 38,12
}
 
if (!empty($database)) {
if (MYSQL_SYNTAX) {
echo "CREATE DATABASE IF NOT EXISTS `$database`;\n\n";
echo "USE `$database`;\n\n";
} else {
echo "CREATE DATABASE IF NOT EXISTS $database;\n\n";
echo "USE $database;\n\n";
}
}
echo $cont;