Skip to content

Commit

Permalink
Remove support for SQL validator
Browse files Browse the repository at this point in the history
The SOAP service seems to be down for quite some time and it is not
mentioned anywhere on Mimer website.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Apr 2, 2014
1 parent 2ef0744 commit 7233657
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 954 deletions.
45 changes: 0 additions & 45 deletions doc/config.rst
Expand Up @@ -2369,15 +2369,6 @@ SQL query box settings
Whether to display a link to wrap a query in PHP code in any SQL Query
box.

.. config:option:: $cfg['SQLQuery']['Validate']
:type: boolean
:default: false

Whether to display a link to validate a query in any SQL Query box.

.. seealso:: :config:option:`$cfg['SQLValidator']`

.. config:option:: $cfg['SQLQuery']['Refresh']
:type: boolean
Expand Down Expand Up @@ -2706,42 +2697,6 @@ Default queries
Default queries that will be displayed in query boxes when user didn't
specify any. You can use standard :ref:`faq6_27`.

SQL validator settings
----------------------

.. config:option:: $cfg['SQLValidator']
:type: array
:default: array(...)



.. config:option:: $cfg['SQLValidator']['use']
:type: boolean
:default: false

phpMyAdmin now supports use of the `Mimer SQL Validator
<http://developer.mimer.com/validator/index.htm>`_ service, as originally
published on `Slashdot
<http://developers.slashdot.org/article.pl?sid=02/02/19/1720246>`_. For
help in setting up your system to use the service, see the
:ref:`faqsqlvalidator`.

.. config:option:: $cfg['SQLValidator']['username']
:type: string
:default: ``''``

.. config:option:: $cfg['SQLValidator']['password']
:type: string
:default: ``''``

The SOAP service allows you to log in with ``anonymous`` and any password,
so we use those by default. Instead, if you have an account with them, you
can put your login details here, and it will be used in place of the
anonymous login.

MySQL settings
--------------
Expand Down
17 changes: 2 additions & 15 deletions doc/faq.rst
Expand Up @@ -1562,21 +1562,8 @@ work with it, nor delete it.

.. _faqsqlvalidator:

6.14 How do I set up the SQL Validator?
---------------------------------------

To use SQL Validator, you need PHP with :term:`XML`, :term:`PCRE` and
:term:`PEAR` support. In addition you need a :term:`SOAP` support, either as a
PHP extension or as a PEAR SOAP module.

To install :term:`PEAR` :term:`SOAP` module, run :command:`pear install
Net_Socket Net_URL HTTP_Request Mail_Mime Net_DIME SOAP` to get the necessary
:term:`PEAR` modules for usage.

If you use the Validator, you should be aware that any :term:`SQL` statement
you submit will be stored anonymously (database/table/column names, strings,
numbers replaced with generic values). The Mimer :term:`SQL` Validator itself,
is © 2001 Upright Database Technology. We utilize it as free SOAP service.
6.14 (withdrawn).
-----------------

.. _faq6_15:

Expand Down
7 changes: 0 additions & 7 deletions doc/glossary.rst
Expand Up @@ -312,13 +312,6 @@ From Wikipedia, the free encyclopedia

.. seealso:: <http://dev.mysql.com/doc/en/storage-engines.html>

SOAP
Simple Object Access Protocol is a protocol specification for exchanging
structured information in the implementation of Web Services in computer
networks.

.. seealso:: <http://en.wikipedia.org/wiki/SOAP>

socket
a form of inter-process communication.

Expand Down
40 changes: 2 additions & 38 deletions libraries/Util.class.php
Expand Up @@ -1127,14 +1127,6 @@ public static function getMessage(

if (! empty($GLOBALS['show_as_php'])) {
$query_base = '$sql = "' . $query_base;
} elseif (! empty($GLOBALS['validatequery'])) {
try {
$query_base = PMA_validateSQL($query_base);
} catch (Exception $e) {
$retval .= PMA_Message::error(
__('Failed to connect to SQL validator!')
)->getDisplay();
}
} elseif (isset($query_base)) {
$query_base = self::formatSql($query_base);
}
Expand Down Expand Up @@ -1167,11 +1159,6 @@ public static function getMessage(
$is_select = preg_match('@^SELECT[[:space:]]+@i', $sql_query);
if (! empty($cfg['SQLQuery']['Explain']) && ! $query_too_big) {
$explain_params = $url_params;
// Detect if we are validating as well
// To preserve the validate uRL data
if (! empty($GLOBALS['validatequery'])) {
$explain_params['validatequery'] = 1;
}
if ($is_select) {
$explain_params['sql_query'] = 'EXPLAIN ' . $sql_query;
$_message = __('Explain SQL');
Expand Down Expand Up @@ -1253,30 +1240,7 @@ public static function getMessage(
$refresh_link = '';
} //refresh

if (! empty($cfg['SQLValidator']['use'])
&& ! empty($cfg['SQLQuery']['Validate'])
) {
$validate_params = $url_params;
if (! empty($GLOBALS['validatequery'])) {
$validate_message = __('Skip Validate SQL');
} else {
$validate_params['validatequery'] = 1;
$validate_message = __('Validate SQL');
}

$validate_link = 'import.php'
. PMA_URL_getCommon($validate_params);
$validate_link = ' ['
. self::linkOrButton($validate_link, $validate_message) . ']';
} else {
$validate_link = '';
} //validator

if (! empty($GLOBALS['validatequery'])) {
$retval .= '<div class="sqlvalidate">';
} else {
$retval .= '<div class="sqlOuter">';
}
$retval .= '<div class="sqlOuter">';
if ($query_too_big) {
$retval .= $shortened_query_base;
} else {
Expand Down Expand Up @@ -1322,7 +1286,7 @@ public static function getMessage(
$inline_edit_link = '';
}
$retval .= $inline_edit_link . $edit_link . $explain_link . $php_link
. $refresh_link . $validate_link;
. $refresh_link;
$retval .= '</div>';
}

Expand Down
5 changes: 0 additions & 5 deletions libraries/common.inc.php
Expand Up @@ -1025,11 +1025,6 @@
*/
include_once './libraries/sqlparser.lib.php';

/**
* SQL Validator interface code
*/
include_once './libraries/sqlvalidator.lib.php';

/**
* the PMA_List_Database class
*/
Expand Down
39 changes: 0 additions & 39 deletions libraries/config.default.php
Expand Up @@ -2718,13 +2718,6 @@
*/
$cfg['SQLQuery']['ShowAsPHP'] = true;

/**
* Validate a query (see $cfg['SQLValidator'] as well)
*
* @global boolean $cfg['SQLQuery']['Validate']
*/
$cfg['SQLQuery']['Validate'] = false;

/**
* Refresh the results page
*
Expand Down Expand Up @@ -2824,38 +2817,6 @@
*/
$cfg['SendErrorReports'] = 'ask';

/*******************************************************************************
* If you wish to use the SQL Validator service, you should be aware of the
* following:
* All SQL statements are stored anonymously for statistical purposes.
* Mimer SQL Validator, Copyright 2002 Upright Database Technology.
* All rights reserved.
*
* @global array $cfg['SQLValidator']
*/
$cfg['SQLValidator'] = array();

/**
* Make the SQL Validator available
*
* @global boolean $cfg['SQLValidator']['use']
*/
$cfg['SQLValidator']['use'] = false;

/**
* If you have a custom username, specify it here (defaults to anonymous)
*
* @global string $cfg['SQLValidator']['username']
*/
$cfg['SQLValidator']['username'] = '';

/**
* Password for username
*
* @global string $cfg['SQLValidator']['password']
*/
$cfg['SQLValidator']['password'] = '';


/*******************************************************************************
* Developers ONLY!
Expand Down
15 changes: 0 additions & 15 deletions libraries/config/FormDisplay.class.php
Expand Up @@ -809,21 +809,6 @@ private function _setComments($system_path, array &$opts)
$opts['comment'] = $comment;
$opts['comment_warning'] = true;
}
if ($system_path == 'SQLQuery/Validate'
&& ! $GLOBALS['cfg']['SQLValidator']['use']
) {
$opts['comment'] = __('SQL Validator is disabled');
$opts['comment_warning'] = true;
}
if ($system_path == 'SQLValidator/use') {
if (!class_exists('SOAPClient')) {
@include_once 'SOAP/Client.php';
if (!class_exists('SOAP_Client')) {
$opts['comment'] = __('SOAP extension not found');
$opts['comment_warning'] = true;
}
}
}
if (!defined('PMA_SETUP')) {
if (($system_path == 'MaxDbList' || $system_path == 'MaxTableList'
|| $system_path == 'QueryHistoryMax')
Expand Down
15 changes: 0 additions & 15 deletions libraries/config/messages.inc.php
Expand Up @@ -291,14 +291,6 @@
$strConfigForm_Sql_desc = __('Customize default options.');
$strConfigForm_Sql_queries = __('SQL queries');
$strConfigForm_Sql_queries_desc = __('SQL queries settings.');
$strConfigForm_Sql_validator = __('SQL Validator');
$strConfigForm_Sql_validator_desc = __(
'If you wish to use the SQL Validator service, you should be aware that '
. '[strong]all SQL statements are stored anonymously for statistical '
. 'purposes[/strong].[br][em][a@http://sqlvalidator.mimer.com/]Mimer SQL '
. 'Validator[/a], Copyright 2002 Upright Database Technology. All rights '
. 'reserved.[/em]'
);
$strConfigForm_Startup = __('Startup');
$strConfigForm_Startup_desc = __('Customize startup page.');
$strConfigForm_DbStructure = __('Database structure');
Expand Down Expand Up @@ -752,13 +744,6 @@
$strConfigSQLQuery_Explain_name = __('Explain SQL');
$strConfigSQLQuery_Refresh_name = __('Refresh');
$strConfigSQLQuery_ShowAsPHP_name = __('Create PHP Code');
$strConfigSQLQuery_Validate_desc = __('Requires SQL Validator to be enabled.');
$strConfigSQLQuery_Validate_name = __('Validate SQL');
$strConfigSQLValidator_password_name = __('Password');
$strConfigSQLValidator_use_desc = __('[strong]Warning:[/strong] requires PHP SOAP extension or PEAR SOAP to be installed.');
$strConfigSQLValidator_use_name = __('Enable SQL Validator');
$strConfigSQLValidator_username_desc = __('If you have a custom username, specify it here (defaults to [kbd]anonymous[/kbd]).');
$strConfigSQLValidator_username_name = __('Username');
$strConfigSuhosinDisableWarning_desc = __('A warning is displayed on the main page if Suhosin is detected.');
$strConfigSuhosinDisableWarning_name = __('Suhosin warning');
$strConfigTextareaCols_desc = __('Textarea size (columns) in edit mode, this value will be emphasized for SQL query textareas (*2) and for query window (*1.25).');
Expand Down
5 changes: 0 additions & 5 deletions libraries/config/setup.forms.php
Expand Up @@ -164,12 +164,7 @@
'Edit',
'Explain',
'ShowAsPHP',
'Validate',
'Refresh'));
$forms['Sql_queries']['Sql_validator'] = array('SQLValidator' => array(
'use',
'username',
'password'));
$forms['Navi_panel']['Navi_panel'] = array(
'NavigationDisplayLogo',
'NavigationLogoLink',
Expand Down
1 change: 0 additions & 1 deletion libraries/config/user_preferences.forms.php
Expand Up @@ -77,7 +77,6 @@
'SQLQuery/Edit',
'SQLQuery/Explain',
'SQLQuery/ShowAsPHP',
'SQLQuery/Validate',
'SQLQuery/Refresh');
$forms['Navi_panel']['Navi_panel'] = array(
'NavigationDisplayLogo',
Expand Down
4 changes: 1 addition & 3 deletions libraries/sql.lib.php
Expand Up @@ -1490,7 +1490,7 @@ function PMA_executeTheQuery($analyzed_sql_results, $full_sql_query, $is_gotofil
$db, $table, $find_real_end, $sql_query_for_bookmark, $extra_data
) {
// Only if we ask to see the php code
if (isset($GLOBALS['show_as_php']) || ! empty($GLOBALS['validatequery'])) {
if (isset($GLOBALS['show_as_php'])) {
$result = null;
$num_rows = 0;
$unlim_num_rows = 0;
Expand Down Expand Up @@ -1631,8 +1631,6 @@ function PMA_getMessageForNoRowsReturned($message_to_show, $analyzed_sql_results
} elseif (isset($GLOBALS['show_as_php'])) {
/* User disable showing as PHP, query is only displayed */
$message = PMA_Message::notice(__('Showing SQL query'));
} elseif (! empty($GLOBALS['validatequery'])) {
$message = PMA_Message::notice(__('Validated SQL'));
} else {
$message = PMA_Message::success(
__('MySQL returned an empty result set (i.e. zero rows).')
Expand Down

0 comments on commit 7233657

Please sign in to comment.