From 554fca62049cc389d4c337bab14ca1395aadcc81 Mon Sep 17 00:00:00 2001 From: thilinaa Date: Sun, 19 Aug 2012 00:23:30 +0530 Subject: [PATCH] formatting for server_privileges-lib --- libraries/server_privileges.lib.php | 450 ++++++++++++++++++---------- 1 file changed, 292 insertions(+), 158 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 278883b2d7..0a9be05db2 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -26,17 +26,17 @@ if (! defined('PHPMYADMIN')) { */ function PMA_wildcardEscapeForGrant($dbname, $tablename) { + $common_functions = PMA_CommonFunctions::getInstance(); if (! strlen($dbname)) { $db_and_table = '*.*'; } else { if (strlen($tablename)) { - $db_and_table - = PMA_CommonFunctions::getInstance()->backquote( - PMA_CommonFunctions::getInstance()->unescapeMysqlWildcards($dbname) + $db_and_table = $common_functions->backquote( + $common_functions->unescapeMysqlWildcards($dbname) ) . '.' - . PMA_CommonFunctions::getInstance()->backquote($tablename); + . $common_functions->backquote($tablename); } else { - $db_and_table = PMA_CommonFunctions::getInstance()->backquote($dbname) . '.*'; + $db_and_table = $common_functions->backquote($dbname) . '.*'; } } return $db_and_table; @@ -51,13 +51,14 @@ function PMA_wildcardEscapeForGrant($dbname, $tablename) */ function PMA_rangeOfUsers($initial = '') { + $common_functions = PMA_CommonFunctions::getInstance(); // strtolower() is used because the User field // might be BINARY, so LIKE would be case sensitive if (! empty($initial)) { $ret = " WHERE `User` LIKE '" - . PMA_CommonFunctions::getInstance()->sqlAddSlashes($initial, true) . "%'" + . $common_functions->sqlAddSlashes($initial, true) . "%'" . " OR `User` LIKE '" - . PMA_CommonFunctions::getInstance()->sqlAddSlashes(strtolower($initial), true) . "%'"; + . $common_functions->sqlAddSlashes(strtolower($initial), true) . "%'"; } else { $ret = ''; } @@ -309,11 +310,15 @@ function PMA_getHtmlForDisplayColumnPrivileges($columns, $row, $name_for_select, . $name_for_select . '[]" multiple="multiple" size="8">' . "\n"; foreach ($columns as $current_column => $current_column_privileges) { - $html_output .= '' . "\n"; } $html_output .= '' . "\n" @@ -465,12 +470,16 @@ function PMA_getHtmlToDisplayPrivilegesTable($random_n, $db = '*', ); } else { // g l o b a l o r d b - s p e c i f i c - $html_output .= PMA_getHtmlForGlobalOrDbSpecificPrivs($db, $table, $row, $random_n); + $html_output .= PMA_getHtmlForGlobalOrDbSpecificPrivs( + $db, $table, $row, $random_n + ); } $html_output .= '' . "\n"; if ($submit) { - $html_output .= '