revert disable/* options
This commit is contained in:
@@ -2314,16 +2314,6 @@ $cfg['UserprefsDisallow'] = array();
|
||||
*/
|
||||
$cfg['UserprefsDeveloperTab'] = false;
|
||||
|
||||
/**
|
||||
* User preferences: disabling options by users
|
||||
*/
|
||||
$cfg['disable'] = array(
|
||||
'AllowUserDropDatabase' => false,
|
||||
'UseDbSearch' => false,
|
||||
'QueryHistoryDB' => false,
|
||||
'ShowPhpInfo' => false,
|
||||
'ShowChgPassword' => false);
|
||||
|
||||
/*******************************************************************************
|
||||
* Window title settings
|
||||
*/
|
||||
|
@@ -321,12 +321,8 @@ class FormDisplay
|
||||
'doc' => $this->getDocLink($system_path),
|
||||
'wiki' => $this->getWikiLink($system_path),
|
||||
'show_restore_default' => $show_restore_default,
|
||||
'userprefs_allow' => $userprefs_allow);
|
||||
$comment = PMA_lang_name($system_path, 'cmt', '');
|
||||
if ($cf->getDefault('disable/' . $system_path) === false) {
|
||||
$comment .= ($comment ? "\n" : '') . __('Users can disable this option');
|
||||
}
|
||||
$opts['userprefs_comment'] = $comment;
|
||||
'userprefs_allow' => $userprefs_allow,
|
||||
'userprefs_comment' => PMA_lang_name($system_path, 'cmt', ''));
|
||||
if (isset($form->default[$system_path])) {
|
||||
$opts['setvalue'] = $form->default[$system_path];
|
||||
}
|
||||
@@ -690,9 +686,7 @@ class FormDisplay
|
||||
*/
|
||||
private function _getOptName($path)
|
||||
{
|
||||
return str_replace(
|
||||
array('Servers/1/', 'disable/', '/'),
|
||||
array('Servers/', '', '_'), $path);
|
||||
return str_replace(array('Servers/1/', '/'), array('Servers/', '_'), $path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -188,9 +188,6 @@ function display_input($path, $name, $description = '', $type, $value, $value_is
|
||||
. ' value="' . htmlspecialchars($value) . '" />';
|
||||
break;
|
||||
case 'checkbox':
|
||||
if (strpos($path, 'disable-') === 0) {
|
||||
echo '<label for="' . htmlspecialchars($path) . '" title="' . __('Mark to disable this option') . '">' . __('Disable') . '</label> ';
|
||||
}
|
||||
echo '<span' . $field_class . '><input type="checkbox" ' . $name_id
|
||||
. ($value ? ' checked="checked"' : '') . ' /></span>';
|
||||
break;
|
||||
|
@@ -67,8 +67,8 @@ function PMA_lang($lang_key)
|
||||
function PMA_lang_name($canonical_path, $type = 'name', $default = 'key')
|
||||
{
|
||||
$lang_key = str_replace(
|
||||
array('Servers/1/', 'disable/', '/'),
|
||||
array('Servers/', '', '_'),
|
||||
array('Servers/1/', '/'),
|
||||
array('Servers/', '_'),
|
||||
$canonical_path) . '_' . $type;
|
||||
return isset($GLOBALS["strConfig$lang_key"])
|
||||
? ($type == 'desc' ? PMA_lang($lang_key) : $GLOBALS["strConfig$lang_key"])
|
||||
|
@@ -20,10 +20,7 @@ $forms['Features']['General'] = array(
|
||||
'ReplaceHelpImg',
|
||||
'SkipLockedTables',
|
||||
'MaxDbList',
|
||||
'MaxTableList',
|
||||
'disable/AllowUserDropDatabase',
|
||||
'disable/UseDbSearch',
|
||||
'disable/QueryHistoryDB');
|
||||
'MaxTableList');
|
||||
$forms['Features']['Text_fields'] = array(
|
||||
'CharEditing',
|
||||
'CharTextareaCols',
|
||||
@@ -94,9 +91,7 @@ $forms['Main_frame']['Startup'] = array(
|
||||
'SuggestDBName',
|
||||
':group:end',
|
||||
'ShowStats',
|
||||
'ShowServerInfo',
|
||||
'disable/ShowPhpInfo',
|
||||
'disable/ShowChgPassword');
|
||||
'ShowServerInfo');
|
||||
$forms['Main_frame']['Browse'] = array(
|
||||
'NavigationBarIconic',
|
||||
'ShowAll',
|
||||
|
@@ -151,22 +151,6 @@ function PMA_apply_userprefs(array $config_data)
|
||||
if (!isset($whitelist[$path]) || isset($blacklist[$path])) {
|
||||
continue;
|
||||
}
|
||||
if (strpos($path, 'disable/') === 0) {
|
||||
// write disable/ value
|
||||
PMA_array_write($path, $cfg, $value);
|
||||
// prepare path and value for disabled key
|
||||
$path = substr($path, 8);
|
||||
switch (gettype(PMA_array_read($path, $GLOBALS['PMA_Config']->default))) {
|
||||
case 'string':
|
||||
$value = '';
|
||||
break;
|
||||
case 'double':
|
||||
case 'integer':
|
||||
$value = 0;
|
||||
default:
|
||||
$value = false;
|
||||
}
|
||||
}
|
||||
PMA_array_write($path, $cfg, $value);
|
||||
}
|
||||
return $cfg;
|
||||
|
Reference in New Issue
Block a user