mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Read-only mode relying successively on a DB property, and an application setting
SVN:trunk[972]
This commit is contained in:
@@ -135,7 +135,7 @@ class Config
|
||||
'source_of_value' => '',
|
||||
'show_in_conf_sample' => false,
|
||||
),
|
||||
'read_only' => array(
|
||||
'database_read_only' => array(
|
||||
'type' => 'bool',
|
||||
'description' => 'Freeze the data for administration purposes - administrators can still do anything... in appearance!',
|
||||
'default' => false,
|
||||
|
||||
@@ -2536,10 +2536,30 @@ abstract class MetaModel
|
||||
return $aDataDump;
|
||||
}
|
||||
|
||||
// Temporary - investigate the cost of such a limitation
|
||||
/*
|
||||
* Determines wether the target DB is frozen or not
|
||||
* 1 - consider the DB property 'status'
|
||||
* 2 - check the setting 'database_read_only'
|
||||
*/
|
||||
public static function DBIsReadOnly()
|
||||
{
|
||||
return self::$m_oConfig->Get('read_only');
|
||||
$sStatus = DBProperty::GetProperty('status', null);
|
||||
if (!is_null($sStatus))
|
||||
{
|
||||
switch (strtolower(trim($sStatus)))
|
||||
{
|
||||
case 'fullaccess':
|
||||
$ret = false;
|
||||
break;
|
||||
default:
|
||||
$ret = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret = self::$m_oConfig->Get('database_read_only');
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
protected static function MakeDictEntry($sKey, $sValueFromOldSystem, $sDefaultValue, &$bNotInDico)
|
||||
|
||||
Reference in New Issue
Block a user