diff --git a/ChangeLog b/ChangeLog index ef14389e61..09c3bad541 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ phpMyAdmin - ChangeLog + rfe #316 Configurable menus; allow user groups with customized menus per group - bug #4024 Editing field a record is selected by makes pma load forever - bug #4035 Query "inline" link disappears when turning off "Explain SQL" option ++ rfe #1385 Hide tables, functions, procedures, events and views in navigation tree 4.0.5.0 (not yet released) - bug #3977 Not detected configuration storage @@ -46,6 +47,17 @@ phpMyAdmin - ChangeLog - bug #3998 Non-permanent SQL history not working - bug #3578 Transformations for text/plain on a BLOB column +4.0.4.2 (2013-07-28) +- [security] Fix stored XSS in Server status monitor, see PMASA-2013-9 +- [security] Fix stored XSS in navigation panel logo link, see PMASA-2013-9 +- [security] Fix self-XSS in setup, trusted proxies validation, see PMASA-2013-9 +- [security] Fix full path disclosure, see PMASA-2013-12 +- [security] Fix control user SQL injection in pmd_pdf.php, see PMASA-2013-15 +- [security] Fix control user SQL injection in schema_export.php, see PMASA-2013-15 +- [security] Fix self-XSS in schema export, see PMASA-2013-14 +- [security] Fix unencoded json object, see PMASA-2013-11 +- [security] Fix stored XSS in link transformation plugin, see PMASA-2013-13 + 4.0.4.1 (2013-06-30) - [security] Global variables scope injection vulnerability (see PMASA-2013-7) @@ -232,6 +244,20 @@ underscore (see PMASA-2013-5) - bug #3892 [export] SQL Export files are empty +3.5.8.2 (2013-07-28) +- [security] Fix self-XSS in "Showing rows", see PMASA-2013-8 +- [security] Fix self-XSS in Display chart, see PMASA-2013-9 +- [security] Fix stored XSS in Server status monitor, see PMASA-2013-9 +- [security] Fix stored XSS in navigation panel logo link, see PMASA-2013-9 +- [security] Fix self-XSS in setup, trusted proxies validation, see PMASA-2013-9 ++ [security] JSON content type header for version_check.php, see PMASA-2013-9 ++ [security] Backport fix for jQuery issue #9521 from jQuery 1.6.3, see PMASA-2013-9 ++ [security] Fix full path disclosure, see PMASA-2013-12 ++ [security] Fix control user SQL injection in pmd_pdf.php, see PMASA-2013-15 ++ [security] Fix control user SQL injection in schema_export.php, see PMASA-2013-15 +- [security] Fix self-XSS in schema export, see PMASA-2013-14 +- [security] Fix unencoded json object, see PMASA-2013-11 + 3.5.8.1 (2013-04-24) - [security] Remote code execution (preg_replace), reported by Janek Vind (see PMASA-2013-2) diff --git a/browse_foreigners.php b/browse_foreigners.php index d9441e18fe..e94cea8082 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -241,7 +241,7 @@ if (is_array($foreignData['disp_row'])) { $val_ordered_current_row++; - if ($GLOBALS['PMA_String']::strlen($val_ordered_current_val) <= $cfg['LimitChars']) { + if ($GLOBALS['PMA_String']->strlen($val_ordered_current_val) <= $cfg['LimitChars']) { $val_ordered_current_val = htmlspecialchars( $val_ordered_current_val ); @@ -251,11 +251,11 @@ if (is_array($foreignData['disp_row'])) { $val_ordered_current_val ); $val_ordered_current_val = htmlspecialchars( - $GLOBALS['PMA_String']::substr($val_ordered_current_val, 0, $cfg['LimitChars']) + $GLOBALS['PMA_String']->substr($val_ordered_current_val, 0, $cfg['LimitChars']) . '...' ); } - if ($GLOBALS['PMA_String']::strlen($key_ordered_current_val) <= $cfg['LimitChars']) { + if ($GLOBALS['PMA_String']->strlen($key_ordered_current_val) <= $cfg['LimitChars']) { $key_ordered_current_val = htmlspecialchars( $key_ordered_current_val ); @@ -265,7 +265,7 @@ if (is_array($foreignData['disp_row'])) { $key_ordered_current_val ); $key_ordered_current_val = htmlspecialchars( - $GLOBALS['PMA_String']::substr( + $GLOBALS['PMA_String']->substr( $key_ordered_current_val, 0, $cfg['LimitChars'] ) . '...' ); diff --git a/config.sample.inc.php b/config.sample.inc.php index 7c40fb40e3..117798fbf4 100644 --- a/config.sample.inc.php +++ b/config.sample.inc.php @@ -61,6 +61,7 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false; // $cfg['Servers'][$i]['recent'] = 'pma__recent'; // $cfg['Servers'][$i]['users'] = 'pma__users'; // $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; +// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; /* Contrib / Swekey authentication */ // $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf'; diff --git a/doc/config.rst b/doc/config.rst index e97b6596ba..b46cec3159 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -673,6 +673,20 @@ Server connection settings :config:option:`$cfg['Servers'][$i]['users']` (e.g. ``pma__users``) and :config:option:`$cfg['Servers'][$i]['usergroups']` (e.g. ``pma__usergroups``) +.. _navigationhiding: +.. config:option:: $cfg['Servers'][$i]['navigationhiding'] + + :type: string + :default: ``''`` + + Since release 4.1.0 you can hide/show items in the navigation tree. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['navigationhiding']` (e.g. + ``pma__navigationhiding``) + .. _tracking: .. config:option:: $cfg['Servers'][$i]['tracking'] diff --git a/examples/config.manyhosts.inc.php b/examples/config.manyhosts.inc.php index b9165355ee..3ab6572bcc 100644 --- a/examples/config.manyhosts.inc.php +++ b/examples/config.manyhosts.inc.php @@ -47,4 +47,5 @@ foreach ($hosts as $host) { $cfg['Servers'][$i]['recent'] = 'pma__recent'; $cfg['Servers'][$i]['users'] = 'pma__users'; $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; + $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; } diff --git a/examples/create_tables.sql b/examples/create_tables.sql index ae2c81408c..ca23e71c06 100644 --- a/examples/create_tables.sql +++ b/examples/create_tables.sql @@ -302,3 +302,20 @@ CREATE TABLE IF NOT EXISTS `pma__usergroups` ( ) COMMENT='User groups with configured menu items' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `pma__navigationhiding` +-- + +CREATE TABLE IF NOT EXISTS `pma__navigationhiding` ( + `username` varchar(64) NOT NULL, + `item_name` varchar(64) NOT NULL, + `item_type` varchar(64) NOT NULL, + `db_name` varchar(64) NOT NULL, + `table_name` varchar(64) NOT NULL, + PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`) +) + COMMENT='Hidden items of navigation tree' + DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; diff --git a/examples/create_tables_drizzle.sql b/examples/create_tables_drizzle.sql index 257018815a..4bbb9c34d5 100644 --- a/examples/create_tables_drizzle.sql +++ b/examples/create_tables_drizzle.sql @@ -288,3 +288,20 @@ CREATE TABLE IF NOT EXISTS `pma__usergroups` ( ) COMMENT='User groups with configured menu items' COLLATE utf8_bin; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `pma__navigationhiding` +-- + +CREATE TABLE IF NOT EXISTS `pma__navigationhiding` ( + `username` varchar(64) NOT NULL, + `item_name` varchar(64) NOT NULL, + `item_type` varchar(64) NOT NULL, + `db_name` varchar(64) NOT NULL, + `table_name` varchar(64) NOT NULL, + PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`) +) + COMMENT='Hidden items of navigation tree' + COLLATE utf8_bin; diff --git a/import.php b/import.php index 1f0aa99fd5..e1c9534f52 100644 --- a/import.php +++ b/import.php @@ -10,6 +10,8 @@ * Get the variables sent or posted to this script and a core script */ require_once 'libraries/common.inc.php'; +require_once 'libraries/sql.lib.php'; +require_once 'libraries/bookmark.lib.php'; //require_once 'libraries/display_import_functions.lib.php'; if (isset($_REQUEST['show_as_php'])) { @@ -601,17 +603,15 @@ if (isset($my_die)) { } } -// we want to see the results of the last query that returned at least a row -if (! empty($last_query_with_results)) { - // but we want to show intermediate results too - $disp_query = $sql_query; - $disp_message = __('Your SQL query has been executed successfully'); - $sql_query = $last_query_with_results; - $go_sql = true; -} - if ($go_sql) { - include 'sql.php'; + // parse sql query + require_once 'libraries/parse_analyze.inc.php'; + + PMA_executeQueryAndSendQueryResponse( + $analyzed_sql_results, false, $db, $table, null, null, null, false, null, + null, null, null, $goto, $pmaThemeImage, null, null, null, $sql_query, + null, null + ); } else { $active_page = $goto; include '' . $goto; diff --git a/js/messages.php b/js/messages.php index 7f0f0cc7d6..17ff796eb6 100644 --- a/js/messages.php +++ b/js/messages.php @@ -366,6 +366,7 @@ $js_messages['strMore'] = __('More'); /* navigation panel */ $js_messages['strShowPanel'] = __('Show Panel'); $js_messages['strHidePanel'] = __('Hide Panel'); +$js_messages['strUnhideNavItem'] = __('Show hidden navigation tree items'); /* microhistory */ $js_messages['strInvalidPage'] = __('The requested page was not found in the history, it may have expired.'); diff --git a/js/navigation.js b/js/navigation.js index 40de3a85e0..5f95808094 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -180,7 +180,10 @@ $(function () { }); /** Export Routines, Triggers and Events */ - $('li.procedure a.ajax img, li.function a.ajax img, li.trigger a.ajax img, li.event a.ajax img').live('click', function (event) { + $('li.procedure div:eq(1) a.ajax img,' + + ' li.function div:eq(1) a.ajax img,' + + ' li.trigger div:eq(1) a.ajax img,' + + ' li.event div:eq(1) a.ajax img').live('click', function (event) { event.preventDefault(); var dialog = new RTE.object(); dialog.exportDialog($(this).parent()); @@ -211,6 +214,70 @@ $(function () { event.preventDefault(); PMA_createViewDialog($(this)); }); + + /** Hide navigation tree item */ + $('a.hideNavItem.ajax').live('click', function (event) { + event.preventDefault(); + $.ajax({ + url: $(this).attr('href') + '&ajax_request=true', + success: function(data) { + if (data.success === true) { + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error); + } + } + }); + }); + + /** Display a dialog to choose hidden navigation items to show */ + $('a.showUnhide.ajax').live('click', function (event) { + event.preventDefault(); + var $msg = PMA_ajaxShowMessage(); + $.get($(this).attr('href') + '&ajax_request=1', function (data) { + if (data.success === true) { + PMA_ajaxRemoveMessage($msg); + var buttonOptions = {}; + buttonOptions[PMA_messages.strClose] = function () { + $(this).dialog("close"); + }; + var $dialog = $('
') + .attr('id', 'unhideNavItemDialog') + .append(data.message) + .dialog({ + width: 400, + minWidth: 200, + modal: true, + buttons: buttonOptions, + title: PMA_messages.strUnhideNavItem, + close: function () { + $(this).remove(); + } + }); + } else { + PMA_ajaxShowMessage(data.error); + } + }); + }); + + /** Show a hidden navigation tree item */ + $('a.unhideNavItem.ajax').live('click', function (event) { + event.preventDefault(); + var $tr = $(this).parents('tr'); + var $msg = PMA_ajaxShowMessage(); + $.ajax({ + url: $(this).attr('href') + '&ajax_request=true', + success: function(data) { + PMA_ajaxRemoveMessage($msg); + if (data.success === true) { + $tr.remove(); + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error); + } + } + }); + }); }); /** diff --git a/libraries/.htaccess b/libraries/.htaccess deleted file mode 100644 index 56baee608b..0000000000 --- a/libraries/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ -# This folder does not require access over HTTP -# (the following directive denies access by default) -Order allow,deny diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 076fbd137e..e5c6c2cc9f 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -5,6 +5,7 @@ * * @package PhpMyAdmin */ + if (! defined('PHPMYADMIN')) { exit; } diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index ef4b059a05..1acf310f77 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -3657,11 +3657,11 @@ class PMA_DisplayResults // if a transform function for blob is set, none of these // replacements will be made - if (($GLOBALS['PMA_String']::strlen($column) > $GLOBALS['cfg']['LimitChars']) + if (($GLOBALS['PMA_String']->strlen($column) > $GLOBALS['cfg']['LimitChars']) && ($_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_PARTIAL_TEXT) && ! $this->_isNeedToSyntaxHighlight(strtolower($meta->name)) ) { - $column = $GLOBALS['PMA_String']::substr( + $column = $GLOBALS['PMA_String']->substr( $column, 0, $GLOBALS['cfg']['LimitChars'] ) . '...'; $is_field_truncated = true; @@ -3749,10 +3749,10 @@ class PMA_DisplayResults // Convert to WKT format $wktval = PMA_Util::asWKT($column); - if (($GLOBALS['PMA_String']::strlen($wktval) > $GLOBALS['cfg']['LimitChars']) + if (($GLOBALS['PMA_String']->strlen($wktval) > $GLOBALS['cfg']['LimitChars']) && ($_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_PARTIAL_TEXT) ) { - $wktval = $GLOBALS['PMA_String']::substr( + $wktval = $GLOBALS['PMA_String']->substr( $wktval, 0, $GLOBALS['cfg']['LimitChars'] ) . '...'; $is_field_truncated = true; @@ -3774,10 +3774,10 @@ class PMA_DisplayResults $wkbval = $this->_displayBinaryAsPrintable($column, 'binary', 8); - if (($GLOBALS['PMA_String']::strlen($wkbval) > $GLOBALS['cfg']['LimitChars']) + if (($GLOBALS['PMA_String']->strlen($wkbval) > $GLOBALS['cfg']['LimitChars']) && ($_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_PARTIAL_TEXT) ) { - $wkbval = $GLOBALS['PMA_String']::substr( + $wkbval = $GLOBALS['PMA_String']->substr( $wkbval, 0, $GLOBALS['cfg']['LimitChars'] ) . '...'; $is_field_truncated = true; @@ -3861,12 +3861,12 @@ class PMA_DisplayResults // Cut all fields to $GLOBALS['cfg']['LimitChars'] // (unless it's a link-type transformation) - if ($GLOBALS['PMA_String']::strlen($column) > $GLOBALS['cfg']['LimitChars'] + if ($GLOBALS['PMA_String']->strlen($column) > $GLOBALS['cfg']['LimitChars'] && ($_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_PARTIAL_TEXT) && gettype($transformation_plugin) == "object" && ! strpos($transformation_plugin->getName(), 'Link') === true ) { - $column = $GLOBALS['PMA_String']::substr( + $column = $GLOBALS['PMA_String']->substr( $column, 0, $GLOBALS['cfg']['LimitChars'] ) . '...'; $is_field_truncated = true; @@ -4918,31 +4918,28 @@ class PMA_DisplayResults $message_view_warning = false; } - $message = PMA_Message::success(__('Showing rows')); - $message->addMessage($first_shown_rec); + $message = PMA_Message::success(__('Showing rows %1s - %2s')); + $message->addParam($first_shown_rec); if ($message_view_warning) { - - $message->addMessage('...', ' - '); - $message->addMessage($message_view_warning); - $message->addMessage('('); - + $message->addParam('... ' . $message_view_warning, false); } else { + $message->addParam($last_shown_rec); + } - $message->addMessage($last_shown_rec, ' - '); - $message->addMessage(' ('); - $message->addMessage( - $pre_count . PMA_Util::formatNumber($total, 0) - ); - $message->addString(__('total')); + $message->addMessage('('); + + if (!$message_view_warning) { + $message_total = PMA_Message::notice($precount . __('%d total')); + $message_total->addParam($total); if (!empty($after_count)) { - $message->addMessage($after_count); + $message_total->addMessage($after_count); } + $message->addMessage($message_total, ''); $message->addMessage($selectstring, ''); $message->addMessage(', ', ''); - } $message_qt = PMA_Message::notice(__('Query took %01.4f sec') . ')'); @@ -6009,7 +6006,7 @@ class PMA_DisplayResults ) { $content = bin2hex($content); if ($hexlength !== null) { - $content = $GLOBALS['PMA_String']::substr($content, $hexlength); + $content = $GLOBALS['PMA_String']->substr($content, $hexlength); } } else { $content = htmlspecialchars( diff --git a/libraries/Error.class.php b/libraries/Error.class.php index e6495a295e..e0c8e0a02b 100644 --- a/libraries/Error.class.php +++ b/libraries/Error.class.php @@ -6,6 +6,10 @@ * @package PhpMyAdmin */ +if (! defined('PHPMYADMIN')) { + exit; +} + /** * base class */ diff --git a/libraries/Error_Handler.class.php b/libraries/Error_Handler.class.php index 799c3fef34..3bad9b8333 100644 --- a/libraries/Error_Handler.class.php +++ b/libraries/Error_Handler.class.php @@ -6,6 +6,10 @@ * @package PhpMyAdmin */ +if (! defined('PHPMYADMIN')) { + exit; +} + /** * */ diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index bde533f95c..de5a2834ef 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -5,6 +5,7 @@ * * @package PhpMyAdmin */ + if (! defined('PHPMYADMIN')) { exit; } diff --git a/libraries/PMA.php b/libraries/PMA.php index 0d0c39e55b..021917d374 100644 --- a/libraries/PMA.php +++ b/libraries/PMA.php @@ -7,6 +7,10 @@ * */ +if (! defined('PHPMYADMIN')) { + exit; +} + /** * Database listing. */ diff --git a/libraries/RecentTable.class.php b/libraries/RecentTable.class.php index 8f3cd0c87c..62a026544f 100644 --- a/libraries/RecentTable.class.php +++ b/libraries/RecentTable.class.php @@ -4,6 +4,7 @@ * * @package PhpMyAdmin */ + if (! defined('PHPMYADMIN')) { exit; } diff --git a/libraries/String.class.php b/libraries/String.class.php new file mode 100644 index 0000000000..904b0595f1 --- /dev/null +++ b/libraries/String.class.php @@ -0,0 +1,248 @@ +_byte = new PMA_StringMB(); + } else { + include_once 'libraries/StringNative.class.php'; + $this->_byte = new PMA_StringNative(); + } + + if (@extension_loaded('ctype')) { + include_once 'libraries/StringCType.class.php'; + $this->_type = new PMA_StringCType(); + } else { + include_once 'libraries/StringNativeType.class.php'; + $this->_type = new PMA_StringNativeType(); + } + } + + /** + * Checks if a given character position in the string is escaped or not + * + * @param string $string string to check for + * @param integer $pos the character to check for + * @param integer $start starting position in the string + * + * @return boolean whether the character is escaped or not + */ + public function charIsEscaped($string, $pos, $start = 0) + { + $pos = max(intval($pos), 0); + $start = max(intval($start), 0); + $len = $this->strlen($string); + // Base case: + // Check for string length or invalid input or special case of input + // (pos == $start) + if ($pos <= $start || $len <= max($pos, $start)) { + return false; + } + + $pos--; + $escaped = false; + while ($pos >= $start && $this->substr($string, $pos, 1) == '\\') { + $escaped = !$escaped; + $pos--; + } // end while + + return $escaped; + } + + /** + * Checks if a character is an SQL identifier + * + * @param string $c character to check for + * @param boolean $dot_is_valid whether the dot character is valid or not + * + * @return boolean whether the character is an SQL identifier or not + */ + public function isSqlIdentifier($c, $dot_is_valid = false) + { + return ($this->isAlnum($c) + || ($ord_c = ord($c)) && $ord_c >= 192 && $ord_c != 215 && $ord_c != 249 + || $c == '_' + || $c == '$' + || ($dot_is_valid != false && $c == '.')); + } + + /** + * Returns length of string depending on current charset. + * + * @param string $string string to count + * + * @return int string length + */ + + public function strlen($string) + { + return $this->_byte->strlen($string); + } + + /** + * Returns substring from string, works depending on current charset. + * + * @param string $string string to count + * @param int $start start of substring + * @param int $length length of substring + * + * @return string the sub string + */ + public function substr($string, $start, $length = 2147483647) + { + return $this->_byte->substr($string, $start, $length); + } + + /** + * Returns postion of $needle in $haystack or false if not found + * + * @param string $haystack the string being checked + * @param string $needle the string to find in haystack + * @param int $offset the search offset + * + * @return integer position of $needle in $haystack or false + */ + public function strpos($haystack, $needle, $offset = 0) + { + return $this->_byte->strpos($haystack, $needle, $offset); + } + + /** + * Make a string lowercase + * + * @param string $string the string being lowercased + * + * @return string the lower case string + */ + public function strtolower($string) + { + return $this->_byte->strtolower($string); + } + + /** + * Checks if a character is an alphanumeric one + * + * @param string $c character to check for + * + * @return boolean whether the character is an alphanumeric one or not + */ + public function isAlnum($c) + { + return $this->_type->isAlnum($c); + } + + /** + * Checks if a character is an alphabetic one + * + * @param string $c character to check for + * + * @return boolean whether the character is an alphabetic one or not + */ + public function isAlpha($c) + { + return $this->_type->isAlpha($c); + } + + /** + * Checks if a character is a digit + * + * @param string $c character to check for + * + * @return boolean whether the character is a digit or not + */ + public function isDigit($c) + { + return $this->_type->isDigit($c); + } + + /** + * Checks if a character is an upper alphabetic one + * + * @param string $c character to check for + * + * @return boolean whether the character is an upper alphabetic one or not + */ + public function isUpper($c) + { + return $this->_type->isUpper($c); + } + + /** + * Checks if a character is a lower alphabetic one + * + * @param string $c character to check for + * + * @return boolean whether the character is a lower alphabetic one or not + */ + public function isLower($c) + { + return $this->_type->isLower($c); + } + + /** + * Checks if a character is a space one + * + * @param string $c character to check for + * + * @return boolean whether the character is a space one or not + */ + public function isSpace($c) + { + return $this->_type->isSpace($c); + } + + /** + * Checks if a character is an hexadecimal digit + * + * @param string $c character to check for + * + * @return boolean whether the character is an hexadecimal digit or not + */ + public function isHexDigit($c) + { + return $this->_type->isHexDigit($c); + } + + /** + * Checks if a number is in a range + * + * @param integer $num number to check for + * @param integer $lower lower bound + * @param integer $upper upper bound + * + * @return boolean whether the number is in the range or not + */ + public function numberInRangeInclusive($num, $lower, $upper) + { + return $this->_type->numberInRangeInclusive($num, $lower, $upper); + } +} +?> \ No newline at end of file diff --git a/libraries/StringAbstractType.class.php b/libraries/StringAbstractType.class.php new file mode 100644 index 0000000000..6424844a2c --- /dev/null +++ b/libraries/StringAbstractType.class.php @@ -0,0 +1,35 @@ += $lower && $num <= $upper); + } +} +?> \ No newline at end of file diff --git a/libraries/StringByte.int.php b/libraries/StringByte.int.php new file mode 100644 index 0000000000..d716770700 --- /dev/null +++ b/libraries/StringByte.int.php @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/libraries/StringCType.class.php b/libraries/StringCType.class.php index dbd4bf054f..5972f12487 100644 --- a/libraries/StringCType.class.php +++ b/libraries/StringCType.class.php @@ -1,13 +1,8 @@ isAlpha($c) || $this->isDigit($c)); } // end of the "isAlnum()" function /** @@ -37,9 +40,9 @@ class PMA_StringNativeType * * @return boolean whether the character is an alphabetic one or not */ - public static function isAlpha($c) + public function isAlpha($c) { - return (self::isUpper($c) || self::isLower($c)); + return ($this->isUpper($c) || $this->isLower($c)); } // end of the "isAlpha()" function /** @@ -49,13 +52,13 @@ class PMA_StringNativeType * * @return boolean whether the character is a digit or not */ - public static function isDigit($c) + public function isDigit($c) { $ord_zero = 48; //ord('0'); $ord_nine = 57; //ord('9'); $ord_c = ord($c); - return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); + return $this->numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); } // end of the "isDigit()" function /** @@ -65,13 +68,13 @@ class PMA_StringNativeType * * @return boolean whether the character is an upper alphabetic one or not */ - public static function isUpper($c) + public function isUpper($c) { $ord_zero = 65; //ord('A'); $ord_nine = 90; //ord('Z'); $ord_c = ord($c); - return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); + return $this->numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); } // end of the "isUpper()" function /** @@ -81,13 +84,13 @@ class PMA_StringNativeType * * @return boolean whether the character is a lower alphabetic one or not */ - public static function isLower($c) + public function isLower($c) { $ord_zero = 97; //ord('a'); $ord_nine = 122; //ord('z'); $ord_c = ord($c); - return PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); + return $this->numberInRangeInclusive($ord_c, $ord_zero, $ord_nine); } // end of the "isLower()" function /** @@ -97,7 +100,7 @@ class PMA_StringNativeType * * @return boolean whether the character is a space one or not */ - public static function isSpace($c) + public function isSpace($c) { $ord_space = 32; //ord(' ') $ord_tab = 9; //ord('\t') @@ -107,7 +110,7 @@ class PMA_StringNativeType return ($ord_c == $ord_space || $ord_c == $ord_NOBR - || PMA_STR_numberInRangeInclusive($ord_c, $ord_tab, $ord_CR)); + || $this->numberInRangeInclusive($ord_c, $ord_tab, $ord_CR)); } // end of the "isSpace()" function /** @@ -117,7 +120,7 @@ class PMA_StringNativeType * * @return boolean whether the character is an hexadecimal digit or not */ - public static function isHexDigit($c) + public function isHexDigit($c) { $ord_Aupper = 65; //ord('A'); $ord_Fupper = 70; //ord('F'); @@ -127,9 +130,9 @@ class PMA_StringNativeType $ord_nine = 57; //ord('9'); $ord_c = ord($c); - return (PMA_STR_numberInRangeInclusive($ord_c, $ord_zero, $ord_nine) - || PMA_STR_numberInRangeInclusive($ord_c, $ord_Aupper, $ord_Fupper) - || PMA_STR_numberInRangeInclusive($ord_c, $ord_Alower, $ord_Flower)); + return ($this->numberInRangeInclusive($ord_c, $ord_zero, $ord_nine) + || $this->numberInRangeInclusive($ord_c, $ord_Aupper, $ord_Fupper) + || $this->numberInRangeInclusive($ord_c, $ord_Alower, $ord_Flower)); } // end of the "isHexDigit()" function } ?> diff --git a/libraries/StringType.int.php b/libraries/StringType.int.php new file mode 100644 index 0000000000..dfcb7de8ec --- /dev/null +++ b/libraries/StringType.int.php @@ -0,0 +1,85 @@ + \ No newline at end of file diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 572b187e0f..b1a0faf1e5 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -1342,43 +1342,41 @@ class PMA_Util } $retval .= '
'; + $retval .= '
'; + $retval .= PMA_generate_common_hidden_inputs( + $GLOBALS['db'], $GLOBALS['table'] + ); + $retval .= ''; + // avoid displaying a Profiling checkbox that could // be checked, which would reexecute an INSERT, for example - if (! empty($refresh_link)) { - $retval .= self::getProfilingForm($sql_query); - } - // if needed, generate an invisible form that contains controls for the - // Inline link; this way, the behavior of the Inline link does not - // depend on the profiling support or on the refresh link - if (empty($refresh_link) || !self::profilingSupported()) { - $retval .= ''; - $retval .= PMA_generate_common_hidden_inputs( - $GLOBALS['db'], $GLOBALS['table'] + if (! empty($refresh_link) && self::profilingSupported()) { + $retval .= ''; + $retval .= self::getCheckbox( + 'profiling', __('Profiling'), isset($_SESSION['profiling']), true ); - $retval .= ''; - $retval .= '
'; } + $retval .= ''; - // in the tools div, only display the Inline link when not in ajax - // mode because 1) it currently does not work and 2) we would - // have two similar mechanisms on the page for the same goal - if ($is_select || ($GLOBALS['is_ajax_request'] === false) + /** + * TODO: Should we have $cfg['SQLQuery']['InlineEdit']? + */ + if (! empty($cfg['SQLQuery']['Edit']) + && $is_select && ! $query_too_big ) { - // see in js/functions.js the jQuery code attached to id inline_edit - // document.write conflicts with jQuery, hence used $().append() - $retval .= ""; + $inline_edit_link = ' [' + . self::linkOrButton( + '#', + _pgettext('Inline edit query', 'Inline'), + array('class' => 'inline_edit_sql') + ) + . ']'; + } else { + $inline_edit_link = ''; } - $retval .= $edit_link . $explain_link . $php_link + $retval .= $inline_edit_link . $edit_link . $explain_link . $php_link . $refresh_link . $validate_link; $retval .= '
'; } @@ -1417,38 +1415,6 @@ class PMA_Util return self::cacheGet('profiling_supported', true); } - /** - * Returns HTML for the form with the Profiling checkbox - * - * @param string $sql_query sql query - * - * @return string HTML for the form with the Profiling checkbox - * - * @access public - */ - public static function getProfilingForm($sql_query) - { - $retval = ''; - if (self::profilingSupported()) { - - $retval .= '
' . "\n"; - $retval .= PMA_generate_common_hidden_inputs( - $GLOBALS['db'], $GLOBALS['table'] - ); - - $retval .= '' . "\n" - . '' . "\n"; - - $retval .= self::getCheckbox( - 'profiling', __('Profiling'), isset($_SESSION['profiling']), true - ); - $retval .= '
' . "\n"; - - } - return $retval; - } - /** * Formats $value to byte view * @@ -2080,7 +2046,7 @@ class PMA_Util * @param string $Separator The Separator (defaults to "
\n") * * @access public - * @todo add a multibyte safe function PMA_STR_split() + * @todo add a multibyte safe function $GLOBALS['PMA_String']->split() * * @return string The flipped string */ diff --git a/libraries/bookmark.lib.php b/libraries/bookmark.lib.php index ef126232bc..b50a968636 100644 --- a/libraries/bookmark.lib.php +++ b/libraries/bookmark.lib.php @@ -5,6 +5,7 @@ * * @package PhpMyAdmin */ + if (! defined('PHPMYADMIN')) { exit; } diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 522790e774..3af65f45ee 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -31,6 +31,13 @@ * @package PhpMyAdmin */ +/** + * block attempts to directly run this script + */ +if (getcwd() == dirname(__FILE__)) { + die('Attack stopped'); +} + /** * Minimum PHP version; can't call PMA_fatalError() which uses a * PHP 5 function, so cannot easily localize this message. @@ -39,6 +46,11 @@ if (version_compare(PHP_VERSION, '5.3.0', 'lt')) { die('PHP 5.3+ is required'); } +/** + * for verification in all procedural scripts under libraries + */ +define('PHPMYADMIN', true); + /** * the error handler */ @@ -61,11 +73,6 @@ if (version_compare(phpversion(), '5.4', 'lt')) { @ini_set('magic_quotes_runtime', false); } -/** - * for verification in all procedural scripts under libraries - */ -define('PHPMYADMIN', true); - /** * core functions */ @@ -735,7 +742,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { /** * String handling */ - include_once './libraries/string.lib.php'; + include_once './libraries/string.inc.php'; /** * Lookup server by name diff --git a/libraries/config.default.php b/libraries/config.default.php index dbb327dafd..a9bf023e5b 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -420,6 +420,15 @@ $cfg['Servers'][$i]['users'] = ''; */ $cfg['Servers'][$i]['usergroups'] = ''; +/** + * table to store information about item hidden from navigation triee + * - leave blank to disable hide/show navigation items feature + * SUGGESTED: 'pma__navigationhiding' + * + * @global string $cfg['Servers'][$i]['navigationhiding'] + */ +$cfg['Servers'][$i]['navigationhiding'] = ''; + /** * Maximum number of records saved in $cfg['Servers'][$i]['table_uiprefs'] table. * @@ -584,7 +593,11 @@ $cfg['ServerDefault'] = 1; * * @global boolean $cfg['VersionCheck'] */ -$cfg['VersionCheck'] = VERSION_CHECK_DEFAULT; +if (defined('VERSION_CHECK_DEFAULT')) { + $cfg['VersionCheck'] = VERSION_CHECK_DEFAULT; +} else { + $cfg['VersionCheck'] = true; +} /** * The url of the proxy to be used when retrieving the information about diff --git a/libraries/config.values.php b/libraries/config.values.php index 7007222351..80640109d6 100644 --- a/libraries/config.values.php +++ b/libraries/config.values.php @@ -239,13 +239,13 @@ $cfg_db['_validators'] = array( */ $cfg_db['_userValidators'] = array( 'MaxDbList' => array( - array('PMA_validateUpperBound', 'value:MaxDbList') + array('validateUpperBound', 'value:MaxDbList') ), 'MaxTableList' => array( - array('PMA_validateUpperBound', 'value:MaxTableList') + array('validateUpperBound', 'value:MaxTableList') ), 'QueryHistoryMax' => array( - array('PMA_validateUpperBound', 'value:QueryHistoryMax') + array('validateUpperBound', 'value:QueryHistoryMax') ) ); ?> diff --git a/libraries/config/Validator.class.php b/libraries/config/Validator.class.php index a23c5c2529..37d2180746 100644 --- a/libraries/config/Validator.class.php +++ b/libraries/config/Validator.class.php @@ -435,7 +435,8 @@ class PMA_Validator $matches = array(); // we catch anything that may (or may not) be an IP if (!preg_match("/^(.+):(?:[ ]?)\\w+$/", $line, $matches)) { - $result[$path][] = __('Incorrect value:') . ' ' . $line; + $result[$path][] = __('Incorrect value:') . ' ' + . htmlspecialchars($line); continue; } // now let's check whether we really have an IP address diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index d0db72b4b7..349967a1b2 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -454,6 +454,8 @@ $strConfigServers_users_desc = __('Leave blank to disable configurable menus fea $strConfigServers_users_name = __('Users table'); $strConfigServers_usergroups_desc = __('Leave blank to disable configurable menus feature, suggested: [kbd]pma__usergroups[/kbd]'); $strConfigServers_usergroups_name = __('User groups table'); +$strConfigServers_navigationhiding_desc = __('Leave blank to disable the feature to hide and show navigation items, suggested: [kbd]pma__navigationhiding[/kbd]'); +$strConfigServers_navigationhiding_name = __('Hidden navigation items table'); $strConfigServers_user_desc = __('Leave empty if not using config auth'); $strConfigServers_user_name = __('User for config auth'); $strConfigServers_verbose_desc = __('A user-friendly description of this server. Leave blank to display the hostname instead.'); diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index da81bd0a55..43d6569427 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -72,6 +72,7 @@ $forms['Servers']['Server_pmadb'] = array('Servers' => array(1 => array( 'userconfig' => 'pma__userconfig', 'users' => 'pma__users', 'usergroups' => 'pma__usergroups', + 'navigationhiding' => 'pma__navigationhiding', 'table_info' => 'pma__table_info', 'column_info' => 'pma__column_info', 'history' => 'pma__history', diff --git a/libraries/engines/bdb.lib.php b/libraries/engines/bdb.lib.php index 91a56bb57f..3e1e9f912c 100644 --- a/libraries/engines/bdb.lib.php +++ b/libraries/engines/bdb.lib.php @@ -7,6 +7,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * * @package PhpMyAdmin-Engines diff --git a/libraries/engines/berkeleydb.lib.php b/libraries/engines/berkeleydb.lib.php index d5324b1acd..52f6280978 100644 --- a/libraries/engines/berkeleydb.lib.php +++ b/libraries/engines/berkeleydb.lib.php @@ -7,6 +7,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * Load BDB class. */ diff --git a/libraries/engines/binlog.lib.php b/libraries/engines/binlog.lib.php index ea81738967..e6a4df0eb9 100644 --- a/libraries/engines/binlog.lib.php +++ b/libraries/engines/binlog.lib.php @@ -7,6 +7,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * * @package PhpMyAdmin-Engines diff --git a/libraries/engines/innobase.lib.php b/libraries/engines/innobase.lib.php index f81ae3f3b9..9c95a8ece7 100644 --- a/libraries/engines/innobase.lib.php +++ b/libraries/engines/innobase.lib.php @@ -8,6 +8,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * */ diff --git a/libraries/engines/innodb.lib.php b/libraries/engines/innodb.lib.php index c7b639b25a..04d70a44ef 100644 --- a/libraries/engines/innodb.lib.php +++ b/libraries/engines/innodb.lib.php @@ -9,6 +9,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * The InnoDB storage engine * diff --git a/libraries/engines/memory.lib.php b/libraries/engines/memory.lib.php index 8e9fe5fc88..819b9c0663 100644 --- a/libraries/engines/memory.lib.php +++ b/libraries/engines/memory.lib.php @@ -9,6 +9,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * The MEMORY (HEAP) storage engine * diff --git a/libraries/engines/merge.lib.php b/libraries/engines/merge.lib.php index 4bccfc79ca..22d6a759dd 100644 --- a/libraries/engines/merge.lib.php +++ b/libraries/engines/merge.lib.php @@ -9,6 +9,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * The MERGE storage engine * diff --git a/libraries/engines/mrg_myisam.lib.php b/libraries/engines/mrg_myisam.lib.php index d3425365c2..eadccd0578 100644 --- a/libraries/engines/mrg_myisam.lib.php +++ b/libraries/engines/mrg_myisam.lib.php @@ -7,6 +7,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * */ diff --git a/libraries/engines/myisam.lib.php b/libraries/engines/myisam.lib.php index 5882824bc4..456bf294c3 100644 --- a/libraries/engines/myisam.lib.php +++ b/libraries/engines/myisam.lib.php @@ -9,6 +9,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * The MyISAM storage engine * diff --git a/libraries/engines/ndbcluster.lib.php b/libraries/engines/ndbcluster.lib.php index e57846b601..74d2b2b953 100644 --- a/libraries/engines/ndbcluster.lib.php +++ b/libraries/engines/ndbcluster.lib.php @@ -9,6 +9,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * The NDBCLUSTER storage engine * diff --git a/libraries/engines/pbxt.lib.php b/libraries/engines/pbxt.lib.php index fc4e343f5e..180279b090 100644 --- a/libraries/engines/pbxt.lib.php +++ b/libraries/engines/pbxt.lib.php @@ -9,6 +9,10 @@ if (! defined('PHPMYADMIN')) { exit; } +if (! defined('PHPMYADMIN')) { + exit; +} + /** * The PBXT storage engine * diff --git a/libraries/navigation/Navigation.class.php b/libraries/navigation/Navigation.class.php index d140bbc33a..98665ce07d 100644 --- a/libraries/navigation/Navigation.class.php +++ b/libraries/navigation/Navigation.class.php @@ -73,5 +73,141 @@ class PMA_Navigation return $retval; } + + /** + * Add an item of navigation tree to the hidden items list in PMA database. + * + * @param string $itemName name of the navigation tree item + * @param string $itemType type of the navigation tree item + * @param string $dbName database name + * @param string $tableName table name if applicable + * + * @return void + */ + public function hideNavigationItem( + $itemName, $itemType, $dbName, $tableName = null + ) { + $navTable = PMA_Util::backquote($GLOBALS['cfgRelation']['db']) + . "." . PMA_Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); + $sqlQuery = "INSERT INTO " . $navTable + . "(`username`, `item_name`, `item_type`, `db_name`, `table_name`)" + . " VALUES (" + . "'" . PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . "'," + . "'" . PMA_Util::sqlAddSlashes($itemName) . "'," + . "'" . PMA_Util::sqlAddSlashes($itemType) . "'," + . "'" . PMA_Util::sqlAddSlashes($dbName) . "'," + . "'" . (! empty($tableName)? PMA_Util::sqlAddSlashes($tableName) : "" ) + . "')"; + PMA_queryAsControlUser($sqlQuery, false); + } + + /** + * Remove a hidden item of navigation tree from the + * list of hidden items in PMA database. + * + * @param string $itemName name of the navigation tree item + * @param string $itemType type of the navigation tree item + * @param string $dbName database name + * @param string $tableName table name if applicable + * + * @return void + */ + public function unhideNavigationItem( + $itemName, $itemType, $dbName, $tableName = null + ) { + $navTable = PMA_Util::backquote($GLOBALS['cfgRelation']['db']) + . "." . PMA_Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); + $sqlQuery = "DELETE FROM " . $navTable + . " WHERE " + . " `username`='" + . PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . "'" + . " AND `item_name`='" . PMA_Util::sqlAddSlashes($itemName) . "'" + . " AND `item_type`='" . PMA_Util::sqlAddSlashes($itemType) . "'" + . " AND `db_name`='" . PMA_Util::sqlAddSlashes($dbName) . "'" + . (! empty($tableName) + ? " AND `table_name`='" . PMA_Util::sqlAddSlashes($tableName) . "'" + : "" + ); + PMA_queryAsControlUser($sqlQuery, false); + } + + /** + * Returns HTML for the dialog to show hidden nativation items. + * + * @param string $dbName database name + * @param string $itemType type of the items to include + * @param string $tableName table name + * + * @return string HTML for the dialog to show hidden nativation items + */ + public function getItemUnhideDialog($dbName, $itemType = null, $tableName = null) + { + $html = '
'; + $html .= '
'; + $html .= PMA_generate_common_hidden_inputs($dbName, $tableName); + + $navTable = PMA_Util::backquote($GLOBALS['cfgRelation']['db']) + . "." . PMA_Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); + $sqlQuery = "SELECT `item_name`, `item_type` FROM " . $navTable + . " WHERE `username`='" + . PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) ."'" + . " AND `db_name`='" . PMA_Util::sqlAddSlashes($dbName) . "'" + . " AND `table_name`='" + . (! empty($tableName) ? PMA_Util::sqlAddSlashes($tableName) : '') . "'"; + $result = PMA_queryAsControlUser($sqlQuery, false); + + $hidden = array(); + if ($result) { + while ($row = $GLOBALS['dbi']->fetchArray($result)) { + $type = $row['item_type']; + if (! isset($hidden[$type])) { + $hidden[$type] = array(); + } + $hidden[$type][] = $row['item_name']; + } + } + $GLOBALS['dbi']->freeResult($result); + + $typeMap = array( + 'event' => __('Events:'), + 'function' => __('Functions:'), + 'procedure' => __('Procedures:'), + 'table' => __('Tables:'), + 'view' => __('Views:'), + ); + if (empty($tableName)) { + $first = true; + foreach ($typeMap as $t => $lable) { + if ((empty($itemType) || $itemType == $t) + && isset($hidden[$t]) + ) { + $html .= (! $first ? '
' : '') + . '' . $lable . ''; + $html .= ''; + $odd = true; + foreach ($hidden[$t] as $hiddenItem) { + $html .= ''; + $html .= ''; + $html .= ''; + $odd = ! $odd; + } + $html .= '
' . htmlspecialchars($hiddenItem) . '' + . PMA_Util::getIcon('b_undo.png', __('Show')) + . '
'; + $first = false; + } + } + } + + $html .= '
'; + $html .= '
'; + return $html; + } } ?> diff --git a/libraries/navigation/NavigationHeader.class.php b/libraries/navigation/NavigationHeader.class.php index 68f8d6d506..d0bfaaec1b 100644 --- a/libraries/navigation/NavigationHeader.class.php +++ b/libraries/navigation/NavigationHeader.class.php @@ -79,9 +79,14 @@ class PMA_NavigationHeader } $retval .= ''); exit; - ?> diff --git a/setup/frames/.htaccess b/setup/frames/.htaccess deleted file mode 100644 index 56baee608b..0000000000 --- a/setup/frames/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ -# This folder does not require access over HTTP -# (the following directive denies access by default) -Order allow,deny diff --git a/setup/lib/.htaccess b/setup/lib/.htaccess deleted file mode 100644 index 56baee608b..0000000000 --- a/setup/lib/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ -# This folder does not require access over HTTP -# (the following directive denies access by default) -Order allow,deny diff --git a/test/classes/dbi/DBIMysql_test.php b/test/classes/dbi/DBIMysql_test.php new file mode 100644 index 0000000000..d5f0253da9 --- /dev/null +++ b/test/classes/dbi/DBIMysql_test.php @@ -0,0 +1,154 @@ +object = new PMA_DBI_Mysql(); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + * + * @access protected + * @return void + */ + protected function tearDown() + { + unset($this->object); + } + + /** + * Test for realMultiQuery + * + * @return void + * + * @group medium + */ + public function testRealMultiQuery() + { + //PHP's 'mysql' extension does not support multi_queries + $this->assertEquals( + false, + $this->object->realMultiQuery(null, "select * from PMA") + ); + } + + /** + * Test for selectDb + * + * @return void + * + * @group medium + */ + public function testSelectDb() + { + //$link is empty + $GLOBALS['userlink'] = null; + $this->assertEquals( + false, + $this->object->selectDb("PMA") + ); + } + + /** + * Test for moreResults + * + * @return void + * + * @group medium + */ + public function testMoreResults() + { + //PHP's 'mysql' extension does not support multi_queries + $this->assertEquals( + false, + $this->object->moreResults() + ); + //PHP's 'mysql' extension does not support multi_queries + $this->assertEquals( + false, + $this->object->nextResult() + ); + } + + /** + * Test for getClientInfo + * + * @return void + * + * @group medium + */ + public function testGetClientInfo() + { + $this->assertEquals( + mysql_get_client_info(), + $this->object->getClientInfo() + ); + } + + /** + * Test for numRows + * + * @return void + * + * @group medium + */ + public function testNumRows() + { + $this->assertEquals( + false, + $this->object->numRows(true) + ); + } + + /** + * Test for storeResult + * + * @return void + * + * @group medium + */ + public function testStoreResult() + { + $this->assertEquals( + false, + $this->object->storeResult() + ); + } +} diff --git a/test/classes/dbi/DBIMysqli_test.php b/test/classes/dbi/DBIMysqli_test.php new file mode 100644 index 0000000000..64b90372ad --- /dev/null +++ b/test/classes/dbi/DBIMysqli_test.php @@ -0,0 +1,102 @@ +object = new PMA_DBI_Mysqli(); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + * + * @access protected + * @return void + */ + protected function tearDown() + { + unset($this->object); + } + + /** + * Test for selectDb + * + * @return void + * + * @group medium + */ + public function testSelectDb() + { + //$link is empty + $GLOBALS['userlink'] = null; + $this->assertEquals( + false, + $this->object->selectDb("PMA") + ); + } + + /** + * Test for getClientInfo + * + * @return void + * + * @group medium + */ + public function testGetClientInfo() + { + $this->assertEquals( + mysql_get_client_info(), + $this->object->getClientInfo() + ); + } + + /** + * Test for numRows + * + * @return void + * + * @group medium + */ + public function testNumRows() + { + $this->assertEquals( + 0, + $this->object->numRows(true) + ); + } +} diff --git a/test/classes/plugin/import/ImportOds_test.php b/test/classes/plugin/import/ImportOds_test.php index 313fc7b398..ef569184e0 100644 --- a/test/classes/plugin/import/ImportOds_test.php +++ b/test/classes/plugin/import/ImportOds_test.php @@ -4,7 +4,7 @@ * * @package PhpMyAdmin-test */ - + /* * we must set $GLOBALS['server'] here * since 'check_user_privileges.lib.php' will use it globally @@ -47,11 +47,11 @@ class ImportOds_Test extends PHPUnit_Framework_TestCase * @return void */ protected function setUp() - { - $GLOBALS['plugin_param'] = "csv"; - $this->object = new ImportOds(); + { + $GLOBALS['plugin_param'] = "csv"; + $this->object = new ImportOds(); - //setting + //setting $GLOBALS['finished'] = false; $GLOBALS['read_limit'] = 100000000; $GLOBALS['offset'] = 0; @@ -59,20 +59,20 @@ class ImportOds_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['ServerDefault'] = 0; $GLOBALS['cfg']['AllowUserDropDatabase'] = false; $GLOBALS['cfg']['MySQLManualType'] = 'none'; - + $GLOBALS['import_file'] = 'test/test_data/db_test.ods'; - + /** * Load interface for zip extension. */ include_once 'libraries/zip_extension.lib.php'; $result = PMA_getZipContents($GLOBALS['import_file']); $GLOBALS['import_text'] = $result["data"]; - $GLOBALS['compression'] = 'application/zip'; + $GLOBALS['compression'] = 'application/zip'; $GLOBALS['read_multiply'] = 10; $GLOBALS['import_type'] = 'ods'; $GLOBALS['import_handle'] = @fopen($GLOBALS['import_file'], 'r'); - + //varible for Ods $_REQUEST['ods_recognize_percentages'] = true; $_REQUEST['ods_recognize_currency'] = true; @@ -90,7 +90,7 @@ class ImportOds_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getProperties * @@ -104,17 +104,17 @@ class ImportOds_Test extends PHPUnit_Framework_TestCase $this->assertEquals( __('OpenDocument Spreadsheet'), $properties->getText() - ); + ); $this->assertEquals( 'ods', $properties->getExtension() - ); + ); $this->assertEquals( __('Options'), $properties->getOptionsText() - ); + ); } - + /** * Test for doImport * @@ -128,57 +128,57 @@ class ImportOds_Test extends PHPUnit_Framework_TestCase //$import_notice will show the import detail result global $import_notice, $sql_query, $sql_query_disabled; $sql_query_disabled = false; - + //Mock DBI $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); $GLOBALS['dbi'] = $dbi; - + //Test function called $this->object->doImport(); - - //asset that all sql are executed + + //asset that all sql are executed $this->assertContains( 'CREATE DATABASE IF NOT EXISTS `ODS_DB` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci', $sql_query - ); + ); $this->assertContains( 'CREATE TABLE IF NOT EXISTS `ODS_DB`.`pma_bookmark`', $sql_query - ); + ); $this->assertContains( "INSERT INTO `ODS_DB`.`pma_bookmark` (`A`, `B`, `C`, `D`) VALUES (1, 'dbbase', NULL, 'ddd');", $sql_query - ); - + ); + //asset that all databases and tables are imported $this->assertContains( 'The following structures have either been created or altered.', $import_notice - ); + ); $this->assertContains( 'Go to database: `ODS_DB`', $import_notice - ); + ); $this->assertContains( 'Edit settings for `ODS_DB`', $import_notice - ); + ); $this->assertContains( 'Go to table: `pma_bookmark`', $import_notice - ); + ); $this->assertContains( 'Edit settings for `pma_bookmark`', $import_notice ); - + //asset that the import process is finished $this->assertEquals( true, $GLOBALS['finished'] - ); + ); } } diff --git a/test/classes/plugin/transformations/Image_JPEG_Inline_test.php b/test/classes/plugin/transformations/Image_JPEG_Inline_test.php index 854267ce3c..5f491dcb23 100644 --- a/test/classes/plugin/transformations/Image_JPEG_Inline_test.php +++ b/test/classes/plugin/transformations/Image_JPEG_Inline_test.php @@ -34,7 +34,7 @@ class Image_JPEG_Inline_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Image_JPEG_Inline(new PluginManager()); + $this->object = new Image_JPEG_Inline(new PluginManager()); } /** @@ -48,7 +48,7 @@ class Image_JPEG_Inline_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -58,14 +58,12 @@ class Image_JPEG_Inline_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = - 'Displays a clickable thumbnail. The options are the maximum width' + $info = 'Displays a clickable thumbnail. The options are the maximum width' . ' and height in pixels. The original aspect ratio is preserved.'; - $this->assertEquals( + $this->assertEquals( $info, Image_JPEG_Inline::getInfo() - ); - + ); } /** @@ -76,11 +74,11 @@ class Image_JPEG_Inline_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Inline", Image_JPEG_Inline::getName() - ); + ); } /** @@ -91,11 +89,11 @@ class Image_JPEG_Inline_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Image", Image_JPEG_Inline::getMIMEType() - ); + ); } /** @@ -106,11 +104,11 @@ class Image_JPEG_Inline_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "JPEG", Image_JPEG_Inline::getMIMESubtype() - ); + ); } /** @@ -124,13 +122,13 @@ class Image_JPEG_Inline_Test extends PHPUnit_Framework_TestCase { $buffer = "PMA_JPEG_Inline"; $options = array("./image/", "200", "wrapper_link"=>"PMA_wrapper_link"); - $result = 'PMA_JPEG_Inline'; $this->assertEquals( $result, $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/plugin/transformations/Image_Link_test.php b/test/classes/plugin/transformations/Image_Link_test.php index ab3eef45ea..d5c72e062d 100644 --- a/test/classes/plugin/transformations/Image_Link_test.php +++ b/test/classes/plugin/transformations/Image_Link_test.php @@ -34,7 +34,7 @@ class Image_JPEG_Link_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Image_JPEG_Link(new PluginManager()); + $this->object = new Image_JPEG_Link(new PluginManager()); } /** @@ -48,7 +48,7 @@ class Image_JPEG_Link_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -58,14 +58,12 @@ class Image_JPEG_Link_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = __( - 'Displays a link to download this image.' - ); - $this->assertEquals( + $info = __('Displays a link to download this image.'); + $this->assertEquals( $info, Image_JPEG_Link::getInfo() - ); - + ); + } /** @@ -76,11 +74,11 @@ class Image_JPEG_Link_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "ImageLink", Image_JPEG_Link::getName() - ); + ); } /** @@ -91,11 +89,11 @@ class Image_JPEG_Link_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Image", Image_JPEG_Link::getMIMEType() - ); + ); } /** @@ -106,11 +104,11 @@ class Image_JPEG_Link_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "JPEG", Image_JPEG_Link::getMIMESubtype() - ); + ); } /** @@ -124,11 +122,11 @@ class Image_JPEG_Link_Test extends PHPUnit_Framework_TestCase { $buffer = "PMA_IMAGE_LINK"; $options = array("./image/", "200", "wrapper_link"=>"PMA_wrapper_link"); - $result = '[BLOB]'; $this->assertEquals( $result, $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/plugin/transformations/Image_PNG_Inline_test.php b/test/classes/plugin/transformations/Image_PNG_Inline_test.php index e031566447..2facf47d8e 100644 --- a/test/classes/plugin/transformations/Image_PNG_Inline_test.php +++ b/test/classes/plugin/transformations/Image_PNG_Inline_test.php @@ -34,7 +34,7 @@ class Image_PNG_Inline_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Image_PNG_Inline(new PluginManager()); + $this->object = new Image_PNG_Inline(new PluginManager()); } /** @@ -48,7 +48,7 @@ class Image_PNG_Inline_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -58,14 +58,13 @@ class Image_PNG_Inline_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = - 'Displays a clickable thumbnail. The options are the maximum width' + $info = 'Displays a clickable thumbnail. The options are the maximum width' . ' and height in pixels. The original aspect ratio is preserved.'; - $this->assertEquals( + $this->assertEquals( $info, Image_PNG_Inline::getInfo() - ); - + ); + } /** @@ -76,11 +75,11 @@ class Image_PNG_Inline_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Inline", Image_PNG_Inline::getName() - ); + ); } /** @@ -91,11 +90,11 @@ class Image_PNG_Inline_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Image", Image_PNG_Inline::getMIMEType() - ); + ); } /** @@ -106,11 +105,11 @@ class Image_PNG_Inline_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "PNG", Image_PNG_Inline::getMIMESubtype() - ); + ); } /** @@ -124,13 +123,13 @@ class Image_PNG_Inline_Test extends PHPUnit_Framework_TestCase { $buffer = "PMA_PNG_Inline"; $options = array("./image/", "200", "wrapper_link"=>"PMA_wrapper_link"); - $result = ''; $this->assertEquals( $result, $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php b/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php index 22a1fabfa1..c930e27bd5 100644 --- a/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php @@ -36,7 +36,7 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Text_Plain_Dateformat(new PluginManager()); + $this->object = new Text_Plain_Dateformat(new PluginManager()); } /** @@ -50,7 +50,7 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -69,12 +69,12 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase . ' that, date format has different value - for "local" see the' . ' documentation for PHP\'s strftime() function and for "utc" it' . ' is done using gmdate() function.'; - - $this->assertEquals( + + $this->assertEquals( $info, Text_Plain_Dateformat::getInfo() - ); - + ); + } /** @@ -85,11 +85,11 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Date Format", Text_Plain_Dateformat::getName() - ); + ); } /** @@ -100,11 +100,11 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Text", Text_Plain_Dateformat::getMIMEType() - ); + ); } /** @@ -115,11 +115,11 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "Plain", Text_Plain_Dateformat::getMIMESubtype() - ); + ); } /** @@ -143,11 +143,11 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase $result, $this->object->applyTransformation($timestamp, $options, $meta) ); - - //other format timestamp, Detect TIMESTAMP(6 | 8 | 10 | 12 | 14) + + //other format timestamp, Detect TIMESTAMP(6 | 8 | 10 | 12 | 14) $meta->type = 'string'; $timestamp = 12345678; - $result = '' + $result = '' . 'May 23, 1970 at 09:21 PM'; $this->assertEquals( $result, @@ -156,7 +156,7 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase //no MYSQL timestamp $timestamp = 123456789; - $result = '' + $result = '' . 'Nov 29, 1973 at 09:33 PM'; $this->assertEquals( $result, @@ -170,8 +170,8 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase $result, $this->object->applyTransformation($timestamp, $options, $meta) ); - - + + } } @@ -179,5 +179,5 @@ class Text_Plain_Dateformat_Meta { var $blob = null; var $max_length = null; - var $type = null; + var $type = null; } \ No newline at end of file diff --git a/test/classes/plugin/transformations/Text_Plain_Download_test.php b/test/classes/plugin/transformations/Text_Plain_Download_test.php index 5d12f94aac..49df7c3159 100644 --- a/test/classes/plugin/transformations/Text_Plain_Download_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Download_test.php @@ -36,7 +36,7 @@ class Application_Octetstream_Download_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Application_Octetstream_Download(new PluginManager()); + $this->object = new Application_Octetstream_Download(new PluginManager()); global $row, $fields_meta; $fields_meta = array(); $row = array("pma"=>"aaa", "pca"=>"bbb"); @@ -53,7 +53,7 @@ class Application_Octetstream_Download_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -63,17 +63,16 @@ class Application_Octetstream_Download_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = - 'Displays a link to download the binary data of the column. You can' + $info = 'Displays a link to download the binary data of the column. You can' . ' use the first option to specify the filename, or use the second' . ' option as the name of a column which contains the filename. If' . ' you use the second option, you need to set the first option to' - . ' the empty string.'; + . ' the empty string.'; $this->assertEquals( $info, Application_Octetstream_Download::getInfo() - ); - + ); + } /** @@ -84,11 +83,11 @@ class Application_Octetstream_Download_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Download", Application_Octetstream_Download::getName() - ); + ); } /** @@ -99,11 +98,11 @@ class Application_Octetstream_Download_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Application", Application_Octetstream_Download::getMIMEType() - ); + ); } /** @@ -114,11 +113,11 @@ class Application_Octetstream_Download_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "OctetStream", Application_Octetstream_Download::getMIMESubtype() - ); + ); } /** @@ -132,18 +131,18 @@ class Application_Octetstream_Download_Test extends PHPUnit_Framework_TestCase { $buffer = "PMA_BUFFER"; $options = array("filename", 'wrapper_link'=>'PMA_wrapper_link'); - $result = 'filename'; $this->assertEquals( $result, $this->object->applyTransformation($buffer, $options) - ); - + ); + //using default filename: binary_file.dat $options = array("", 'cloumn', 'wrapper_link'=>'PMA_wrapper_link'); - $result = 'binary_file.dat'; $this->assertEquals( $result, diff --git a/test/classes/plugin/transformations/Text_Plain_External_test.php b/test/classes/plugin/transformations/Text_Plain_External_test.php index da65caa2bf..c8c3b3c786 100644 --- a/test/classes/plugin/transformations/Text_Plain_External_test.php +++ b/test/classes/plugin/transformations/Text_Plain_External_test.php @@ -35,7 +35,7 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Text_Plain_External(new PluginManager()); + $this->object = new Text_Plain_External(new PluginManager()); } /** @@ -49,7 +49,7 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -59,8 +59,8 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = - 'LINUX ONLY: Launches an external application and feeds it the column' + $info + = 'LINUX ONLY: Launches an external application and feeds it the column' . ' data via standard input. Returns the standard output of the' . ' application. The default is Tidy, to pretty-print HTML code.' . ' For security reasons, you have to manually edit the file' @@ -71,12 +71,12 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase . ' The third option, if set to 1, will convert the output using' . ' htmlspecialchars() (Default 1). The fourth option, if set to 1,' . ' will prevent wrapping and ensure that the output appears all on' - . ' one line (Default 1).'; + . ' one line (Default 1).'; $this->assertEquals( $info, Text_Plain_External::getInfo() - ); - + ); + } /** @@ -87,11 +87,11 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "External", Text_Plain_External::getName() - ); + ); } /** @@ -102,11 +102,11 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Text", Text_Plain_External::getMIMEType() - ); + ); } /** @@ -117,11 +117,11 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "Plain", Text_Plain_External::getMIMESubtype() - ); + ); } /** @@ -138,7 +138,7 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase $this->assertEquals( "PMA_BUFFER", $this->object->applyTransformation($buffer, $options) - ); + ); } /** @@ -154,21 +154,21 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase $this->assertEquals( true, $this->object->applyTransformationNoWrap($options) - ); + ); $options = array("/dev/null -i -wrap -q", "/dev/null -i -wrap -q", "/dev/null -i -wrap -q", 1); $this->assertEquals( true, $this->object->applyTransformationNoWrap($options) - ); + ); $options = array("/dev/null -i -wrap -q", "/dev/null -i -wrap -q", "/dev/null -i -wrap -q", "1"); $this->assertEquals( true, $this->object->applyTransformationNoWrap($options) - ); + ); $options = array("/dev/null -i -wrap -q", "/dev/null -i -wrap -q", "/dev/null -i -wrap -q", 2); $this->assertEquals( false, $this->object->applyTransformationNoWrap($options) - ); + ); } } diff --git a/test/classes/plugin/transformations/Text_Plain_Formatted_test.php b/test/classes/plugin/transformations/Text_Plain_Formatted_test.php index 93484fd260..3d95c1c0e8 100644 --- a/test/classes/plugin/transformations/Text_Plain_Formatted_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Formatted_test.php @@ -34,7 +34,7 @@ class Text_Plain_Formatted_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Text_Plain_Formatted(new PluginManager()); + $this->object = new Text_Plain_Formatted(new PluginManager()); } /** @@ -48,7 +48,7 @@ class Text_Plain_Formatted_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -58,15 +58,14 @@ class Text_Plain_Formatted_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = - 'Displays the contents of the column as-is, without running it' + $info = 'Displays the contents of the column as-is, without running it' . ' through htmlspecialchars(). That is, the column is assumed' . ' to contain valid HTML.'; $this->assertEquals( $info, Text_Plain_Formatted::getInfo() - ); - + ); + } /** @@ -77,11 +76,11 @@ class Text_Plain_Formatted_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Formatted", Text_Plain_Formatted::getName() - ); + ); } /** @@ -92,11 +91,11 @@ class Text_Plain_Formatted_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Text", Text_Plain_Formatted::getMIMEType() - ); + ); } /** @@ -107,11 +106,11 @@ class Text_Plain_Formatted_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "Plain", Text_Plain_Formatted::getMIMESubtype() - ); + ); } /** @@ -126,8 +125,8 @@ class Text_Plain_Formatted_Test extends PHPUnit_Framework_TestCase $buffer = "PMA_BUFFER"; $options = array("option1", "option2"); $this->assertEquals( - $buffer, + $buffer, $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/plugin/transformations/Text_Plain_Hex_test.php b/test/classes/plugin/transformations/Text_Plain_Hex_test.php index c44d6103cf..fd074d1c75 100644 --- a/test/classes/plugin/transformations/Text_Plain_Hex_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Hex_test.php @@ -35,7 +35,7 @@ class Application_Octetstream_Hex_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Application_Octetstream_Hex(new PluginManager()); + $this->object = new Application_Octetstream_Hex(new PluginManager()); } /** @@ -49,7 +49,7 @@ class Application_Octetstream_Hex_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -59,15 +59,15 @@ class Application_Octetstream_Hex_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = - 'Displays hexadecimal representation of data. Optional first' + $info + = 'Displays hexadecimal representation of data. Optional first' . ' parameter specifies how often space will be added (defaults' . ' to 2 nibbles).'; $this->assertEquals( $info, Application_Octetstream_Hex::getInfo() - ); - + ); + } /** @@ -78,11 +78,11 @@ class Application_Octetstream_Hex_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Hex", Application_Octetstream_Hex::getName() - ); + ); } /** @@ -93,11 +93,11 @@ class Application_Octetstream_Hex_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Application", Application_Octetstream_Hex::getMIMEType() - ); + ); } /** @@ -108,11 +108,11 @@ class Application_Octetstream_Hex_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "OctetStream", Application_Octetstream_Hex::getMIMESubtype() - ); + ); } /** @@ -129,21 +129,21 @@ class Application_Octetstream_Hex_Test extends PHPUnit_Framework_TestCase $this->assertEquals( "313 131 313 130 303 1 ", $this->object->applyTransformation($buffer, $options) - ); - + ); + $buffer = "11111001"; $options = array(0); $this->assertEquals( "3131313131303031", $this->object->applyTransformation($buffer, $options) - ); - - //no option + ); + + //no option $buffer = "11111001"; $this->assertEquals( "31 31 31 31 31 30 30 31 ", $this->object->applyTransformation($buffer) - ); - + ); + } } diff --git a/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php b/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php index 7a88c08350..c19abea4d7 100644 --- a/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php @@ -18,7 +18,7 @@ require_once 'libraries/plugins/transformations/Text_Plain_Imagelink.class.php'; * * @package PhpMyAdmin-test */ -class Text_Plain_Imagelink_test extends PHPUnit_Framework_TestCase +class Text_Plain_Imagelink_Test extends PHPUnit_Framework_TestCase { /** * @access protected @@ -34,7 +34,7 @@ class Text_Plain_Imagelink_test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Text_Plain_Imagelink(new PluginManager()); + $this->object = new Text_Plain_Imagelink(new PluginManager()); } /** @@ -48,7 +48,7 @@ class Text_Plain_Imagelink_test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -58,15 +58,15 @@ class Text_Plain_Imagelink_test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = 'Displays an image and a link; ' - . 'the column contains the filename. The first option' - . ' is a URL prefix like "http://www.example.com/". The second and third options' - . ' are the width and the height in pixels.'; + $info = 'Displays an image and a link; ' + . 'the column contains the filename. The first option' + . ' is a URL prefix like "http://www.example.com/". The second and third options' + . ' are the width and the height in pixels.'; $this->assertEquals( $info, Text_Plain_Imagelink::getInfo() - ); - + ); + } /** @@ -77,11 +77,11 @@ class Text_Plain_Imagelink_test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Image Link", Text_Plain_Imagelink::getName() - ); + ); } /** @@ -92,11 +92,11 @@ class Text_Plain_Imagelink_test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Text", Text_Plain_Imagelink::getMIMEType() - ); + ); } /** @@ -107,11 +107,11 @@ class Text_Plain_Imagelink_test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "Plain", Text_Plain_Imagelink::getMIMESubtype() - ); + ); } /** @@ -125,12 +125,12 @@ class Text_Plain_Imagelink_test extends PHPUnit_Framework_TestCase { $buffer = "PMA_IMAGE"; $options = array("./image/", "200"); - $result = '' - . 'PMA_IMAGE'; $this->assertEquals( $result, $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/plugin/transformations/Text_Plain_Link_test.php b/test/classes/plugin/transformations/Text_Plain_Link_test.php index 39ba902a14..60991f4f90 100644 --- a/test/classes/plugin/transformations/Text_Plain_Link_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Link_test.php @@ -34,7 +34,7 @@ class Text_Plain_Link_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Text_Plain_Link(new PluginManager()); + $this->object = new Text_Plain_Link(new PluginManager()); } /** @@ -48,7 +48,7 @@ class Text_Plain_Link_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -58,15 +58,15 @@ class Text_Plain_Link_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = - 'Displays a link; the column contains the filename. The first option' + $info + = 'Displays a link; the column contains the filename. The first option' . ' is a URL prefix like "http://www.example.com/". The second option' . ' is a title for the link.'; - $this->assertEquals( + $this->assertEquals( $info, Text_Plain_Link::getInfo() - ); - + ); + } /** @@ -77,11 +77,11 @@ class Text_Plain_Link_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "TextLink", Text_Plain_Link::getName() - ); + ); } /** @@ -92,11 +92,11 @@ class Text_Plain_Link_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Text", Text_Plain_Link::getMIMEType() - ); + ); } /** @@ -107,11 +107,11 @@ class Text_Plain_Link_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "Plain", Text_Plain_Link::getMIMESubtype() - ); + ); } /** @@ -125,11 +125,11 @@ class Text_Plain_Link_Test extends PHPUnit_Framework_TestCase { $buffer = "PMA_TXT_LINK"; $options = array("./php/", "text_name"); - $result = 'text_name'; $this->assertEquals( $result, $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/schema/User_Schema_test.php b/test/classes/schema/User_Schema_test.php new file mode 100644 index 0000000000..2c23bbb3db --- /dev/null +++ b/test/classes/schema/User_Schema_test.php @@ -0,0 +1,172 @@ +getMockBuilder('PMA_DatabaseInterface') + ->disableOriginalConstructor() + ->getMock(); + + $dbi->expects($this->any()) + ->method('insertId') + ->will($this->returnValue(10)); + + $databases = array(); + $database_name = 'PMA'; + $databases[$database_name]['SCHEMA_TABLES'] = 1; + $databases[$database_name]['SCHEMA_TABLE_ROWS'] = 3; + $databases[$database_name]['SCHEMA_DATA_LENGTH'] = 5; + $databases[$database_name]['SCHEMA_MAX_DATA_LENGTH'] = 10; + $databases[$database_name]['SCHEMA_INDEX_LENGTH'] = 10; + $databases[$database_name]['SCHEMA_LENGTH'] = 10; + $databases[$database_name]['ENGINE'] = "InnerDB"; + + $dbi->expects($this->any())->method('getTablesFull') + ->will($this->returnValue($databases)); + + $GLOBALS['dbi'] = $dbi; + + $this->object = new PMA_User_Schema(); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + * + * @access protected + * @return void + */ + protected function tearDown() + { + unset($this->object); + } + + /** + * Test for setAction & processUserChoice + * + * @return void + * + * @group medium + */ + public function testSetActionAndProcessUserChoice() + { + //action: selectpage + $_REQUEST['chpage'] = 10; + $_REQUEST['action_choose'] = '2'; + $this->object->setAction("selectpage"); + $this->object->processUserChoice(); + $this->assertEquals( + "selectpage", + $this->object->action + ); + $this->assertEquals( + 10, + $this->object->chosenPage + ); + + $_REQUEST['action_choose'] = '1'; + $this->object->processUserChoice(); + //deleteCoordinates successfully + $this->assertEquals( + 0, + $this->object->chosenPage + ); + + //action: createpage + $_POST['newpage'] = "3"; + $_POST['auto_layout_foreign'] = true; + $_POST['auto_layout_internal'] = true; + $_POST['delrow'] = array("row1", "row2"); + $_POST['chpage'] = "chpage"; + $this->object->setAction("delete_old_references"); + $this->object->processUserChoice(); + $this->object->setAction("createpage"); + $this->object->processUserChoice(); + $this->assertEquals( + 10, + $this->object->pageNumber + ); + $this->assertEquals( + "1", + $this->object->autoLayoutForeign + ); + $this->assertEquals( + "1", + $this->object->autoLayoutInternal + ); + + //action: edcoord + $_POST['chpage'] = "3"; + $_POST['c_table_rows'] = 1; + $_POST['c_table_0'] = array( + 'x' => 'x0', + 'y' => 'y0', + 'name' => 'name0', + 'delete' => 'delete0', + 'x' => 'x0', + ); + $this->object->setAction("edcoord"); + $this->object->processUserChoice(); + $this->assertEquals( + '3', + $this->object->chosenPage + ); + $this->assertEquals( + 1, + $this->object->c_table_rows + ); + } +} diff --git a/test/libraries/PMA_STR_sub_test.php b/test/libraries/PMA_STR_sub_test.php deleted file mode 100644 index e4bf4add7e..0000000000 --- a/test/libraries/PMA_STR_sub_test.php +++ /dev/null @@ -1,25 +0,0 @@ -assertEquals( - 'čšě', - $GLOBALS['PMA_String']::substr('čšěčščěš', 0, 3) - ); - } -} -?> diff --git a/test/libraries/PMA_StringCType_test.php b/test/libraries/PMA_StringCType_test.php index f24b767e8e..27955e9265 100644 --- a/test/libraries/PMA_StringCType_test.php +++ b/test/libraries/PMA_StringCType_test.php @@ -18,46 +18,48 @@ require_once 'libraries/StringCType.class.php'; */ class PMA_StringCType_Test extends PHPUnit_Framework_TestCase { + private $_object; /** * Setup function for test cases - * + * * @access protected * @return void */ - protected function setUp() + protected function setUp() { if (!@extension_loaded('ctype')) { $this->markTestSkipped( "ctype extension not present." ); } + $this->_object = new PMA_StringCType(); } /** - * Test for PMA_StringCType::isAlnum - * + * Test for isAlnum() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isAlnumData */ public function testIsAlnum($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringCType::isAlnum($str) + $this->_object->isAlnum($str) ); } /** * Data provider for testIsAlnum - * + * * @return array Test data */ - public function isAlnumData() + public function isAlnumData() { return array( array(true, "AbCd1zyZ9"), @@ -66,29 +68,29 @@ class PMA_StringCType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringCType::isAlpha - * + * Test for isAlpha() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isAlphaData */ public function testIsAlpha($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringCType::isAlpha($str) + $this->_object->isAlpha($str) ); } /** * Data provider for testIsAlpha - * + * * @return array Test data */ - public function isAlphaData() + public function isAlphaData() { return array( array(true, "kJW"), @@ -97,29 +99,29 @@ class PMA_StringCType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringCType::isDigit - * + * Test for isDigit() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isDigitData */ public function testIsDigit($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringCType::isDigit($str) + $this->_object->isDigit($str) ); } /** * Data provider for testIsDigit - * + * * @return array Test data */ - public function isDigitData() + public function isDigitData() { return array( array(false, "kJW"), @@ -129,29 +131,29 @@ class PMA_StringCType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringCType::isUpper - * + * Test for isUpper() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isUpperData */ public function testIsUpper($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringCType::isUpper($str) + $this->_object->isUpper($str) ); } /** * Data provider for testIsUpper - * + * * @return array Test data */ - public function isUpperData() + public function isUpperData() { return array( array(true, "ABCD"), @@ -161,29 +163,29 @@ class PMA_StringCType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringCType::isLower - * + * Test for isLower() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isLowerData */ public function testIsLower($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringCType::isLower($str) + $this->_object->isLower($str) ); } /** * Data provider for testIsLower - * + * * @return array Test data */ - public function isLowerData() + public function isLowerData() { return array( array(true, "abcd"), @@ -193,29 +195,29 @@ class PMA_StringCType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringCType::isSpace - * + * Test for isSpace() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isSpaceData */ public function testIsSpace($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringCType::isSpace($str) + $this->_object->isSpace($str) ); } /** * Data provider for testIsSpace - * + * * @return array Test data */ - public function isSpaceData() + public function isSpaceData() { return array( array(true, " "), @@ -226,29 +228,29 @@ class PMA_StringCType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringCType::isHexDigit - * + * Test for isHexDigit() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isHexDigitData */ public function testIsHexDigit($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringCType::isHexDigit($str) + $this->_object->isHexDigit($str) ); } /** * Data provider for testIsHexDigit - * + * * @return array Test data */ - public function isHexDigitData() + public function isHexDigitData() { return array( array(true, "AB10BC99"), diff --git a/test/libraries/PMA_StringMB_test.php b/test/libraries/PMA_StringMB_test.php index 71ffc325e6..89fe57d11b 100644 --- a/test/libraries/PMA_StringMB_test.php +++ b/test/libraries/PMA_StringMB_test.php @@ -23,15 +23,15 @@ class PMA_String_Mb_Test extends PMA_StringNative_Test /** * Setup function for test cases - * + * * @access protected * @return void */ - protected function setUp() + protected function setUp() { if (@function_exists('mb_strlen')) { $this->internal_encoding = mb_internal_encoding(); - $this->testClass = new PMA_StringMB; + $this->testObject = new PMA_StringMB(); } else { $this->markTestSkipped( "Multibyte functions don't exist, skipping test." @@ -41,11 +41,11 @@ class PMA_String_Mb_Test extends PMA_StringNative_Test /** * TearDown function for tests, restores internal encoding - * + * * @access protected * @return void */ - protected function tearDown() + protected function tearDown() { if (isset($this->internal_encoding)) { mb_internal_encoding($this->internal_encoding); diff --git a/test/libraries/PMA_StringNativeType_test.php b/test/libraries/PMA_StringNativeType_test.php index f18763e64b..eba79047f8 100644 --- a/test/libraries/PMA_StringNativeType_test.php +++ b/test/libraries/PMA_StringNativeType_test.php @@ -18,31 +18,43 @@ require_once 'libraries/StringNativeType.class.php'; */ class PMA_StringNativeType_Test extends PHPUnit_Framework_TestCase { + private $_object; /** - * Test for PMA_StringNativeType::isAlnum - * + * Setup function for test cases + * + * @access protected + * @return void + */ + protected function setUp() + { + $this->_object = new PMA_StringNativeType(); + } + + /** + * Test for isAlnum() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isAlnumData */ public function testIsAlnum($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringNativeType::isAlnum($str) + $this->_object->isAlnum($str) ); } /** * Data provider for testIsAlnum - * + * * @return array Test data */ - public function isAlnumData() + public function isAlnumData() { return array( array(true, "A"), @@ -53,29 +65,29 @@ class PMA_StringNativeType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringNativeType::isAlpha - * + * Test for isAlpha() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isAlphaData */ public function testIsAlpha($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringNativeType::isAlpha($str) + $this->_object->isAlpha($str) ); } /** * Data provider for testIsAlpha - * + * * @return array Test data */ - public function isAlphaData() + public function isAlphaData() { return array( array(true, "k"), @@ -84,29 +96,29 @@ class PMA_StringNativeType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringNativeType::isDigit - * + * Test for isDigit() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isDigitData */ public function testIsDigit($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringNativeType::isDigit($str) + $this->_object->isDigit($str) ); } /** * Data provider for testIsDigit - * + * * @return array Test data */ - public function isDigitData() + public function isDigitData() { return array( array(false, "k"), @@ -116,29 +128,29 @@ class PMA_StringNativeType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringNativeType::isUpper - * + * Test for isUpper() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isUpperData */ public function testIsUpper($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringNativeType::isUpper($str) + $this->_object->isUpper($str) ); } /** * Data provider for testIsUpper - * + * * @return array Test data */ - public function isUpperData() + public function isUpperData() { return array( array(true, "A"), @@ -148,29 +160,29 @@ class PMA_StringNativeType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringNativeType::isLower - * + * Test for isLower() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isLowerData */ public function testIsLower($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringNativeType::isLower($str) + $this->_object->isLower($str) ); } /** * Data provider for testIsLower - * + * * @return array Test data */ - public function isLowerData() + public function isLowerData() { return array( array(true, "a"), @@ -180,29 +192,29 @@ class PMA_StringNativeType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringNativeType::isSpace - * + * Test for isSpace() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isSpaceData */ public function testIsSpace($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringNativeType::isSpace($str) + $this->_object->isSpace($str) ); } /** * Data provider for testIsSpace - * + * * @return array Test data */ - public function isSpaceData() + public function isSpaceData() { return array( array(true, " "), @@ -213,29 +225,29 @@ class PMA_StringNativeType_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_StringNativeType::isHexDigit - * + * Test for isHexDigit() + * * @param integer $expected Expected output * @param string $str String to check - * + * * @return void * @test * @dataProvider isHexDigitData */ public function testIsHexDigit($expected, $str) - { + { $this->assertEquals( $expected, - PMA_StringNativeType::isHexDigit($str) + $this->_object->isHexDigit($str) ); } /** * Data provider for testIsHexDigit - * + * * @return array Test data */ - public function isHexDigitData() + public function isHexDigitData() { return array( array(true, "A"), diff --git a/test/libraries/PMA_StringNative_test.php b/test/libraries/PMA_StringNative_test.php index e9c31bc0e5..170eb81474 100644 --- a/test/libraries/PMA_StringNative_test.php +++ b/test/libraries/PMA_StringNative_test.php @@ -18,43 +18,43 @@ require_once 'libraries/StringNative.class.php'; */ class PMA_StringNative_Test extends PHPUnit_Framework_TestCase { - protected $testClass; + protected $testObject; /** * Setup function for test cases - * + * * @access protected * @return void */ protected function setUp() { - $this->testClass = new PMA_StringNative; + $this->testObject = new PMA_StringNative(); } - + /** * Test for PMA_StringNative::strlen - * + * * @param integer $length Length of the string * @param string $str String to check for - * + * * @return void * @test * @dataProvider strlenData */ public function testNativeStrlen($length, $str) - { + { $this->assertEquals( $length, - $this->testClass->strlen($str) + $this->testObject->strlen($str) ); } /** * Data provider for testNativeStrlen - * + * * @return array Test data */ - public function strlenData() + public function strlenData() { return array( array(2, "ab"), @@ -65,30 +65,30 @@ class PMA_StringNative_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_StringNative::substr - * + * * @param string $str Expected substring * @param string $haystack String to check in * @param int $start Starting position of substring * @param int $length Length of substring - * + * * @return void * @test * @dataProvider subStrData */ public function testNativeSubStr($str, $haystack, $start, $length) - { + { $this->assertEquals( $str, - $this->testClass->substr($haystack, $start, $length) + $this->testObject->substr($haystack, $start, $length) ); } /** * Data provider for testNativeSubStr - * + * * @return array Test data */ - public function subStrData() + public function subStrData() { return array( array("b", "ab", 1, 1), @@ -98,30 +98,30 @@ class PMA_StringNative_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_StringNative::strpos - * + * * @param int $pos Expected position * @param string $haystack String to search in * @param string $needle String to search for * @param int $offset Search offset - * + * * @return void * @test * @dataProvider strposData */ public function testNativeStrpos($pos, $haystack, $needle, $offset) - { + { $this->assertEquals( $pos, - $this->testClass->strpos($haystack, $needle, $offset) + $this->testObject->strpos($haystack, $needle, $offset) ); } /** * Data provider for testNativeStrpos - * + * * @return array Test data */ - public function strposData() + public function strposData() { return array( array(1, "ab", "b", 0), @@ -131,28 +131,28 @@ class PMA_StringNative_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_StringNative::strtolower - * + * * @param string $expected Expected lowercased string * @param string $string String to convert to lowercase - * + * * @return void * @test * @dataProvider strToLowerData */ public function testNativeStrToLower($expected, $string) - { + { $this->assertEquals( $expected, - $this->testClass->strtolower($string) + $this->testObject->strtolower($string) ); } /** * Data provider for testNativeStrpos - * + * * @return array Test data */ - public function strToLowerData() + public function strToLowerData() { return array( array("mary had a", "Mary Had A"), diff --git a/test/libraries/PMA_relation_cleanup_test.php b/test/libraries/PMA_relation_cleanup_test.php index 3722aa9e30..c84d40c59f 100644 --- a/test/libraries/PMA_relation_cleanup_test.php +++ b/test/libraries/PMA_relation_cleanup_test.php @@ -26,26 +26,27 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase $GLOBALS['server'] = 1; $GLOBALS['cfg']['Server']['user'] = "user"; $GLOBALS['cfg']['Server']['pmadb'] = "pmadb"; - $GLOBALS['cfg']['Server']['bookmarktable'] = 'bookmark'; - $GLOBALS['cfg']['Server']['relation'] = 'relation'; - $GLOBALS['cfg']['Server']['table_info'] = 'table_info'; - $GLOBALS['cfg']['Server']['table_coords'] = 'table_coords'; - $GLOBALS['cfg']['Server']['designer_coords'] = 'designer_coords'; - $GLOBALS['cfg']['Server']['column_info'] = 'column_info'; - $GLOBALS['cfg']['Server']['pdf_pages'] = 'pdf_pages'; - $GLOBALS['cfg']['Server']['history'] = 'history'; - $GLOBALS['cfg']['Server']['recent'] = 'recent'; - $GLOBALS['cfg']['Server']['table_uiprefs'] = 'table_uiprefs'; - $GLOBALS['cfg']['Server']['tracking'] = 'tracking'; - $GLOBALS['cfg']['Server']['userconfig'] = 'userconfig'; - $GLOBALS['cfg']['Server']['users'] = 'users'; - $GLOBALS['cfg']['Server']['usergroups'] = 'usergroups'; - + $GLOBALS['cfg']['Server']['bookmarktable'] = 'bookmark'; + $GLOBALS['cfg']['Server']['relation'] = 'relation'; + $GLOBALS['cfg']['Server']['table_info'] = 'table_info'; + $GLOBALS['cfg']['Server']['table_coords'] = 'table_coords'; + $GLOBALS['cfg']['Server']['designer_coords'] = 'designer_coords'; + $GLOBALS['cfg']['Server']['column_info'] = 'column_info'; + $GLOBALS['cfg']['Server']['pdf_pages'] = 'pdf_pages'; + $GLOBALS['cfg']['Server']['history'] = 'history'; + $GLOBALS['cfg']['Server']['recent'] = 'recent'; + $GLOBALS['cfg']['Server']['table_uiprefs'] = 'table_uiprefs'; + $GLOBALS['cfg']['Server']['tracking'] = 'tracking'; + $GLOBALS['cfg']['Server']['userconfig'] = 'userconfig'; + $GLOBALS['cfg']['Server']['users'] = 'users'; + $GLOBALS['cfg']['Server']['usergroups'] = 'usergroups'; + $GLOBALS['cfg']['Server']['navigationhiding'] = 'navigationhiding'; + $this->redefineRelation(); } - + public function redefineRelation() - { + { $GLOBALS['dbi'] = new DBI_PMA_Relation_Cleanup(); unset($_SESSION['relation'][$GLOBALS['server']]); } @@ -61,7 +62,7 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase $table = "PMA_bookmark"; $column = "name"; $this->redefineRelation(); - + //the $cfgRelation value before cleanup column $cfgRelation = PMA_checkRelationsParam(); $this->assertEquals( @@ -88,20 +89,20 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase 'relation', $cfgRelation['relation'] ); - + //cleanup PMA_relationsCleanupColumn($db, $table, $column); - + //the $cfgRelation value after cleanup column $cfgRelation = PMA_checkRelationsParam(); - - $is_defined_column_info + + $is_defined_column_info = isset($cfgRelation['column_info'])? $cfgRelation['column_info'] : null; - $is_defined_table_info + $is_defined_table_info = isset($cfgRelation['table_info'])? $cfgRelation['table_info'] : null; $is_defined_relation = isset($cfgRelation['relation'])? $cfgRelation['relation'] : null; - + $this->assertEquals( null, $is_defined_column_info @@ -114,7 +115,7 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase null, $is_defined_relation ); - + } /** @@ -127,7 +128,7 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase $db = "PMA"; $table = "PMA_bookmark"; $this->redefineRelation(); - + //the $cfgRelation value before cleanup column $cfgRelation = PMA_checkRelationsParam(); $this->assertEquals( @@ -150,28 +151,28 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase 'relation', $cfgRelation['relation'] ); - + //PMA_relationsCleanupTable PMA_relationsCleanupTable($db, $table); - + //the $cfgRelation value after cleanup column $cfgRelation = PMA_checkRelationsParam(); - - $is_defined_column_info + + $is_defined_column_info = isset($cfgRelation['column_info'])? $cfgRelation['column_info'] : null; - $is_defined_table_info + $is_defined_table_info = isset($cfgRelation['table_info'])? $cfgRelation['table_info'] : null; $is_defined_relation = isset($cfgRelation['relation'])? $cfgRelation['relation'] : null; $is_defined_table_coords = isset($cfgRelation['table_coords']) - ? $cfgRelation['table_coords'] + ? $cfgRelation['table_coords'] : null; $is_defined_designer_coords = isset($cfgRelation['designer_coords']) - ? $cfgRelation['designer_coords'] + ? $cfgRelation['designer_coords'] : null; - + $this->assertEquals( null, $is_defined_column_info @@ -192,7 +193,7 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase null, $is_defined_designer_coords ); - + } /** @@ -204,7 +205,7 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase { $db = "PMA"; $this->redefineRelation(); - + //the $cfgRelation value before cleanup column $cfgRelation = PMA_checkRelationsParam(); $this->assertEquals( @@ -235,28 +236,28 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase 'relation', $cfgRelation['relation'] ); - + //cleanup PMA_relationsCleanupDatabase($db); - + //the value after cleanup column $cfgRelation = PMA_checkRelationsParam(); - - $is_defined_column_info + + $is_defined_column_info = isset($cfgRelation['column_info'])? $cfgRelation['column_info'] : null; - $is_defined_table_info + $is_defined_table_info = isset($cfgRelation['table_info'])? $cfgRelation['table_info'] : null; $is_defined_relation = isset($cfgRelation['relation'])? $cfgRelation['relation'] : null; $is_defined_table_coords = isset($cfgRelation['table_coords']) - ? $cfgRelation['table_coords'] + ? $cfgRelation['table_coords'] : null; $is_defined_designer_coords = isset($cfgRelation['designer_coords']) - ? $cfgRelation['designer_coords'] + ? $cfgRelation['designer_coords'] : null; - + $this->assertEquals( null, $is_defined_column_info @@ -276,7 +277,7 @@ class PMA_Relation_Cleanup_Test extends PHPUnit_Framework_TestCase $this->assertEquals( null, $is_defined_designer_coords - ); + ); } } @@ -286,8 +287,8 @@ class DBI_PMA_Relation_Cleanup extends PMA_DatabaseInterface var $index; var $values = array(); var $indexs = array(); - - public function __construct() + + public function __construct() { $this->index = 0; $this->values = array( @@ -305,6 +306,7 @@ class DBI_PMA_Relation_Cleanup extends PMA_DatabaseInterface 'userconfig', 'users', 'usergroups', + 'navigationhiding', ); $this->indexs = array( 'bookmark' => 0, @@ -321,63 +323,64 @@ class DBI_PMA_Relation_Cleanup extends PMA_DatabaseInterface 'userconfig' => 11, 'users' => 12, 'usergroups' => 13, + 'navigationhiding' => 14, ); } - - function fetchRow($result) + + function fetchRow($result) { if ($this->index < count($this->values)) { $curr_table[0] = $this->values[$this->index]; $this->index++; return $curr_table; } - + $this->index = 0; return false; } - - function query($sql, $link = null, $options = 0, $cache_affected_rows = true) + + function query($sql, $link = null, $options = 0, $cache_affected_rows = true) { if (stripos($sql, "column_info") !== false) { unset($this->values[$this->indexs['column_info']]); } - + if (stripos($sql, "table_info") !== false) { unset ($this->values[$this->indexs['table_info']]); } - + if (stripos($sql, "table_coords") !== false) { unset($this->values[$this->indexs['table_coords']]); } - + if (stripos($sql, "designer_coords") !== false) { unset($this->values[$this->indexs['designer_coords']]); } - + if (stripos($sql, "relation") !== false) { unset($this->values[$this->indexs['relation']]); } - + if (stripos($sql, "pdf_pages") !== false) { unset($GLOBALS [$this->indexs['pdf_pages']]); } - + if (stripos($sql, "bookmark") !== false) { unset($GLOBALS [$this->indexs['bookmark']]); } } - + public function tryQuery( $query, $link = null, $options = 0, $cache_affected_rows = true ) { return true; } - - public function selectDb($dbname, $link = null) + + public function selectDb($dbname, $link = null) { return true; } - + public function freeResult($result) { return true; diff --git a/test/libraries/PMA_string_test.php b/test/libraries/PMA_string_test.php index 28994bfb9e..2b47263ca0 100644 --- a/test/libraries/PMA_string_test.php +++ b/test/libraries/PMA_string_test.php @@ -9,8 +9,8 @@ /* * Include to test. */ -require_once 'libraries/string.lib.php'; -require_once 'libraries/StringNativeType.class.php'; +require_once 'libraries/String.class.php'; + /** * Tests for Specialized String Functions for phpMyAdmin * @@ -18,44 +18,48 @@ require_once 'libraries/StringNativeType.class.php'; */ class PMA_String_Test extends PHPUnit_Framework_TestCase { + /** + * @var PMA_String + */ + private $_testObj; /** * Setup function for test cases - * + * * @access protected * @return void */ - protected function setUp() + protected function setUp() { - $GLOBALS['PMA_StringType'] = new PMA_StringNativeType(); + $this->_testObj = new PMA_String(); } /** - * Test for Str_charIsEscaped - * + * Test for charIsEscaped() + * * @param boolean $expected Expected value from test * @param string $str String to check for * @param integer $pos Character to check for * @param integer $start Starting position of string - * + * * @return void * @test * @dataProvider charIsEscapedData */ public function testCharIsEscaped($expected, $str, $pos, $start) - { + { $this->assertEquals( $expected, - PMA_STR_charIsEscaped($str, $pos, $start) + $this->_testObj->charIsEscaped($str, $pos, $start) ); } /** * Data provider for testCharIsEscaped - * + * * @return array Test data */ - public function charIsEscapedData() + public function charIsEscapedData() { return array( array(false, 'test', -1, 0), @@ -68,13 +72,13 @@ class PMA_String_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_STR_numberInRangeInclusive - * + * Test for numberInRangeInclusive() + * * @param bool $expected Expected value from test * @param integer $num Number to check for * @param integer $lower Lower bound * @param integer $upper Upper bound - * + * * @return void * @test * @dataProvider numberInRangeData @@ -84,16 +88,16 @@ class PMA_String_Test extends PHPUnit_Framework_TestCase ) { $this->assertEquals( $expected, - PMA_STR_numberInRangeInclusive($num, $lower, $upper) + $this->_testObj->numberInRangeInclusive($num, $lower, $upper) ); } /** * Data provider for testNumberInRangeInclusive - * + * * @return void */ - public function numberInRangeData() + public function numberInRangeData() { return array( array(true, 2, 2, 3), @@ -105,30 +109,30 @@ class PMA_String_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_STR_isSqlIdentifier - * + * Test for isSqlIdentifier() + * * @param boolean $expected Expected value from test * @param string $c Character to check for * @param boolean $dot_is_valid whether the dot character is valid or not - * + * * @return void * @test * @dataProvider isSqlIdentifierData */ - public function testIsSqlIdentifier($expected, $c, $dot_is_valid = false) + public function testIsSqlIdentifier($expected, $c, $dot_is_valid = false) { $this->assertEquals( $expected, - PMA_STR_isSqlIdentifier($c, $dot_is_valid) + $this->_testObj->isSqlIdentifier($c, $dot_is_valid) ); } /** * Data provider for testIsSqlIdentifier - * + * * @return array Test data */ - public function isSqlIdentifierData() + public function isSqlIdentifierData() { return array( array(true, '2'), @@ -142,7 +146,5 @@ class PMA_String_Test extends PHPUnit_Framework_TestCase array(true, '$') ); } - - } ?> diff --git a/themes/original/css/navigation.css.php b/themes/original/css/navigation.css.php index 2cb8d8f5b2..a9dcee78e5 100644 --- a/themes/original/css/navigation.css.php +++ b/themes/original/css/navigation.css.php @@ -119,6 +119,21 @@ if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) { color: ; background-color: ; } +#pma_navigation_tree li .dbItemControls { + padding-left: 4px; +} +#pma_navigation_tree li .navItemControls { + display: none; + padding-left: 4px; +} +#pma_navigation_tree li.activePointer .navItemControls { + display: inline; + opacity: 0.5; +} +#pma_navigation_tree li.activePointer .navItemControls:hover { + display: inline; + opacity: 1.0; +} #pma_navigation_tree ul { clear: both; padding: 0; diff --git a/themes/original/img/b_undo.png b/themes/original/img/b_undo.png new file mode 100644 index 0000000000..498187821c Binary files /dev/null and b/themes/original/img/b_undo.png differ diff --git a/themes/original/img/sprites.png b/themes/original/img/sprites.png index 1ea0cb85ab..0ba0969243 100644 Binary files a/themes/original/img/sprites.png and b/themes/original/img/sprites.png differ diff --git a/themes/original/sprites.lib.php b/themes/original/sprites.lib.php index f6c8d8570b..eda977bae5 100644 --- a/themes/original/sprites.lib.php +++ b/themes/original/sprites.lib.php @@ -375,253 +375,258 @@ function PMA_sprites() 'width' => '16', 'height' => '16' ), - 'b_unique' => array( + 'b_undo' => array( 'position' => '75', 'width' => '16', 'height' => '16' ), - 'b_usradd' => array( + 'b_unique' => array( 'position' => '76', 'width' => '16', 'height' => '16' ), - 'b_usrcheck' => array( + 'b_usradd' => array( 'position' => '77', 'width' => '16', 'height' => '16' ), - 'b_usrdrop' => array( + 'b_usrcheck' => array( 'position' => '78', 'width' => '16', 'height' => '16' ), - 'b_usredit' => array( + 'b_usrdrop' => array( 'position' => '79', 'width' => '16', 'height' => '16' ), - 'b_usrlist' => array( + 'b_usredit' => array( 'position' => '80', 'width' => '16', 'height' => '16' ), - 'b_view_add' => array( + 'b_usrlist' => array( 'position' => '81', 'width' => '16', 'height' => '16' ), - 'b_view' => array( + 'b_view_add' => array( 'position' => '82', 'width' => '16', 'height' => '16' ), - 'b_views' => array( + 'b_view' => array( 'position' => '83', 'width' => '16', 'height' => '16' ), - 'col_drop' => array( + 'b_views' => array( 'position' => '84', 'width' => '16', 'height' => '16' ), - 'eye_grey' => array( + 'col_drop' => array( 'position' => '85', 'width' => '16', 'height' => '16' ), - 'eye' => array( + 'eye_grey' => array( 'position' => '86', 'width' => '16', 'height' => '16' ), - 'more' => array( + 'eye' => array( 'position' => '87', + 'width' => '16', + 'height' => '16' + ), + 'more' => array( + 'position' => '88', 'width' => '13', 'height' => '16' ), 'new_data_hovered' => array( - 'position' => '88', - 'width' => '16', - 'height' => '16' - ), - 'new_data' => array( 'position' => '89', 'width' => '16', 'height' => '16' ), - 'new_data_selected_hovered' => array( + 'new_data' => array( 'position' => '90', 'width' => '16', 'height' => '16' ), - 'new_data_selected' => array( + 'new_data_selected_hovered' => array( 'position' => '91', 'width' => '16', 'height' => '16' ), - 'new_struct_hovered' => array( + 'new_data_selected' => array( 'position' => '92', 'width' => '16', 'height' => '16' ), - 'new_struct' => array( + 'new_struct_hovered' => array( 'position' => '93', 'width' => '16', 'height' => '16' ), - 'new_struct_selected_hovered' => array( + 'new_struct' => array( 'position' => '94', 'width' => '16', 'height' => '16' ), - 'new_struct_selected' => array( + 'new_struct_selected_hovered' => array( 'position' => '95', 'width' => '16', 'height' => '16' ), - 'pause' => array( + 'new_struct_selected' => array( 'position' => '96', 'width' => '16', 'height' => '16' ), - 'play' => array( + 'pause' => array( 'position' => '97', 'width' => '16', 'height' => '16' ), - 's_asci' => array( + 'play' => array( 'position' => '98', 'width' => '16', 'height' => '16' ), - 's_asc' => array( + 's_asci' => array( 'position' => '99', + 'width' => '16', + 'height' => '16' + ), + 's_asc' => array( + 'position' => '100', 'width' => '11', 'height' => '9' ), 's_cancel' => array( - 'position' => '100', - 'width' => '16', - 'height' => '16' - ), - 's_cog' => array( 'position' => '101', 'width' => '16', 'height' => '16' ), - 's_db' => array( + 's_cog' => array( 'position' => '102', 'width' => '16', 'height' => '16' ), - 's_desc' => array( + 's_db' => array( 'position' => '103', + 'width' => '16', + 'height' => '16' + ), + 's_desc' => array( + 'position' => '104', 'width' => '11', 'height' => '9' ), 's_error2' => array( - 'position' => '104', + 'position' => '105', 'width' => '11', 'height' => '11' ), 's_error' => array( - 'position' => '105', - 'width' => '16', - 'height' => '16' - ), - 's_host' => array( 'position' => '106', 'width' => '16', 'height' => '16' ), - 's_lang' => array( + 's_host' => array( 'position' => '107', 'width' => '16', 'height' => '16' ), - 's_loggoff' => array( + 's_lang' => array( 'position' => '108', 'width' => '16', 'height' => '16' ), - 's_notice' => array( + 's_loggoff' => array( 'position' => '109', 'width' => '16', 'height' => '16' ), - 's_passwd' => array( + 's_notice' => array( 'position' => '110', 'width' => '16', 'height' => '16' ), - 's_really' => array( + 's_passwd' => array( 'position' => '111', + 'width' => '16', + 'height' => '16' + ), + 's_really' => array( + 'position' => '112', 'width' => '11', 'height' => '11' ), 's_reload' => array( - 'position' => '112', - 'width' => '16', - 'height' => '16' - ), - 's_replication' => array( 'position' => '113', 'width' => '16', 'height' => '16' ), - 's_rights' => array( + 's_replication' => array( 'position' => '114', 'width' => '16', 'height' => '16' ), - 's_sortable' => array( + 's_rights' => array( 'position' => '115', + 'width' => '16', + 'height' => '16' + ), + 's_sortable' => array( + 'position' => '116', 'width' => '11', 'height' => '15' ), 's_status' => array( - 'position' => '116', - 'width' => '16', - 'height' => '16' - ), - 's_success' => array( 'position' => '117', 'width' => '16', 'height' => '16' ), - 's_sync' => array( + 's_success' => array( 'position' => '118', 'width' => '16', 'height' => '16' ), - 's_tbl' => array( + 's_sync' => array( 'position' => '119', 'width' => '16', 'height' => '16' ), - 's_theme' => array( + 's_tbl' => array( 'position' => '120', 'width' => '16', 'height' => '16' ), - 's_top' => array( + 's_theme' => array( 'position' => '121', 'width' => '16', 'height' => '16' ), - 's_vars' => array( + 's_top' => array( 'position' => '122', 'width' => '16', 'height' => '16' ), - 's_views' => array( + 's_vars' => array( 'position' => '123', + 'width' => '16', + 'height' => '16' + ), + 's_views' => array( + 'position' => '124', 'width' => '10', 'height' => '10' ), 'window-new' => array( - 'position' => '124', + 'position' => '125', 'width' => '16', 'height' => '16' ), diff --git a/themes/pmahomme/css/navigation.css.php b/themes/pmahomme/css/navigation.css.php index 0b9068446d..122d12c388 100644 --- a/themes/pmahomme/css/navigation.css.php +++ b/themes/pmahomme/css/navigation.css.php @@ -104,6 +104,21 @@ if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) { color: ; background-color: ; } +#pma_navigation_tree li .dbItemControls { + padding-left: 4px; +} +#pma_navigation_tree li .navItemControls { + display: none; + padding-left: 4px; +} +#pma_navigation_tree li.activePointer .navItemControls { + display: inline; + opacity: 0.5; +} +#pma_navigation_tree li.activePointer .navItemControls:hover { + display: inline; + opacity: 1.0; +} #pma_navigation_tree ul { clear: both; padding: 0; diff --git a/themes/pmahomme/img/b_undo.png b/themes/pmahomme/img/b_undo.png new file mode 100644 index 0000000000..498187821c Binary files /dev/null and b/themes/pmahomme/img/b_undo.png differ diff --git a/themes/pmahomme/img/sprites.png b/themes/pmahomme/img/sprites.png index c370af4a52..2835f23685 100644 Binary files a/themes/pmahomme/img/sprites.png and b/themes/pmahomme/img/sprites.png differ diff --git a/themes/pmahomme/sprites.lib.php b/themes/pmahomme/sprites.lib.php index b0913cd5bb..da85bbdf97 100644 --- a/themes/pmahomme/sprites.lib.php +++ b/themes/pmahomme/sprites.lib.php @@ -430,296 +430,301 @@ function PMA_sprites() 'width' => '16', 'height' => '16' ), - 'b_unique' => array( + 'b_undo' => array( 'position' => '86', 'width' => '16', 'height' => '16' ), - 'b_usradd' => array( + 'b_unique' => array( 'position' => '87', 'width' => '16', 'height' => '16' ), - 'b_usrcheck' => array( + 'b_usradd' => array( 'position' => '88', 'width' => '16', 'height' => '16' ), - 'b_usrdrop' => array( + 'b_usrcheck' => array( 'position' => '89', 'width' => '16', 'height' => '16' ), - 'b_usredit' => array( + 'b_usrdrop' => array( 'position' => '90', 'width' => '16', 'height' => '16' ), - 'b_usrlist' => array( + 'b_usredit' => array( 'position' => '91', 'width' => '16', 'height' => '16' ), - 'b_view_add' => array( + 'b_usrlist' => array( 'position' => '92', 'width' => '16', 'height' => '16' ), - 'b_view' => array( + 'b_view_add' => array( 'position' => '93', 'width' => '16', 'height' => '16' ), - 'b_views' => array( + 'b_view' => array( 'position' => '94', 'width' => '16', 'height' => '16' ), - 'col_drop' => array( + 'b_views' => array( 'position' => '95', 'width' => '16', 'height' => '16' ), - 'database' => array( + 'col_drop' => array( 'position' => '96', 'width' => '16', 'height' => '16' ), - 'eye_grey' => array( + 'database' => array( 'position' => '97', 'width' => '16', 'height' => '16' ), - 'eye' => array( + 'eye_grey' => array( 'position' => '98', 'width' => '16', 'height' => '16' ), - 'item' => array( + 'eye' => array( 'position' => '99', + 'width' => '16', + 'height' => '16' + ), + 'item' => array( + 'position' => '100', 'width' => '9', 'height' => '9' ), 'more' => array( - 'position' => '100', + 'position' => '101', 'width' => '13', 'height' => '16' ), 'new_data_hovered' => array( - 'position' => '101', - 'width' => '16', - 'height' => '16' - ), - 'new_data' => array( 'position' => '102', 'width' => '16', 'height' => '16' ), - 'new_data_selected_hovered' => array( + 'new_data' => array( 'position' => '103', 'width' => '16', 'height' => '16' ), - 'new_data_selected' => array( + 'new_data_selected_hovered' => array( 'position' => '104', 'width' => '16', 'height' => '16' ), - 'new_struct_hovered' => array( + 'new_data_selected' => array( 'position' => '105', 'width' => '16', 'height' => '16' ), - 'new_struct' => array( + 'new_struct_hovered' => array( 'position' => '106', 'width' => '16', 'height' => '16' ), - 'new_struct_selected_hovered' => array( + 'new_struct' => array( 'position' => '107', 'width' => '16', 'height' => '16' ), - 'new_struct_selected' => array( + 'new_struct_selected_hovered' => array( 'position' => '108', 'width' => '16', 'height' => '16' ), - 'pause' => array( + 'new_struct_selected' => array( 'position' => '109', 'width' => '16', 'height' => '16' ), - 'php_sym' => array( + 'pause' => array( 'position' => '110', 'width' => '16', 'height' => '16' ), - 'play' => array( + 'php_sym' => array( 'position' => '111', 'width' => '16', 'height' => '16' ), - 's_asci' => array( + 'play' => array( 'position' => '112', 'width' => '16', 'height' => '16' ), - 's_asc' => array( + 's_asci' => array( 'position' => '113', 'width' => '16', 'height' => '16' ), - 's_attention' => array( + 's_asc' => array( 'position' => '114', 'width' => '16', 'height' => '16' ), - 's_cancel2' => array( + 's_attention' => array( 'position' => '115', 'width' => '16', 'height' => '16' ), - 's_cancel' => array( + 's_cancel2' => array( 'position' => '116', 'width' => '16', 'height' => '16' ), - 's_cog' => array( + 's_cancel' => array( 'position' => '117', 'width' => '16', 'height' => '16' ), - 's_db' => array( + 's_cog' => array( 'position' => '118', 'width' => '16', 'height' => '16' ), - 's_desc' => array( + 's_db' => array( 'position' => '119', 'width' => '16', 'height' => '16' ), - 's_error2' => array( + 's_desc' => array( 'position' => '120', + 'width' => '16', + 'height' => '16' + ), + 's_error2' => array( + 'position' => '121', 'width' => '11', 'height' => '11' ), 's_error' => array( - 'position' => '121', - 'width' => '16', - 'height' => '16' - ), - 's_host' => array( 'position' => '122', 'width' => '16', 'height' => '16' ), - 's_info' => array( + 's_host' => array( 'position' => '123', 'width' => '16', 'height' => '16' ), - 's_lang' => array( + 's_info' => array( 'position' => '124', 'width' => '16', 'height' => '16' ), - 's_loggoff' => array( + 's_lang' => array( 'position' => '125', 'width' => '16', 'height' => '16' ), - 's_notice' => array( + 's_loggoff' => array( 'position' => '126', 'width' => '16', 'height' => '16' ), - 's_okay' => array( + 's_notice' => array( 'position' => '127', 'width' => '16', 'height' => '16' ), - 's_passwd' => array( + 's_okay' => array( 'position' => '128', 'width' => '16', 'height' => '16' ), - 's_process' => array( + 's_passwd' => array( 'position' => '129', 'width' => '16', 'height' => '16' ), - 's_really' => array( + 's_process' => array( 'position' => '130', + 'width' => '16', + 'height' => '16' + ), + 's_really' => array( + 'position' => '131', 'width' => '11', 'height' => '11' ), 's_reload' => array( - 'position' => '131', - 'width' => '16', - 'height' => '16' - ), - 's_replication' => array( 'position' => '132', 'width' => '16', 'height' => '16' ), - 's_rights' => array( + 's_replication' => array( 'position' => '133', 'width' => '16', 'height' => '16' ), - 's_sortable' => array( + 's_rights' => array( 'position' => '134', 'width' => '16', 'height' => '16' ), - 's_status' => array( + 's_sortable' => array( 'position' => '135', 'width' => '16', 'height' => '16' ), - 's_success' => array( + 's_status' => array( 'position' => '136', 'width' => '16', 'height' => '16' ), - 's_sync' => array( + 's_success' => array( 'position' => '137', 'width' => '16', 'height' => '16' ), - 's_tbl' => array( + 's_sync' => array( 'position' => '138', 'width' => '16', 'height' => '16' ), - 's_theme' => array( + 's_tbl' => array( 'position' => '139', 'width' => '16', 'height' => '16' ), - 's_top' => array( + 's_theme' => array( 'position' => '140', 'width' => '16', 'height' => '16' ), - 's_vars' => array( + 's_top' => array( 'position' => '141', 'width' => '16', 'height' => '16' ), - 's_views' => array( + 's_vars' => array( 'position' => '142', 'width' => '16', 'height' => '16' ), - 'window-new' => array( + 's_views' => array( 'position' => '143', 'width' => '16', 'height' => '16' ), + 'window-new' => array( + 'position' => '144', + 'width' => '16', + 'height' => '16' + ), ); } ?>