removed some messages from messages.inc.php (validation, some other error messages)

User preferences:
added translations and values for some fields
validation for DefaultPropDisplay
This commit is contained in:
Crack
2010-06-13 15:01:37 +02:00
parent 2e1fd2677f
commit a90b0a21f2
12 changed files with 115 additions and 73 deletions

View File

@@ -2160,7 +2160,7 @@ setfacl -d -m "g:www-data:rwx" tmp
<dt id="cfg_TitleDatabase">$cfg['TitleDatabase'] string</dt> <dt id="cfg_TitleDatabase">$cfg['TitleDatabase'] string</dt>
<dt id="cfg_TitleServer">$cfg['TitleServer'] string</dt> <dt id="cfg_TitleServer">$cfg['TitleServer'] string</dt>
<dt id="cfg_TitleDefault">$cfg['TitleDefault'] string</dt> <dt id="cfg_TitleDefault">$cfg['TitleDefault'] string</dt>
<dd>Allows you to specify window's title bar. Following magic string can <dd>Allows you to specify windows' title bar. Following magic strings can
be used to get special values: be used to get special values:
<dl> <dl>
<dt><code>@HTTP_HOST@</code></dt> <dt><code>@HTTP_HOST@</code></dt>

View File

@@ -200,6 +200,18 @@ var validators = {
} }
return result; return result;
}, },
/**
* DefaultPropDisplay validator
*
* @param {boolean} isKeyUp
*/
validate_DefaultPropDisplay: function(isKeyUp) {
if (isKeyUp && this.value == '') {
return true;
}
var valid = this.value.match(/^(?:horizontal|vertical|[0-9]+)$/) != null;
return valid ? true : PMA_messages['error_invalid_value']
},
// field validators // field validators
_field: { _field: {
}, },

View File

@@ -2149,7 +2149,7 @@ $cfg['DefaultDisplay'] = 'horizontal';
/** /**
* default display direction for altering/creating columns (tbl_properties) * default display direction for altering/creating columns (tbl_properties)
* (horizontal|vertical|<number>) * (horizontal|vertical|<number>)
* number indicates maximal number for which vertical model is used * number indicates maximum number for which vertical model is used
* *
* @global integer $cfg['DefaultPropDisplay'] * @global integer $cfg['DefaultPropDisplay']
*/ */

View File

@@ -64,6 +64,7 @@ $cfg_db['QueryWindowDefTab'] = array(
'files', // Import files 'files', // Import files
'history', // SQL history 'history', // SQL history
'full'); // All (SQL and SQL history) 'full'); // All (SQL and SQL history)
$cfg_db['InitialSlidersState'] = array('open', 'closed');
$cfg_db['Import']['format'] = array( $cfg_db['Import']['format'] = array(
'csv', // CSV 'csv', // CSV
'docsql', // DocSQL 'docsql', // DocSQL
@@ -110,5 +111,6 @@ $cfg_db['_validators'] = array(
'CharTextareaRows' => 'validate_positive_number', 'CharTextareaRows' => 'validate_positive_number',
'InsertRows' => 'validate_positive_number', 'InsertRows' => 'validate_positive_number',
'ForeignKeyMaxLimit' => 'validate_positive_number', 'ForeignKeyMaxLimit' => 'validate_positive_number',
'DefaultPropDisplay' => 'validate_DefaultPropDisplay',
'Import/skip_queries' => 'validate_non_negative_number'); 'Import/skip_queries' => 'validate_non_negative_number');
?> ?>

View File

@@ -58,8 +58,7 @@ class FormDisplay
* Will be looked up in $GLOBALS: str{value} or strSetup{value} * Will be looked up in $GLOBALS: str{value} or strSetup{value}
* @var array * @var array
*/ */
private $js_lang_strings = array('error_nan_p', 'error_nan_nneg', private $js_lang_strings = array();
'error_incorrect_port');
/** /**
* Tells whether forms have been validated * Tells whether forms have been validated
@@ -67,6 +66,16 @@ class FormDisplay
*/ */
private $is_valdiated = true; private $is_valdiated = true;
public function __construct()
{
$this->js_lang_strings = array(
'error_nan_p' => __('Not a positive number'),
'error_nan_nneg' => __('Not a non-negative number'),
'error_incorrect_port' => __('Not a valid port number'),
'error_invalid_value' => __('Incorrect value')
);
}
/** /**
* Registers form in form manager * Registers form in form manager
* *
@@ -222,11 +231,8 @@ class FormDisplay
if (!$js_lang_sent) { if (!$js_lang_sent) {
$js_lang_sent = true; $js_lang_sent = true;
$js_lang = array(); $js_lang = array();
foreach ($this->js_lang_strings as $str) { foreach ($this->js_lang_strings as $strName => $strValue) {
$lang = isset($GLOBALS["strSetup$str"]) $js_lang[] = "'$strName': '" . PMA_jsFormat($strValue, false) . '\'';
? $GLOBALS["strSetup$str"]
: filter_var($GLOBALS["str$str"]); // null if not set
$js_lang[] = "'$str': '" . PMA_jsFormat($lang, false) . '\'';
} }
$js[] = '$.extend(PMA_messages, {' . implode(",\n\t", $js_lang) . '})'; $js[] = '$.extend(PMA_messages, {' . implode(",\n\t", $js_lang) . '})';
} }
@@ -434,8 +440,8 @@ class FormDisplay
if ($form->getOptionType($field) == 'boolean') { if ($form->getOptionType($field) == 'boolean') {
$_POST[$key] = false; $_POST[$key] = false;
} else { } else {
$this->errors[$form->name][] = PMA_lang( $this->errors[$form->name][] = sprintf(
'error_missing_field_data', __('Missing data for %s'),
'<i>' . PMA_lang_name($system_path) . '</i>'); '<i>' . PMA_lang_name($system_path) . '</i>');
$result = false; $result = false;
continue; continue;

View File

@@ -18,10 +18,7 @@ $strSetupAllowArbitraryServer_desc = __('If enabled user can enter any MySQL ser
$strSetupAllowArbitraryServerMsg = __('This [a@?page=form&amp;formset=features#tab_Security]option[/a] should be disabled as it allows attackers to bruteforce login to any MySQL server. If you feel this is necessary, use [a@?page=form&amp;formset=features#tab_Security]trusted proxies list[/a]. However, IP-based protection may not be reliable if your IP belongs to an ISP where thousands of users, including you, are connected to.'); $strSetupAllowArbitraryServerMsg = __('This [a@?page=form&amp;formset=features#tab_Security]option[/a] should be disabled as it allows attackers to bruteforce login to any MySQL server. If you feel this is necessary, use [a@?page=form&amp;formset=features#tab_Security]trusted proxies list[/a]. However, IP-based protection may not be reliable if your IP belongs to an ISP where thousands of users, including you, are connected to.');
$strSetupAllowArbitraryServer_name = __('Allow login to any MySQL server'); $strSetupAllowArbitraryServer_name = __('Allow login to any MySQL server');
$strSetupAllowUserDropDatabase_name = __('Show &quot;Drop database&quot; link to normal users'); $strSetupAllowUserDropDatabase_name = __('Show &quot;Drop database&quot; link to normal users');
$strSetupBlowfishSecretCharsMsg = __('Key should contain letters, numbers [em]and[/em] special characters');
$strSetupblowfish_secret_desc = __('Secret passphrase used for encrypting cookies in [kbd]cookie[/kbd] authentication'); $strSetupblowfish_secret_desc = __('Secret passphrase used for encrypting cookies in [kbd]cookie[/kbd] authentication');
$strSetupBlowfishSecretLengthMsg = __('Key is too short, it should have at least 8 characters');
$strSetupBlowfishSecretMsg = __('You didn\'t have blowfish secret set and have enabled cookie authentication, so a key was automatically generated for you. It is used to encrypt cookies; you don\'t need to remember it.');
$strSetupblowfish_secret_name = __('Blowfish secret'); $strSetupblowfish_secret_name = __('Blowfish secret');
$strSetupBrowseMarkerEnable_desc = __('Highlight selected rows'); $strSetupBrowseMarkerEnable_desc = __('Highlight selected rows');
$strSetupBrowseMarkerEnable_name = __('Row marker'); $strSetupBrowseMarkerEnable_name = __('Row marker');
@@ -29,9 +26,8 @@ $strSetupBrowsePointerEnable_desc = __('Highlight row pointed by the mouse curso
$strSetupBrowsePointerEnable_name = __('Highlight pointer'); $strSetupBrowsePointerEnable_name = __('Highlight pointer');
$strSetupBZipDump_desc = __('Enable [a@http://en.wikipedia.org/wiki/Bzip2]bzip2[/a] compression for import and export operations'); $strSetupBZipDump_desc = __('Enable [a@http://en.wikipedia.org/wiki/Bzip2]bzip2[/a] compression for import and export operations');
$strSetupBZipDump_name = __('Bzip2'); $strSetupBZipDump_name = __('Bzip2');
$strSetupBZipDumpWarning = __('[a@?page=form&amp;formset=features#tab_Import_export]Bzip2 compression and decompression[/a] requires functions (%s) which are unavailable on this system.');
$strSetupCannotLoadConfig = __('Cannot load or save configuration'); $strSetupCannotLoadConfig = __('Cannot load or save configuration');
$strSetupCannotLoadConfigMsg = __('Please create web server writable folder [em]config[/em] in phpMyAdmin top level directory as described in [a@../Documentation.html#setup_script]documentation[/a]. Otherwise you will be only able to download or display it.'); $strSetupCannotLoadConfigMsg = __('Please create web server writable folder [em]config[/em] in phpMyAdmin top level directory as described in [a@Documentation.html#setup_script]documentation[/a]. Otherwise you will be only able to download or display it.');
$strSetupCharEditing_desc = __('Defines which type of editing controls should be used for CHAR and VARCHAR columns; [kbd]input[/kbd] - allows limiting of input length, [kbd]textarea[/kbd] - allows newlines in columns'); $strSetupCharEditing_desc = __('Defines which type of editing controls should be used for CHAR and VARCHAR columns; [kbd]input[/kbd] - allows limiting of input length, [kbd]textarea[/kbd] - allows newlines in columns');
$strSetupCharEditing_name = __('CHAR columns editing'); $strSetupCharEditing_name = __('CHAR columns editing');
$strSetupCharTextareaCols_desc = __('Number of columns for CHAR/VARCHAR textareas'); $strSetupCharTextareaCols_desc = __('Number of columns for CHAR/VARCHAR textareas');
@@ -39,15 +35,17 @@ $strSetupCharTextareaCols_name = __('CHAR textarea columns');
$strSetupCharTextareaRows_desc = __('Number of rows for CHAR/VARCHAR textareas'); $strSetupCharTextareaRows_desc = __('Number of rows for CHAR/VARCHAR textareas');
$strSetupCharTextareaRows_name = __('CHAR textarea rows'); $strSetupCharTextareaRows_name = __('CHAR textarea rows');
$strSetupCheckConfigurationPermissions_name = __('Check config file permissions'); $strSetupCheckConfigurationPermissions_name = __('Check config file permissions');
$strSetupClear = __('Clear');
$strSetupCompressOnFly_desc = __('Compress gzip/bzip2 exports on the fly without the need for much memory; if you encounter problems with created gzip/bzip2 files disable this feature'); $strSetupCompressOnFly_desc = __('Compress gzip/bzip2 exports on the fly without the need for much memory; if you encounter problems with created gzip/bzip2 files disable this feature');
$strSetupCompressOnFly_name = __('Compress on the fly'); $strSetupCompressOnFly_name = __('Compress on the fly');
$strSetupConfigurationFile = __('Configuration file'); $strSetupConfigurationFile = __('Configuration file');
$strSetupConfirm_desc = __('Whether a warning (&quot;Are your really sure...&quot;) should be displayed when you\'re about to lose data'); $strSetupConfirm_desc = __('Whether a warning (&quot;Are your really sure...&quot;) should be displayed when you\'re about to lose data');
$strSetupConfirm_name = __('Confirm DROP queries'); $strSetupConfirm_name = __('Confirm DROP queries');
$strSetupCtrlArrowsMoving_name = __('Field navigation using Ctrl+Arrows');
$strSetupDefaultCharset_desc = __('Default character set used for conversions'); $strSetupDefaultCharset_desc = __('Default character set used for conversions');
$strSetupDefaultCharset_name = __('Default character set'); $strSetupDefaultCharset_name = __('Default character set');
$strSetupDefaultLanguage = __('Default language'); $strSetupDefaultLanguage = __('Default language');
$strSetupDefaultPropDisplay_name = __('Display direction for altering/creating columns');
$strSetupDefaultPropDisplay_desc = __('[kbd]horizontal[/kbd], [kbd]vertical[/kbd] or a number that indicates maximum number for which vertical model is used');
$strSetupDefaultServer = __('Default server'); $strSetupDefaultServer = __('Default server');
$strSetupDefaultTabDatabase_desc = __('Tab that is displayed when entering a database'); $strSetupDefaultTabDatabase_desc = __('Tab that is displayed when entering a database');
$strSetupDefaultTabDatabase_name = __('Default database tab'); $strSetupDefaultTabDatabase_name = __('Default database tab');
@@ -64,19 +62,8 @@ $strSetupDisplayServersList_name = __('Display servers as a list');
$strSetupDonateLink = __('Donate'); $strSetupDonateLink = __('Donate');
$strSetupDownload = __('Download'); $strSetupDownload = __('Download');
$strSetupEndOfLine = __('End of line'); $strSetupEndOfLine = __('End of line');
$strSetuperror_connection = __('Could not connect to MySQL server'); $strSetupErrorIconic_name = __('Iconic errors');
$strSetuperror_empty_pmadb_password = __('Empty phpMyAdmin control user password while using pmadb'); $strSetupErrorIconic_desc = __('Show icons for warning, error and information messages');
$strSetuperror_empty_pmadb_user = __('Empty phpMyAdmin control user while using pmadb');
$strSetuperror_empty_signon_session = __('Empty signon session name while using signon authentication method');
$strSetuperror_empty_signon_url = __('Empty signon URL while using signon authentication method');
$strSetuperror_empty_user_for_config_auth = __('Empty username while using config authentication method');
$strSetuperror_form = __('Submitted form contains errors');
$strSetuperror_incorrect_ip_address = __('Incorrect IP address: %s');
$strSetuperror_incorrect_port = __('Not a valid port number');
$strSetuperror_incorrect_value = __('Incorrect value');
$strSetuperror_missing_field_data = __('Missing data for %s');
$strSetuperror_nan_nneg = __('Not a non-negative number');
$strSetuperror_nan_p = __('Not a positive number');
$strSetupExecTimeLimit_desc = __('Set the number of seconds a script is allowed to run ([kbd]0[/kbd] for no limit)'); $strSetupExecTimeLimit_desc = __('Set the number of seconds a script is allowed to run ([kbd]0[/kbd] for no limit)');
$strSetupExecTimeLimit_name = __('Maximum execution time'); $strSetupExecTimeLimit_name = __('Maximum execution time');
$strSetupExport_asfile_name = __('Save as file'); $strSetupExport_asfile_name = __('Save as file');
@@ -103,6 +90,7 @@ $strSetupForm_Edit_desc = __('Customize edit mode');
$strSetupForm_Edit = __('Edit mode'); $strSetupForm_Edit = __('Edit mode');
$strSetupForm_Export_defaults_desc = __('Customize default export options'); $strSetupForm_Export_defaults_desc = __('Customize default export options');
$strSetupForm_Export_defaults = __('Export defaults'); $strSetupForm_Export_defaults = __('Export defaults');
$strSetupForm_General = __('General settings');
$strSetupForm_Import_defaults_desc = __('Customize default common import options'); $strSetupForm_Import_defaults_desc = __('Customize default common import options');
$strSetupForm_Import_defaults = __('Import defaults'); $strSetupForm_Import_defaults = __('Import defaults');
$strSetupForm_Import_export_desc = __('Set import and export directories and compression options'); $strSetupForm_Import_export_desc = __('Set import and export directories and compression options');
@@ -120,6 +108,8 @@ $strSetupForm_Other_core_settings_desc = __('Settings that didn\'t fit enywhere
$strSetupForm_Other_core_settings = __('Other core settings'); $strSetupForm_Other_core_settings = __('Other core settings');
$strSetupForm_Query_window_desc = __('Customize query window options'); $strSetupForm_Query_window_desc = __('Customize query window options');
$strSetupForm_Query_window = __('Query window'); $strSetupForm_Query_window = __('Query window');
$strSetupForm_Page_titles = __('Page titles');
$strSetupForm_Page_titles_desc = __('Specify windows\' title bar. Refer to [a@Documentation.html#cfg_TitleTable]documentation[/a] for magic strings that can be used to get special values.');
$strSetupForm_Security_desc = __('Please note that phpMyAdmin is just a user interface and its features do not limit MySQL'); $strSetupForm_Security_desc = __('Please note that phpMyAdmin is just a user interface and its features do not limit MySQL');
$strSetupForm_Security = __('Security'); $strSetupForm_Security = __('Security');
$strSetupForm_Server = __('Basic settings'); $strSetupForm_Server = __('Basic settings');
@@ -128,7 +118,7 @@ $strSetupForm_Server_config = __('Server configuration');
$strSetupForm_Server_desc = __('Enter server connection parameters'); $strSetupForm_Server_desc = __('Enter server connection parameters');
$strSetupForm_Server_login_options_desc = __('Enter login options for signon authentication'); $strSetupForm_Server_login_options_desc = __('Enter login options for signon authentication');
$strSetupForm_Server_login_options = __('Signon login options'); $strSetupForm_Server_login_options = __('Signon login options');
$strSetupForm_Server_pmadb_desc = __('Configure phpMyAdmin database to gain access to additional features, see [a@../Documentation.html#linked-tables]linked-tables infrastructure[/a] in documentation'); $strSetupForm_Server_pmadb_desc = __('Configure phpMyAdmin database to gain access to additional features, see [a@Documentation.html#linked-tables]linked-tables infrastructure[/a] in documentation');
$strSetupForm_Server_pmadb = __('PMA database'); $strSetupForm_Server_pmadb = __('PMA database');
$strSetupForm_Server_tracking_desc = __('Tracking of changes made in database. Requires configured PMA database.'); $strSetupForm_Server_tracking_desc = __('Tracking of changes made in database. Requires configured PMA database.');
$strSetupForm_Server_tracking = __('Changes tracking'); $strSetupForm_Server_tracking = __('Changes tracking');
@@ -160,6 +150,7 @@ $strSetupImport_format_desc = __('Default format; be aware that this list depend
$strSetupImport_format_name = __('Format of imported file'); $strSetupImport_format_name = __('Format of imported file');
$strSetupImport_skip_queries_desc = __('Number of queries to skip from start'); $strSetupImport_skip_queries_desc = __('Number of queries to skip from start');
$strSetupImport_skip_queries_name = __('Partial import: skip queries'); $strSetupImport_skip_queries_name = __('Partial import: skip queries');
$strSetupInitialSlidersState_name = __('Initial state for sliders');
$strSetupInsecureConnection = __('Insecure connection'); $strSetupInsecureConnection = __('Insecure connection');
$strSetupInsecureConnectionMsg1 = __('You are not using a secure connection; all data (including potentially sensitive information, like passwords) is transferred unencrypted!'); $strSetupInsecureConnectionMsg1 = __('You are not using a secure connection; all data (including potentially sensitive information, like passwords) is transferred unencrypted!');
$strSetupInsecureConnectionMsg2 = __('If your server is also configured to accept HTTPS requests follow [a@%s]this link[/a] to use a secure connection.'); $strSetupInsecureConnectionMsg2 = __('If your server is also configured to accept HTTPS requests follow [a@%s]this link[/a] to use a secure connection.');
@@ -197,6 +188,8 @@ $strSetupLoginCookieStore_name = __('Login cookie store');
$strSetupLoginCookieValidity_desc = __('Define how long (in seconds) a login cookie is valid'); $strSetupLoginCookieValidity_desc = __('Define how long (in seconds) a login cookie is valid');
$strSetupLoginCookieValidityMsg = __('[a@?page=form&formset=features#tab_Security]Login cookie validity[/a] should be set to 1800 seconds (30 minutes) at most. Values larger than 1800 may pose a security risk such as impersonation.'); $strSetupLoginCookieValidityMsg = __('[a@?page=form&formset=features#tab_Security]Login cookie validity[/a] should be set to 1800 seconds (30 minutes) at most. Values larger than 1800 may pose a security risk such as impersonation.');
$strSetupLoginCookieValidity_name = __('Login cookie validity'); $strSetupLoginCookieValidity_name = __('Login cookie validity');
$strSetupLongtextDoubleTextarea_name = __('Bigger textarea for LONGTEXT');
$strSetupLongtextDoubleTextarea_desc = __('Double size of textarea for LONGTEXT fields');
$strSetupMainPageIconic_name = __('Use icons on main page'); $strSetupMainPageIconic_name = __('Use icons on main page');
$strSetupMaxCharactersInDisplayedSQL_desc = __('Maximum number of characters used when a SQL query is displayed'); $strSetupMaxCharactersInDisplayedSQL_desc = __('Maximum number of characters used when a SQL query is displayed');
$strSetupMaxCharactersInDisplayedSQL_name = __('Maximum displayed SQL length'); $strSetupMaxCharactersInDisplayedSQL_name = __('Maximum displayed SQL length');
@@ -208,6 +201,8 @@ $strSetupMaxTableList_desc = __('Maximum number of tables displayed in table lis
$strSetupMaxTableList_name = __('Maximum tables'); $strSetupMaxTableList_name = __('Maximum tables');
$strSetupMemoryLimit_desc = __('The number of bytes a script is allowed to allocate, eg. [kbd]32M[/kbd] ([kbd]0[/kbd] for no limit)'); $strSetupMemoryLimit_desc = __('The number of bytes a script is allowed to allocate, eg. [kbd]32M[/kbd] ([kbd]0[/kbd] for no limit)');
$strSetupMemoryLimit_name = __('Memory limit'); $strSetupMemoryLimit_name = __('Memory limit');
$strSetupNaturalOrder_name = __('Natural order');
$strSetupNaturalOrder_desc = __('Use natural order for sorting table and database names');
$strSetupNavigationBarIconic_desc = __('Use only icons, only text or both'); $strSetupNavigationBarIconic_desc = __('Use only icons, only text or both');
$strSetupNavigationBarIconic_name = __('Iconic navigation bar'); $strSetupNavigationBarIconic_name = __('Iconic navigation bar');
$strSetupNewServer = __('New server'); $strSetupNewServer = __('New server');
@@ -232,6 +227,8 @@ $strSetupQueryWindowDefTab_desc = __('Tab displayed when opening a new query win
$strSetupQueryWindowDefTab_name = __('Default query window tab'); $strSetupQueryWindowDefTab_name = __('Default query window tab');
$strSetupRecodingEngine_desc = __('Select which functions will be used for character set conversion'); $strSetupRecodingEngine_desc = __('Select which functions will be used for character set conversion');
$strSetupRecodingEngine_name = __('Recoding engine'); $strSetupRecodingEngine_name = __('Recoding engine');
$strSetupReplaceHelpImg_name = __('Show help button');
$strSetupReplaceHelpImg_desc = __('Show help button instead of Documentation text');
$strSetupRestoreDefaultValue = __('Restore default value'); $strSetupRestoreDefaultValue = __('Restore default value');
$strSetupRevertErroneousFields = __('Try to revert erroneous fields to their default values'); $strSetupRevertErroneousFields = __('Try to revert erroneous fields to their default values');
$strSetupSaveDir_desc = __('Directory where exports can be saved on server'); $strSetupSaveDir_desc = __('Directory where exports can be saved on server');
@@ -270,7 +267,6 @@ $strSetupServers_designer_coords_name = __('Designer table');
$strSetupServers_DisableIS_desc = __('More information on [a@http://sf.net/support/tracker.php?aid=1849494]PMA bug tracker[/a] and [a@http://bugs.mysql.com/19588]MySQL Bugs[/a]'); $strSetupServers_DisableIS_desc = __('More information on [a@http://sf.net/support/tracker.php?aid=1849494]PMA bug tracker[/a] and [a@http://bugs.mysql.com/19588]MySQL Bugs[/a]');
$strSetupServers_DisableIS_name = __('Disable use of INFORMATION_SCHEMA'); $strSetupServers_DisableIS_name = __('Disable use of INFORMATION_SCHEMA');
$strSetupServerSecurityInfoMsg = __('If you feel this is necessary, use additional protection settings - [a@?page=servers&amp;mode=edit&amp;id=%1$d#tab_Server_config]host authentication[/a] settings and [a@?page=form&amp;formset=features#tab_Security]trusted proxies list[/a]. However, IP-based protection may not be reliable if your IP belongs to an ISP where thousands of users, including you, are connected to.'); $strSetupServerSecurityInfoMsg = __('If you feel this is necessary, use additional protection settings - [a@?page=servers&amp;mode=edit&amp;id=%1$d#tab_Server_config]host authentication[/a] settings and [a@?page=form&amp;formset=features#tab_Security]trusted proxies list[/a]. However, IP-based protection may not be reliable if your IP belongs to an ISP where thousands of users, including you, are connected to.');
$strSetupServersEdit = __('Edit server');
$strSetupServers_extension_desc = __('What PHP extension to use; you should use mysqli if supported'); $strSetupServers_extension_desc = __('What PHP extension to use; you should use mysqli if supported');
$strSetupServers_extension_name = __('PHP extension to use'); $strSetupServers_extension_name = __('PHP extension to use');
$strSetupServers_hide_db_desc = __('Hide databases matching regular expression (PCRE)'); $strSetupServers_hide_db_desc = __('Hide databases matching regular expression (PCRE)');
@@ -357,6 +353,17 @@ $strSetupSQLQuery_ShowAsPHP_name = __('Create PHP Code');
$strSetupSQLQuery_Validate_name = __('Validate SQL'); $strSetupSQLQuery_Validate_name = __('Validate SQL');
$strSetupSuggestDBName_desc = __('Suggest a database name on the &quot;Create Database&quot; form (if possible) or keep the text field empty'); $strSetupSuggestDBName_desc = __('Suggest a database name on the &quot;Create Database&quot; form (if possible) or keep the text field empty');
$strSetupSuggestDBName_name = __('Suggest new database name'); $strSetupSuggestDBName_name = __('Suggest new database name');
$strSetupTextareaCols_name = __('Textarea columns');
$strSetupTextareaCols_desc = __('Textarea size (columns) in edit mode, this value will be emphasized for SQL query textareas (*2) and for query window (*1.25)');
$strSetupTextareaRows_name = __('Textarea rows');
$strSetupTitleDefault_name = __('Default title');
$strSetupTitleDefault_desc = __('Title of browser window when nothing is selected');
$strSetupTitleTable_name = __('Table');
$strSetupTitleTable_desc = __('Title of browser window when a table is selected');
$strSetupTitleDatabase_name = __('Database');
$strSetupTitleDatabase_desc = __('Title of browser window when a database is selected');
$strSetupTitleServer_name = __('Server');
$strSetupTitleServer_desc = __('Title of browser window when a server is selected');
$strSetupTrue = __('yes'); $strSetupTrue = __('yes');
$strSetupTrustedProxies_desc = __('Input proxies as [kbd]IP: trusted HTTP header[/kbd]. The following example specifies that phpMyAdmin should trust a HTTP_X_FORWARDED_FOR (X-Forwarded-For) header coming from the proxy 1.2.3.4:[br][kbd]1.2.3.4: HTTP_X_FORWARDED_FOR[/kbd]'); $strSetupTrustedProxies_desc = __('Input proxies as [kbd]IP: trusted HTTP header[/kbd]. The following example specifies that phpMyAdmin should trust a HTTP_X_FORWARDED_FOR (X-Forwarded-For) header coming from the proxy 1.2.3.4:[br][kbd]1.2.3.4: HTTP_X_FORWARDED_FOR[/kbd]');
$strSetupTrustedProxies_name = __('List of trusted proxies for IP allow/deny'); $strSetupTrustedProxies_name = __('List of trusted proxies for IP allow/deny');

View File

@@ -8,9 +8,6 @@
$forms = array(); $forms = array();
$forms['Features']['General'] = array( $forms['Features']['General'] = array(
'DefaultLang',
'DefaultConnectionCollation',
'ThemeDefault',
'NaturalOrder', 'NaturalOrder',
'InitialSlidersState', 'InitialSlidersState',
'ErrorIconic', 'ErrorIconic',
@@ -28,26 +25,21 @@ $forms['Sql_queries']['Sql_queries'] = array(
'IgnoreMultiSubmitErrors', 'IgnoreMultiSubmitErrors',
'VerboseMultiSubmit', 'VerboseMultiSubmit',
'MaxCharactersInDisplayedSQL',// [s-] 'MaxCharactersInDisplayedSQL',// [s-]
'SQLQuery/Edit',// [s-]
'SQLQuery/Explain',// [s-]
'SQLQuery/ShowAsPHP',// [s-]
'SQLQuery/Validate',// [false or no override]
'SQLQuery/Refresh',// [s-]
'EditInWindow',// [s-] 'EditInWindow',// [s-]
'QueryWindowWidth',// [s-] 'QueryWindowWidth',// [s-]
'QueryWindowHeight',// [s-] 'QueryWindowHeight',// [s-]
'QueryWindowDefTab');// [s-] 'QueryWindowDefTab');// [s-]
$forms['Sql_queries']['Sql_box'] = array( $forms['Sql_queries']['Sql_box'] = array(
'Edit', 'SQLQuery/Edit',// [s-]
'Explain', 'SQLQuery/Explain',// [s-]
'ShowAsPHP', 'SQLQuery/ShowAsPHP',// [s-]
'Validate',// (false or no override) 'SQLQuery/Validate',// [false or no override]
'Refresh'); 'SQLQuery/Refresh');// [s-]
$forms['Features']['Page_titles'] = array( $forms['Features']['Page_titles'] = array(
'TitleDefault',// [s-]
'TitleTable',// [s-] 'TitleTable',// [s-]
'TitleDatabase',// [s-] 'TitleDatabase',// [s-]
'TitleServer',// [s-] 'TitleServer');// [s-]
'TitleDefault');// [s-]
$forms['Left_frame']['Left_frame'] = array( $forms['Left_frame']['Left_frame'] = array(
'LeftFrameLight', 'LeftFrameLight',
'LeftDisplayLogo', 'LeftDisplayLogo',

View File

@@ -41,7 +41,7 @@ function process_formset(FormDisplay $form_display) {
?> ?>
<div class="warning"> <div class="warning">
<h4><?php echo __('Warning') ?></h4> <h4><?php echo __('Warning') ?></h4>
<?php echo PMA_lang('error_form') ?><br /> <?php echo __('Submitted form contains errors') ?><br />
<a href="?page=<?php echo $page . $formset . $id . $separator ?>mode=revert"><?php echo PMA_lang('RevertErroneousFields') ?></a> <a href="?page=<?php echo $page . $formset . $id . $separator ?>mode=revert"><?php echo PMA_lang('RevertErroneousFields') ?></a>
</div> </div>
<?php $form_display->displayErrors() ?> <?php $form_display->displayErrors() ?>

View File

@@ -323,20 +323,20 @@ function perform_config_checks()
if ($blowfish_secret_set) { if ($blowfish_secret_set) {
// 'cookie' auth used, blowfish_secret was generated // 'cookie' auth used, blowfish_secret was generated
messages_set('notice', 'blowfish_secret_created', 'blowfish_secret_name', messages_set('notice', 'blowfish_secret_created', 'blowfish_secret_name',
PMA_lang('BlowfishSecretMsg')); __('You didn\'t have blowfish secret set and have enabled cookie authentication, so a key was automatically generated for you. It is used to encrypt cookies; you don\'t need to remember it.'));
} else { } else {
$blowfish_warnings = array(); $blowfish_warnings = array();
// check length // check length
if (strlen($blowfish_secret) < 8) { if (strlen($blowfish_secret) < 8) {
// too short key // too short key
$blowfish_warnings[] = PMA_lang('BlowfishSecretLengthMsg'); $blowfish_warnings[] = __('Key is too short, it should have at least 8 characters');
} }
// check used characters // check used characters
$has_digits = (bool) preg_match('/\d/', $blowfish_secret); $has_digits = (bool) preg_match('/\d/', $blowfish_secret);
$has_chars = (bool) preg_match('/\S/', $blowfish_secret); $has_chars = (bool) preg_match('/\S/', $blowfish_secret);
$has_nonword = (bool) preg_match('/\W/', $blowfish_secret); $has_nonword = (bool) preg_match('/\W/', $blowfish_secret);
if (!$has_digits || !$has_chars || !$has_nonword) { if (!$has_digits || !$has_chars || !$has_nonword) {
$blowfish_warnings[] = PMA_lang('BlowfishSecretCharsMsg'); $blowfish_warnings[] = PMA_sanitize(__('Key should contain letters, numbers [em]and[/em] special characters'));
} }
if (!empty($blowfish_warnings)) { if (!empty($blowfish_warnings)) {
messages_set('warning', 'blowfish_warnings' . count($blowfish_warnings), messages_set('warning', 'blowfish_warnings' . count($blowfish_warnings),
@@ -413,7 +413,7 @@ function perform_config_checks()
? '' ? ''
: ($functions ? ', ' : '') . 'bzcompress'; : ($functions ? ', ' : '') . 'bzcompress';
messages_set('warning', 'BZipDump', 'BZipDump_name', messages_set('warning', 'BZipDump', 'BZipDump_name',
PMA_lang('BZipDumpWarning', $functions)); PMA_sanitize(sprintf(__('[a@?page=form&amp;formset=features#tab_Import_export]Bzip2 compression and decompression[/a] requires functions (%s) which are unavailable on this system.'), $functions)));
} }
// //

View File

@@ -131,14 +131,14 @@ function test_db_connection($extension, $connect_type, $host, $port, $socket, $u
if ($extension == 'mysql') { if ($extension == 'mysql') {
$conn = @mysql_connect($host . $socket . $port, $user, $pass); $conn = @mysql_connect($host . $socket . $port, $user, $pass);
if (!$conn) { if (!$conn) {
$error = PMA_lang('error_connection'); $error = __('Could not connect to MySQL server');
} else { } else {
mysql_close($conn); mysql_close($conn);
} }
} else { } else {
$conn = @mysqli_connect($host, $user, $pass, null, $port, $socket); $conn = @mysqli_connect($host, $user, $pass, null, $port, $socket);
if (!$conn) { if (!$conn) {
$error = PMA_lang('error_connection'); $error = __('Could not connect to MySQL server');
} else { } else {
mysqli_close($conn); mysqli_close($conn);
} }
@@ -162,15 +162,15 @@ function validate_server($path, $values)
$result = array('Server' => '', 'Servers/1/user' => '', 'Servers/1/SignonSession' => '', 'Servers/1/SignonURL' => ''); $result = array('Server' => '', 'Servers/1/user' => '', 'Servers/1/SignonSession' => '', 'Servers/1/SignonURL' => '');
$error = false; $error = false;
if ($values['Servers/1/auth_type'] == 'config' && empty($values['Servers/1/user'])) { if ($values['Servers/1/auth_type'] == 'config' && empty($values['Servers/1/user'])) {
$result['Servers/1/user'] = PMA_lang('error_empty_user_for_config_auth'); $result['Servers/1/user'] = __('Empty username while using config authentication method');
$error = true; $error = true;
} }
if ($values['Servers/1/auth_type'] == 'signon' && empty($values['Servers/1/SignonSession'])) { if ($values['Servers/1/auth_type'] == 'signon' && empty($values['Servers/1/SignonSession'])) {
$result['Servers/1/SignonSession'] = PMA_lang('error_empty_signon_session'); $result['Servers/1/SignonSession'] = __('Empty signon session name while using signon authentication method');
$error = true; $error = true;
} }
if ($values['Servers/1/auth_type'] == 'signon' && empty($values['Servers/1/SignonURL'])) { if ($values['Servers/1/auth_type'] == 'signon' && empty($values['Servers/1/SignonURL'])) {
$result['Servers/1/SignonURL'] = PMA_lang('error_empty_signon_url'); $result['Servers/1/SignonURL'] = __('Empty signon URL while using signon authentication method');
$error = true; $error = true;
} }
@@ -203,15 +203,17 @@ function validate_pmadb($path, $values)
$result = array(); $result = array();
if ($values['Servers/1/controluser'] == '') { if ($values['Servers/1/controluser'] == '') {
$result['Servers/1/controluser'] = PMA_lang('error_empty_pmadb_user'); $result['Servers/1/controluser'] = __('Empty phpMyAdmin control user while using pmadb');
$error = true; $error = true;
} }
if ($values['Servers/1/controlpass'] == '') { if ($values['Servers/1/controlpass'] == '') {
$result['Servers/1/controlpass'] = PMA_lang('error_empty_pmadb_password'); $result['Servers/1/controlpass'] = __('Empty phpMyAdmin control user password while using pmadb');
$error = true; $error = true;
} }
if (!$error) { if (!$error) {
$test = test_db_connection($values['Servers/1/extension'], $values['Servers/1/connect_type'], $values['Servers/1/host'], $values['Servers/1/port'], $values['Servers/1/socket'], $values['Servers/1/controluser'], $values['Servers/1/controlpass'], 'Server_pmadb'); $test = test_db_connection($values['Servers/1/extension'], $values['Servers/1/connect_type'],
$values['Servers/1/host'], $values['Servers/1/port'], $values['Servers/1/socket'],
$values['Servers/1/controluser'], $values['Servers/1/controlpass'], 'Server_pmadb');
if ($test !== true) { if ($test !== true) {
$result = array_merge($result, $test); $result = array_merge($result, $test);
} }
@@ -283,14 +285,14 @@ function validate_trusted_proxies($path, $values)
$matches = array(); $matches = array();
// we catch anything that may (or may not) be an IP // we catch anything that may (or may not) be an IP
if (!preg_match("/^(.+):(?:[ ]?)\\w+$/", $line, $matches)) { if (!preg_match("/^(.+):(?:[ ]?)\\w+$/", $line, $matches)) {
$result[$path][] = PMA_lang('error_incorrect_value') . ': ' . $line; $result[$path][] = __('Incorrect value') . ': ' . $line;
continue; continue;
} }
// now let's check whether we really have an IP address // now let's check whether we really have an IP address
if (filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false if (filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false
&& filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) { && filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$ip = htmlspecialchars(trim($matches[1])); $ip = htmlspecialchars(trim($matches[1]));
$result[$path][] = PMA_lang('error_incorrect_ip_address', $ip); $result[$path][] = sprintf(__('Incorrect IP address: %s'), $ip);
continue; continue;
} }
} }
@@ -307,17 +309,17 @@ function validate_trusted_proxies($path, $values)
* @param bool $allow_neg allow negative values * @param bool $allow_neg allow negative values
* @param bool $allow_zero allow zero * @param bool $allow_zero allow zero
* @param int $max_value max allowed value * @param int $max_value max allowed value
* @param string $error_lang_key error message key: $GLOBALS["strSetup$error_lang_key"] * @param string $error_string error message key: $GLOBALS["strSetup$error_lang_key"]
* @return string empty string if test is successful * @return string empty string if test is successful
*/ */
function test_number($path, $values, $allow_neg, $allow_zero, $max_value, $error_lang_key) function test_number($path, $values, $allow_neg, $allow_zero, $max_value, $error_string)
{ {
if ($values[$path] === '') { if ($values[$path] === '') {
return ''; return '';
} }
if (intval($values[$path]) != $values[$path] || (!$allow_neg && $values[$path] < 0) || (!$allow_zero && $values[$path] == 0) || $values[$path] > $max_value) { if (intval($values[$path]) != $values[$path] || (!$allow_neg && $values[$path] < 0) || (!$allow_zero && $values[$path] == 0) || $values[$path] > $max_value) {
return PMA_lang($error_lang_key); return $error_string;
} }
return ''; return '';
@@ -332,7 +334,7 @@ function test_number($path, $values, $allow_neg, $allow_zero, $max_value, $error
*/ */
function validate_port_number($path, $values) function validate_port_number($path, $values)
{ {
return array($path => test_number($path, $values, false, false, 65536, 'error_incorrect_port')); return array($path => test_number($path, $values, false, false, 65536, __('Not a valid port number')));
} }
/** /**
@@ -344,7 +346,7 @@ function validate_port_number($path, $values)
*/ */
function validate_positive_number($path, $values) function validate_positive_number($path, $values)
{ {
return array($path => test_number($path, $values, false, false, PHP_INT_MAX, 'error_nan_p')); return array($path => test_number($path, $values, false, false, PHP_INT_MAX, __('Not a positive number')));
} }
/** /**
@@ -356,6 +358,19 @@ function validate_positive_number($path, $values)
*/ */
function validate_non_negative_number($path, $values) function validate_non_negative_number($path, $values)
{ {
return array($path => test_number($path, $values, false, true, PHP_INT_MAX, 'error_nan_nneg')); return array($path => test_number($path, $values, false, true, PHP_INT_MAX, __('Not a non-negative number')));
}
/**
* Validates DefaultPropDisplay field
*
* @param $path
* @param $values
* @return array
*/
function validate_DefaultPropDisplay($path, $values)
{
$result = preg_match('/^(?:horizontal|vertical|\d+)$/', $values[$path]);
return array($path => ($result ? '' : __('Incorrect value')));
} }
?> ?>

View File

@@ -1251,7 +1251,6 @@ table#serverconnection_trg_local {
padding: 0.1em 0.4em; padding: 0.1em 0.4em;
white-space: nowrap; white-space: nowrap;
text-decoration: none; text-decoration: none;
background-color: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
border: 1px solid <?php echo $GLOBALS['cfg']['BgTwo']; ?>; border: 1px solid <?php echo $GLOBALS['cfg']['BgTwo']; ?>;
border-bottom: none; border-bottom: none;
} }
@@ -1264,7 +1263,7 @@ table#serverconnection_trg_local {
} }
.config-form ul.tabs li a.active { .config-form ul.tabs li a.active {
background-color: <?php echo $GLOBALS['cfg']['BgTwo']; ?>; background-color: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
} }
.config-form fieldset { .config-form fieldset {
@@ -1375,3 +1374,12 @@ table#serverconnection_trg_local {
border: 1px #6676FF solid; border: 1px #6676FF solid;
background: #F7FBFF; background: #F7FBFF;
} }
/* error list */
dd {
margin-left: 0.5em;
}
dd:before {
content: "\25B8 ";
}

View File

@@ -68,7 +68,7 @@ if (!$form_display->process(false)) {
?> ?>
<div class="warning"> <div class="warning">
<h4><?php echo __('Warning') ?></h4> <h4><?php echo __('Warning') ?></h4>
<?php echo PMA_lang('error_form') ?><br /> <?php echo __('Submitted form contains errors') ?><br />
<a href="?form=<?php echo $form_param ?>&amp;mode=revert"><?php echo PMA_lang('RevertErroneousFields') ?></a> <a href="?form=<?php echo $form_param ?>&amp;mode=revert"><?php echo PMA_lang('RevertErroneousFields') ?></a>
</div> </div>
<?php $form_display->displayErrors() ?> <?php $form_display->displayErrors() ?>