diff --git a/ChangeLog b/ChangeLog index 7cda441b2..2acdf45b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,9 +83,47 @@ $Id$ + [core] Include Content Security Policy HTTP headers. - bug #3004216 [CSS] Field attributes use inline CSS - patch #2999595, rfe #2998130 [interface] Cleanup navigation frame. -- [core] Update library PHPExcel to version 1.7.3c +- patch #3025161 [core] Prevent sending of unnecessary cookies, + thanks to Piotr Przybylski - crackpl +- bug [password] Generate password only available if JS is enabled + (fixed for Privileges and Change password) +- [core] RecodingEngine now accepts none as valid option. ++ [core] Dropped AllowAnywhereRecoding configuration variable. +- rfe #3016457 [interface] Define tab order in SQL form to allow easier tab + navigation. ++ [core] Centralized format string expansion, @VARIABLES@ are recommended way + now, used by file name templates, default queries, export and title + generating. ++ [validator] SQL validator works also with SOAP PHP extension. +- [interface] Better formatting for SQL validator results. +- [doc] The linked-tables infrastructure is now called phpMyAdmin + configuration storage. +- [interface] Move drop/empty links from being tabs to Operations tab. +- [interface] Fixed rendering of error/notice/info titles background. -3.3.4.0 (not yet released) +3.3.6.0 (not yet released) +- bug #3033063 [core] Navi gets wrong db name +- bug #3031705 [core] Fix generating condition for real numbers by comparing + them to string. + +3.3.5.0 (2010-07-26) +- patch #2932113 [information_schema] Slow export when having lots of + databases, thanks to Stéphane Pontier - shadow_walker +- bug #3022705 [import] Import button does not work in Catalan when there + is no progress bar possible +- bug [replication] Do not offer information_schema in the list of databases +- bug [js] Avoid loading twice a js file +- bug #3024344 [setup] Setup forces numeric MemoryLimit +- bug #3025975 [auth] Odd LoginCookieValidity default value +- bug #3026400 [PHP] ereg functions are deprecated +- bug #3027557 [PHP] split() deprecated in PHP 5.3 (backport fixes from master) +- bug #3023507 [core] No result set display from stored procedure SELECT +- bug [export] CSV for MS Excel (Windows) should have semi-colon as separator +- [core] Update library PHPExcel to version 1.7.3c +- bug #2994885, bug #3029168 [import] Convert Excel column name correctly +- bug [scripts] MySQL 5.5.5 does not accept TIMESTAMP(14) in create_tables.sql + +3.3.4.0 (2010-06-28) - bug #2996161 [import] properly escape import value - bug #2998889 [import] Import button does not work in Catalan - [browse] Fix handling of sort order if only column is specified. @@ -96,6 +134,11 @@ $Id$ - bug [synchronize] Rows were deleted in target table regardless of the "Would you like to delete..." option - bug [privileges] List of tables not shown when the db name has a wildcard +- bug #3011126 [display] Edit link missing after long query +- patch #3013264 [doc] FAQ 1.40 uses a comma instead of a period, + thanks to Isaac Bennetch - ibennetch +- [engines] Fix getting InnoDB status. +- bug #2986422 [import] Results for query are not displayed 3.3.3.0 (2010-05-10) - patch #2982480 [navi] Do not group if there would be one table in group, diff --git a/Documentation.html b/Documentation.html index 659cd68c7..bf9a05a81 100644 --- a/Documentation.html +++ b/Documentation.html @@ -69,7 +69,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
  • To support uploading of ZIP files, you need the PHP zip extension.
  • For proper support of multibyte strings (eg. UTF-8, which is - currently default), you should install mbstring and ctype + currently the default), you should install the mbstring and ctype extensions.
  • You need GD2 support in PHP to display inline @@ -84,6 +84,9 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
  • To support upload progress bars, see FAQ 2.9.
  • +
  • To support BLOB streaming, see PHP and MySQL requirements + in + FAQ 6.25.
  • MySQL 5.0 or newer (details);
  • @@ -167,7 +170,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
    1. Quick Install
    2. Setup script usage
    3. -
    4. Linked-tables infrastructure
    5. +
    6. phpMyAdmin configuration storage
    7. Upgrading from an older version
    8. Using authentication modes
    @@ -323,7 +326,7 @@ rm -rf config # remove not needed directory -

    Linked-tables infrastructure

    +

    phpMyAdmin configuration storage

    For a whole set of new features (bookmarks, comments, SQL-history, @@ -340,7 +343,8 @@ rm -rf config # remove not needed directory FAQ 1.23).

    If you already had this infrastructure and upgraded to MySQL 4.1.2 - or newer, please use ./scripts/upgrade_tables_mysql_4_1_2+.sql.

    + or newer, please use ./scripts/upgrade_tables_mysql_4_1_2+.sql + and then create new tables by importing ./scripts/create_tables.sql.

    You can use your phpMyAdmin to create the tables for you. Please be aware that you may need special (administrator) privileges to create the database @@ -369,7 +373,7 @@ rm -rf config # remove not needed directory is version-specific.

    If you have upgraded your MySQL server from a version previous to 4.1.2 to - version 4.1.2 or newer and if you use the pmadb/linked table infrastructure, + version 4.1.2 or newer and if you use the phpMyAdmin configuration storage, you should run the SQL script found in scripts/upgrade_tables_mysql_4_1_2+.sql.

    @@ -396,7 +400,7 @@ rm -rf config # remove not needed directory In cookie mode, the password is stored, encrypted with the blowfish algorithm, in a temporary cookie. -
  • Note: starting with phpMyAdmin 2.6.1, this section is only applicable if +
  • Note: this section is only applicable if your MySQL server is running with --skip-show-database.

    For 'HTTP' and 'cookie' @@ -439,8 +443,9 @@ GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'; - (this of course requires that your linked-tables - infrastructure be set up).
  • + (this of course requires that your phpMyAdmin + configuration storage be set up). +
  • Then each of the true users should be granted a set of privileges on a set of particular databases. Normally you shouldn't give global @@ -715,7 +720,7 @@ since this link provides funding for phpMyAdmin.
    This special account is used for 2 distinct purposes: to make possible all relational features (see $cfg['Servers'][$i]['pmadb']) - and, for a MySQL server previous to 4.1.2 or running with + and, for a MySQL server running with --skip-show-database, to enable a multi-user installation (HTTP or cookie authentication mode).

    @@ -861,11 +866,11 @@ since this link provides funding for phpMyAdmin.
    $cfg['Servers'][$i]['pmadb'] string
    -
    The name of the database containing the linked-tables infrastructure. +
    The name of the database containing the phpMyAdmin configuration storage.

    - See the Linked-tables infrastructure - section in this document to see the benefits of this infrastructure, + See the phpMyAdmin configuration storage + section in this document to see the benefits of this feature, and for a quick way of creating this database and the needed tables.

    @@ -874,7 +879,7 @@ since this link provides funding for phpMyAdmin. case, just put your current database name in $cfg['Servers'][$i]['pmadb']. For a multi-user installation, set this parameter to the name of your central database containing - the linked-tables infrastructure.
    + the phpMyAdmin configuration storage.
    $cfg['Servers'][$i]['bookmarktable'] string @@ -883,7 +888,7 @@ since this link provides funding for phpMyAdmin. useful for queries you often run.

    To allow the usage of this functionality: -
    Default queries that will be displayed in query boxes when user didn't - specify any. Use %d for database name, %t for table name and %f for a - comma separated list of column names. Note that %t and %f are only - applicable to $cfg['DefaultQueryTable'].
    + specify any. You can use standard + format string expansion. +
    $cfg['SQP']['fmtType'] string [html|none]
    @@ -3141,7 +3115,7 @@ RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L] in your Apache configuration. See http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#ssloptions.

    - 1.40 When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work,

    + 1.40 When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work.

    To be able to use cookie auth Apache must know that it has to rewrite the set-cookie headers.
    Example from the Apache 2.2 documentation:

    @@ -3365,7 +3339,7 @@ have either the APC extension

    3.1 When using - HTTP authentication, an user + HTTP authentication, a user who logged out can not log in again in with the same nick.

    This is related to the authentication mechanism (protocol) used by @@ -4134,25 +4108,34 @@ INSERT INTO REL_towns VALUES ('M', 'Montréal'); 6.14 How do I set up the SQL Validator? -

    To use it, you need a very recent version of PHP, 4.3.0 recommended, with +

    + To use SQL Validator, you need PHP with XML, PCRE and PEAR support. - On your system command line, run "pear install Net_Socket Net_URL - HTTP_Request Mail_Mime Net_DIME SOAP" to get the necessary - PEAR modules - for usage.
    - On a more recent pear version, I had problems with the state of Net_DIME - being beta, so this single command - "pear -d preferred_state=beta install -a SOAP" installed all the - needed modules.
    + In addition you need a SOAP support, either as a PHP extension or as a PEAR SOAP + module. +

    + +

    + To install PEAR SOAP module, run "pear install Net_Socket Net_URL + HTTP_Request Mail_Mime Net_DIME SOAP" to get the necessary PEAR modules for + usage. +

    + +

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

    + We utilize it as free SOAP service. +

    6.15 I want to add a BLOB column and put an index on @@ -4323,17 +4306,59 @@ chmod o+rwx tmp

    6.25 How does BLOB streaming work in phpMyAdmin?

    -

    First, for general information about BLOB streaming on MySQL, visit blobstreaming.org. We currently support streaming if you are running MySQL 5.1 with the PBXT and PBMS storage engines.

    +

    For general information about BLOB streaming on MySQL, visit blobstreaming.org. You need the following components:

    +
      +
    • PBMS BLOB Streaming Daemon for MySQL (0.5.15 or later)
    • +
    • Streaming enabled PBXT Storage engine for MySQL (1.0.11-6 or + later)
    • +
    • PBMS Client Library for MySQL (0.5.15 or later)
    • +
    • PBMS PHP Extension for MySQL (0.1.1 or later)
    • +
    + +

    Here are details about configuration and operation:

      -
    1. In config.inc.php your host should be defined with a FQDN (fully qualified domain name) instead of something like "localhost".
    2. -
    3. A current limitation is that your first login via phpMyAdmin to a freshly-started server must be done with an account that has the SUPER privilege.
    4. -
    5. On your target database, go to Operations and in the "BLOB Repository" section, click "Enable". This creates the PBMS system tables inside your database.
    6. -
    7. Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column.
    8. +
    9. In config.inc.php your host should be defined with a FQDN (fully qualified domain name) instead of "localhost".
    10. +
    11. Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column and a primary key.
    12. When you insert or update a row in this table, put a checkmark on the "Upload to BLOB repository" optional choice; otherwise, the upload will be done directly in your column instead of the repository.
    13. Finally when you browse your table, you'll see in your column a link to stream your data, for example "View image". A header containing the correct MIME-type will be sent to your browser; this MIME-type was stored at upload time but in case it's incorrect, it's possible to edit it by clicking on the displayed MIME-type.
    +

    + 6.26 How can I select a range of rows?

    + +

    Click the first row of the range, hold the shift key and click the last row of the range. This works everywhere you see rows, for example in Browse mode or on the Structure page.

    + + +

    + 6.27 What format strings can I use?

    + +

    + In all places where phpMyAdmin accepts format strings, you can use + @VARIABLE@ expansion and + strftime format strings. The + expanded variables depend on a context (eg. if you don't have chosen + table, you can not get table name), but following variables can be used: +

    +
    +
    @HTTP_HOST@
    +
    HTTP host that runs phpMyAdmin
    +
    @SERVER@
    +
    MySQL server name
    +
    @VERBOSE@
    +
    Verbose MySQL server name as defined in server configuration
    +
    @VSERVER@
    +
    Verbose MySQL server name if set, otherwise normal
    +
    @DATABASE@
    +
    Currently opened database
    +
    @TABLE@
    +
    Currently opened table
    +
    @FIELDS@
    +
    Fields of currently opened table
    +
    @PHPMYADMIN@
    +
    phpMyAdmin with version
    +
    +

    phpMyAdmin project

    @@ -4344,21 +4369,22 @@ chmod o+rwx tmp under the Bugs section.

    But please first discuss your bug with other users:
    - - http://sf.net/projects/phpmyadmin/ (and choose Forums)

    + + https://sourceforge.net/projects/phpmyadmin/forums. +

    7.2 I want to translate the messages to a new language or upgrade an existing language, where do I start?

    -

    Always use latest Git version of po file to translate. You can optionally +

    Always use latest Git version of the po file to translate. You can optionally translate online at our translation - server where you can also get latest po files and merge them - with your translations. For creating new translation simply use + server where you can also get the latest po files and merge them + with your translations. For creating a new translation simply use po/phpmyadmin.pot and generate po/LANG_CODE.po for your language (you can use msginit -i po/phpmyadmin.pot -l LANG_CODE --no-translator -o po/LANG_CODE.po - to do this) or ask on mailing list to add the translation to the web + to do this) or ask on the mailing list to add the translation to the web interface. More details are available on our wiki.

    @@ -4366,18 +4392,30 @@ chmod o+rwx tmp the translations, since we define the right character set in the file. With HTML entities, the text on JavaScript messages would not display correctly. - However there are some entities that need to be there, for quotes - ,non-breakable spaces, ampersands, less than, greater than. + However there are some entities that need to be there: quotes, + non-breakable spaces, ampersands, less than, greater than.

    You can then put your translations, as a zip file to avoid losing special - characters, on the sourceforge.net translation tracker. + characters, on the sourceforge.net translation tracker.

    - It would be a good idea to subscribe to the phpmyadmin-translators mailing + It would be a good idea to subscribe to the phpmyadmin-translators mailing list, because this is where we ask for translations of new messages.

    +

    + Documentation is being translated using po4a and gettext (see + documentation + for existing translations). To start, checkout + localized_docs/po + from Git, or just go to the translation server + and translate it online. If your language is missing, just contact + Michal Čihař; he will add it. If + you prefer to directly translate the po files, please put updated ones into our + translation tracker. +

    +

    7.3 I would like to help out with the development of phpMyAdmin. How should I proceed?

    @@ -4417,7 +4455,7 @@ chmod o+rwx tmp 8.2 How can I protect phpMyAdmin against brute force attacks?

    If you use Apache web server, phpMyAdmin exports information about - authentication to Apache environment and it can be used in Apache logs. + authentication to the Apache environment and it can be used in Apache logs. Currently there are two variables available:

    @@ -4448,14 +4486,14 @@ LogFormat "%h %l %u %t \"%r\" %>s %b \ 9.1 How can I synchronize two databases/tables in phpMyAdmin?

    You can now synchronize databases/tables in phpMyAdmin using the Synchronize feature. -It allows you to connect to local as well as remote servers.This requires you to enter +It allows you to connect to local as well as remote servers. This requires you to enter server host name, username, password, port and the name of the database. Therefore you can now synchronize your databases placed on the same server or some remote server.

    This feature is helpful for developers who need to replicate their -databases’ structure as well as data. Moreover, this feature not only +database’s structure as well as data. Moreover, this feature not only helps replication but also facilitates the user to keep his/her database in sync with another database. Other than the full database, certain tables of the databases can also be synchronized. @@ -4476,29 +4514,29 @@ representation.

    -On the left, are listed the source database table names.  Some of the -names have a ‘+’ plus sign preceding them. This shows that these tables +On the left, are listed the source database table names. Some of the +names have a + plus sign preceding them. This shows that these tables are only present in source database and they need to be added to the target database in order to synchronize the target database. The tables -whose names are not preceded by a ‘+’ sign are already present in the +whose names are not preceded by a + sign are already present in the target database.

    On the right, are listed the target database table names. There are few -table names that have “(not present)” appended after their names. This +table names that have (not present) appended after their names. This means that these tables are to be created in target database in order to -synchronize target database with source database. Some tables’ names -have a ‘-’ minus sign preceding them. This shows that these tables are +synchronize target database with source database. Some table names +have a - minus sign preceding them. This shows that these tables are only present in target database and they will remain unchanged in the target database. The column in the middle shows the difference between the source and target corresponding tables.

    -The difference is depicted by the red and green buttons with S and D +The difference is depicted by the red and green buttons with S and D letters, indicating that either Structure or Data are not up to date. By -clicking on them, they will turn grey, what means that they will be synchronised. +clicking on them, they will turn grey, what means that they will be synchronized.

    @@ -4816,6 +4854,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  • Replication support
  • +
  • Barrie Leslie +
  • +

    diff --git a/browse_foreigners.php b/browse_foreigners.php index 714d8676d..4cfa543e8 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -3,7 +3,6 @@ /** * display selection for relational field values * - * @version $Id$ * @package phpMyAdmin */ @@ -23,7 +22,6 @@ require_once './libraries/header_http.inc.php'; * Displays the frame */ $per_page = 200; -require_once './libraries/relation.lib.php'; // foreign keys require_once './libraries/transformations.lib.php'; // Transformations $cfgRelation = PMA_getRelationsParam(); $foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE); diff --git a/bs_change_mime_type.php b/bs_change_mime_type.php index b8fea6b55..edefae144 100644 --- a/bs_change_mime_type.php +++ b/bs_change_mime_type.php @@ -1,7 +1,6 @@ get('BLOBSTREAMING_PLUGINS_EXIST')) - { - $pbms_ref_tbl = $PMA_Config->get('PBMS_NAME') . '_reference'; - $pbms_cust_content_type_tbl = $PMA_Config->get('PBMS_NAME') . '_custom_content_type'; - - // if specified DB is selected - if (PMA_DBI_select_db($bsDB)) - { - $query = "SELECT * FROM " . PMA_backquote($pbms_ref_tbl); - $query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'"; - - $result = PMA_DBI_query($query); - - // if record exists - if ($data = PMA_DBI_fetch_assoc($result)) - { - $query = "SELECT count(*) FROM " . PMA_backquote($pbms_cust_content_type_tbl); - $query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'"; - - $result = PMA_DBI_query($query); - - // if record exists - if ($data = PMA_DBI_fetch_assoc($result)) - { - if (1 == $data['count(*)']) - { - $query = "UPDATE " . PMA_backquote($pbms_cust_content_type_tbl) . " SET Content_type='"; - $query .= PMA_sqlAddslashes($bsNewMIMEType) . "' WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'"; - } - else - { - $query = "INSERT INTO " . PMA_backquote($pbms_cust_content_type_tbl) . " (Blob_url, Content_type)"; - $query .= " VALUES('" . PMA_sqlAddslashes($bsReference) . "', '" . PMA_sqlAddslashes($bsNewMIMEType) . "')"; - } - - $result = PMA_DBI_query($query); - - // if query execution succeeded - if ($result) - { - // determine redirector page - $newLoc = $cfg['PmaAbsoluteUri'] . 'sql.php?' . PMA_generate_common_url ('','', '&') . (isset($bsDB) ? '&db=' . urlencode($bsDB) : '') . (isset($bsTable) ? '&table=' . urlencode($bsTable) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . '&reload=1&purge=1'; - - // redirect to specified page - ?> - - get('BLOBSTREAMING_PLUGINS_EXIST')) - } // end if (!empty($PMA_Config)) + // redirect to specified page + ?> + + diff --git a/bs_disp_as_mime_type.php b/bs_disp_as_mime_type.php index a83dfa66e..085d88823 100644 --- a/bs_disp_as_mime_type.php +++ b/bs_disp_as_mime_type.php @@ -1,7 +1,6 @@ get('BLOBSTREAMING_SERVER'); -if (empty($bs_server)) die('No blob streaming server configured!'); - // Check URL parameters PMA_checkParameters(array('reference', 'c_type')); @@ -31,15 +23,23 @@ $reference = $_REQUEST['reference']; */ $c_type = preg_replace('/[^A-Za-z0-9/_-]/', '_', $_REQUEST['c_type']); -$filename = 'http://' . $bs_server . '/' . $reference; +// Get the blob streaming URL +$filename = PMA_BS_getURL($reference); +if (empty($filename)) { + die(__('No blob streaming server configured!')); +} $hdrs = get_headers($filename, 1); -if ($hdrs === FALSE) die('Failed to fetch headers'); +if ($hdrs === FALSE) { + die(__('Failed to fetch headers')); +} $fHnd = fopen($filename, "rb"); -if ($fHnd === FALSE) die('Failed to open remote URL'); +if ($fHnd === FALSE) { + die(__('Failed to open remote URL')); +} $f_size = $hdrs['Content-Length']; @@ -59,8 +59,9 @@ while (!feof($fHnd)) { $content .= fread($fHnd, $f_size); $pos = strlen($content); - if ($pos >= $f_size) + if ($pos >= $f_size) { break; + } } echo $content; diff --git a/bs_play_media.php b/bs_play_media.php index 94ed25a2b..fe6f57425 100644 --- a/bs_play_media.php +++ b/bs_play_media.php @@ -1,7 +1,6 @@ get('BLOBSTREAMING_SERVER'); - if (empty($bs_server)) die('No blob streaming server configured!'); - - $bs_file_path = "http://" . $bs_server . '/' . $bsReference; - - if (isset($customType) && $customType) - - $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType)); - + if (isset($mediaType) && isset($bsReference)) { + if (isset($customType) && $customType) { + $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType)); + } else { + // Get the BLOB streaming URL + $bs_file_path = PMA_BS_getURL($bsReference); + if (empty($bs_file_path)) { + die(__('No blob streaming server configured!')); + } + } ?> @@ -70,7 +61,6 @@ diff --git a/changelog.php b/changelog.php index dcdbecf5d..9ab2e399a 100644 --- a/changelog.php +++ b/changelog.php @@ -3,7 +3,6 @@ /** * Simple script to set correct charset for changelog * - * @version $Id$ * @package phpMyAdmin */ diff --git a/chk_rel.php b/chk_rel.php index f95d45bda..8955350b0 100644 --- a/chk_rel.php +++ b/chk_rel.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -10,9 +9,7 @@ * Gets some core libraries */ require_once './libraries/common.inc.php'; -$GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; -require_once './libraries/relation.lib.php'; /** @@ -24,5 +21,5 @@ $cfgRelation = PMA_getRelationsParam(TRUE); /** * Displays the footer */ -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/config.sample.inc.php b/config.sample.inc.php index 575e96562..da403fd2b 100644 --- a/config.sample.inc.php +++ b/config.sample.inc.php @@ -35,12 +35,6 @@ $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = false; -/* for blobstreaming */ -$cfg['Servers'][$i]['bs_garbage_threshold'] = 50; -$cfg['Servers'][$i]['bs_repository_threshold'] = '32M'; -$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600; -$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M'; - /* User for advanced features */ // $cfg['Servers'][$i]['controluser'] = 'pma'; // $cfg['Servers'][$i]['controlpass'] = 'pmapass'; @@ -100,7 +94,7 @@ $cfg['SaveDir'] = ''; /** * Default language to use, if not browser-defined or user-defined - * (you find all languages in the file libraries/select_lang.lib.php) + * (you find all languages in the locale folder) * uncomment the desired line: * default = 'en' */ diff --git a/db_create.php b/db_create.php index b55e04fad..50e4cf67d 100644 --- a/db_create.php +++ b/db_create.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -10,7 +9,6 @@ * Gets some core libraries */ require_once './libraries/common.inc.php'; -$GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/mysql_charsets.lib.php'; PMA_checkParameters(array('new_db')); diff --git a/db_datadict.php b/db_datadict.php index 7af533c94..7666b567a 100644 --- a/db_datadict.php +++ b/db_datadict.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -19,10 +18,10 @@ if (!isset($selected_tbl)) { /** * Gets the relations settings */ -require_once './libraries/relation.lib.php'; +$cfgRelation = PMA_getRelationsParam(); + require_once './libraries/transformations.lib.php'; -$cfgRelation = PMA_getRelationsParam(); /** * Check parameters @@ -321,5 +320,5 @@ function printPage()
    '; -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/db_export.php b/db_export.php index 718a489d8..a44469ef2 100644 --- a/db_export.php +++ b/db_export.php @@ -3,7 +3,6 @@ /** * dumps a database * - * @version $Id$ * @uses libraries/db_common.inc.php * @uses libraries/db_info.inc.php * @uses libraries/display_export.lib.php @@ -73,5 +72,5 @@ require_once './libraries/display_export.lib.php'; /** * Displays the footer */ -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/db_import.php b/db_import.php index bdcd5d698..73ba817fa 100644 --- a/db_import.php +++ b/db_import.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ diff --git a/db_operations.php b/db_operations.php index 40ec65272..53a282187 100644 --- a/db_operations.php +++ b/db_operations.php @@ -9,7 +9,6 @@ * - adding tables * - viewing PDF schemas * - * @version $Id$ * @package phpMyAdmin */ @@ -17,12 +16,8 @@ * requirements */ require_once './libraries/common.inc.php'; -require_once './libraries/Table.class.php'; require_once './libraries/mysql_charsets.lib.php'; -// add blobstreaming library functions -require_once "./libraries/blobstreaming.lib.php"; - /** * Rename/move or copy database */ @@ -261,71 +256,11 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { } } -/* - * Enable/Disable/Repair BLOB Repository Monitoring for current database -*/ -if (strlen($db) > 0 && !empty($db_blob_streaming_op)) -{ - // load PMA_Config - $PMA_Config = $GLOBALS['PMA_Config']; - - if (!empty($PMA_Config)) - { - if ($PMA_Config->get('PBXT_NAME') !== strtolower($db)) - { - // if Blobstreaming plugins exist, begin checking for Blobstreaming tables - if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) - { - $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES'); - $bs_tables = $bs_tables[$db]; - - $oneBSTableExists = FALSE; - - // check if at least one blobstreaming table exists - foreach ($bs_tables as $table_key=>$tbl) - if ($bs_tables[$table_key]['Exists']) - { - $oneBSTableExists = TRUE; - break; - } - - switch ($db_blob_streaming_op) - { - // enable BLOB repository monitoring - case "enable": - // if blobstreaming tables do not exist, create them - if (!$oneBSTableExists) - PMA_BS_CreateTables($db); - break; - // disable BLOB repository monitoring - case "disable": - // if at least one blobstreaming table exists, execute drop - if ($oneBSTableExists) - PMA_BS_DropTables($db); - break; - // repair BLOB repository - case "repair": - // check if a blobstreaming table is missing - foreach ($bs_tables as $table_key=>$tbl) - if (!$bs_tables[$table_key]['Exists']) - { - PMA_DBI_select_db($db); - PMA_DBI_query(PMA_BS_GetTableStruct($table_key)); - } - } - - // refresh side menu - PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_operations.php?' . PMA_generate_common_url ('','', '&') . (isset($db) ? '&db=' . urlencode($db) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . 'reload=1&purge=1'); - } // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) - } // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db)) - } -} /** * Settings for relations stuff */ -require_once './libraries/relation.lib.php'; $cfgRelation = PMA_getRelationsParam(); /** @@ -429,7 +364,41 @@ if (!$is_information_schema) { + +

    + '; +} +echo __('Remove database'); +?> + +
    + get('PBXT_NAME') !== strtolower($db)) - { - if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) - { - $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES'); - $bs_tables = $bs_tables[$db]; - - $oneBSTableExists = FALSE; - $allBSTablesExist = TRUE; - - // first check that all blobstreaming tables do not exist - foreach ($bs_tables as $table_key=>$tbl) - if ($bs_tables[$table_key]['Exists']) - $oneBSTableExists = TRUE; - else - $allBSTablesExist = FALSE; - - ?> - -
    - -
    - - - - - : - - - -
    -
    - - -
    - - - -
    - - -
    - - - -
    - - -
    - -
    - get('BLOBSTREAMING_PLUGINS_EXIST')) - } // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db)) - } /** * Change database charset @@ -612,7 +495,7 @@ if (!$is_information_schema) { if ($num_tables > 0 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { - $message = PMA_Message::notice(__('The additional features for working with linked tables have been deactivated. To find out why click %shere%s.')); + $message = PMA_Message::notice(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.')); $message->addParam('', false); $message->addParam('', false); /* Show error if user has configured something, notice elsewhere */ @@ -651,5 +534,5 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?> /** * Displays the footer */ -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/db_printview.php b/db_printview.php index a6d66f7b5..36f297c99 100644 --- a/db_printview.php +++ b/db_printview.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -27,7 +26,6 @@ $err_url = 'db_sql.php?' . PMA_generate_common_url($db); /** * Settings for relations stuff */ -require_once './libraries/relation.lib.php'; $cfgRelation = PMA_getRelationsParam(); /** @@ -266,5 +264,5 @@ function printPage() id="print" value="" onclick="printPage()" /> diff --git a/db_qbe.php b/db_qbe.php index 0b661c95f..2475065fc 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -3,7 +3,6 @@ /** * query by example the whole database * - * @version $Id$ * @package phpMyAdmin */ @@ -11,9 +10,6 @@ * requirements */ require_once './libraries/common.inc.php'; -require_once './libraries/Table.class.php'; -require_once './libraries/relation.lib.php'; - /** * Gets the relation settings @@ -100,7 +96,7 @@ $tbl_result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', $tbl_result_cnt = PMA_DBI_num_rows($tbl_result); if (0 == $tbl_result_cnt) { PMA_Message::error(__('No tables found in database.'))->display(); - require_once './libraries/footer.inc.php'; + require './libraries/footer.inc.php'; exit; } @@ -941,5 +937,5 @@ if (!empty($qry_orderby)) { /** * Displays the footer */ -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/db_search.php b/db_search.php index 627ac2567..0b68ba3d4 100644 --- a/db_search.php +++ b/db_search.php @@ -7,23 +7,6 @@ * @todo display executed query, optional? * @uses $cfg['UseDbSearch'] * @uses $GLOBALS['db'] - * @uses __('Access denied') - * @uses __('at least one of the words') - * @uses __('all words') - * @uses __('the exact phrase') - * @uses __('as regular expression') - * @uses __('Search results for "%s" %s:') - * @uses __('%s match(es) inside table %s') - * @uses __('Browse') - * @uses __('Delete') - * @uses __('Total: %s match(es)') - * @uses __('Search in database') - * @uses __('Word(s) or value(s) to search for (wildcard: "%"):') - * @uses __('Find:') - * @uses __('Words are separated by a space character (" ").') - * @uses __('Inside table(s):') - * @uses __('Unselect All') - * @uses __('Select All') * @uses PMA_DBI_get_tables() * @uses PMA_sqlAddslashes() * @uses PMA_getSearchSqls() @@ -46,7 +29,6 @@ * @uses array_intersect() * @uses sprintf() * @uses in_array() - * @version $Id$ * @package phpMyAdmin */ @@ -257,7 +239,7 @@ if (isset($_REQUEST['submit_search'])) { $sql_query .= $newsearchsqls['select_count']; echo '' - .'' . sprintf(__('%s match(es) inside table %s'), $res_cnt, + .'' . sprintf(_ngettext('%s match inside table %s', '%s matches inside table %s', $res_cnt), $res_cnt, htmlspecialchars($each_table)) . "\n"; if ($res_cnt > 0) { @@ -282,7 +264,7 @@ if (isset($_REQUEST['submit_search'])) { echo '' . "\n"; if (count($tables_selected) > 1) { - echo '

    ' . sprintf(__('Total: %s match(es)'), + echo '

    ' . sprintf(_ngettext('Total: %s match', 'Total: %s matches', $num_search_result_total), $num_search_result_total) . '

    ' . "\n"; } } // end 1. @@ -368,5 +350,5 @@ $alter_select = /** * Displays the footer */ -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/db_sql.php b/db_sql.php index 2ac198bda..986fb3417 100644 --- a/db_sql.php +++ b/db_sql.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -42,5 +41,5 @@ PMA_sqlQueryForm(true, false, isset($_REQUEST['delimiter']) ? $_REQUEST['delimit /** * Displays the footer */ -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/db_structure.php b/db_structure.php index 65b78b708..9e118210b 100644 --- a/db_structure.php +++ b/db_structure.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ @@ -10,7 +9,6 @@ * */ require_once './libraries/common.inc.php'; -require_once './libraries/Table.class.php'; $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; @@ -57,7 +55,7 @@ if ($num_tables == 0) { /** * Displays the footer */ - require_once './libraries/footer.inc.php'; + require './libraries/footer.inc.php'; exit; } @@ -151,25 +149,12 @@ $hidden_fields = array(); $odd_row = true; $sum_row_count_pre = ''; -// for blobstreaming -$PMA_Config = $GLOBALS['PMA_Config']; - -if (!empty($PMA_Config)) - $session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES'); // list of blobstreaming tables - $tableReductionCount = 0; // the amount to reduce the table count by foreach ($tables as $keyname => $each_table) { - if (isset($session_bs_tables)) - { - // compare table name against blobstreaming tables - foreach ($session_bs_tables as $table_key=>$table_val) - // if the table is a blobstreaming table, reduce table count and skip outer foreach loop - if ($table_key == $keyname) - { - $tableReductionCount++; - continue 2; - } + if (PMA_BS_IsHiddenTable($keyname)) { + $tableReductionCount++; + continue; } // Get valid statistics whatever is the table type @@ -360,24 +345,24 @@ foreach ($tables as $keyname => $each_table) { ) { $do = true; } - foreach ($server_slave_Wild_Do_Table as $table) { - if (($db == PMA_replication_strout($table)) && (ereg("^".substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true))-1), $truename))) + foreach ($server_slave_Wild_Do_Table as $db_table) { + $table_part = PMA_extract_db_or_table($db_table, 'table'); + if (($db == PMA_extract_db_or_table($db_table, 'db')) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))) { $do = true; + } } //////////////////////////////////////////////////////////////////// if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) { $ignored = true; } - foreach ($server_slave_Wild_Ignore_Table as $table) { - if (($db == PMA_replication_strout($table)) && (ereg("^".substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true))-1), $truename))) + foreach ($server_slave_Wild_Ignore_Table as $db_table) { + $table_part = PMA_extract_db_or_table($db_table, 'table'); + if (($db == PMA_extract_db_or_table($db_table)) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))) { $ignored = true; + } } - }/* elseif ($server_master_status) { - if ((strlen(array_search($db, $server_master_Do_DB))>0) || count($server_master_Do_DB)==1) - $do = true; - elseif ((strlen(array_search($db, $server_master_Ignore_DB))>0) || count($server_master_Ignore_DB)==1) - $ignored = true; - }*/ + unset($table_part); + } ?> @@ -613,5 +598,5 @@ if (empty($db_is_information_schema)) { /** * Displays the footer */ -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/db_tracking.php b/db_tracking.php index 68faafec3..1c8c5cece 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -1,7 +1,6 @@ 0) { /** * Display the footer */ -require_once './libraries/footer.inc.php'; +require './libraries/footer.inc.php'; ?> diff --git a/error.php b/error.php index 674d08e0f..117d070a2 100644 --- a/error.php +++ b/error.php @@ -3,14 +3,13 @@ /** * phpMyAdmin fatal error display page * - * @version $Id$ * @package phpMyAdmin */ /** * Input sanitizing. */ -require_once './libraries/sanitizing.lib.php'; +require './libraries/sanitizing.lib.php'; /* Get variables */ if (! empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) { diff --git a/export.php b/export.php index 5d487a107..00639e22a 100644 --- a/export.php +++ b/export.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * @todo too much die here, or? - * @version $Id$ * @package phpMyAdmin */ @@ -60,7 +59,6 @@ if (empty($_REQUEST['asfile'])) { // Does export require to be into file? if (isset($export_list[$type]['force_file']) && ! $asfile) { $message = PMA_Message::error(__('Selected export type has to be saved in file!')); - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; if ($export_type == 'server') { $active_page = 'server_export.php'; @@ -207,7 +205,7 @@ if ($what == 'sql') { $output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xls'; // Do we need to convert charset? -$output_charset_conversion = $asfile && $cfg['AllowAnywhereRecoding'] +$output_charset_conversion = $asfile && $GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE && isset($charset_of_file) && $charset_of_file != $charset && $type != 'xls'; @@ -248,25 +246,19 @@ if ($asfile) { if (isset($remember_template)) { $GLOBALS['PMA_Config']->setCookie('pma_server_filename_template', $filename_template); } - $filename = str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template)); } elseif ($export_type == 'database') { if (isset($remember_template)) { $GLOBALS['PMA_Config']->setCookie('pma_db_filename_template', $filename_template); } - $filename = str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template))); } else { if (isset($remember_template)) { $GLOBALS['PMA_Config']->setCookie('pma_table_filename_template', $filename_template); } - $filename = str_replace('__TABLE__', $table, str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template)))); } + $filename = PMA_expandUserString($filename_template); // convert filename to iso-8859-1, it is safer - if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] )) { - $filename = PMA_convert_string($charset, 'iso-8859-1', $filename); - } else { - $filename = PMA_convert_string($convcharset, 'iso-8859-1', $filename); - } + $filename = PMA_convert_string($charset, 'iso-8859-1', $filename); // Grab basic dump extension and mime type $filename .= '.' . $export_list[$type]['extension']; @@ -305,7 +297,6 @@ if ($save_on_server) { } } if (isset($message)) { - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; if ($export_type == 'server') { $active_page = 'server_export.php'; @@ -357,7 +348,6 @@ if (!$save_on_server) { $num_tables = count($tables); if ($num_tables == 0) { $message = PMA_Message::error(__('No tables found in database.')); - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; $active_page = 'db_export.php'; require './db_export.php'; @@ -393,7 +383,6 @@ $do_relation = isset($GLOBALS[$what . '_relation']); $do_comments = isset($GLOBALS[$what . '_comments']); $do_mime = isset($GLOBALS[$what . '_mime']); if ($do_relation || $do_comments || $do_mime) { - require_once './libraries/relation.lib.php'; $cfgRelation = PMA_getRelationsParam(); } if ($do_mime) { @@ -572,7 +561,6 @@ if (!PMA_exportFooter()) { // End of fake loop if ($save_on_server && isset($message)) { - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; if ($export_type == 'server') { $active_page = 'server_export.php'; @@ -629,7 +617,6 @@ if (!empty($asfile)) { $message = new PMA_Message(__('Dump has been saved to file %s.'), PMA_Message::SUCCESS, $save_filename); } - $GLOBALS['js_include'][] = 'functions.js'; require_once './libraries/header.inc.php'; if ($export_type == 'server') { $active_page = 'server_export.php'; @@ -680,6 +667,6 @@ else { //]]> diff --git a/import.php b/import.php index 9498752c6..dbc4d56ad 100644 --- a/import.php +++ b/import.php @@ -4,7 +4,6 @@ * Core script for import, this is just the glue around all other stuff * * @uses PMA_Bookmark_getList() - * @version $Id$ * @package phpMyAdmin */ @@ -13,7 +12,6 @@ */ require_once './libraries/common.inc.php'; //require_once './libraries/display_import_functions.lib.php'; -$GLOBALS['js_include'][] = 'functions.js'; // reset import messages for ajax request $_SESSION['Import_message']['message'] = null; @@ -343,7 +341,7 @@ if ($import_file != 'none' && !$error) { //$_SESSION['Import_message'] = $message->getDisplay(); // Convert the file's charset if necessary -if ($cfg['AllowAnywhereRecoding'] && isset($charset_of_file)) { +if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE && isset($charset_of_file)) { if ($charset_of_file != $charset) { $charset_conversion = TRUE; } @@ -447,6 +445,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) { require './sql.php'; } else { diff --git a/import_status.php b/import_status.php index 4125eadea..d739009ee 100644 --- a/import_status.php +++ b/import_status.php @@ -2,7 +2,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * - * @version $Id$ * @package phpMyAdmin */ diff --git a/index.php b/index.php index d2d16fa78..16e13d028 100644 --- a/index.php +++ b/index.php @@ -3,8 +3,6 @@ /** * forms frameset * - * @version $Id$ - * @uses __('phpMyAdmin is more friendly with a frames-capable browser.') * @uses $GLOBALS['cfg']['QueryHistoryDB'] * @uses $GLOBALS['cfg']['Server']['user'] * @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe @@ -34,11 +32,6 @@ */ require_once './libraries/common.inc.php'; -/** - * Includes the ThemeManager if it hasn't been included yet - */ -require_once './libraries/relation.lib.php'; - // free the session file, for the other frames to be loaded session_write_close(); @@ -63,7 +56,7 @@ unset($cfgRelation); /** * pass variables to child pages */ -$drops = array('lang', 'server', 'convcharset', 'collation_connection', +$drops = array('lang', 'server', 'collation_connection', 'db', 'table'); foreach ($drops as $each_drop) { diff --git a/js/common.js b/js/common.js index 1d52c9770..8ba7bcd0f 100644 --- a/js/common.js +++ b/js/common.js @@ -101,10 +101,13 @@ function setDb(new_db) { var old_db = db; db = new_db; + // the db name as an id exists only when LeftFrameLight is false if (window.frame_navigation.document.getElementById(db) == null) { + // happens when LeftFrameLight is true // db is unknown, reload complete left frame refreshNavigation(); } else { + // happens when LeftFrameLight is false unmarkDbTable(old_db); markDbTable(db); } diff --git a/js/functions.js b/js/functions.js index 908ced29f..b5995f0f5 100644 --- a/js/functions.js +++ b/js/functions.js @@ -194,7 +194,7 @@ function confirmQuery(theForm1, sqlQuery1) * Displays a confirmation box before disabling the BLOB repository for a given database. * This function is called while clicking links * - * @param object the database + * @param object the database * * @return boolean whether to disable the repository or not */ @@ -282,10 +282,10 @@ function checkSqlQuery(theForm) // Global variable row_class is set to even var row_class = 'even'; -/** +/** * Generates a row dynamically in the differences table displaying -* the complete statistics of difference in table like number of -* rows to be updated, number of rows to be inserted, number of +* the complete statistics of difference in table like number of +* rows to be updated, number of rows to be inserted, number of * columns to be added, number of columns to be removed, etc. * * @param index index of matching table @@ -294,17 +294,17 @@ var row_class = 'even'; * @param remove_size number of columns to be removed * @param insert_index number of indexes to be inserted * @param remove_index number of indexes to be removed -* @param img_obj image object +* @param img_obj image object * @param table_name name of the table */ function showDetails(i, update_size, insert_size, remove_size, insert_index, remove_index, img_obj, table_name) -{ +{ // The path of the image is split to facilitate comparison - var relative_path = (img_obj.src).split("themes/"); - + var relative_path = (img_obj.src).split("themes/"); + // The image source is changed when the showDetails function is called. - if (relative_path[1] == 'original/img/new_data_hovered.jpg') { + if (relative_path[1] == 'original/img/new_data_hovered.jpg') { img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg"; img_obj.alt = PMA_messages['strClickToUnselect']; //only for IE browser } else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') { @@ -313,76 +313,76 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') { img_obj.src = "./themes/original/img/new_struct_hovered.jpg"; img_obj.alt = PMA_messages['strClickToSelect']; - } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { + } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { img_obj.src = "./themes/original/img/new_data_hovered.jpg"; img_obj.alt = PMA_messages['strClickToSelect']; - } - - var div = document.getElementById("list"); - var table = div.getElementsByTagName("table")[0]; + } + + var div = document.getElementById("list"); + var table = div.getElementsByTagName("table")[0]; var table_body = table.getElementsByTagName("tbody")[0]; - + //Global variable row_class is being used if (row_class == 'even') { row_class = 'odd'; } else { - row_class = 'even'; + row_class = 'even'; } - // If the red or green button against a table name is pressed then append a new row to show the details of differences of this table. - if ((relative_path[1] != 'original/img/new_struct_selected_hovered.jpg') && (relative_path[1] != 'original/img/new_data_selected_hovered.jpg')) { - - var newRow = document.createElement("tr"); + // If the red or green button against a table name is pressed then append a new row to show the details of differences of this table. + if ((relative_path[1] != 'original/img/new_struct_selected_hovered.jpg') && (relative_path[1] != 'original/img/new_data_selected_hovered.jpg')) { + + var newRow = document.createElement("tr"); newRow.setAttribute("class", row_class); - newRow.className = row_class; - // Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array + newRow.className = row_class; + // Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array newRow.setAttribute("id" , i); - + var table_name_cell = document.createElement("td"); table_name_cell.align = "center"; table_name_cell.innerHTML = table_name ; - + newRow.appendChild(table_name_cell); - + var create_table = document.createElement("td"); create_table.align = "center"; - + var add_cols = document.createElement("td"); add_cols.align = "center"; - + var remove_cols = document.createElement("td"); remove_cols.align = "center"; - + var alter_cols = document.createElement("td"); alter_cols.align = "center"; - + var add_index = document.createElement("td"); add_index.align = "center"; - + var delete_index = document.createElement("td"); delete_index.align = "center"; - + var update_rows = document.createElement("td"); update_rows.align = "center"; - + var insert_rows = document.createElement("td"); insert_rows.align = "center"; - + var tick_image = document.createElement("img"); - tick_image.src = "./themes/original/img/s_success.png"; + tick_image.src = "./themes/original/img/s_success.png"; if (update_size == '' && insert_size == '' && remove_size == '') { /** - This is the case when the table needs to be created in target database. + This is the case when the table needs to be created in target database. */ create_table.appendChild(tick_image); add_cols.innerHTML = "--"; - remove_cols.innerHTML = "--"; + remove_cols.innerHTML = "--"; alter_cols.innerHTML = "--"; delete_index.innerHTML = "--"; add_index.innerHTML = "--"; update_rows.innerHTML = "--"; insert_rows.innerHTML = "--"; - + newRow.appendChild(create_table); newRow.appendChild(add_cols); newRow.appendChild(remove_cols); @@ -391,43 +391,21 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem newRow.appendChild(add_index); newRow.appendChild(update_rows); newRow.appendChild(insert_rows); - + } else if (update_size == '' && remove_size == '') { /** - This is the case when data difference is displayed in the - table which is present in source but absent from target database + This is the case when data difference is displayed in the + table which is present in source but absent from target database */ create_table.innerHTML = "--"; add_cols.innerHTML = "--"; - remove_cols.innerHTML = "--"; + remove_cols.innerHTML = "--"; alter_cols.innerHTML = "--"; add_index.innerHTML = "--"; delete_index.innerHTML = "--"; update_rows.innerHTML = "--"; insert_rows.innerHTML = insert_size; - - newRow.appendChild(create_table); - newRow.appendChild(add_cols); - newRow.appendChild(remove_cols); - newRow.appendChild(alter_cols); - newRow.appendChild(delete_index); - newRow.appendChild(add_index); - newRow.appendChild(update_rows); - newRow.appendChild(insert_rows); - - } else if (remove_size == '') { - /** - This is the case when data difference between matching_tables is displayed. - */ - create_table.innerHTML = "--"; - add_cols.innerHTML = "--"; - remove_cols.innerHTML = "--"; - alter_cols.innerHTML = "--"; - add_index.innerHTML = "--"; - delete_index.innerHTML = "--"; - update_rows.innerHTML = update_size; - insert_rows.innerHTML = insert_size; - + newRow.appendChild(create_table); newRow.appendChild(add_cols); newRow.appendChild(remove_cols); @@ -436,41 +414,63 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem newRow.appendChild(add_index); newRow.appendChild(update_rows); newRow.appendChild(insert_rows); - + + } else if (remove_size == '') { + /** + This is the case when data difference between matching_tables is displayed. + */ + create_table.innerHTML = "--"; + add_cols.innerHTML = "--"; + remove_cols.innerHTML = "--"; + alter_cols.innerHTML = "--"; + add_index.innerHTML = "--"; + delete_index.innerHTML = "--"; + update_rows.innerHTML = update_size; + insert_rows.innerHTML = insert_size; + + newRow.appendChild(create_table); + newRow.appendChild(add_cols); + newRow.appendChild(remove_cols); + newRow.appendChild(alter_cols); + newRow.appendChild(delete_index); + newRow.appendChild(add_index); + newRow.appendChild(update_rows); + newRow.appendChild(insert_rows); + } else { /** This is the case when structure difference between matching_tables id displayed */ create_table.innerHTML = "--"; add_cols.innerHTML = insert_size; - remove_cols.innerHTML = remove_size; + remove_cols.innerHTML = remove_size; alter_cols.innerHTML = update_size; delete_index.innerHTML = remove_index; add_index.innerHTML = insert_index; update_rows.innerHTML = "--"; insert_rows.innerHTML = "--"; - + newRow.appendChild(create_table); newRow.appendChild(add_cols); newRow.appendChild(remove_cols); - newRow.appendChild(alter_cols); + newRow.appendChild(alter_cols); newRow.appendChild(delete_index); newRow.appendChild(add_index); newRow.appendChild(update_rows); newRow.appendChild(insert_rows); } table_body.appendChild(newRow); - + } else if ((relative_path[1] != 'original/img/new_struct_hovered.jpg') && (relative_path[1] != 'original/img/new_data_hovered.jpg')) { //The case when the row showing the details need to be removed from the table i.e. the difference button is deselected now. var table_rows = table_body.getElementsByTagName("tr"); var j; var index = 0; - for (j=0; j < table_rows.length; j++) - { - if (table_rows[j].id == i) { + for (j=0; j < table_rows.length; j++) + { + if (table_rows[j].id == i) { index = j; - table_rows[j].parentNode.removeChild(table_rows[j]); + table_rows[j].parentNode.removeChild(table_rows[j]); } } //The table row css is being adjusted. Class "odd" for odd rows and "even" for even rows should be maintained. @@ -481,11 +481,11 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem table_rows[index].setAttribute("class","odd"); // for Mozilla firefox table_rows[index].className = "odd"; // for IE browser } else { - table_rows[index].setAttribute("class","even"); // for Mozilla firefox - table_rows[index].className = "even"; // for IE browser + table_rows[index].setAttribute("class","even"); // for Mozilla firefox + table_rows[index].className = "even"; // for IE browser } - } - } + } + } } /** @@ -494,35 +494,35 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem * @param img_obj the image object whose source needs to be changed * */ - + function change_Image(img_obj) { - var relative_path = (img_obj.src).split("themes/"); - - if (relative_path[1] == 'original/img/new_data.jpg') { - img_obj.src = "./themes/original/img/new_data_hovered.jpg"; + var relative_path = (img_obj.src).split("themes/"); + + if (relative_path[1] == 'original/img/new_data.jpg') { + img_obj.src = "./themes/original/img/new_data_hovered.jpg"; } else if (relative_path[1] == 'original/img/new_struct.jpg') { img_obj.src = "./themes/original/img/new_struct_hovered.jpg"; } else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') { img_obj.src = "./themes/original/img/new_struct.jpg"; - } else if (relative_path[1] == 'original/img/new_data_hovered.jpg') { - img_obj.src = "./themes/original/img/new_data.jpg"; - } else if (relative_path[1] == 'original/img/new_data_selected.jpg') { - img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg"; - } else if(relative_path[1] == 'original/img/new_struct_selected.jpg') { - img_obj.src = "./themes/original/img/new_struct_selected_hovered.jpg"; - } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') { - img_obj.src = "./themes/original/img/new_struct_selected.jpg"; - } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { - img_obj.src = "./themes/original/img/new_data_selected.jpg"; + } else if (relative_path[1] == 'original/img/new_data_hovered.jpg') { + img_obj.src = "./themes/original/img/new_data.jpg"; + } else if (relative_path[1] == 'original/img/new_data_selected.jpg') { + img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg"; + } else if(relative_path[1] == 'original/img/new_struct_selected.jpg') { + img_obj.src = "./themes/original/img/new_struct_selected_hovered.jpg"; + } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') { + img_obj.src = "./themes/original/img/new_struct_selected.jpg"; + } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { + img_obj.src = "./themes/original/img/new_data_selected.jpg"; } } /** - * Generates the URL containing the list of selected table ids for synchronization and - * a variable checked for confirmation of deleting previous rows from target tables + * Generates the URL containing the list of selected table ids for synchronization and + * a variable checked for confirmation of deleting previous rows from target tables * - * @param token the token generated for each PMA form + * @param token the token generated for each PMA form * */ @@ -536,15 +536,15 @@ function ApplySelectedChanges(token) var x = table_rows.length; var i; /** - Append the token at the beginning of the query string followed by - Table_ids that shows that "Apply Selected Changes" button is pressed + Append the token at the beginning of the query string followed by + Table_ids that shows that "Apply Selected Changes" button is pressed */ var append_string = "?token="+token+"&Table_ids="+1; for(i=0; i"+ $sql_query +""); + $(".inner_sql").replaceWith(""); return false; }); @@ -1718,12 +1718,20 @@ $(document).ready(function(){ }); $("#btnDiscard").live("click",function(){ - $(".sql").html(""+$oldText+""); + $(".sql").html(""+$oldText+""); }); $('.sqlbutton').click(function(evt){ insertQuery(evt.target.id); return false; }); + $('#sqlquery').focus(); + if ($('#input_username')) { + if ($('#input_username').val() == '') { + $('#input_username').focus(); + } else { + $('#input_password').focus(); + } + } }); diff --git a/js/messages.php b/js/messages.php index 8eb745ac1..aeb93f56c 100644 --- a/js/messages.php +++ b/js/messages.php @@ -62,6 +62,10 @@ $js_messages['strSelectForeignKey'] = __('Select Foreign Key'); $js_messages['strPleaseSelectPrimaryOrUniqueKey'] = __('Please select the primary key or a unique key'); $js_messages['strChangeDisplay'] = __('Choose column to display'); +/* password generation */ +$js_messages['strGeneratePassword'] = __('Generate password'); +$js_messages['strGenerate'] = __('Generate'); + echo "var PMA_messages = new Array();\n"; foreach ($js_messages as $name => $js_message) { PMA_printJsValue("PMA_messages['" . $name . "']", $js_message); diff --git a/js/password_generation.js b/js/password_generation.js new file mode 100644 index 000000000..9153cc9b5 --- /dev/null +++ b/js/password_generation.js @@ -0,0 +1,10 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * for libraries/display_change_password.lib.php + * + */ + +$(document).ready(function() { + $('#tr_element_before_generate_password').parent().append('' + PMA_messages['strGeneratePassword'] + ''); + $('#div_element_before_generate_password').parent().append('
    '); +}); diff --git a/libraries/Config.class.php b/libraries/Config.class.php index c0090aa7f..7389b9f76 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -3,14 +3,13 @@ /** * * - * @version $Id$ * @package phpMyAdmin */ /** * Load vendor configuration. */ -require_once('./libraries/vendor_config.php'); +require('./libraries/vendor_config.php'); /** * Configuration class @@ -994,7 +993,6 @@ class PMA_Config * @uses $GLOBALS['PMA_Config'] * @uses PMA_Config::get() * @uses PMA_Config::_getFontsizeOptions() - * @uses __('Font size') * @static * @param string $current_size currently slected font size with unit * @return string html selectbox @@ -1031,7 +1029,6 @@ class PMA_Config * * @uses PMA_generate_common_hidden_inputs() * @uses PMA_Config::_getFontsizeSelection() - * @uses __('Go') * @static * @param string $current_size currently slected font size with unit * @return string html selectbox @@ -1086,10 +1083,13 @@ class PMA_Config if ($validity == null) { $validity = 2592000; } - if (strlen($value) && null !== $default && $value === $default - && isset($_COOKIE[$cookie])) { - // remove cookie, default value is used - return $this->removeCookie($cookie); + if (strlen($value) && null !== $default && $value === $default) { + // default value is used + if (isset($_COOKIE[$cookie])) { + // remove cookie + return $this->removeCookie($cookie); + } + return false; } if (! strlen($value) && isset($_COOKIE[$cookie])) { diff --git a/libraries/Error.class.php b/libraries/Error.class.php index 849287e43..b063995be 100644 --- a/libraries/Error.class.php +++ b/libraries/Error.class.php @@ -3,7 +3,6 @@ /** * Holds class PMA_Error * - * @version $Id$ * @package phpMyAdmin */ diff --git a/libraries/Error_Handler.class.php b/libraries/Error_Handler.class.php index fab7a3986..0b9089833 100644 --- a/libraries/Error_Handler.class.php +++ b/libraries/Error_Handler.class.php @@ -3,7 +3,6 @@ /** * Holds class PMA_Error_Handler * - * @version $Id$ * @package phpMyAdmin */ diff --git a/libraries/File.class.php b/libraries/File.class.php index 9dfe5687b..83f5d14de 100644 --- a/libraries/File.class.php +++ b/libraries/File.class.php @@ -3,7 +3,6 @@ /** * file upload functions * - * @version $Id$ * @package phpMyAdmin */ @@ -259,13 +258,6 @@ class PMA_File * @uses PMA_File::setRecentBLOBReference() * @uses curl_setopt_array() * @uses PMA_File::$_error_message - * @uses __('The uploaded file exceeds the upload_max_filesize directive in php.ini.') - * @uses __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.') - * @uses __('The uploaded file was only partially uploaded.') - * @uses __('Missing a temporary folder.') - * @uses __('Failed to write file to disk.') - * @uses __('File upload stopped by extension.') - * @uses __('Unknown error in file upload.') * @uses $_FILES * @param string $key a numeric key used to identify the different rows * @param string $primary_key @@ -287,118 +279,27 @@ class PMA_File $is_bs_upload = FALSE; // check if this field requires a repository upload - if (isset($_REQUEST['upload_blob_repo_' . $key])) + if (isset($_REQUEST['upload_blob_repo_' . $key])) { $is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE; - + } // if request is an upload to the BLOB repository - if ($is_bs_upload) - { - // load PMA configuration - $PMA_Config = $GLOBALS['PMA_Config']; + if ($is_bs_upload) { + $bs_db = $_REQUEST['db']; + $bs_table = $_REQUEST['table']; + $tmp_filename = $file['tmp_name']; + $tmp_file_type = $file['type']; - // if PMA configuration is loaded - if (!empty($PMA_Config)) - { - // load BS variables from PMA configuration - $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'); - $curlExists = $PMA_Config->get('CURL_EXISTS'); - $bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES'); - $bs_database = $bs_database[$_REQUEST['db']]; + if (! $tmp_file_type) { + $tmp_file_type = NULL; + } - $allBSTablesExist = TRUE; - - // determine if plugins and curl exist - if ($pluginsExist && $curlExists) - { - foreach ($bs_database as $table_key=>$table) - { - if (!$bs_database[$table_key]['Exists']) - { - $allBSTablesExist = FALSE; - break; - } - } - } - else - $allBSTablesExist = FALSE; - - // if necessary BS tables exist - if ($allBSTablesExist) - { - // setup bs variables for uploading - $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER'); - $bs_db = $_REQUEST['db']; - $bs_table = $_REQUEST['table']; - - // setup file handle and related variables - $tmp_file = fopen($file['tmp_name'], 'r'); - $tmp_file_type = $file['type']; - $tmp_file_size = $file['size']; - - if (!$tmp_file_type) - $tmp_file_type = NULL; - - // if none of the required variables contain data, return with an unknown error message - if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size) - { - $this->_error_message = __('Unknown error in file upload.'); - return FALSE; - } - else - $bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table; - - // init curl handle - $curlHnd = curl_init ($bs_server_path); - - // if curl handle init successful - if ($curlHnd) - { - // specify custom header - $customHeader = array( - "Accept-Language: en-us;en;q=0;5", - "Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7", - "Content-type: $tmp_file_type" - ); - - // specify CURL options in array - $curlOptArr = array( - CURLOPT_PUT => TRUE, - CURLOPT_HEADER => TRUE, - CURLOPT_HTTPHEADER => $customHeader, - CURLOPT_INFILESIZE => $tmp_file_size, - CURLOPT_INFILE => $tmp_file, - CURLOPT_RETURNTRANSFER => TRUE - ); - - // pass array of options to curl handle setup function - curl_setopt_array($curlHnd, $curlOptArr); - - // execute curl request and retrieve error message(s) (if any) - $ret = curl_exec($curlHnd); - $errRet = curl_error($curlHnd); - - // close curl handle - curl_close($curlHnd); - - // split entire string into array of lines - $retArr = explode("\r\n", $ret); - - // check each line as a valid string of a BLOB reference - foreach ($retArr as $value) - if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4)) - { - // is a valid reference, so set as current and break - PMA_File::setRecentBLOBReference($value); - break; - } - - // close file handle - if ($tmp_file) - fclose($tmp_file); - } // end if ($curlHnd) - } // end if ($allBSTablesExist) - } // end if ($PMA_Config) - } // end if ($is_bs_upload) + if (! $bs_db || ! $bs_table) { + $this->_error_message = $GLOBALS['strUploadErrorUnknown']; + return FALSE; + } + $blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename); + PMA_File::setRecentBLOBReference($blob_url); + } // end if ($is_bs_upload) // check for file upload errors switch ($file['error']) { @@ -495,135 +396,43 @@ class PMA_File $is_bs_upload = FALSE; // check if this field requires a repository upload - if (isset($_REQUEST['upload_blob_repo_' . $key])) + if (isset($_REQUEST['upload_blob_repo_' . $key])) { $is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE; + } // is a request to upload file to BLOB repository using uploadDir mechanism - if ($is_bs_upload) - { - // load PMA configuration - $PMA_Config = $GLOBALS['PMA_Config']; + if ($is_bs_upload) { + $bs_db = $_REQUEST['db']; + $bs_table = $_REQUEST['table']; + $tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]; - // if the PMA configuration was loaded - if (!empty($PMA_Config)) - { - // load BS variables from PMA configuration - $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'); - $curlExists = $PMA_Config->get('CURL_EXISTS'); - $bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES'); - $bs_database = $bs_database[$_REQUEST['db']]; + // check if fileinfo library exists + if ($PMA_Config->get('FILEINFO_EXISTS')) { + // attempt to init fileinfo + $finfo = finfo_open(FILEINFO_MIME); - $allBSTablesExist = TRUE; - - // if plugins and curl exist - if ($pluginsExist && $curlExists) - { - foreach ($bs_database as $table_key=>$table) - { - if (!$bs_database[$table_key]['Exists']) - { - $allBSTablesExist = FALSE; - break; - } - } + // fileinfo exists + if ($finfo) { + // pass in filename to fileinfo and close fileinfo handle after + $tmp_file_type = finfo_file($finfo, $tmp_filename); + finfo_close($finfo); } - else - $allBSTablesExist = FALSE; + } else { + // no fileinfo library exists, use file command + $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename)); + } - // if necessary BS tables exist - if ($allBSTablesExist) - { - // load BS variables - $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER'); - $bs_db = $_REQUEST['db']; - $bs_table = $_REQUEST['table']; + if (! $tmp_file_type) { + $tmp_file_type = NULL; + } - // setup uploadDir mechanism and file variables - $tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]; - $tmp_file = fopen($tmp_filename, 'r'); - $tmp_file_size = filesize($tmp_filename); - - // check if fileinfo library exists - if ($PMA_Config->get('FILEINFO_EXISTS')) - { - // attempt to init fileinfo - $finfo = finfo_open(FILEINFO_MIME); - - // fileinfo exists - if ($finfo) - { - // pass in filename to fileinfo and close fileinfo handle after - $tmp_file_type = finfo_file($finfo, $tmp_filename); - finfo_close($finfo); - } - } - else // no fileinfo library exists, use file command - $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename)); - - if (!$tmp_file_type) - $tmp_file_type = NULL; - - // necessary variables aren't loaded, return error message (unknown error) - if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size) - { - $this->_error_message = __('Unknown error in file upload.'); - return FALSE; - } - else - $bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table; - - // init curl handle - $curlHnd = curl_init ($bs_server_path); - - // curl handle exists - if ($curlHnd) - { - // specify custom header - $customHeader = array( - "Accept-Language: en-us;en;q=0;5", - "Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7", - "Content-type: $tmp_file_type" - ); - - // specify custom curl options - $curlOptArr = array( - CURLOPT_PUT => TRUE, - CURLOPT_HEADER => TRUE, - CURLOPT_HTTPHEADER => $customHeader, - CURLOPT_INFILESIZE => $tmp_file_size, - CURLOPT_INFILE => $tmp_file, - CURLOPT_RETURNTRANSFER => TRUE - ); - - // setup custom curl options (as specified in above array) - curl_setopt_array($curlHnd, $curlOptArr); - - // execute curl request and retrieve error message(s) (if any) - $ret = curl_exec($curlHnd); - $errRet = curl_error($curlHnd); - - // close curl handle - curl_close($curlHnd); - - // split return string into lines - $retArr = explode("\r\n", $ret); - - // check subsequent lines for valid BLOB reference string - foreach ($retArr as $value) - if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4)) - { - // is a valid reference, so set as current and break - PMA_File::setRecentBLOBReference($value); - break; - } - - // close file handle - if ($tmp_file) - fclose($tmp_file); - } // end if ($curlHnd) - } // end if ($allBSTablesExist) - } // end if ($PMA_Config) - } // end if ($is_bs_upload) + if (! $bs_db || !$bs_table) { + $this->_error_message = $GLOBALS['strUploadErrorUnknown']; + return FALSE; + } + $blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename); + PMA_File::setRecentBLOBReference($blob_url); + } // end if ($is_bs_upload) return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]); } else { @@ -641,127 +450,36 @@ class PMA_File // is a request to upload file to BLOB repository using uploadDir mechanism if ($is_bs_upload) { - // load PMA configuration - $PMA_Config = $GLOBALS['PMA_Config']; + // check if fileinfo library exists + if ($PMA_Config->get('FILEINFO_EXISTS')) + { + // attempt to init fileinfo + $finfo = finfo_open(FILEINFO_MIME); - // if the PMA configuration was loaded - if (!empty($PMA_Config)) - { - // load BS variables from PMA configuration - $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'); - $curlExists = $PMA_Config->get('CURL_EXISTS'); - $bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES'); - $bs_database = $bs_database[$_REQUEST['db']]; + // if fileinfo exists + if ($finfo) + { + // pass in filename to fileinfo and close fileinfo handle after + $tmp_file_type = finfo_file($finfo, $tmp_filename); + finfo_close($finfo); + } + } + else // no fileinfo library exists, use file command + $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename)); - $allBSTablesExist = TRUE; + if (!$tmp_file_type) + $tmp_file_type = NULL; - // if plugins and curl exist - if ($pluginsExist && $curlExists) - { - foreach ($bs_database as $table_key=>$table) - { - if (!$bs_database[$table_key]['Exists']) - { - $allBSTablesExist = FALSE; - break; - } - } - } - else - $allBSTablesExist = FALSE; + $bs_db = $_REQUEST['db']; + $bs_table = $_REQUEST['table']; + if (!$bs_db || !$bs_table) + { + $this->_error_message = $GLOBALS['strUploadErrorUnknown']; + return FALSE; + } + $blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename); + PMA_File::setRecentBLOBReference($blob_url); - if ($allBSTablesExist) - { - // load BS variables - $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER'); - $bs_db = $_REQUEST['db']; - $bs_table = $_REQUEST['table']; - - // setup uploadDir mechanism and file variables - $tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]; - $tmp_file = fopen($tmp_filename, 'r'); - $tmp_file_size = filesize($tmp_filename); - - // check if fileinfo library exists - if ($PMA_Config->get('FILEINFO_EXISTS')) - { - // attempt to init fileinfo - $finfo = finfo_open(FILEINFO_MIME); - - // if fileinfo exists - if ($finfo) - { - // pass in filename to fileinfo and close fileinfo handle after - $tmp_file_type = finfo_file($finfo, $tmp_filename); - finfo_close($finfo); - } - } - else // no fileinfo library exists, use file command - $tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename)); - - if (!$tmp_file_type) - $tmp_file_type = NULL; - - // necessary variables aren't loaded, return error message (unknown error) - if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size) - { - $this->_error_message = __('Unknown error in file upload.'); - return FALSE; - } - else - $bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table; - - // init curl handle - $curlHnd = curl_init ($bs_server_path); - - // if curl handle exists - if ($curlHnd) - { - // specify custom header - $customHeader = array( - "Accept-Language: en-us;en;q=0;5", - "Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7", - "Content-type: $tmp_file_type" - ); - - // specify custom curl options - $curlOptArr = array( - CURLOPT_PUT => TRUE, - CURLOPT_HEADER => TRUE, - CURLOPT_HTTPHEADER => $customHeader, - CURLOPT_INFILESIZE => $tmp_file_size, - CURLOPT_INFILE => $tmp_file, - CURLOPT_RETURNTRANSFER => TRUE - ); - - // setup custom curl options (as specified in above array) - curl_setopt_array($curlHnd, $curlOptArr); - - // execute curl request and retrieve error message(s) (if any) - $ret = curl_exec($curlHnd); - $errRet = curl_error($curlHnd); - - // close curl handle - curl_close($curlHnd); - - // split return string into lines - $retArr = explode("\r\n", $ret); - - // check subsequent lines for valid BLOB reference string - foreach ($retArr as $value) - if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4)) - { - // is a valid reference, so set as current and break - PMA_File::setRecentBLOBReference($value); - break; - } - - // close file handle - if ($tmp_file) - fclose($tmp_file); - } // end if ($curlHnd) - } // end if ($allBSTablesExist) - } // end if ($PMA_Config) } // end if ($is_bs_upload) return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]); @@ -832,7 +550,6 @@ class PMA_File /** * * @access public - * @uses __('File could not be read') * @uses PMA_File::setName() * @uses PMA_securePath() * @uses PMA_userDir() @@ -881,7 +598,6 @@ class PMA_File * @todo move check of $cfg['TempDir'] into PMA_Config? * @access public * @uses $cfg['TempDir'] - * @uses __('Error moving the uploaded file, see [a@./Documentation.html#faq1_11@Documentation]FAQ 1.11[/a]') * @uses PMA_File::isReadable() * @uses PMA_File::getName() * @uses PMA_File::setName() @@ -937,7 +653,6 @@ class PMA_File * * @todo move file read part into readChunk() or getChunk() * @todo add support for compression plugins - * @uses __('File could not be read') * @uses PMA_File::$_compression to set it * @uses PMA_File::getName() * @uses fopen() diff --git a/libraries/Index.class.php b/libraries/Index.class.php index 66a2114ba..f2033899c 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -3,7 +3,6 @@ /** * holds the database index class * - * @version $Id$ * @package phpMyAdmin */ @@ -539,7 +538,6 @@ class PMA_Index /** * Function to check over array of indexes and look for common problems * - * @uses __('The indexes %1 and %2 seem to be equal and one of them could possibly be removed.') * @uses is_string() * @uses is_array() * @uses count() diff --git a/libraries/List.class.php b/libraries/List.class.php index 029b6fc3d..65ac7fc5a 100644 --- a/libraries/List.class.php +++ b/libraries/List.class.php @@ -3,7 +3,6 @@ /** * hold the PMA_List base class * - * @version $Id$ * @package phpMyAdmin */ diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index 397a6db32..f793ed424 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -3,7 +3,6 @@ /** * holds the PMA_List_Database class * - * @version $Id$ * @package phpMyAdmin */ diff --git a/libraries/Message.class.php b/libraries/Message.class.php index ffddb87e0..68d32bcfc 100644 --- a/libraries/Message.class.php +++ b/libraries/Message.class.php @@ -3,7 +3,6 @@ /** * Holds class PMA_Message * - * @version $Id$ * @package phpMyAdmin */ diff --git a/libraries/Partition.class.php b/libraries/Partition.class.php index cd696338a..c2b14a4e3 100644 --- a/libraries/Partition.class.php +++ b/libraries/Partition.class.php @@ -3,7 +3,6 @@ /** * Library for extracting information about the partitions * - * @version $Id$ * @package phpMyAdmin */ diff --git a/libraries/StorageEngine.class.php b/libraries/StorageEngine.class.php index 711f709e1..71b363625 100644 --- a/libraries/StorageEngine.class.php +++ b/libraries/StorageEngine.class.php @@ -3,7 +3,6 @@ /** * Library for extracting information about the available storage engines * - * @version $Id$ * @package phpMyAdmin */ @@ -92,12 +91,7 @@ class PMA_StorageEngine && ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED')) { continue; } - // currently (MySQL 5.1.26) there is no way we can be informed - // that PBMS does not support normal table creation so - // we use an exception here - if ('PBMS' == $details['Engine']) { - continue; - } + $output .= '