# HG changeset patch # User ethanzonca # Date 2009-06-06 23:08:27 # Node ID ffe4eed5354906b26cca69113e9521ad81c5a466 # Parent 3be168914a12ecb43fba012c64467857b49b56ba removed terrible stuff :D diff --git a/htdocs/sql/CREDITS b/htdocs/sql/CREDITS deleted file mode 100755 --- a/htdocs/sql/CREDITS +++ /dev/null @@ -1,9 +0,0 @@ -$Id: CREDITS 5152 2003-11-18 15:20:45Z nijel $ - - -phpMyAdmin - Credits -==================== - - Please have a look to the Documentation.txt or - Documentation.html files. - diff --git a/htdocs/sql/ChangeLog b/htdocs/sql/ChangeLog deleted file mode 100755 --- a/htdocs/sql/ChangeLog +++ /dev/null @@ -1,635 +0,0 @@ ----------------------- -phpMyAdmin - ChangeLog ----------------------- - -$Id: ChangeLog 12317 2009-03-24 21:04:18Z lem9 $ -$HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $ - -2.11.9.5 (2009-03-24) -- [security] XSS vulnerability on export page -- [security] Insufficient output sanitizing when generating configuration file - -2.11.9.4 (2008-12-09) -- [security] possible XSRF on several pages - -2.11.9.3 (2008-10-30) -- [security] XSS in a Designer component - -2.11.9.2 (2008-09-22) -- [security] XSS in MSIE using NUL byte, thanks to JPCERT. - -2.11.9.1 (2008-09-15) -- [security] Code execution vulnerability, thanks to Norman Hippert - -2.11.9.0 (2008-08-28) -- bug #2031221 [auth] Links to version number on login screen -- bug #2032707 [core] PMA does not start if ini_set() is disabled -- bug #2004915 [bookmarks] Saved queries greater than 1000 chars not - displayed, thanks to Maik Wiege - mswiege -- bug #2037381 [export] Export type "replace" does not work -- bug #2037375 [export] DROP PROCEDURE needs IF EXISTS -- bug #2045512 [export] Numbers in Excel export -+ [lang] Norwegian UTF-8 original file remerged, thanks to Sven-Erik Andersen -- bug #2074250 [parser] Undefined variable seen_from - -2.11.8.0 (2008-07-28) -- patch #1987593 [interface] Table list pagination in navi, - thanks to Jason Day - jday29 -- bug #1989081 [profiling] Profiling causes query to be executed again - (really causes a problem in case of INSERT/UPDATE) -- bug #1990342 [import] SQL file import very slow on Windows, - thanks to Richard Heaton - wotnot -- bug [XHTML] problem with tabindex and radio fields -- bug #1971221 [interface] tabindex not set correctly -- bug [views] VIEW name created via the GUI was not protected with backquotes -- bug #1989813 [interface] Deleting multiple views (space in name) -- bug #1992628 [parser] SQL parser removes essential space -- bug #1989281 [export] CSV for MS Excel incorrect escaping of double quotes -- bug #1959855 [interface] Font size option problem when no config file -- bug #1982489 [relation] Relationship view should check for changes -- bug [history] Do not save too big queries in history -- [security] Do not show version info on login screen -- bug #2018595 [import] Potential data loss on import resubmit -- patch #2020630 [export] Safari and timedate, thanks to Sebastian Mendel, - Isaac Bennetch and Jürgen Wind -- bug #2022182 [import, export] Import/Export fails because of Mac files -- [security] protection against cross-frame scripting and - new directive AllowThirdPartyFraming, thanks to YGN Ethical Hacker Group -- [security] possible XSS during setup, thanks to YGN Ethical Hacker Group -- [interface] revert language changing problem introduced with 2.11.7.1 - -2.11.7.1 (2008-07-15) -- bug [security] XSRF/CSRF by manipulating the db, - convcharset and collation_connection parameters, - thanks to YGN Ethical Hacker Group - -2.11.7.0 (2008-06-23) -- bug #1908719 [interface] New field cannot be auto-increment and primary key -- [dbi] Incorrect interpretation for some mysqli field flags -- bug #1910621 [display] part 1: do not display a TEXT utf8_bin as BLOB - (fixed for mysqli extension only) -- [interface] sanitize the after_field parameter, - thanks to Norman Hippert -- [structure] do not remove the BINARY attribute in drop-down -- bug #1955386 [session] Overriding session.hash_bits_per_character -- [interface] sanitize the table comments in table print view, - db print view and db data dictionary, thanks to Norman Hippert -- bug #1939031 Auto_Increment selected for TimeStamp by Default -- patch #1957998 [display] No tilde for InnoDB row counter when we know - it for sure, thanks to Vladyslav Bakayev - dandy76 -- bug #1955572 [display] alt text causes duplicated strings -- bug #1762029 [interface] Cannot upload BLOB into existing row -- bug #1981043 [export] HTML in exports getting corrupted, - thanks to Jason Judge - jasonjudge -- bug #1936761 [interface] BINARY not treated as BLOB: update/delete issues -- protection against XSS when register_globals is on and .htaccess has - no effect, thanks to Tim Starling -- bug #1996943 [export] Firefox 3 and .sql.gz (corrupted); detect Gecko 1.9, - thanks to Jürgen Wind - windkiel - -2.11.6.0 (2008-04-29) -- bug #1903724 [interface] Displaying of very large queries in error message -- bug #1905711 [compatibility] Functions deprecated in PHP 5.3: is_a() and - get_magic_quotes_gpc(), thanks to Dmitry N. Shilnikov - yrtimd -- bug [lang] catalan wrong accented characters -- bug #1893034 [Export] SET NAMES for importing with command-line client -+ [lang] Russian update, thanks to Victor Volkov -- bug #1910485 [core] Unsetting the whitelist during the loop, - thanks to Jeroen Vrijkorte - jv_map -- bug #1906980 [Export] Import of VIEWs fails if temp table exists, - thanks to Falk Nisius - klaf -- bug #1812763 [Copy] Table copy when server is in ANSI_QUOTES sql_mode - thanks to Tony Marston - tonymarston -- bug #1918531 [compatibility] Navigation isn't w3.org valid - thanks to Michael Keck - mkkeck -- bug #1926357 [data] BIT defaults displayed incorrectly -- patch #1930057 [auth] colon in password prevents HTTP login on CGI/IIS, - thanks to Jürgen Wind - windkiel -- patch #1929553 [lang] Don't output BOM character in Swedish language file, - thanks to Samuel L. B. - samuellb -- patch #1895796 [lang] Typo in Japanese lang files, - thanks to tyman - acoustype -- bug #1935652 [auth] Access denied (show warning about mcrypt on login page) -- bug #1906983 [export] Reimport of FUNCTION fails -- bug #1919808 [operations] Renaming a database fails to handle functions -- bug #1934401 [core] Cannot force a language -- bug #1944077 [core] Config file containing a BOM, - thanks to Gaetano Giunta - ggiunta -- bug #1947189 [scripts] Missing in scripts/signon.php, - thanks to Dolf Schimmel -+ [lang] Romanian update, thanks to Sergiu Bivol - sbivol - -2.11.5.2 (2008-04-22) -- PMASA-2008-3 [security] File disclosure - -2.11.5.1 (2008-03-29) -- bug #1909711 [security] Sensitive data in session files - -2.11.5.0 (2008-03-01) -- bug #1862661 [GUI] Warn about rename deleting database -- bug #1866041 [interface] Incorrect sorting with AS -- bug #1871038 [import] Notice: undefined variable first_sql_delimiter -- bug #1873110 [export] Problem exporting with a LIMIT clause -- bug #1871164 [GUI] Empty and navigation frame synch. -- patch #1873188 [GUI] Making db pager work when js is disabled, - thanks to Jürgen Wind - windkiel -- bug #1875010 [auth] MySQL server and client version mismatch (mysql ext.) -- patch #1879031 [transform] dateformat transformation and UNIX timestamps, - thanks to Tim Steiner - spam38 -- bug [import] Do not verify a missing enclosing character for CSV, - because files generated by Excel don't have any enclosing character -- bug #1799691 [export] "Propose table structure" and Export -- bug #1884911 [GUI] Space usage -- bug #1863326 [GUI] Wrong error message / no edit (Suhosin) -- bug #1887204 [GUI] Order columns in result list messing up query -- patch #1893538 [GUI] Display issues on Opera 9.50, - thanks to Jürgen Wind - windkiel -- bug [GUI] Do not display the database name used by the previous user, - thanks to Ronny Görner -- bug [security] Remove cookies from $_REQUEST for better coexistence with - other applications, thanks to Richard Cunningham. See PMASA-2008-1. - -2.11.4.0 (2008-01-12) -- bug #1843428 [GUI] Space issue with DROP/DELETE/ALTER TABLE -- bug #1807816 [search] regular expression search doesn't work with - backslashes -- bug #1843463 [GUI] DROP PROCEDURE does not show alert -- bug #1835904 [GUI] Back link after a SQL error forgets the query -- bug #1835654 [core] wrong escaping when using double quotes -- bug #1817612 [cookies] Wrong cookie path on IIS with PHP-CGI, - thanks to Carsten Wiedmann -- bug #1848889 [export] export trigger should use DROP TRIGGER IF EXISTS -- bug #1851833 [display] Sorting forgets an explicit LIMIT - (fix for sorting on column headers) -- bug #1764182 [cookies] Suhosin cookie encryption breaks phpMyAdmin -- bug #1798786 [import] Wrong error when a string contains semicolon -- bug #1813508 [login] Missing parameter: field after re-login -- bug #1710144 [parser] Space after COUNT breaks Export but not Query -- bug #1783620 [parser] Subquery results without "as" are ignored -- bug #1821264 [display] MaxTableList and INFORMATION_SCHEMA -- bug #1859460 [display] Operations and many databases -- bug #1814679 [display] Database selection pagination when switching servers -- patch #1861717 [export] CSV Escape character not exported right, - thanks to nicolasdigraf -- bug #1864468 [display] Theme does not switch to darkblue_orange -- bug #1847409 [security] Path disclosure on darkblue_orange/layout.inc.php, - thanks to Jürgen Wind - windkiel - -2.11.3.0 (2007-12-08) -- patch #1818389 to remove a notice (failed to flush buffer), thanks to - Bertrand -- patch #1821154, HTTP authentication: fix auth working with php/mod_fastcgi, - thanks to yarodin -- wrong default charset in case of broken session -- bug #1824506 [profiling] Profile command repeated on older MySQL servers -- bug #1825172 [export] Exporting and functions -- bug #1817224 [import] Incorrect detection of file_uploads in some cases, - thanks to Juergen Wind -- bug #1777249 [display] Do not underline links in left panel (in default -- bug #1826022 [privileges] unable to add user (MySQL 3.23) since PMA 2.11.2 -- bug #1823045 [import] Error importing file with lowercase "delimiter" -- bug #1828913 [structure] Can't set FULLTEXT index on CHAR column -- bug #1804081 [export] export on server doesn't obey AllowAnyWhereRecoding -- bug #1789988 [display] space before SHOW COLUMNS -- bug #1831646 [table creation] Error in CREATE TABLE with multiple primary - keys and AUTO_INCREMENT -- [display] Division by zero when showing all records (page selector) -- bug #1828265 [privileges] No weird characters in generated password -- bug #1759194 [import] open_basedir warning -- bug #1793948 [parser] ROW_FORMAT incorrectly parsed -- undefined PMA_MYSQL_INT_VERSION when no default server is set -- bug #1763343 [session] Behavior with session.auto_start enabled -+ [lang] Hungarian update, thanks to Mihály Mészáros -+ [lang] German update, thanks to Jürgen Wind - windkiel -- patch #1837691 [query window] js errors, thanks to Victor Volkov -- patch #1839052 [lang] catalan not in UTF-8, thanks to jaz001 -- patch #1838626 [GUI] Login interface broken on Konqueror, thanks to fhimpe - -2.11.2.2 (2007-11-20) -- bug #1835123 [security] fixed XSS vulnerability on login page, - thanks to Tim Brown (Nth Dimension) for the advisory - and to Sebastian for the fix - -2.11.2.1 (2007-11-11) -- fixed possible SQL injection using database name -- fixed possible XSS in database name - thanks to Omer Singer, The DigiTrust Group - -2.11.2.0 (2007-10-27) -- patch #1791576 HTTP auth: support REDIRECT_REMOTE_USER, thanks to Allard -+ [lang] Serbian update, thanks to Mihailo Stefanovic -- bug #1798841 [relations] Copying db does not copy internal relations -- bug #1798646 [display] Character '+' in query wrongly interpreted -- bug #1801919 [themes] Do not use NaviDatabaseNameColor for fieldset legend -- bug #1764735 [core] Designer: PDF error when deleting a table -- bug #1764195 [views] DROP button does not work on defective views -- bug #1805773 [relations] browse foreign values: return values not escaped, - thanks to Alex Rambau -- bug #1807923 [login] Login with html entities in password fails -- [core] Undefined variable when creating a table that exists -- patch #1808578 Changes in font size were no longer detected after patch - #1787915 -+ [lang] Croatian update, thanks to Renato Pavicic -- patch #1807615 [GUI] Display patch for column rights in Opera -- bug #1811519 Can't delete user with a german umlaut. -- bug #1811519 [privileges] fixed used collation for accessing mysql.user in server privileges -- it should not be possible to move or copy a table to information_schema -- bug #1814733 win: copy db to mixed name db fails -- bug #1777249 [display] Remove horizontal lines in navigation panel -- bug #1805102 [display] TextareaAutoSelect issues: set this parameter - default value to false to help cut&paste from a terminal window; also - set focus to the textarea -- bug #1814463 [display] Wrong database size -- bug #1811527 [display] Problem with links to the MySQL manual -- patch #1817529 [auth] Incorrect login via URL when AllowArbitraryServer - is true, thanks to Juergen Wind - -2.11.1.2 (2007-10-17) -- fixed XSS in server_status.php, thanks to Omer Singer, The DigiTrust Group -- fixed some possible XSS with PHP_SELF, PATH_INFO, REQUEST_URI - (reference: CVE-2007-5589) - -2.11.1.1 (2007-10-15) -- bug #1810629 [setup] XSS in setup.php, thanks to Omer Singer, The DigiTrust Group - -2.11.1.0 (2007-09-20) -- bug #1783667 [export] NO_AUTO_VALUE_ON_ZERO and MySQL version -- bug #1780098 [GUI] Logout causes CSS loss, thanks to Juergen Wind -. incorrect field ids, thanks to Michael Keck -- bug #1787522 [view] wrong choice in algorithm drop-down -- bug #1777620 [GUI] Table Print preview: missing column header, - thanks to Mario Rohkrämer -- Do not display "Your MySQL library..." if only the Z part of X.Y.Z version - is different -- bugs #1767759, 1216521 [data] Duplicate entry error Browse feature: this minor - feature removed due to its complexity -- bug #1774825 [operations] Rename database loses charset info -- bug #1791568 [core] Undefined cfg, thanks to Christian Schmidt -- bug #1782332 [structure] New table form does not overtake data -- bug #1793763 [requirements] minimum PHP should be 4.2.0 -- patch #1787915 Avoid CSS reloading on every click, thanks to Juergen Wind -- bug #1798627 [GUI] Wrong storage engine displayed - -2.11.0.0 (2007-08-21) -+ [import] support handling of DELIMITER to mimic mysql CLI, thanks to fb1 -+ improved PHP 6 compatibility -- bug #1674914 [structure] changing definition of a TIMESTAMP field -- bug #1615530 [upload] added more specific error message if field upload fails -- bug #1627210, #1083301, #1482401 [data] warning on duplicate indexes -- bug #1668724 JavaScript focus login Opera -- bug #1666657 [auth] Cookie password delete on timeout / inactivity -- bug #1648802 different mysql library and server version -- bug #1662976 [auth] Authentication fails when controluser/pass is set -- bug #1643758 [import] Error #1264 importing NULL values in MySQL 5.0 -- bug #1523747 [innodb] make warning about row count more visible -- bug #1676012 [auth] strip non-US-ASCII characters (RFC2616) -- bug #1679440 Added FAQ entry about header errors under IIS caused by - an end-of-line character -- [gui] avoid displaying a wide selector in server selection -- bug #1614004 [relation] foreign key spanning multiple columns are - incorrectly displayed -- bug #1681598 [interface] Edit next row -- bug #1688053 [export] Wrong export of binary character fields -- bug #1498281 [parser] Wrong primary key used for displaying results - with subquery -- bug #1699772 Visual space bug in table name (in browser) -- bug #1699532 Cause of data manipulation issues: implemented changes - as suggested by crisp_; still have to work on updating an ENUM value -+ [core] added PMA_fatalError() and made use of it -. [core] added PMA_isValid() and PMA_ifSetOr() for variable handling -. [i18n] use generic $strOptions -. [core] get rid of $propicon -. [core] globalized variables to be includable inside function in - libraries/select_lang.lib.php -+ [doc] changed all documentation in config.inc.php to phpDocumentor style -+ [data] support for CREATE VIEW from query results -+ [gui] dropped css/ folder and moved into root of PMA -+ [l10n] new: Sinhala, Macedonian -+ [export] YAML export (see yaml.org), thanks to Bryce Thornton -+ [upload] moved file upload functionality into own class -+ [upload] make use of $cfg['TempDir'] for file uploads -+ [server] improved display of binary logs -+ [data] better error handling in tbl_create.php -+ [routines] from Patch #1649881, thanks to Mike Beck -+ [querywindow] store sql history in session -+ [querywindow] sql history now without db too -+ [querywindow] tweaks in sql history view -+ [export] Native Excel (Spreadsheet_Excel_Writer) improvements, - thanks to Christian Schmidt -+ [doc] requirement of mcrypt on 64-bit, thanks to Isaac Bennetch -+ [lang] Danish update, thanks to Finn Sorensen -+ RFE #1435922 [gui] navigation frame shows listing of databases when none selected -+ [data] support BIT datatype (under mysqli), thanks to Christian Schmidt -+ [display] automatic confirmation for sort by key, thanks to Juergen Wind -+ [data] can now choose the number of insert rows -+ RFE #1704779 [gui] link documentation from login page -+ RFE #1513345 [setup] check control user connection during setup -+ [structure] TRIGGERS: display/edit/drop/SQL export -+ [browse] store browse state in session per query -+ [lang] Turkish update, thanks to Burak Yavuz -+ [lang] Galician update, thanks to Xosé Calvo -+ [lang] Brazilian-Portuguese update, thanks to Airon Luis Pereira -+ [gui] Insert/Edit: no longer display the Go button each 15 lines - but just at the end of a row -+ [gui] Query window: use verbose server name if any -+ [auth] patch #1712514 specify host for single signon, thanks to Thierry -+ [gui] Navigator for the db list in the navigation panel -+ [gui] Navigator for the table list in the content panel -- bug #1727138 HTML not encoded (more than 1000 characters) -+ [display] Support for MySQL 5.0.37 profiling -+ RFE #1743983 [gui] Replace $max_characters by a configurable param: - $cfg['MaxCharactersInDisplayedSQL'] -- bug #1746186 LeftLogoLink fails if set to some external site -. [transformations]: remove "auto-detect" MIME-type that was never implemented -+ [display] patch #1749705, Allow multibyte characters in number formatting, - thanks to garas -- bug #1747215 Export emits blanks at line ends -- bug #1751172 Do not export data when exporting a single VIEW -+ [lang] Swedish update, thanks to Björn T. Hallberg -+ [lang] Russian update, thanks to Victor Volkov and the php-myadmin.ru users -+ [privileges] Support password hashing on the Edit Privileges interface -- bug #1755339 Warn about rename dataase actually being copy/delete -- bug #1746921 Left frame shrinks on db change, thanks to Juergen Wind -+ [gui] Export: Select All/Unselect All over the choices, - thanks to Florian Schmitz -+ [lang] Japanese update, thanks to Ishigaki Kenichi -- bug #1759528 browse_foreigners fails due to newlines, - thanks to Hanno Boeck -+ [lang] Norwegian update, thanks to Sven-Erik Andersen -+ [lang] Italian update, thanks to Luca Rebellato -+ [lang] Spanish update, thanks to Daniel Hinostroza -. [export] Do not obey $cfg['MaxTableList'] on database export -- [doc] UploadDir and the Import tab, thanks to Juergen Wind -- bug #1766975 Parameters lost when editing stored routine -- [export] patch #1766633 Incorrect export with specified MySQL port, - thanks to Juergen Wind -+ [lang] Catalan update, thanks to Xavier Navarro -- bug #1751553 Drop-down instead of input when editing -- [data] foreign key browser: encoding mixups, thanks to Thijs Kinkhorst -- bug #1771721 Old SVN URLs - -2.10.3.0 (2007-07-20) -- bug #1734285 Copy database with VIEWs -- bug #1722502 DROP TABLE in export VIEW -- bug #1729027 Sorting results of VIEW browsing -- bug #1733012 Unwanted table alias in delete button -- bug #1736405 Pretty printer and HTML line breaks -- bug #1745257 Invalid DB name is still displayed -- bug #1730367 Calendar "Go" has no effect -- bug #1748633 Incorrect parameter validation for VIEWs -+ [lang] Russian revision, thanks to Victor Volkov and the users of - php-myadmin.ru -- Do not try to delete an internal relation if we just deleted an InnoDB one - -2.10.2.0 (2007-06-15) -+ [data] display all warnings, not only last one -- typo in fix for bug #1671813 -- bug #1714908 Inserted Row Count is wrong -- bug #1712570 Deleting last record freezes -- bug #1717339 Missing header when deleting a checked column, - thanks to Michael Keck -- bug #1717477 Warning on Query page when db is empty -- bug #1721002 db rename -> undefined cfgRelation, thanks to Jürgen Wind -- bug #1721571 CREATE database privilege not always detected, - thanks to Gordon McNaughton -- bug #1715709 export in SQL format always includes procedures and functions -- bug #1722502 DROP TABLE in export view structure -- bug #1718787 Multi-server setup breaks Designer -- bug #1724401 Column truncation in repair table output -- patch #1726500 Wrong position of , thanks to Jürgen Wind -- bug #1728590 Detected failing session_start fails, thanks to Jürgen Wind -- RFE #1714760 Obey ShowCreateDb on the Databases tab -- patch #1733762 Typo in message "INSERT DELAY", thanks to Victor Volkov -- patch #1730171 Dead message strLanguageFileNotFound, thanks to Victor Volkov -- patch #1731280 Avoid negative exponent in gmp_pow(), thanks to anosek - -2.10.1.0 (2007-04-23) -- bug #1541147 [js] '#' in database names not correctly handled by queywindow.js -- bug #1671403 [parser] using "client" as table name -- bug #1672379 [core] Call to undefined function PMA_removeCookie() -- bug [core] undefined variable in libraries/tbl_replace_fields.inc.php -- bug [gui] query window icon did not work, thanks to Jürgen Wind - windkiel -. [general] use PMA_getenv('PHP_SELF') -- bug #1676033 [core] pow(int,int) causes overflow -- bug #1680952 [core] undefined function PMA_getUvaCondition() -- bug #1596328 [export] drop support for POSTGRESQL compatibility mode -- bug #1609443 [privileges] Grant all priv. on wildcard name (fix message) -- bug #1567317 [sqp] Syntax highlighter: extra spaces -- bug #1239401 [sqp] table dot numeric field name -- bug #1672789 [sqp] Undefined offset: 4 in sqlparser.lib.php #1674 -- bug #1682044 [export] Export file even if file not selected -- bug #1664212 querywindow loses url encoded characters -- replaced ctype_digit() with is_numeric() -+ [config] clean cookies on phpMyAdmin upgrade -- bug #1674972 [export] no export with %afm% -- bug #1667887 HTML maxlength -- bug #1679055 #1050 - Table '' already exists -- patch #1681620 [interface] support reordering of $cfg['ColumnTypes'], - thanks to Leonard den Ottolander -- bug #1690718 Can't edit if BLOB and no PK -- bug #1672636 [export] PDF export too wide -+ [lang] brazilian-portuguese update, thanks to Airon Luis Pereira -- patch #1698964 javascript typo, thanks to Corey Hollaway -- bug #1703897 [css] undefined index 'js_frame' -- bug #1690561 Blobs being cleared on Edit of row -- bug #1679801 [core] XSS vulnerability in PMA_sanitize(), thanks to sp3x SecurityReason -- bug #1704467 XSS vulnerability in browse_foreigners.php, thanks to sp3x SecurityReason - -2.10.0.2 (2007-03-02) -+ bug #1671813 CVE-2006-1549 deep recursion crash - -2.10.0.1 (2007-03-01) -. [config] set $cfg['Servers'][$i]['ssl'] default value to false, - we got reports from some users having problems with the default value of true - -2.10.0.0 (2007-02-28) -- bug #1659176 [general] memory error displaying a table with large BLOBs -- bug #1668662 [install] can create the new pma_designer_coords table -+ [gui] navi logo now links to main page by default, with still the possibility - of having an external URL - -2007-02-25 Marc Delisle - * libraries/common.lib.php: bug #1667466, undefined variable when - export + save on server - * server_status.php: bug #1665930, undefined PHP_SELF - -2007-02-24 Marc Delisle - * libraries/config.default.php: RFE #1621437, HEX and UNHEX were not - available for a BINARY field - -2007-02-21 Marc Delisle - * pmd/scripts/move.js: bug #1650770, Designer and Mac OSX, - thanks to Ivan Kirillov - -2007-02-17 Marc Delisle - * Documentation.html: patch #1659347, missing doc for some config, - thanks to Isaac Bennetch - * libraries/export/sql.php: bug #1663336, undefined variable - -2007-02-16 Marc Delisle - * libraries/common.lib.php, footer.inc.php: avoid generating big links - after an upload into a BLOB - -2007-02-14 Marc Delisle - * libraries/common.lib.php: white page after uploading a 700 Kio BLOB - * add a warning on main page if mcrypt can't be loaded (bug 1658160) - -2007-02-12 Sebastian Mendel - * libraries/database_interface.lib.php: bug #1616486 server_databases does - not show all databases - * libraries/sqlparser.data.php: MySQL function and column names, reserved - and forbidden words updated, - bug #1657045 Spatial functions not supported - bug #1657037 Missing column type "geometry" - -2007-02-09 Marc Delisle - * main.php: some links should open a new page - * Documentation.html, libraries/navigation_header.inc.php, - libraries/config.default.php: $cfg['LeftLogoLinkWindow'] to decide - in which window the logo-linked page will appear - -2007-02-09 Michal Čihař - * lang/czech: Fix syntax error (sorry for that). - -2007-02-08 Marc Delisle - * themes/darkblue_orange/img/logo_left.png, - themes/original/img/logo_left.png: smaller PMA logo for navi - -2007-02-08 Sebastian Mendel - * themes/*/css/theme_right.css.php: bug #1653769 browsing highlight disabling - doesn't work - -2007-02-06 Sebastian Mendel - * pmd_general.php, pmd_pdf.php, pmd_save_pos.php: fixed short open tags - patch #1652886 thanks to Martin Thielecke - mthie - * tbl_change.php: fixed escaping of field names in HTML and JavaScript - * libraries/common.lib.php: PMA_backquote() did not quote 0 - * tbl_change.php: bug #1652810 - slashes are not escaped properly - -2007-02-05 Marc Delisle - * lang/japanese: Update, thanks to Ishigaki Kenichi - tcool. - -2007-02-05 Sebastian Mendel - * lang/german: updated - -2007-02-03 Marc Delisle - * pmd/scripts/move.js: display problems in Opera, thanks to Maxim Bulygin - -2007-02-02 Marc Delisle - * tbl_replace.php: Calendar icon does not work on "Insert another new row" - -2007-02-01 Marc Delisle - * libraries/import.lib.php: bug #1626064, too much quoting on import - -2007-02-01 Sebastian Mendel - * libraries/display_tbl.lib.php: bug #1644740 - $cfg['Order'] = 'SMART' - overwritten - * libraries/Theme.class.php: removed __wakeup() due to some requirements are - not fulfilled at this point - also thanks to Jürgen Wind - windkiel - -2007-01-31 Sebastian Mendel - * libraries/session.inc.php: - bug #1630871 - Detecting a missing write permission on sessions directory - -2007-01-30 Sebastian Mendel - * libraries/sqlparser.lib.php PMA_SQP_analyze(): - bug #1647785 - do not pass variables by reference - -2007-01-29 Marc Delisle - * lang/catalan update, thanks to Xavier Navarro (xavin) - * pmd_general.php: possibility of quotes in Designer messages, - thanks to Ivan Kirillov - -2007-01-26 Michal Čihař - * libraries/common.lib.php, libraries/js_escape.lib.php, - test/escape_js_string.php, test/core.lib.php: Move java script escaping - to separate library, make it safer on escaping and add - testcase for it. - * test/theme.php: Move to test package. - -2007-01-22 Marc Delisle - * pmd/*: button for direct/angular links, thanks to Ivan Kirillov - -2007-01-22 Michal Čihař - * lang/czech: Updated. - -2007-01-21 Marc Delisle - * libraries/Table.class.php: on a MySQL 5.0.33 server with 4400 databases, - one of which having 400 tables, it took more than 3 minutes just to - see the database structure (some accesses to INFORMATION_SCHEMA are - just too slow) so I changed PMA_Table::isView() to avoid calling - INFORMATION_SCHEMA - -2007-01-20 Marc Delisle - * libraries/sqlparser.lib.php: bug #1638267, wrong reserved word - recognition - * server_privileges.php: bug #1635377, superfluous backslash, - thanks to Hanut - -2007-01-19 Marc Delisle - * pmd*, lang/*: Designer now supports set/unset of the display field, - thanks to Ivan Kirillov - -2007-01-18 Michal Čihař - * lang/czech: Updated. - * libraries/auth/cookie.auth.lib.php: Make server switching honour more - server settings (patch #1630104). - -2007-01-17 Marc Delisle - * lang/turkish: update, thanks to Burak Yavuz - bourock - -2007-01-16 Marc Delisle - ### 2.9.2 released from QA_2_9 - -2007-01-12 Marc Delisle - * (many files): Designer, two features (snap to grid / display field) - thanks to Ivan Kirillov - * libraries/Theme_Manager.class.php: patch #1611684, force a change - of a session variable to avoid phpmyadmin.css.php caching problems, - thanks to Christian Schmidt - -2007-01-11 Marc Delisle - * lang/estonian: Update, thanks to Marko Ellermaa - uhuu - -2007-01-09 Michal Čihař - * index.php: Properly escape strings written in JS code. - * libraries/Theme_Manager.class.php: Avoid trigger error here, parameter - comes from user and it might lead to path disclossure. - * libraries/common.lib.php: - - Properly escape in JS code. - - Check db, table and sql_query params to be string. - -2007-01-08 Marc Delisle - * libraries/session.inc.php: prevent attack on session name cookie - -2007-01-05 Marc Delisle - * libraries/session.inc.php: bug #1538132, remove the setting of - session.save_handler to 'files' - * pmd_general.php: patch #1627831, - English language improvements, thanks to Isaac Bennetch - * pmd_general.php, pmd_relation_new.php, lang/*: abstract messages - -2007-01-04 Marc Delisle - * pmd/scripts/move.js: avoid text selection when moving a table object - under MSIE 6, thanks to Ivan Kirillov - * libraries/db_links.inc.php: better icon for Designer, thanks to I.K. - -2007-01-02 Marc Delisle - * Designer: various fixes and improvements (for example support - for MSIE 6), thanks to Ivan Kirillov - * pdf_pages.php: undefined $pdf_page_number when no auto layout - * server_privileges.php: bug #1614087, deleting a user having a - global GRANT privilege fails under MySQL 4.1.x - -2007-01-02 Michal Čihař - * libraries/common.lib.php: Add
to allow selecting whole SQL by - tripple click (patch #1611591). - * libraries/export/sql.php: DELIMITER should not be commented out (bug - #1612870). - - --- Older ChangeLogs can be found on our project website --- - http://www.phpmyadmin.net/old-stuff/ChangeLogs/ - -# vim: et ts=4 sw=4 sts=4 -# vim: ft=changelog fenc=utf-8 encoding=utf-8 -# vim: fde=getline(v\:lnum-1)=~'^\\s*$'&&getline(v\:lnum)=~'\\S'?'>1'\:1&&v\:lnum>8&&getline(v\:lnum)!~'^#' -# vim: fdn=1 fdm=expr diff --git a/htdocs/sql/Documentation.html b/htdocs/sql/Documentation.html deleted file mode 100755 --- a/htdocs/sql/Documentation.html +++ /dev/null @@ -1,4423 +0,0 @@ - - - - - - - - - - phpMyAdmin 2.11.9.5 - Documentation - - - - - - - - -

phpMyAdmin 2.11.9.5 Documentation

- - - - -

Requirements

- -
  • PHP -
    • You need PHP 4.2.0 or newer, with session support - (see - FAQ 1.31) -
    • -
    • You need GD2 support in PHP to display inline - thumbnails of JPEGs ("image/jpeg: inline") with their - original aspect ratio
    • -
    • You need PHP 4.3.0 or newer to use the - "text/plain: external" MIME-based transformation
    • -
    • When using the "cookie" - authentication method, the - mcrypt extension - is strongly suggested for most users and is required for - 64–bit machines. Not using mcrypt will cause phpMyAdmin to - load pages significantly slower. -
    • -
    -
  • -
  • MySQL 3.23.32 or newer (details);
  • -
  • Web browser with cookies enabled.
  • -
- - -

Introduction

- -

phpMyAdmin can manage a whole MySQL server (needs a super-user) as well as - a single database. To accomplish the latter you'll need a properly set up - MySQL user who can read/write only the desired database. It's up to you to - look up the appropriate part in the MySQL manual. -

- -

Currently phpMyAdmin can:

- -
  • browse and drop databases, tables, views, fields and indexes
  • -
  • create, copy, drop, rename and alter databases, tables, fields and - indexes
  • -
  • maintenance server, databases and tables, with proposals on server - configuration
  • -
  • execute, edit and bookmark any - SQL-statement, even - batch-queries
  • -
  • load text files into tables
  • -
  • create1 and read dumps of tables -
  • -
  • export1 data to various formats: - CSV, - XML, - PDF, - ISO/IEC 26300 - - OpenDocument Text and Spreadsheet, - Word, - Excel and LATEX formats -
  • -
  • administer multiple servers
  • -
  • manage MySQL users and privileges
  • -
  • check referential integrity in MyISAM tables
  • -
  • using Query-by-example (QBE), create complex queries automatically - connecting required tables
  • -
  • create PDF graphics of - your Database layout
  • -
  • search globally in a database or a subset of it
  • -
  • transform stored data into any format using a set of predefined - functions, like displaying BLOB-data as image or download-link -
  • -
  • support InnoDB tables and foreign keys (see - FAQ 3.6)
  • -
  • support mysqli, the improved MySQL extension - (see FAQ 1.17)
  • -
  • communicate in 54 different languages -
  • -
- -

A word about users:

-

Many people have difficulty - understanding the concept of user management with regards to phpMyAdmin. When - a user logs in to phpMyAdmin, that username and password are passed directly - to MySQL. phpMyAdmin does no account management on its own (other than - allowing one to manipulate the MySQL user account information); all users - must be valid MySQL users.

- -

- 1) phpMyAdmin can compress (Zip, GZip -RFC 1952- or Bzip2 formats) - dumps and CSV exports if you use - PHP with Zlib support (--with-zlib) and/or Bzip2 support - (--with-bz2). Proper support may also need changes in - php.ini.

- - -

Installation

- -
  1. Quick Install
  2. -
  3. Setup script usage
  4. -
  5. Linked-tables infrastructure
  6. -
  7. Upgrading from an older version
  8. -
  9. Using authentication modes
  10. -
- -

- phpMyAdmin does not apply any special security methods to the MySQL database - server. It is still the system administrator's job to grant permissions on - the MySQL databases properly. phpMyAdmin's "Privileges" page can - be used for this. -

- -

- Warning for Mac users:
- if you are on a Mac - OS version before - OS X, StuffIt unstuffs with - Mac formats.
- So you'll have to resave as in BBEdit to Unix style ALL phpMyAdmin scripts - before uploading them to your server, as PHP seems not to like - Mac-style end of lines character - ("\r").

- -

Quick Install

-
  1. Choose an appropriate distribution kit from the phpmyadmin.net - Downloads page. Some kits contain only the English messages, - others contain all languages in UTF-8 format (this should be fine - in most situations), others contain all - languages and all character sets. We'll assume you chose a kit whose - name looks like phpMyAdmin-x.x.x-all-languages.tar.gz. -
  2. -
  3. Untar or unzip the distribution (be sure to unzip the subdirectories): - tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz in your webserver's - document root. If you don't have direct access to your document root, - put the files in a directory on your local machine, and, after step 4, - transfer the directory on your web server using, for example, ftp.
  4. -
  5. Ensure that all the scripts have the appropriate owner (if PHP is - running in safe mode, having some scripts with an owner different - from the owner of other scripts will be a - problem). See - FAQ 4.2 and - FAQ - 1.26 for suggestions.
  6. -
  7. Now you must configure your installation. There are two methods that - can be used. Traditionally, users have hand-edited a copy of - config.inc.php, but now a wizard-style setup script is - provided for those who prefer a graphical installation. Creating a - config.inc.php file is - still a quick way to get started and needed for some advanced features. -
    • To manually create the file, simply use your text editor to - create the file config.inc.php (you can copy - config.sample.inc.php to get minimal configuration - file) in the main (top-level) phpMyAdmin directory (the one - that contains index.php). phpMyAdmin first loads - libraries/config.default.php and then overrides those - values with anything found in config.inc.php. If the - default value is okay for a particular setting, there is no - need to include it in config.inc.php. You'll need a - few directives to get going, a simple configuration may look - like this: -
      -<?php
      -$cfg['blowfish_secret'] = 'ba17c1ec07d65003';  // use here a value of your choice
      -
      -$i=0;
      -$i++;
      -$cfg['Servers'][$i]['auth_type']     = 'cookie';
      -?>
      -
      - Or, if you prefer to not be prompted every time you log in: -
      -<?php
      -
      -$i=0;
      -$i++;
      -$cfg['Servers'][$i]['user']          = 'root';
      -$cfg['Servers'][$i]['password']      = 'cbb74bc'; // use here your password
      -?>
      -
      - For a full explanation of possible configuration values, see the - Configuration Section of this document.
    • -
    • Instead of manually editing - config.inc.php, you can use the - Setup Script. First you must - manually create a folder config in the phpMyAdmin - directory. This is a security measure. On a Linux/Unix system you - can use the following commands: -
      -cd phpMyAdmin
      -mkdir config                        # create directory for saving
      -chmod o+rw config                   # give it world writable permissions
      -
      - And to edit an existing configuration, copy it over first: -
      -cp config.inc.php config/           # copy current configuration for editing
      -chmod o+w config/config.inc.php     # give it world writable permissions
      -
      - On other platforms, simply create the folder and ensure that your - web server has read and write access to it. FAQ - 1.26 can help with this.

      - - Next, open scripts/setup.php - in your browser. Note that changes are not saved to - disk until explicitly choose Save from the - Configuration area of the screen. Normally the script saves - the new config.inc.php to the config/ directory, but if - the webserver does not have the proper permissions you may see the - error "Cannot load or save configuration." Ensure that the - config/ directory exists and has the proper permissions - - or use the Download link to save the config file locally - and upload (via FTP or some similar means) to the proper location.

      - - Once the file has been saved, it must be moved out of the - config/ directory and the permissions must be reset, again - as a security measure: -
      -mv config/config.inc.php .         # move file to current directory
      -chmod o-rw config.inc.php          # remove world read and write permissions
      -
      - Now the file is ready to be used. You can choose to review or edit - the file with your favorite editor, if you prefer to set some - advanced options which the setup script does not provide.
  8. -
  9. If you are using the - auth_type "config", it is suggested that you - protect the phpMyAdmin installation directory because using - config does not require a user to - enter a password to access the phpMyAdmin installation. Use of an alternate - authentication method is recommended, for example with - HTTP–AUTH in a .htaccess file or switch to using - auth_type cookie or http. See the - multi–user sub–section of this - FAQ for additional - information, especially - FAQ 4.4.
  10. -
  11. Open the main phpMyAdmin directory - in your browser. phpMyAdmin should now display a welcome screen - and your databases, or a login dialog if using - HTTP or cookie - authentication mode.
  12. -
  13. You should deny access to the ./libraries subfolder in your - webserver configuration. For Apache you can use supplied .htaccess file - in that folder, for other webservers, you should configure this yourself. - Such configuration prevents from possible path exposure and cross side - scripting vulnerabilities that might happen to be found in that code.
  14. -
- -

Linked-tables infrastructure

- -

For a whole set of new features (bookmarks, comments, - SQL-history, - PDF-generation, field contents - transformation, etc.) you need to create a set of special tables. Those - tables can be located in your own database, or in a central database for a - multi-user installation (this database would then be accessed by the - controluser, so no other user should have rights to it).

- -

Please look at your ./scripts/ directory, where you should find a - file called create_tables.sql. (If you are using a Windows server, pay - special attention to - FAQ 1.23).

- -

If your MySQL server's version is 4.1.2 or later, please use - ./scripts/create_tables_mysql_4_1_2+.sql instead, for a new - installation.

- -

If you already had this infrastructure and upgraded to MySQL 4.1.2 - or later, please use ./scripts/upgrade_tables_mysql_4_1_2+.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 - and tables, and that the script may need some tuning, depending on the - database name.

- -

After having imported the ./scripts/create_tables.sql file, you - should specify the table names in your ./config.inc.php file. The - directives used for that can be found in the Configuration - section. You will also need to have a controluser with the proper rights - to those tables (see section Using - authentication modes below).

- -

Upgrading from an older version

- -

Simply copy ./config.inc.php from your previous installation into the newly - unpacked one. Configuration files from very old versions (2.3.0 or before) may - require some tweaking as some options have been changed or removed. - For compatibility with PHP 6, remove a set_magic_quotes_runtime(0); - statement that you might find near the end of your configuration file.

- -

You should not copy libraries/config.default.php - over config.inc.php because the default configuration file - 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, - you should run the SQL script found in - scripts/upgrade_tables_mysql_4_1_2+.sql.

- -

Using authentication modes

- -
  • HTTP and cookie - authentication modes are recommended in a multi-user environment - where you want to give users access to their own database and don't want - them to play around with others.
    - Nevertheless be aware that MS Internet Explorer seems to be really buggy - about cookies, at least till version 6, and PHP 4.1.1 is also a bit buggy - in this area!
    - Even in a single-user environment, you might prefer to use - HTTP or cookie mode so - that your user/password pair are not in clear in the configuration file. -
  • - -
  • HTTP and cookie - authentication modes are more secure: the MySQL login information does - not need to be set in the phpMyAdmin configuration file (except possibly - for the controluser).
    - However, keep in mind that the password travels in plain text, unless - you are using the HTTPS protocol.
    - 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 - your MySQL server is previous to 4.1.2, or is running with - --skip-show-database.

    - - For 'HTTP' and 'cookie' - modes, phpMyAdmin needs a controluser that has only the - SELECT privilege on the `mysql`.`user` (all columns except - `Password`), `mysql`.`db` (all columns), `mysql`.`host` - (all columns) and `mysql`.`tables_priv` (all columns except - `Grantor` and `Timestamp`) tables.
    You must specify the details - for the controluser in the config.inc.php - file under the - - $cfg['Servers'][$i]['controluser'] and - - $cfg['Servers'][$i]['controlpass'] settings.
    - The following example assumes you want to use pma as the - controluser and pmapass as the controlpass, but this is - only an example: use something else in your file! Input these - statements from the phpMyAdmin SQL Query window or mysql command–line - client.
    - Of course you have to replace localhost with the webserver's host - if it's not the same as the MySQL server's one. - -
    -GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';
    -GRANT SELECT (
    -    Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
    -    Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
    -    File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
    -    Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
    -    Execute_priv, Repl_slave_priv, Repl_client_priv
    -    ) ON mysql.user TO 'pma'@'localhost';
    -GRANT SELECT ON mysql.db TO 'pma'@'localhost';
    -GRANT SELECT ON mysql.host TO 'pma'@'localhost';
    -GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
    -    ON mysql.tables_priv TO 'pma'@'localhost';
    - - If you are using an old MySQL version (below 4.0.2), please replace - the first GRANT SELECT query by this one: - -
    -GRANT SELECT (
    -    Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
    -    Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
    -    File_priv, Grant_priv, References_priv, Index_priv, Alter_priv
    -    ) ON mysql.user TO 'pma'@'localhost';
    - - ... and if you want to use the many new relation and bookmark features: - -
    -GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';
    -
    - - (this of course requires that your linked-tables - infrastructure be set up).
    - Of course, the above queries only work if your MySQL version supports - the GRANT command. This is the case since 3.22.11.
  • - -
  • 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 - privileges to an ordinary user, unless you understand the impact of those - privileges (for example, you are creating a superuser).
    - For example, to grant the user real_user with all privileges on - the database user_base:
    - -
    -GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';
    -
    - - What the user may now do is controlled entirely by the MySQL user - management system.
    - With HTTP or cookie - authentication mode, you don't need to fill the user/password fields - inside the $cfg['Servers'] - array.
  • -
- -

'HTTP' authentication mode

- -
  • Uses HTTP Basic authentication - method and allows you to log in as any valid MySQL user.
  • -
  • Is supported with most PHP configurations. For - IIS - (ISAPI) - support using CGI PHP see - FAQ - 1.32, for using with Apache - CGI see - FAQ - 1.35.
  • -
  • See also - FAQ 4.4 about not - using the .htaccess mechanism along with - 'HTTP' authentication - mode.
  • -
- -

'cookie' authentication mode

- -
  • You can use this method as a replacement for the - HTTP authentication - (for example, if you're running - IIS).
  • -
  • Obviously, the user must enable cookies in the browser, but this is - now a requirement for all authentication modes.
  • -
  • With this mode, the user can truly log out of phpMyAdmin and log in back - with the same username.
  • -
  • If you want to log in to arbitrary server see - - $cfg['AllowArbitraryServer'] directive.
  • -
  • As mentioned in the requirements section, having - the mcrypt extension will speed up access considerably, but is - not required.
  • -
- -

'signon' authentication mode

- -
  • This mode is a convenient way of using credentials from another - application to authenticate to phpMyAdmin.
  • -
  • The other application has to store login information into - session data.
  • -
  • More details in the auth_type - section.
  • -
-

'config' authentication mode

- -
  • This mode is the less secure one because it requires you to fill the - - $cfg['Servers'][$i]['user'] and - - $cfg['Servers'][$i]['password'] fields (and as a result, anyone who - can read your config.inc.php can discover your username and password). -
    - But you don't need to setup a "controluser" here: using the - - $cfg['Servers'][$i]['only_db'] might be enough.
  • -
  • In the - ISP - FAQ section, there - is an entry explaining how to protect your configuration file.
  • -
  • For additional security in this mode, you may wish to consider the Host - authentication - - $cfg['Servers'][$i]['AllowDeny']['order'] and - - $cfg['Servers'][$i]['AllowDeny']['rules'] configuration - directives.
  • -
  • Unlike cookie and http, does not require a user to log in when first - loading the phpMyAdmin site. This is by design but could allow any - user to access your installation. Use of some restriction method is - suggested, perhaps a .htaccess file with the - HTTP-AUTH directive or disallowing incoming HTTP requests at - one’s router or firewall will suffice (both of which - are beyond the scope of this manual but easily searchable with Google).
  • -
- - -

Configuration

- -

Warning for Mac - users: PHP does not seem to like - Mac end of lines character - ("\r"). So ensure you choose the option that allows to use - the *nix end of line character ("\n") in your text editor - before saving a script you have modified.

- -

Configuration note: - Almost all configurable data is placed in config.inc.php. If this file - does not exist, please refer to the Quick install - section to create one. This file only needs to contain the parameters you want to - change from their corresponding default value in - libraries/config.default.php.

- -

The parameters which relate to design (like colors) are placed in - themes/themename/layout.inc.php. You might also want to create - config.footer.inc.php and config.header.inc.php files to add - your site specific code to be included on start and end of each page.

- -
$cfg['PmaAbsoluteUri'] string
-
Sets here the complete URL - (with full path) to your phpMyAdmin installation's directory. - E.g. http://www.your_web.net/path_to_your_phpMyAdmin_directory/. - Note also that the URL on - some web servers are case–sensitive. - Don’t forget the trailing slash at the end.

- - Starting with version 2.3.0, it is advisable to try leaving this - blank. In most cases phpMyAdmin automatically detects the proper - setting. Users of port forwarding will need to set PmaAbsoluteUri (more info). - A good test is to browse a table, edit a row and save it. There should - be an error message if phpMyAdmin is having trouble auto–detecting - the correct value. If you get an error that this must be set or if - the autodetect code fails to detect your path, please post a bug - report on our bug tracker so we can improve the code.
- -
$cfg['PmaNoRelation_DisableWarning'] boolean
-
Starting with version 2.3.0 phpMyAdmin offers a lot of features to work - with master / foreign – tables (see - $cfg['Servers'][$i]['pmadb']). -
- If you tried to set this up and it does not work for you, have a look on - the "Structure" page of one database where you would like to - use it. You will find a link that will analyze why those features have - been disabled.
- If you do not want to use those features set this variable to - TRUE to stop this message from appearing.
- -
$cfg['SuhosinDisableWarning'] boolean
-
A warning is displayed on the main page if Suhosin is detected. - You can set this parameter to TRUE to stop this message - from appearing.
- -
$cfg['AllowThirdPartyFraming'] boolean
-
Setting this to true allows a page located on a different - domain to call phpMyAdmin inside a frame, and is a potential security - hole allowing cross-frame scripting attacks.
- -
$cfg['blowfish_secret'] string
-
The "cookie" auth_type uses blowfish - algorithm to encrypt the password.
- If you are using the "cookie" auth_type, enter here a random - passphrase of your choice. It will be used internally by the blowfish - algorithm: you won’t be prompted for this passphrase. The maximum - number of characters for this parameter seems to be 46.
- -
$cfg['Servers'] array
-
Since version 1.4.2, phpMyAdmin supports the administration of multiple - MySQL servers. Therefore, a - $cfg['Servers']-array has - been added which contains the login information for the different servers. - The first - $cfg['Servers'][$i]['host'] - contains the hostname of the first server, the second - $cfg['Servers'][$i]['host'] - the hostname of the second server, etc. In - ./libraries/config.default.php, there is only one section for - server definition, however you can put as many as you need in - ./config.inc.php, copy that block or needed parts (you don't - have to define all settings, just those you need to change).
- -
$cfg['Servers'][$i]['host'] string
-
The hostname or IP address of your - $i-th MySQL-server. E.g. localhost.
- -
$cfg['Servers'][$i]['port'] string
-
The port-number of your $i-th MySQL-server. Default is 3306 (leave - blank). If you use "localhost" as the hostname, MySQL - ignores this port number and connects with the socket, so if you want - to connect to a port different from the default port, use - "127.0.0.1" or the real hostname in - $cfg['Servers'][$i]['host']. -
- -
$cfg['Servers'][$i]['socket'] string
-
The path to the socket to use. Leave blank for default.
- To determine the correct socket, check your MySQL configuration or, using the - mysql command–line client, issue the status command. - Among the resulting information displayed will be the socket used.
- -
$cfg['Servers'][$i]['ssl'] boolean
-
Whether to enable SSL for connection to MySQL server. -
- -
$cfg['Servers'][$i]['connect_type'] string
-
What type connection to use with the MySQL server. Your options are - 'socket' and 'tcp'. It defaults to 'tcp' as that - is nearly guaranteed to be available on all MySQL servers, while - sockets are not supported on some platforms.

- - To use the socket mode, your MySQL server must be on the same machine - as the Web server.
- -
$cfg['Servers'][$i]['extension'] string
-
What php MySQL extension to use for the connection. Valid options are: -

- - mysql : - The classic MySQL extension. This is the recommended and default - method at this time.

- - mysqli : - The improved MySQL extension. This extension became available - with php 5.0.0 and is the recommended way to connect to a server - running MySQL 4.1.x.
- -
$cfg['Servers'][$i]['compress'] boolean
-
Whether to use a compressed protocol for the MySQL server connection - or not (experimental).
- This feature requires PHP >= 4.3.0.
- -
- $cfg['Servers'][$i]['controluser'] string
- $cfg['Servers'][$i]['controlpass'] string -
-
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 - --skip-show-database, to enable a multi-user installation - (HTTP or cookie - authentication mode).

- - When using HTTP or - cookie authentication modes (or 'config' - authentication mode since phpMyAdmin 2.2.1), you need to supply the - details of a MySQL account that has SELECT privilege on the - mysql.user (all columns except "Password"), - mysql.db (all columns) and mysql.tables_priv (all columns - except "Grantor" and "Timestamp") tables. - This account is used to check what databases the user will see at - login.
- Please see the install section on - "Using authentication modes" for more information.

- - In phpMyAdmin versions before 2.2.5, those were called - "stduser/stdpass".
- -
$cfg['Servers'][$i]['auth_type'] string - ['HTTP'|'http'|'cookie'|'config'|'signon']
-
Whether config or cookie or - HTTP or signon authentication - should be used for this server. -
  • 'config' authentication ($auth_type = 'config') - is the plain old way: username and password are stored in - config.inc.php.
  • -
  • 'cookie' authentication mode - ($auth_type = 'cookie') as introduced in - 2.2.3 allows you to log in as any valid MySQL user with the - help of cookies. Username and password are stored in - cookies during the session and password is deleted when it - ends. This can also allow you to log in in arbitrary server if - $cfg['AllowArbitraryServer'] enabled. -
  • -
  • 'HTTP' authentication (was called 'advanced' in previous versions and can be written also as 'http') - ($auth_type = 'HTTP') as introduced in 1.3.0 - allows you to log in as any valid MySQL user via HTTP-Auth.
  • -
  • 'signon' authentication mode - ($auth_type = 'signon') - as introduced in 2.10.0 allows you to log in from prepared PHP - session data. This is useful for implementing single signon - from another application. Sample way how to seed session is in - signon example: scripts/signon.php. You need to - configure session name and signon - URL to use this authentication method.
  • -
- - Please see the install section on "Using authentication modes" - for more information. -
-
- $cfg['Servers'][$i]['user'] string
- $cfg['Servers'][$i]['password'] string -
-
- When using auth_type = 'config', this is the user/password-pair - which phpMyAdmin will use to connect to the - MySQL server. This user/password pair is not needed when HTTP or - cookie authentication is used and should be empty.
-
- $cfg['Servers'][$i]['nopassword'] boolean -
-
- Allow attempt to log in without password when a login with password - fails. This can be used together with http authentication, when - authentication is done some other way and phpMyAdmin gets user name - from auth and uses empty password for connecting to MySQL. Password - login is still tried first, but as fallback, no password method is - tried.
-
- $cfg['Servers'][$i]['only_db'] string or array -
-
- If set to a (an array of) database name(s), only this (these) database(s) - will be shown to the user. Since phpMyAdmin 2.2.1, this/these - database(s) name(s) may contain MySQL wildcards characters - ("_" and "%"): if you want to use literal instances - of these characters, escape them (I.E. use 'my\_db' and not - 'my_db').
- This setting is an efficient way to lower the server load since the - latter does not need to send MySQL requests to build the available - database list. But it does not replace the - privileges rules of the MySQL database server. If set, it just - means only these databases will be displayed but - not that all other databases can't be used. -

- - An example of using more that one database: - $cfg['Servers'][$i]['only_db'] = array('db1', 'db2'); -

- - As of phpMyAdmin 2.5.5 the order inside the array is used for sorting the - databases in the left frame, so that you can individually arrange your databases.
- If you want to have certain databases at the top, but don't care about the others, you do not - need to specify all other databases. Use: - $cfg['Servers'][$i]['only_db'] = array('db3', 'db4', '*'); - instead to tell phpMyAdmin that it should display db3 and db4 on top, and the rest in alphabetic - order.
- -
$cfg['Servers'][$i]['hide_db'] string -
-
Regular expression for hiding some databases. This only hides them - from listing, but a user is still able to access them (using, for example, - the SQL query area). To limit access, use the MySQL privilege system. -

- For example, to hide all databases starting with the letter "a", use
-
$cfg['Servers'][$i]['hide_db'] = '^a';
- and to hide both "db1" and "db2" use
-
$cfg['Servers'][$i]['hide_db'] = '(db1|db2)';
- More information on regular expressions can be found in the - - PCRE pattern syntax portion of the PHP reference manual. -
- -
$cfg['Servers'][$i]['verbose'] string
-
Only useful when using phpMyAdmin with multiple server entries. If set, - this string will be displayed instead of the hostname in the pull-down - menu on the main page. This can be useful if you want to show only - certain databases on your system, for example. For HTTP auth, all - non-US-ASCII characters will be stripped.
- -
- $cfg['Servers'][$i]['pmadb'] string -
-
The name of the database containing the linked-tables infrastructure. -

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

- - If you are the only user of this phpMyAdmin installation, you can - use your current database to store those special tables; in this - 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.
- -
- $cfg['Servers'][$i]['bookmarktable'] string -
-
Since release 2.2.0 phpMyAdmin allows users to bookmark queries. This can be - useful for queries you often run.

- - To allow the usage of this functionality: -
  • set up pmadb and the linked-tables infrastructure
  • -
  • enter the table name in - $cfg['Servers'][$i]['bookmarktable']
  • -
-
- -
- $cfg['Servers'][$i]['relation'] string -
-
Since release 2.2.4 you can describe, in a special 'relation' table, - which field is a key in another table (a foreign key). phpMyAdmin - currently uses this to -
  • make clickable, when you browse the master table, the data values - that point to the foreign table;
  • -
  • display in an optional tool-tip the "display field" - when browsing the master table, if you move the mouse to a column - containing a foreign key (use also the 'table_info' table);
    - (see - FAQ 6.7)
  • -
  • in edit/insert mode, display a drop-down list of possible foreign - keys (key value and "display field" are shown)
    - (see - FAQ 6.21)
  • -
  • display links on the table properties page, to check referential - integrity (display missing foreign keys) for each described key; -
  • -
  • in query-by-example, create automatic joins (see - FAQ 6.6)
  • -
  • enable you to get a PDF - schema of your database (also uses the table_coords table).
  • -
- - The keys can be numeric or character.

- - To allow the usage of this functionality: - -
  • set up pmadb and the linked-tables - infrastructure
  • -
  • put the relation table name in - $cfg['Servers'][$i]['relation']
  • -
  • now as normal user open phpMyAdmin and for each one of your - tables where you want to use this feature, click - "Structure/Relation view/" and choose foreign fields. -
  • -
- - Please note that in the current version, master_db - must be the same as foreign_db. Those fields have been put in - future development of the cross-db relations. -
- -
- $cfg['Servers'][$i]['table_info'] string -
-
- Since release 2.3.0 you can describe, in a special 'table_info' - table, which field is to be displayed as a tool-tip when moving the - cursor over the corresponding key.
- This configuration variable will hold the name of this special - table. To allow the usage of this functionality: -
  • set up pmadb and the linked-tables infrastructure
  • -
  • put the table name in - $cfg['Servers'][$i]['table_info']
  • -
  • then for each table where you want to use this feature, - click "Structure/Relation view/Choose field to display" - to choose the field.
  • -
- Usage tip: Display field. -
-
- $cfg['Servers'][$i]['table_coords'] string
- $cfg['Servers'][$i]['pdf_pages'] string -
-
Since release 2.3.0 you can have phpMyAdmin create - PDF pages showing - the relations between your tables. To do this it needs two tables - "pdf_pages" (storing information about the available - PDF - pages) and "table_coords" (storing coordinates where each - table will be placed on a PDF - schema output).

- - You must be using the "relation" feature.

- - To allow the usage of this functionality: - -
  • set up pmadb and the linked-tables - infrastructure
  • -
  • put the correct table names in - $cfg['Servers'][$i]['table_coords'] and - $cfg['Servers'][$i]['pdf_pages']
  • -
- - Usage tips: PDF output. -
- -
- $cfg['Servers'][$i]['column_info'] string -
-
- Since release 2.3.0 you can store comments to describe each column for - each table. These will then be shown on the "printview". -

- - Starting with release 2.5.0, comments are consequently used on the table - property pages and table browse view, showing up as tool-tips above the - column name (properties page) or embedded within the header of table in - browse view. They can also be shown in a table dump. Please see the - relevant configuration directives later on.

- - Also new in release 2.5.0 is a MIME-transformation system which is also - based on the following table structure. See - Transformations for further information. To use the - MIME-transformation system, your column_info table has to have the three - new fields 'mimetype', 'transformation', 'transformation_options'. -

- - To allow the usage of this functionality: -
  • set up pmadb and the linked-tables - infrastructure
  • -
  • put the table name in - $cfg['Servers'][$i]['column_info']
  • -
  • to update your PRE-2.5.0 Column_comments Table use this: - -
    -ALTER TABLE `pma_column_comments`
    -    ADD `mimetype` VARCHAR( 255 ) NOT NULL,
    -    ADD `transformation` VARCHAR( 255 ) NOT NULL,
    -    ADD `transformation_options` VARCHAR( 255 ) NOT NULL;
    -
    - - and remember that the Variable in config.inc.php has been - renamed from
    - $cfg['Servers'][$i]['column_comments'] to - $cfg['Servers'][$i]['column_info']
  • -
-
- -
- $cfg['Servers'][$i]['history'] string -
-
Since release 2.5.0 you can store your - SQL history, which means - all queries you entered manually into the phpMyAdmin interface. If you - don't want to use a table-based history, you can use the JavaScript-based - history. Using that, all your history items are deleted when closing the - window.

- - Using - $cfg['QueryHistoryMax'] - you can specify an amount of history items you want to have on hold. On - every login, this list gets cut to the maximum amount.

- - The query history is only available if JavaScript is enabled in your - browser.

- - To allow the usage of this functionality: - -
  • set up pmadb and the linked-tables - infrastructure
  • -
  • put the table name in $cfg['Servers'][$i]['history'] -
  • -
-
- -
- $cfg['Servers'][$i]['designer_coords'] string -
-
Since release 2.10.0 a Designer interface is available; it permits - to visually manage the relations. -

- - To allow the usage of this functionality: - -
  • set up pmadb and the linked-tables - infrastructure
  • -
  • put the table name in $cfg['Servers'][$i]['designer_coords'] -
  • -
-
- -
$cfg['Servers'][$i]['verbose_check'] boolean -
-
Because release 2.5.0 introduced the new MIME-transformation support, the - column_info table got enhanced with three new fields. If the above variable - is set to TRUE (default) phpMyAdmin will check if you have the - latest table structure available. If not, it will emit a warning to the - superuser.

- - You can disable this checking behavior by setting the variable to false, - which should offer a performance increase.

- - Recommended to set to FALSE, when you are sure, your table structure is - up to date.
-
$cfg['Servers'][$i]['AllowRoot'] - boolean
-
Whether to allow root access. This is just simplification of rules below. -
-
- $cfg['Servers'][$i]['AllowDeny']['order'] string -
-
If your rule order is empty, then IP - authentication is disabled.

- - If your rule order is set to 'deny,allow' then the system applies - all deny rules followed by allow rules. Access is allowed by default. Any - client which does not match a Deny command or does match an Allow command - will be allowed access to the server.

- - If your rule order is set to 'allow,deny' then the system - applies all allow rules followed by deny rules. Access is denied by - default. Any client which does not match an Allow directive or does - match a Deny directive will be denied access to the server.

- - If your rule order is set to 'explicit', the authentication is - performed in a similar fashion to rule order 'deny,allow', with the - added restriction that your host/username combination must be - listed in the allow rules, and not listed in the deny - rules. This is the most secure means of using Allow/Deny rules, - and was available in Apache by specifying allow and deny rules without - setting any order.

- - Please also see $cfg['TrustedProxies'] for detecting IP - address behind proxies. -
-
- $cfg['Servers'][$i]['AllowDeny']['rules'] array of strings -
-
The general format for the rules is as such: - -
-<'allow' | 'deny'> <username> [from] <ipmask>
-
- - If you wish to match all users, it is possible to use a '%' as - a wildcard in the username field.
- There are a few shortcuts you can use in the ipmask field as - well (please note that those containing SERVER_ADDRESS might not be - available on all webservers): -
-'all' -> 0.0.0.0/0
-'localhost' -> 127.0.0.1/8
-'localnetA' -> SERVER_ADDRESS/8
-'localnetB' -> SERVER_ADDRESS/16
-'localnetC' -> SERVER_ADDRESS/24
-
- - Having an empty rule list is equivalent to either using - 'allow % from all' if your rule order is set to - 'deny,allow' or 'deny % from all' if your rule order - is set to 'allow,deny' or 'explicit'.

- - For the IP matching system, the - following work:
- xxx.xxx.xxx.xxx (an exact IP address)
- xxx.xxx.xxx.[yyy-zzz] (an IP address range)
- xxx.xxx.xxx.xxx/nn (CIDR, Classless Inter-Domain Routing type IP addresses)
- But the following does not work:
- xxx.xxx.xxx.xx[yyy-zzz] (partial - IP address range) -
-
$cfg['Servers'][$i]['SignonSession'] string
-
Name of session which will be used for signon authentication method. -
-
$cfg['Servers'][$i]['SignonURL'] string
-
URL where user will be redirected to log in for signon authentication method. Should be absolute including protocol. -
-
$cfg['Servers'][$i]['LogoutURL'] string
-
URL where user will be redirected after logout (doesn't affect config authentication method). Should be absolute including protocol. -
- -
$cfg['ServerDefault'] integer
-
If you have more than one server configured, you can set - $cfg['ServerDefault'] to any one of them to autoconnect to - that server when phpMyAdmin is started, or set it to 0 to be given a - list of servers without logging in.
- If you have only one server configured, $cfg['ServerDefault'] - MUST be set to that server.
- -
$cfg['MaxDbList'] integer
-
The maximum number of database names to be displayed in the - navigation frame and the database list.
- -
$cfg['MaxTableList'] integer
-
The maximum number of table names to be displayed in the - main panel's list (except on the Export page). This limit is also enforced in the navigation panel - when in Light mode.
- -
$cfg['MaxCharactersInDisplayedSQL'] integer
-
The maximum number of characters when a SQL query is displayed. The - default limit of 1000 should be correct to avoid the display of tons - of hexadecimal codes that represent BLOBs, but some users have real - SQL queries that are longer than 1000 characters. Also, if a query's - length exceeds this limit, this query is not saved in the history.
- -
$cfg['OBGzip'] string/boolean
-
Defines whether to use GZip output buffering for increased - speed in HTTP transfers.
- Set to true/false for enabling/disabling. When set to 'auto' (string), - phpMyAdmin tries to enable output buffering and will automatically disable - it if your browser has some problems with buffering. IE6 with a certain patch - is known to cause data corruption when having enabled buffering.
- -
$cfg['PersistentConnections'] boolean
-
Whether persistent connections should be used or not (mysql_connect or - mysql_pconnect).
- -
$cfg['ForceSSL'] boolean
-
Whether to force using https while accessing phpMyAdmin.
- -
$cfg['ExecTimeLimit'] integer [number of seconds]
-
Set the number of seconds a script is allowed to run. If seconds is set - to zero, no time limit is imposed.
- This setting is used while importing/exporting dump files but has no - effect when PHP is running in safe mode.
- -
$cfg['MemoryLimit'] integer [number of bytes]
-
Set the number of bytes a script is allowed to allocate. If number set - to zero, no limit is imposed.
- This setting is used while importing/exporting dump files but has no - effect when PHP is running in safe mode.
- You can also use any string as in php.ini, eg. '16M'.
- -
$cfg['SkipLockedTables'] boolean
-
Mark used tables and make it possible to show databases with locked - tables (since MySQL 3.23.30).
- -
$cfg['ShowSQL'] boolean
-
Defines whether SQL queries - generated by phpMyAdmin should be displayed or not.
- -
$cfg['AllowUserDropDatabase'] boolean
-
Defines whether normal users (non-administrator) are allowed to - delete their own database or not. If set as FALSE, the link "Drop - Database" will not be shown, and even a "DROP DATABASE - mydatabase" will be rejected. Quite practical for - ISP's with many - customers.
- Please note that this limitation of SQL queries is not as strict as - when using MySQL privileges. This is due to nature of SQL queries - which might be quite complicated. So this choice should be viewed as - help to avoid accidental dropping rather than strict privilege - limitation.
- -
$cfg['Confirm'] boolean
-
Whether a warning ("Are your really sure...") should be - displayed when you're about to lose data.
- -
$cfg['LoginCookieRecall'] boolean
-
Define whether the previous login should be recalled or not in cookie - authentication mode.
- -
$cfg['LoginCookieValidity'] integer [number of seconds]
-
Define how long is login cookie valid.
- -
$cfg['LoginCookieStore'] integer [number of seconds]
-
Define how long is login cookie should be stored in browser. Default 0 - means that it will be kept for existing session. This is recommended - for not trusted environments.
- -
$cfg['LoginCookieDeleteAll'] boolean
-
If enabled (default), logout deletes cookies for all servers, - otherwise only for current one. Setting this to false makes it easy to - forget to log out from other server, when you are using more of - them.
- -
$cfg['UseDbSearch'] boolean
-
Define whether the "search string inside database" is enabled or not.
- -
$cfg['IgnoreMultiSubmitErrors'] boolean
-
Define whether phpMyAdmin will continue executing a multi-query - statement if one of the queries fails. Default is to abort execution.
- -
$cfg['VerboseMultiSubmit'] boolean
-
Define whether phpMyAdmin will output the results of each query of a - multi-query statement embedded into the - SQL output as inline - comments. Defaults to TRUE.
-
- $cfg['AllowArbitraryServer'] boolean
-
If enabled allows you to log in to arbitrary servers using cookie auth. -

- - NOTE: Please use this carefully, as this may allow users access to - MySQL servers behind the firewall where your - HTTP server is placed. -
- -
$cfg['LeftFrameLight'] boolean
-
Defines whether to use a select-based menu and display only the current - tables in the left frame (smaller page). Only in Non-Lightmode you can - use the feature to display nested folders using - $cfg['LeftFrameTableSeparator'] -
- -
$cfg['LeftFrameDBTree'] boolean
-
In light mode, defines whether to display the names of databases (in the - selector) using a tree, see also - $cfg['LeftFrameDBSeparator']. -
- -
$cfg['LeftFrameDBSeparator'] string
-
The string used to separate the parts of the database name when showing - them in a tree.
- -
$cfg['LeftFrameTableSeparator'] string
-
Defines a string to be used to nest table spaces. Defaults to '__'. - This means if you have tables like 'first__second__third' this will be - shown as a three-level hierarchy like: first > second > third. - If set to FALSE or empty, the feature is disabled. NOTE: You should - not use this separator at the beginning or end of a - table name or multiple times after another without any other - characters in between.
- -
$cfg['LeftFrameTableLevel'] string
-
Defines how many sublevels should be displayed when splitting - up tables by the above separator.
- -
$cfg['ShowTooltip'] boolean
-
Defines whether to display table comment as tool-tip in left frame or - not.
- -
$cfg['ShowTooltipAliasDB'] boolean
-
If tool-tips are enabled and a DB comment is set, this will flip the - comment and the real name. That means that if you have a table called - 'user0001' and add the comment 'MyName' on it, you will see the name - 'MyName' used consequently in the left frame and the tool-tip shows - the real name of the DB.
- -
$cfg['ShowTooltipAliasTB'] boolean/string
-
Same as $cfg['ShowTooltipAliasDB'], except this works for table names. - - When setting this to 'nested', the Alias of the Tablename is only used - to split/nest the tables according to the - $cfg['LeftFrameTableSeparator'] - directive. So only the folder is called like the Alias, the tablename itself - stays the real tablename.
- - -
Defines whether or not to display the phpMyAdmin logo at the top of the left frame. - Defaults to TRUE.
- -
Enter URL where logo in the navigation frame will point to. - For use especially with self made theme which changes this. - The default value for this is main.php.
- -
$cfg['LeftLogoLinkWindow'] string
-
Whether to open the linked page in the main window (main) - or in a new one (new). Note: use new if you are - linking to phpmyadmin.net.
- -
$cfg['LeftDisplayServers'] boolean
-
Defines whether or not to display a server choice at the top of the left frame. - Defaults to FALSE.
-
$cfg['DisplayServersList'] boolean
-
Defines whether to display this server choice as links instead of in a drop-down. - Defaults to FALSE (drop-down).
-
$cfg['DisplayDatabasesList'] boolean or text
-
Defines whether to display database choice in light navigation frame as links - instead of in a drop-down. Defaults to 'auto' - on main page list is - shown, when database is selected, only drop down is displayed.
-
$cfg['ShowStats'] boolean
-
Defines whether or not to display space usage and statistics about databases - and tables.
- Note that statistics requires at least MySQL 3.23.3 and that, at this - date, MySQL doesn't return such information for Berkeley DB tables.
- -
$cfg['ShowServerInfo'] boolean
-
Defines whether to display detailed server information on main page. - You can additionally hide more information by using - $cfg['Servers'][$i]['verbose']. -
- -
$cfg['ShowPhpInfo'] boolean
- $cfg['ShowChgPassword'] boolean
- $cfg['ShowCreateDb'] boolean -
-
Defines whether to display the "PHP information" and - "Change password " links and form for creating database or - not at the starting main (right) frame. This setting - does not check MySQL commands entered directly.

- - Please note that to block the usage of phpinfo() in scripts, you - have to put this in your php.ini: - -
disable_functions = phpinfo()
- - Also note that enabling the "Change password " link has no - effect with "config" authentication mode: because of the - hard coded password value in the configuration file, end users can't - be allowed to change their passwords.
- -
$cfg['SuggestDBName'] boolean
-
Defines whether to suggest a database name on the - "Create Database" form or to keep the textfield empty.
- -
$cfg['ShowBlob'] boolean
-
Defines whether or not BLOB fields are shown when browsing a table's - content.
- -
$cfg['NavigationBarIconic'] string
-
Defines whether navigation bar buttons and the right panel top menu - contain text or symbols only. A value of TRUE displays icons, FALSE - displays text and 'both' displays both icons and text.
- -
$cfg['ShowAll'] boolean
-
Defines whether a user should be displayed a - "show all (records)" button in browse mode or not.
- -
$cfg['MaxRows'] integer
-
Number of rows displayed when browsing a result set. If the result set - contains more rows, "Previous" and "Next" links will be shown.
- -
$cfg['Order'] string [DESC|ASC|SMART]
-
Defines whether fields are displayed in ascending (ASC) order, - in descending (DESC) order or in a "smart" - (SMART) order - I.E. descending order for fields of type TIME, - DATE, DATETIME and TIMESTAMP, ascending order else- by default.
- -
$cfg['ProtectBinary'] boolean or string
-
Defines whether BLOB or BINARY fields are protected - from editing when browsing a table's content. Valid values are: -
  • FALSE to allow editing of all fields;
  • -
  • 'blob' to allow editing of all fields except BLOBS;
  • -
  • 'all' to disallow editing of all BINARY or - BLOB fields.
  • -
-
- -
$cfg['ShowFunctionFields'] boolean
-
Defines whether or not MySQL functions fields should be initially - displayed in edit/insert mode. Since version 2.10, the user can - toggle this setting from the interface. -
- -
$cfg['CharEditing'] string
-
Defines which type of editing controls should be used for CHAR and - VARCHAR fields. Possible values are: -
  • input - this allows to limit size of text to size of field in - MySQL, but has problems with newlines in fields
  • -
  • textarea - no problems with newlines in fields, but also no - length limitations
  • -
- Default is old behavior so input.
- -
$cfg['InsertRows'] integer
-
Defines the maximum number of concurrent entries for the Insert page.
- -
$cfg['ForeignKeyMaxLimit'] integer
-
If there are fewer items than this in the set of foreign keys, then a - drop-down box of foreign keys is presented, in the style described by the - $cfg['ForeignKeyDropdownOrder'] - setting.
- -
$cfg['ForeignKeyDropdownOrder'] array
-
For the foreign key drop-down fields, there are several methods of - display, offering both the key and value data. The contents of the - array should be one or both of the following strings: - 'content-id', 'id-content'.
- -
$cfg['ZipDump'] boolean
- $cfg['GZipDump'] boolean
- $cfg['BZipDump'] boolean -
-
Defines whether to allow the use of zip/GZip/BZip2 compression when - creating a dump file
- -
$cfg['CompressOnFly'] boolean
-
-
Defines whether to allow on the fly compression for GZip/BZip2 - compressed exports. This doesn't affect smaller dumps and allows users to - create larger dumps that won't otherwise fit in memory due to php - memory limit. Produced files contain more GZip/BZip2 headers, but all - normal programs handle this correctly.
- -
$cfg['LightTabs'] boolean
-
If set to TRUE, use less graphically intense tabs on the top of the - mainframe.
- -
$cfg['PropertiesIconic'] string
-
If set to TRUE, will display icons instead of text for db and table - properties links (like 'Browse', 'Select', 'Insert', ...).
Can be - set to 'both' if you want icons AND text.
- When set to FALSE, will only show text.
- -
$cfg['PropertiesNumColumns'] integer
-
How many columns will be utilized to display the tables on the - database property view? Default is 1 column. When setting this to a - value larger than 1, the type of the database will be omitted for more - display space.
- - -
$cfg['DefaultTabServer'] string
-
Defines the tab displayed by default on server view. Possible - values: "main.php" (recommended for multi-user setups), - "server_databases.php", "server_status.php", - "server_variables.php", "server_privileges.php" - or "server_processlist.php".
- -
$cfg['DefaultTabDatabase'] string
-
Defines the tab displayed by default on database view. Possible - values: "db_structure.php", - "db_sql.php" or "db_search.php".
- -
$cfg['DefaultTabTable'] string
-
Defines the tab displayed by default on table view. Possible - values: "tbl_structure.php", - "tbl_sql.php", "tbl_select.php", - "tbl_change.php" or "sql.php".
- -
$cfg['MySQLManualBase'] string
-
If set to an URL which - points to the MySQL documentation (type depends - on $cfg['MySQLManualType']), appropriate help links are - generated.
- See MySQL Documentation page - for more information about MySQL manuals and their types.
- -
$cfg['MySQLManualType'] string
-
Type of MySQL documentation: -
  • viewable - "viewable online", current one used on MySQL website
  • -
  • searchable - "Searchable, with user comments"
  • -
  • chapters - "HTML, one page per chapter"
  • -
  • big - "HTML, all on one page"
  • -
  • none - do not show documentation links
  • -
-
- -
$cfg['DefaultLang'] string
-
Defines the default language to use, if not browser-defined or - user-defined.
- See the select_lang.lib.php script to know the valid values for - this setting.
- -
$cfg['DefaultConnectionCollation'] string
-
Defines the default connection collation to use, if not - user-defined.
- See the MySQL - documentation for list of possible values.
- -
$cfg['Lang'] string
-
Force: always use this language (must be defined in the - select_lang.lib.php script).
- -
$cfg['FilterLanguages'] string
-
Limit list of available languages to those matching the given regular - expression. For example if you want only Czech and English, you should - set filter to '^(cs|en)'.
- -
$cfg['DefaultCharset'] string
-
Default character set to use for recoding of MySQL queries. This must be - enabled and it's described by - $cfg['AllowAnywhereRecoding'] - option.
- You can give here any character set which is in - $cfg['AvailableCharsets'] - array and this is just default choice, user can select any of them.
- -
$cfg['AllowAnywhereRecoding'] boolean
-
Allow character set recoding of MySQL queries. You need recode or iconv - support (compiled in or module) in PHP to allow MySQL queries recoding - and used language file must have it enabled (by default only these - which are in Unicode, just to avoid losing some characters).

- - Setting this to TRUE also activates a pull-down menu - in the Export page, to choose the character set when exporting a file. -
- -
$cfg['RecodingEngine'] string
-
You can select here which functions will be used for character set - conversion. Possible values are: -
  • auto - automatically use available one (first is tested - iconv, then recode)
  • -
  • iconv - use iconv or libiconv functions
  • -
  • recode - use recode_string function
  • -
- Default is auto.
- -
$cfg['IconvExtraParams'] string
-
Specify some parameters for iconv used in charset conversion. See - iconv - documentation for details. By default //TRANSLIT is - used, so that invalid characters will be transliterated.
- -
$cfg['AvailableCharsets'] array
-
Available character sets for MySQL conversion. You can add your own (any of - supported by recode/iconv) or remove these which you don't use. - Character sets will be shown in same order as here listed, so if you - frequently use some of these move them to the top.
- -
$cfg['TrustedProxies'] array
-
Lists proxies and HTTP headers which are trusted for IP Allow/Deny. This list is by - default empty, you need to fill in some trusted proxy servers if you - want to use rules for IP addresses behind proxy.

- - The following example specifies that phpMyAdmin should trust a - HTTP_X_FORWARDED_FOR (X-Forwarded-For) header coming from the proxy 1.2.3.4: -
-$cfg['TrustedProxies'] =
-     array('1.2.3.4' => 'HTTP_X_FORWARDED_FOR');
-
- The $cfg['Servers'][$i]['AllowDeny']['rules'] directive uses the - client's IP address as usual. -
- -
$cfg['GD2Available'] string
-
Specifies whether GD >= 2 is available. If yes it can be used for - MIME transformations.
- Possible values are: -
  • auto - automatically detect, this is a bit expensive - operation for php < 4.3.0 so it is preferred to change this - according to your server real possibilities
  • -
  • yes - GD 2 functions can be used
  • -
  • no - GD 2 function cannot be used
  • -
- Default is auto. -
- -
$cfg['NaviWidth'] integer
-
Navi frame width in pixels. See themes/themename/layout.inc.php. -
- -
$cfg['NaviBackground'] string [valid css code for background]
- $cfg['MainBackground'] string [valid css code for background] -
-
The background styles used for both the frames. - See themes/themename/layout.inc.php.
- -
$cfg['NaviPointerBackground'] string [valid css code for background]
- $cfg['NaviPointerColor'] string [valid css color]
-
The style used for the pointer in the navi frame. - See themes/themename/layout.inc.php.
- -
$cfg['NaviDatabaseNameColor'] string [valid css code]
-
The color used for the database name in the navi frame. - See themes/themename/layout.inc.php.
- -
$cfg['LeftPointerEnable'] boolean
-
A value of TRUE activates the navi pointer (when LeftFrameLight - is FALSE).
- -
$cfg['Border'] integer
-
The size of a table's border. See themes/themename/layout.inc.php. -
- -
$cfg['ThBackground'] string [valid css code for background]
- $cfg['ThColor'] string [valid css color]
-
The style used for table headers. See - themes/themename/layout.inc.php.
- -
$cfg['BgOne'] string [HTML color]
-
The color (HTML) #1 for table rows. See themes/themename/layout.inc.php. -
- -
$cfg['BgTwo'] string [HTML color]
-
The color (HTML) #2 for table rows. See themes/themename/layout.inc.php. -
- -
$cfg['BrowsePointerBackground'] string [HTML color]
- $cfg['BrowsePointerColor'] string [HTML color]
- $cfg['BrowseMarkerBackground'] string [HTML color]
- $cfg['BrowseMarkerColor'] string [HTML color] -
-
The colors (HTML) uses for the pointer and the marker in browse mode.
- The former feature highlights the row over which your mouse is passing - and the latter lets you visually mark/unmark rows by clicking on - them.
- See themes/themename/layout.inc.php.
- - -
$cfg['FontFamily'] string
-
You put here a valid CSS font family value, for example - arial, sans-serif.
- See themes/themename/layout.inc.php.
- -
$cfg['FontFamilyFixed'] string
-
You put here a valid CSS font family value, for example - monospace. This one is used in textarea.
- See themes/themename/layout.inc.php.
- -
$cfg['BrowsePointerEnable'] boolean
-
Whether to activate the browse pointer or not.
- -
$cfg['BrowseMarkerEnable'] boolean
-
Whether to activate the browse marker or not.
- -
$cfg['TextareaCols'] integer
- $cfg['TextareaRows'] integer
- $cfg['CharTextareaCols'] integer
- $cfg['CharTextareaRows'] integer -
-
Number of columns and rows for the textareas.
- This value will be emphasized (*2) for SQL query textareas and (*1.25) for - SQL textareas inside the query window.
- The Char* values are used for CHAR and VARCHAR editing (if configured - via $cfg['CharEditing']).
- -
$cfg['LongtextDoubleTextarea'] boolean -
-
Defines whether textarea for LONGTEXT fields should have double size.
- -
$cfg['TextareaAutoSelect'] boolean -
-
Defines if the whole textarea of the query box will be selected on - click.
-
- $cfg['CtrlArrowsMoving'] boolean -
-
Enable Ctrl+Arrows (Option+Arrows in Safari) moving between fields when - editing.
- -
$cfg['LimitChars'] integer
-
Maximum number of characters showen in any non-numeric field on browse view. - Can be turned off by a toggle button on the browse page.
- -
$cfg['ModifyDeleteAtLeft'] boolean - $cfg['ModifyDeleteAtRight'] boolean -
-
Defines the place where modify and delete links would be put when - tables contents are displayed (you may have them displayed both at the - left and at the right). - "Left" and "right" are parsed as "top" - and "bottom" with vertical display mode.
- -
$cfg['DefaultDisplay'] string - $cfg['HeaderFlipType'] string -
-
There are 3 display modes: horizontal, horizontalflipped and vertical. - Define which one is displayed by default. The first mode displays each - row on a horizontal line, the second rotates the headers by 90 - degrees, so you can use descriptive headers even though fields only - contain small values and still print them out. The vertical mode sorts - each row on a vertical lineup.

- - The HeaderFlipType can be set to 'css' or 'fake'. When using 'css' - the rotation of the header for horizontalflipped is done via CSS. If - set to 'fake' PHP does the transformation for you, but of course this - does not look as good as CSS.
- -
- $cfg['DefaultPropDisplay'] - string or integer
-
When editing/creating new columns in a table all fields normally get - lined up one field a line. (default: 'horizontal'). If you set this to - 'vertical' you can have each field lined up vertically beneath each - other. You can save up a lot of place on the horizontal direction and - no longer have to scroll. If you set this to integer, editing of fewer - columns will appear in 'vertical' mode, while editing of more fields - still in 'horizontal' mode. This way you can still effectively edit - large number of fields, while having full view on few of them.
- -
$cfg['ShowBrowseComments'] boolean
- $cfg['ShowPropertyComments'] boolean -
-
By setting the corresponding variable to TRUE you can enable the - display of column comments in Browse or Property display. In browse - mode, the comments are shown inside the header. In property mode, - comments are displayed using a CSS-formatted dashed-line below the - name of the field. The comment is shown as a tool-tip for that field. -
- -
$cfg['SQLQuery']['Edit'] boolean
-
Whether to display an edit link to change a query in any SQL Query box.
- -
$cfg['SQLQuery']['Explain'] boolean
-
Whether to display a link to explain a SELECT query in any SQL Query box.
- -
$cfg['SQLQuery']['ShowAsPHP'] boolean
-
Whether to display a link to wrap a query in PHP code in any SQL Query box.
- -
$cfg['SQLQuery']['Validate'] boolean
-
Whether to display a link to validate a query in any SQL Query box. - See also $cfg_SQLValidator.
- -
$cfg['SQLQuery']['Refresh'] boolean
-
Whether to display a link to refresh a query in any SQL Query box.
- -
$cfg['UploadDir'] string
-
- The name of the directory where - SQL files have been - uploaded by other means than phpMyAdmin (for example, ftp). Those files - are available under a drop-down box when you click the database or - table name, then the Import tab. -

- - If you want different directory for each user, %u will be replaced - with username.

- - Please note that the file names must have the suffix ".sql" - (or ".sql.bz2" or ".sql.gz" if support for - compressed formats is enabled).

- - This feature is useful when your file is too big to be uploaded via - HTTP, or when file - uploads are disabled in PHP.

- - Please note that if PHP is running in safe mode, this directory must - be owned by the same user as the owner of the phpMyAdmin scripts. -

- - See also - FAQ 1.16 for - alternatives. -
- -
$cfg['SaveDir'] string
-
- The name of the directory where dumps can be saved.

- - If you want different directory for each user, %u will be replaced - with username.

- - Please note that the directory must exist and has to be writable - for the user running the webserver.

- - Please note that if PHP is running in safe mode, this directory must - be owned by the same user as the owner of the phpMyAdmin scripts. -
- -
$cfg['TempDir'] string
-
- The name of the directory where temporary files can be stored. -

- This is needed for native MS Excel export, see - FAQ - 6.23 -
- -
$cfg['Export'] array
-
- In this array are defined default parameters for export, names of - items are similar to texts seen on export page, so you can easily - identify what they mean. -
- -
$cfg['Import'] array
-
- In this array are defined default parameters for import, names of - items are similar to texts seen on import page, so you can easily - identify what they mean. -
- -
$cfg['RepeatCells'] integer
-
- Repeat the headers every X cells, or 0 to deactivate. -
- -
$cfg['EditInWindow'] boolean
- $cfg['QueryWindowWidth'] integer
- $cfg['QueryWindowHeight'] integer
- $cfg['QueryHistoryDB'] boolean
- $cfg['QueryWindowDefTab'] string
- $cfg['QueryHistoryMax'] integer -
-
- All those variables affect the query window feature. A SQL link - or icon is always displayed on the left panel. If JavaScript is enabled in - your browser, a click on this opens a distinct query window, which is - a direct interface to enter SQL queries. Otherwise, the right panel - changes to display a query box.

- - The size of this query window can be customized with - $cfg['QueryWindowWidth'] and $cfg['QueryWindowWidth'] - - both integers for the size in pixels. Note that normally, those - parameters will be modified in layout.inc.php for the - theme you are using.

- - If $cfg['EditInWindow'] is set to true, a click on [Edit] - from the results page (in the "Showing Rows" section) - opens the query window and puts the current query - inside it. If set to false, clicking on the link puts the SQL - query in the right panel's query box. -

- The usage of the JavaScript query window is recommended if you have a - JavaScript enabled browser. Basic functions are used to exchange quite - a few variables, so most 4th generation browsers should be capable to - use that feature. It currently is only tested with Internet Explorer 6 - and Mozilla 1.x. -

- If $cfg['QueryHistoryDB'] is set to TRUE, all your Queries are logged - to a table, which has to be created by you (see $cfg['Servers'][$i]['history']). If set to FALSE, - all your queries will be appended to the form, but only as long as - your window is opened they remain saved. -

- When using the JavaScript based query window, it will always get - updated when you click on a new table/db to browse and will focus if - you click on "Edit SQL" after using a query. You can suppress updating - the query window by checking the box "Do not overwrite this query from - outside the window" below the query textarea. Then you can browse - tables/databases in the background without losing the contents of the - textarea, so this is especially useful when composing a query with - tables you first have to look in. The checkbox will get automatically - checked whenever you change the contents of the textarea. Please - uncheck the button whenever you definitely want the query window to - get updated even though you have made alterations. -

- If $cfg['QueryHistoryDB'] is set to TRUE you can specify the amount of - saved history items using $cfg['QueryHistoryMax']. -

- The query window also has a custom tabbed look to group the features. - Using the variable $cfg['QueryWindowDefTab'] you can specify the - default tab to be used when opening the query window. It can be set to - either 'sql', 'files', 'history' or 'full'.
- -
$cfg['BrowseMIME'] boolean
-
Enable MIME-transformations.
- -
$cfg['MaxExactCount'] integer
-
For InnoDB tables, determines for how large tables phpMyAdmin - should get the exact row count using SELECT COUNT. - If the approximate row count as returned by - SHOW TABLE STATUS is smaller than this value, - SELECT COUNT will be used, otherwise the approximate - count will be used. -
-
$cfg['MaxExactCountViews'] integer
-
For VIEWs, since obtaining the exact count could have an - impact on performance, this value is the maximum to be displayed, using - a SELECT COUNT ... LIMIT. The default value of 0 bypasses - any row counting. -
- -
- $cfg['WYSIWYG-PDF'] boolean
-
Utilizes a WYSIWYG editing control to easily place elements of a - PDF - page. By clicking on the button 'toggle scratchboard' on the page - where you edit x/y coordinates of those elements you can activate a - scratchboard where all your elements are placed. By clicking on an - element, you can move them around in the pre-defined area and the x/y - coordinates will get updated dynamically. Likewise, when entering a - new position directly into the input field, the new position in the - scratchboard changes after your cursor leaves the input field.
- You have to click on the 'OK'-button below the tables to save the new - positions. If you want to place a new element, first add it to the - table of elements and then you can drag the new element around.
- By changing the paper size and the orientation you can change the size - of the scratchboard as well. You can do so by just changing the - dropdown field below, and the scratchboard will resize automatically, - without interfering with the current placement of the elements.
- If ever an element gets out of range you can either enlarge the paper - size or click on the 'reset' button to place all elements below each - other.
- NOTE: You have to use a recent browser like IE6 or Mozilla to - get this control to work. The basic Drag&Drop script functionality - was kindly borrowed from www.youngpup.net and is underlying so - specific license.
- -
$cfg['NaturalOrder'] boolean
-
Sorts database and table names according to natural order (for example, - t1, t2, t10). Currently implemented in the left panel (Light mode) - and in Database view, for the table list.
- -
$cfg['TitleTable'] string
-
$cfg['TitleDatabase'] string
-
$cfg['TitleServer'] string
-
$cfg['TitleDefault'] string
-
Allows you to specify window's title bar. Following magic string can - be used to get special values: -
-
@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
-
@PHPMYADMIN@
-
phpMyAdmin with version
-
-
- -
$cfg['ErrorIconic'] boolean
-
Uses icons for warnings, errors and informations.
- -
$cfg['MainPageIconic'] boolean
-
Uses icons on main page in lists and menu tabs.
- -
$cfg['ReplaceHelpImg'] boolean
-
Shows a help button instead of the "Documentation" message. -
- -
$cfg['ThemePath'] string
-
If theme manager is active, use this as the path of the subdirectory - containing all the themes.
- -
$cfg['ThemeManager'] boolean
-
Enables user-selectable themes. See - FAQ 2.7.
- -
$cfg['ThemeDefault'] string
-
The default theme (a subdirectory under cfg['ThemePath']).
- -
$cfg['ThemePerServer'] boolean
-
Whether to allow different theme for each server.
- -
$cfg['DefaultQueryTable'] string
- $cfg['DefaultQueryDatabase'] string -
-
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 field names. Note that %t and %f are only - applicable to $cfg['DefaultQueryTable'].
- -
$cfg['SQP']['fmtType'] string [html|none]
-
- The main use of the new SQL Parser is to pretty-print SQL queries. By - default we use HTML to format the query, but you can disable this by - setting this variable to 'none'. -
- -
$cfg['SQP']['fmtInd'] float
- $cfg['SQP']['fmtIndUnit'] string [em|px|pt|ex]
-
For the pretty-printing of SQL queries, under some cases the part of a - query inside a bracket is indented. By changing - $cfg['SQP']['fmtInd'] you can change the amount of this indent. -
Related in purpose is $cfg['SQP']['fmtIndUnit'] which - specifies the units of the indent amount that you specified. This is - used via stylesheets.
- -
$cfg['SQP']['fmtColor'] array of string tuples
-
This array is used to define the colours for each type of element of - the pretty-printed SQL queries. The tuple format is
- class => [HTML colour code | empty string]
- If you specify an empty string for the color of a class, it is ignored - in creating the stylesheet. - You should not alter the class names, only the colour strings.
- Class name key: -
  • comment Applies to all comment sub-classes
  • -
  • comment_mysql Comments as "#...\n"
  • -
  • comment_ansi Comments as "-- ...\n"
  • -
  • comment_c Comments as "/*...*/"
  • -
  • digit Applies to all digit sub-classes
  • -
  • digit_hex Hexadecimal numbers
  • -
  • digit_integer Integer numbers
  • -
  • digit_float Floating point numbers
  • -
  • punct Applies to all punctuation sub-classes
  • -
  • punct_bracket_open_round Opening brackets"("
  • -
  • punct_bracket_close_round Closing brackets ")"
  • -
  • punct_listsep List item Separator ","
  • -
  • punct_qualifier Table/Column Qualifier "."
  • -
  • punct_queryend End of query marker ";"
  • -
  • alpha Applies to all alphabetic classes
  • -
  • alpha_columnType Identifiers matching a column type
  • -
  • alpha_columnAttrib Identifiers matching a database/table/column attribute
  • -
  • alpha_functionName Identifiers matching a MySQL function name
  • -
  • alpha_reservedWord Identifiers matching any other reserved word
  • -
  • alpha_variable Identifiers matching a SQL variable "@foo"
  • -
  • alpha_identifier All other identifiers
  • -
  • quote Applies to all quotation mark classes
  • -
  • quote_double Double quotes "
  • -
  • quote_single Single quotes '
  • -
  • quote_backtick Backtick quotes `
  • -
-
- -
$cfg['SQLValidator'] boolean
-
$cfg['SQLValidator']['use'] boolean
-
phpMyAdmin now supports use of the Mimer SQL Validator service, - as originally published on - Slashdot. -
- For help in setting up your system to use the service, see the - FAQ 6.14. -
- -
$cfg['SQLValidator']['username'] string
- $cfg['SQLValidator']['password'] string
-
The SOAP service allows you to log in with anonymous - and any password, so we use those by default. Instead, if - you have an account with them, you can put your login details - here, and it will be used in place of the anonymous login.
-
-
- -
$cfg['DBG']
-
DEVELOPERS ONLY!
- -
$cfg['DBG']['enable'] boolean
-
DEVELOPERS ONLY!
- Enable the DBG extension for debugging phpMyAdmin. Required for profiling - the code.
- For help in setting up your system to this, see the - Developers section.
- -
$cfg['DBG']['profile']['enable'] boolean
-
DEVELOPERS ONLY!
- Enable profiling support for phpMyAdmin. This will append a chunk of data - to the end of every page displayed in the main window with profiling - statistics for that page.
- You may need to increase the maximum execution time for this to - complete successfully.Profiling was removed from the code for - version 2.9.0 due to licensing issues.
- -
$cfg['DBG']['profile']['threshold'] float (units in milliseconds)
-
DEVELOPERS ONLY!
- When profiling data is displayed, this variable controls the threshold of - display for any profiling data, based on the average time each time has - taken. If it is over the threshold it is displayed, otherwise it is not - displayed. This takes a value in milliseconds. In most cases you don't need - to edit this.
- -
$cfg['ColumnTypes'] array
-
All possible types of a MySQL column. In most cases you don't need to - edit this.
- -
$cfg['AttributeTypes'] array
-
Possible attributes for fields. In most cases you don't need to edit - this.
- -
$cfg['Functions'] array
-
A list of functions MySQL supports. In most cases you don't need to - edit this.
- -
$cfg['RestrictColumnTypes'] array
-
Mapping of column types to meta types used for preferring displayed - functions. In most cases you don't need to edit this.
- -
$cfg['RestrictFunctions'] array
-
Functions preferred for column meta types as defined in - $cfg['RestrictColumnTypes']. In most cases you don't need - to edit this.
- -
$cfg['DefaultFunctions'] array
-
Functions selected by default when inserting/changing row, Functions - are defined for meta types from - $cfg['RestrictColumnTypes'] and for - first_timestamp, which is used for first timestamp column - in table.
- -
$cfg['NumOperators'] array
-
Operators available for search operations on numeric and date fields. -
- -
$cfg['TextOperators'] array
-
Operators available for search operations on character fields. - Note that we put LIKE by default instead of - LIKE %...%, to avoid unintended performance problems - in case of huge tables.
- -
$cfg['EnumOperators'] array
-
Operators available for search operations on enum fields.
- -
$cfg['NullOperators'] array
-
Additional operators available for search operations when the - field can be null.
- -
- - -

Transformations

- -
  1. Introduction
  2. -
  3. Usage
  4. -
  5. File structure
  6. -
- -

1. Introduction

- -

To enable transformations, you have to setup the column_info table - and the proper directives. Please see the Configuration - section on how to do so.

- -

You can apply different transformations to the contents of each field. The - transformation will take the content of each field and transform it with - certain rules defined in the selected transformation.

- -

Say you have a field 'filename' which contains a filename. Normally you would - see in phpMyAdmin only this filename. Using transformations you can transform - that filename into a HTML link, so you can click inside of the phpMyAdmin - structure on the field's link and will see the file displayed in a new browser - window. Using transformation options you can also specify strings to - append/prepend to a string or the format you want the output stored in.

- -

For a general overview of all available transformations and their options, - you can consult your - <www.your-host.com>/<your-install-dir>/transformation_overview.php - installation.

- -

For a tutorial on how to effectively use transformations, see our - Link section on - the official phpMyAdmin homepage.

- -

2. Usage

- -

Go to your tbl_structure.php page (i.e. reached through - clicking on the 'Structure' link for a table). There click on - "Change" (or change icon) and there you will see three new fields at - the end of the line. They are called 'MIME-type', 'Browser transformation' and - 'Transformation options'.

- -
  • The field 'MIME-type' is a drop-down field. Select the MIME-type - that corresponds to the column's contents. Please note that - transformations are inactive as long as no MIME-type is selected.
  • - -
  • The field 'Browser transformation' is a drop-down field. You can choose from a - hopefully growing amount of pre-defined transformations. See below for information on - how to build your own transformation.
    - - There are global transformations and mimetype-bound transformations. Global transformations - can be used for any mimetype. They will take the mimetype, if necessary, into regard. - Mimetype-bound transformations usually only operate on a certain mimetype. There are - transformations which operate on the main mimetype (like 'image'), which will most likely - take the subtype into regard, and those who only operate on a - specific subtype (like 'image/jpeg').
    - - You can use transformations on mimetypes for which the function was not defined for. There - is no security check for you selected the right transformation, so take care of what the - output will be like.
  • - -
  • The field 'Transformation options' is a free-type textfield. You have to enter - transform-function specific options here. Usually the transforms can operate with default - options, but it is generally a good idea to look up the overview to see which options are - necessary.
    - - Much like the ENUM/SET-Fields, you have to split up several options using the format - 'a','b','c',...(NOTE THE MISSING BLANKS). This is because internally the options will be - parsed as an array, leaving the first value the first element in the array, and so - forth.
    - - If you want to specify a MIME character set you can define it in the transformation_options. - You have to put that outside of the pre-defined options of the specific mime-transform, - as the last value of the set. Use the format "'; charset=XXX'". If you use a transform, - for which you can specify 2 options and you want to append a character set, enter "'first - parameter','second parameter','charset=us-ascii'". You can, however use the defaults for - the parameters: "'','','charset=us-ascii'".
  • -
- -

3. File structure

- -

All mimetypes and their transformations are defined through single files in - the directory 'libraries/transformations/'.

- -

They are stored in files to ease up customization and easy adding of new - transformations.

- -

Because the user cannot enter own mimetypes, it is kept sure that transformations - always work. It makes no sense to apply a transformation to a mimetype, the - transform-function doesn't know to handle.

- -

One can, however, use empty mime-types and global transformations which should work - for many mimetypes. You can also use transforms on a different mimetype they where built - for, but pay attention to option usage as well as what the transformation does to your - field.

- -

There is a basic file called 'global.inc.php'. This function can be included by - any other transform function and provides some basic functions.

- -

There are 5 possible file names:

- -
  1. A mimetype+subtype transform:

    - - [mimetype]_[subtype]__[transform].inc.php

    - - Please not that mimetype and subtype are separated via '_', which shall - not be contained in their names. The transform function/filename may - contain only characters which cause no problems in the file system as - well as the PHP function naming convention.

    - - The transform function will the be called - 'PMA_transform_[mimetype]_[subtype]__[transform]()'.

    - - Example:

    - - text_html__formatted.inc.php
    - PMA_transform_text_html__formatted()
  2. - -
  3. A mimetype (w/o subtype) transform:

    - - [mimetype]__[transform].inc.php

    - - Please note that there are no single '_' characters. - The transform function/filename may contain only characters which cause - no problems in the file system as well as the PHP function naming - convention.

    - - The transform function will the be called - 'PMA_transform_[mimetype]__[transform]()'.

    - - Example:

    - - text__formatted.inc.php
    - PMA_transform_text__formatted()
  4. - -
  5. A mimetype+subtype without specific transform function

    - - [mimetype]_[subtype].inc.php

    - - Please note that there are no '__' characters in the filename. Do not - use special characters in the filename causing problems with the file - system.

    - - No transformation function is defined in the file itself.

    - - Example:

    - - text_plain.inc.php
    - (No function)
  6. - -
  7. A mimetype (w/o subtype) without specific transform function

    - - [mimetype].inc.php

    - - Please note that there are no '_' characters in the filename. Do not use - special characters in the filename causing problems with the file system. -

    - - No transformation function is defined in the file itself.

    - - Example:

    - - text.inc.php
    - (No function)
  8. - -
  9. A global transform function with no specific mimetype

    - - global__[transform].inc.php

    - - The transform function will the be called - 'PMA_transform_global__[transform]()'.

    - - Example:

    - - global__formatted
    - PMA_transform_global__formatted()
  10. -
- -

So generally use '_' to split up mimetype and subtype, and '__' to provide a - transform function.

- -

All filenames containing no '__' in themselves are not shown as valid transform - functions in the dropdown.

- -

Please see the libraries/transformations/TEMPLATE file for adding your own transform - function. See the libraries/transformations/TEMPLATE_MIMETYPE for adding a mimetype - without a transform function. Also note the introduction of a function description in - the language files. For each function a $strTransformation_[filename without .inc.php] - has to exist.

- -

You can use the template generator to generate new functions and entries in the - language file.

- -

To create a new transform function please see - libraries/transformations/template_generator.sh. - To create a new, empty mimetype please see - libraries/transformations/template_generator_mimetype.sh.

- -

A transform function always gets passed three variables:

- -
  1. $buffer - Contains the text inside of the column. This is the text, - you want to transform.
  2. -
  3. $options - Contains any user-passed options to a transform function - as an array.
  4. -
  5. $meta - Contains an object with field information to your column. - The data is drawn from the output of the - mysql_fetch_field() - function. This means, all object properties described on the - manual page are - available in this variable and can be used to transform a field accordingly - to unsigned/zerofill/not_null/... properties.
    - The $meta->mimetype variable contains the original MIME-type of the - field (i.e. 'text/plain', 'image/jpeg' etc.)
  6. -
- - -

FAQ - Frequently Asked Questions

- -
  1. Server
  2. -
  3. Configuration
  4. -
  5. Known limitations
  6. -
  7. ISPs, multi-user installations
  8. -
  9. Browsers or client OS
  10. -
  11. Using phpMyAdmin
  12. -
  13. phpMyAdmin project
  14. -
  15. Security
  16. -
- -

Please have a look at our - Link section on - the official phpMyAdmin homepage for in-depth coverage of phpMyAdmin's - features and or interface.

- -

Server

- -

- 1.1 I'm running PHP 4+ and my server is crashing each time a specific - action is required or phpMyAdmin sends a blank page or a page full of - cryptic characters to my browser, what can I do?

- -

There are some known PHP bugs with output buffering and compression.
- Try to set the $cfg['OBGzip'] - directive to FALSE in your config.inc.php file and the - zlib.output_compression directive to Off in your php - configuration file.
- Furthermore, we know about such problems connected to the release - candidates of PHP 4.2.0 (tested with PHP 4.2.0 RC1 to RC4) together with - MS Internet Explorer. Please upgrade to the release version PHP 4.2.0.

- -

- 1.2 My Apache server crashes when using phpMyAdmin.

- -

You should first try the latest versions of Apache (and possibly MySQL).
- See also the - FAQ 1.1 - entry about PHP bugs with output buffering.
- If your server keeps crashing, please ask for help in the various Apache - support groups.

- -

- 1.3 I'm running phpMyAdmin with "cookie" authentication - mode under PHP 4.2.0 or 4.2.1 loaded as an Apache 2 module but can't enter the - script: I'm always displayed the login screen.

- -

This is a known PHP bug (see this - bug report) from the - official PHP bug database. It means there is and won't be any phpMyAdmin - fix against it because there is no way to code a fix.

- -

- 1.4 Using phpMyAdmin on - IIS, I'm displayed the - error message: "The specified CGI - application misbehaved by not returning a complete set of - HTTP headers ...". -

- -

You just forgot to read the install.txt file from the php distribution. - Have a look at the last message in this - bug report from the - official PHP bug database.

- -

- 1.5 Using phpMyAdmin on - IIS, I'm facing crashes - and/or many error messages with the - HTTP or advanced authentication - mode.

- -

This is a known problem with the PHP - ISAPI - filter: it's not so stable. Please use instead the cookie authentication mode. -

- -

- 1.6 I can't use phpMyAdmin on PWS: nothing is displayed!

- -

This seems to be a PWS bug. Filippo Simoncini found a workaround (at this - time there is no better fix): remove or comment the DOCTYPE - declarations (2 lines) from the scripts libraries/header.inc.php, - libraries/header_printview.inc.php, index.php, - navigation.php and libraries/common.lib.php.

- -

- 1.7 How can I GZip or Bzip a dump or a - CSV export? It does not seem to - work.

- -

These features are based on the gzencode() and bzcompress() - PHP functions to be more independent of the platform (Unix/Windows, Safe Mode - or not, and so on). So, you must have PHP4 >= 4.0.4 and Zlib/Bzip2 - support (--with-zlib and --with-bz2).
- We faced PHP crashes when trying to download a dump with MS Internet - Explorer when phpMyAdmin is run with a release candidate of PHP 4.2.0. In - this case you should switch to the release version of PHP 4.2.0.

- -

- 1.8 I cannot insert a text file in a table, and I get - an error about safe mode being in effect.

- -

Your uploaded file is saved by PHP in the "upload dir", as - defined in php.ini by the variable upload_tmp_dir (usually - the system default is /tmp).
- We recommend the following setup for Apache servers running in safe mode, - to enable uploads of files while being reasonably secure:

- -
  • create a separate directory for uploads: mkdir /tmp/php
  • -
  • give ownership to the Apache server's user.group: - chown apache.apache /tmp/php
  • -
  • give proper permission: chmod 600 /tmp/php
  • -
  • put upload_tmp_dir = /tmp/php in php.ini
  • -
  • restart Apache
  • -
- -

- 1.9 I'm having troubles when uploading files. In - general file uploads don't work on my system and uploaded files have a - Content-Type: header in the first line.

- -

It's not really phpMyAdmin related but RedHat 7.0. You have a RedHat 7.0 - and you updated your PHP RPM to php-4.0.4pl1-3.i386.rpm, didn't you?
- So the problem is that this package has a serious bug that was corrected - ages ago in PHP (2001-01-28: see - PHP's bug tracking system - for more details). The problem is that the bugged package is still - available though it was corrected (see - RedHat's BugZilla - for more details).
- So please download - the fixed package (4.0.4pl1-9) - and the problem should go away.
- And that fixes the \r\n problem with file uploads!

- -

- 1.10 I'm having troubles when uploading files with - phpMyAdmin running on a secure server. My browser is Internet Explorer and - I'm using the Apache server.

- -

As suggested by "Rob M" in the phpWizard forum, add this line to - your httpd.conf:

- -
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
- -

It seems to clear up many problems between Internet Explorer and SSL.

- -

- 1.11 I get an 'open_basedir restriction' while - uploading a file from the query box.

- -

Since version 2.2.4, phpMyAdmin supports servers with open_basedir - restrictions. Assuming that the restriction allows you to open files in the - current directory ('.'), all you have to do is create a 'tmp' directory - under the phpMyAdmin install directory, with permissions 777 and the same - owner as the owner of your phpMyAdmin directory. The uploaded files will - be moved there, and after execution of your - SQL commands, removed.

- -

- 1.12 I have lost my MySQL root password, what can I do?

- -

The MySQL manual explains how to - - reset the permissions.

- -

- 1.13 I get an error 'No - SQL query' when trying to - execute a bookmark.

- -

If PHP does not have read/write access to its upload_tmp_dir, it - cannot access the uploaded query.

- -

- 1.14 I get an error 'No - SQL query' when trying to - submit a query from the convenient text area.

- -

Check the post_max_size directive from your PHP configuration file - and try to increase it.

- -

- 1.15 I have problems with mysql.user field names. -

- -

In previous MySQL versions, the User and Password fields - were named user and password. Please modify your field - names to align with current standards.

- -

- 1.16 I cannot upload big dump files (memory, - HTTP or timeout problems). -

- -

Starting with version 2.7.0, the import engine has been re–written and these - problems should not occur. If possible, upgrade your phpMyAdmin to the latest version - to take advantage of the new import features.

- -

The first things to check (or ask your host provider to check) are the - values of upload_max_filesize, memory_limit and - post_max_size in the php.ini configuration file. - All of these three settings limit the maximum size of data that can be - submitted and handled by PHP. One user also said that post_max_size - and memory_limit need to be larger than upload_max_filesize.

- - There exist several workarounds if your upload is too big or your - hosting provider is unwilling to change the settings:

- -
  • Look at the $cfg['UploadDir'] - feature. This allows one to - upload a file to the server via scp, ftp, or your favorite file transfer - method. PhpMyAdmin is then able to import the files from the temporary - directory. More information is available in the Configuration - section of this document.
  • -
  • Using a utility (such as - BigDump) to split the files before uploading. We cannot support this - or any third party applications, but are aware of users having success - with it.
  • -
  • If you have shell (command line) access, use MySQL to import the files - directly. You can do this by issuing the "source" command from - within MySQL: source filename.sql.
  • -
- -

- 1.17 Which MySQL versions does phpMyAdmin - support?

- -

All MySQL versions from 3.23.32 till 5.0 (except for 4.1.0 and 4.1.1) are - fully supported. Please note that the older your MySQL version is, the more - limitations you will have to face.
- phpMyAdmin may connect to your MySQL server using php's classic - MySQL extension as well as the - improved MySQL extension (MySQLi) that - is available in php 5.0.
- Either way, the developers of both extensions recommend to use the classic - extension for MySQL 4.0 and below and MySQLi for MySQL 4.1 and newer.
- When compiling php, we strongly recommend that you manually link the MySQL - extension of your choice to a MySQL client library of at least the same - minor version since the one that is bundled with some php distributions is - rather old and might cause problems - (see FAQ 1.17a). - If your webserver is running on a windows system, you might want to try - MySQL's - Connector/PHP - instead of the MySQL / MySQLi extensions that are bundled with the official - php Win32 builds. -
- MySQL 5.1 is not yet supported.

- -
- 1.17a I cannot connect to the MySQL server. It always returns the error - message, "Client does not support authentication protocol requested - by server; consider upgrading MySQL client"
- -

You tried to access MySQL with an old MySQL client library. The version of - your MySQL client library can be checked in your phpinfo() output. - In general, it should have at least the same minor version as your server - - as mentioned in - FAQ 1.17.

- - This problem is generally caused by using MySQL version 4.1 or newer. MySQL - changed the authentication hash and your PHP is trying to use the old method. - The proper solution is to use the mysqli extension - with the proper client library to match your MySQL installation. Your - chosen extension is specified in $cfg['Servers'][$i]['extension']. - More information (and several workarounds) are located in the - MySQL Documentation. -

- -

- 1.18 I'm running MySQL <= 4.0.1 having - lower_case_table_names set to 1. If I create a new table with a - capital letter in its name it is changed to lowercase as it should. But - if I try to DROP this table MySQL is unable to find the corresponding - file.

- -

This is a bug of MySQL <= 4.0.1. Please upgrade to at least - MySQL 4.0.2 or turn off your lower_case_table_names - directive.

- -

- 1.19 I can't run the "display relations" feature because the - script seems not to know the font face I'm using!

- -

The "FPDF" library we're using for this feature requires some - special files to use font faces.
- Please refers to the FPDF manual to build - these files.

- -

- 1.20 I receive the error "cannot load MySQL extension, please - check PHP Configuration".

- -

To connect to a MySQL server, PHP needs a set of MySQL functions called - "MySQL extension". This extension may be part of the PHP - distribution (compiled-in), otherwise it needs to be loaded dynamically. Its - name is probably mysql.so or php_mysql.dll. phpMyAdmin tried - to load the extension but failed.

- - Usually, the problem is solved by installing a software package called - "PHP-MySQL" or something similar.

- -

- 1.21 I am running the - CGI version of PHP under Unix, - and I cannot log in using cookie auth.

- -

In php.ini, set mysql.max_links higher than 1.

- -

- 1.22 I don't see the "Location of text file" field, - so I cannot upload.

- -

This is most likely because in php.ini, your file_uploads - parameter is not set to "on".

- -

- 1.23 I'm running MySQL on a Win32 machine. Each time I create - a new table the table and field names are changed to lowercase!

- -

This happens because the MySQL directive lower_case_table_names - defaults to 1 (ON) in the Win32 version of MySQL. You can change - this behavior by simply changing the directive to 0 (OFF):
- Just edit your my.ini file that should be located in your Windows - directory and add the following line to the group [mysqld]:

- -
set-variable = lower_case_table_names=0
- -

Next, save the file and restart the MySQL service. You can always check the - value of this directive using the query

- -
SHOW VARIABLES LIKE 'lower_case_table_names';
- -

- 1.24 Some characters are being truncated in my queries, or I - get characters randomly added. I am running PHP 4.2.3.

- -

This is a PHP 4.2.3 bug. -

- -

- 1.25 I am running Apache with mod_gzip-1.3.26.1a on Windows XP, - and I get problems, such as undefined variables when I run a - SQL query.

- -

A tip from Jose Fandos: put a comment on the following two lines - in httpd.conf, like this:

- -
-# mod_gzip_item_include file \.php$
-# mod_gzip_item_include mime "application/x-httpd-php.*"
-
- -

as this version of mod_gzip on Apache (Windows) has problems handling - PHP scripts. Of course you have to restart Apache.

- -

- 1.26 I just installed phpMyAdmin in my document root of - IIS but - I get the error "No input file specified" when trying to - run phpMyAdmin.

- -

This is a permission problem. Right-click on the phpmyadmin folder - and choose properties. Under the tab Security, click on "Add" - and select the user "IUSR_machine" from the list. Now set his - permissions and it should work.

- -

- 1.27 I get empty page when I want to view huge page (eg. - db_structure.php with plenty of tables).

- -

This is a PHP bug that occur when - GZIP output buffering is enabled. If you turn off it (by - $cfg['OBGzip'] = false - in config.inc.php), it should work. This bug will be fixed in - PHP 5.0.0.

- -

- 1.28 My MySQL server sometimes refuses queries and returns the - message 'Errorcode: 13'. What does this mean?

- -

This can happen due to a MySQL bug when having database / table names with - upper case characters although lower_case_table_names is set to 1. - To fix this, turn off this directive, convert all database and table names - to lower case and turn it on again. Alternatively, there's a bug-fix - available starting with MySQL 3.23.56 / 4.0.11-gamma.

- -

- 1.29 When I create a table or modify a field, I get an error - and the fields are duplicated.

- -

It is possible to configure Apache in such a way that PHP has problems - interpreting .php files.

- -

The problems occur when two different (and conflicting) set of directives - are used:

- -
-SetOutputFilter PHP
-SetInputFilter PHP
-
- -

and

- -
AddType application/x-httpd-php .php
- -

In the case we saw, one set of directives was in - /etc/httpd/conf/httpd.conf, while - the other set was in /etc/httpd/conf/addon-modules/php.conf.
- The recommended way is with AddType, so just comment out - the first set of lines and restart Apache:

- -
-#SetOutputFilter PHP
-#SetInputFilter PHP
-
- -

- 1.30 I get the error "navigation.php: Missing hash".

- -

This problem is known to happen when the server is running Turck MMCache - but upgrading MMCache to version 2.3.21 solves the problem.

- -

- 1.31 Does phpMyAdmin support php5?

- -

Yes.
- However, phpMyAdmin needs to be backwards compatible to php4. This is why - phpMyAdmin disables the E_STRICT error_level in - error_reporting settings. -

- -

- 1.32 Can I use HTTP authentication with IIS?

- -

Yes. This procedure was tested with phpMyAdmin 2.6.1, PHP 4.3.9 in ISAPI - mode under IIS 5.1.

- -
  1. In your php.ini file, set cgi.rfc2616_headers = 0
  2. -
  3. In Web Site Properties -> File/Directory Security -> Anonymous - Access dialog box, check the Anonymous access checkbox and - uncheck any other checkboxes (i.e. uncheck Basic authentication, - Integrated Windows authentication, and Digest if it's - enabled.) Click OK.
  4. -
  5. In Custom Errors, select the range of 401;1 through - 401;5 and click the Set to Default button.
  6. -
- -

- 1.33 Is there a problem with the mysqli extension when running - PHP 5.0.4 on 64-bit systems?

- -

Yes. This problem affects phpMyAdmin ("Call to undefined function - pma_reloadnavigation"), so upgrade your PHP to the next version.

- -

- 1.34 Can I access directly to database or table pages?

- -

Yes. Out of the box, you can use URLs like -http://server/phpMyAdmin/index.php?server=X&db=database&table=table&target=script. For server you use the server number which refers to -the order of the server paragraph in config.inc.php. - Table and script parts are optional. If you want - http://server/phpMyAdmin/database[/table][/script] URLs, you need to do - some configuration. Following lines apply only for Apache web server. First make sure, - that you have enabled some features within global configuration. You need - Options FollowSymLinks and AllowOverride - FileInfo enabled for directory where phpMyAdmin is installed and - you need mod_rewrite to be enabled. Then you just need to create following - .htaccess file in root folder of phpMyAdmin installation - (don't forget to change directory name inside of it):

- -
-RewriteEngine On
-RewriteBase /path_to_phpMyAdmin
-RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R]
-RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R]
-RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R]
-RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R]
-
- -

- 1.35 Can I use HTTP authentication with Apache CGI?

- -

Yes. However you need to pass authentication variable to CGI using - following rewrite rule:

- -
-RewriteEngine On
-RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
-
- -

- 1.36 I get an error "500 Internal Server Error". -

-

- There can be many explanations to this and a look at your server's - error log file might give a clue. -

- -

- 1.37 I run phpMyAdmin on cluster of different machines and - password encryption in cookie auth doesn't work.

- -

If your cluster consist of different architectures, PHP code used for - encryption/decryption won't work correct. This is caused by use of - pack/unpack functions in code. Only solution is to use mcrypt extension - which works fine in this case.

- -

- 1.38 Can I use phpMyAdmin on a server on which Suhosin is enabled?

- -

Yes but the default configuration values of Suhosin are known to cause - problems with some operations, for example editing a table with many - columns and no primary key. Tuning information is available at - - http://www.hardened-php.net/hphp/troubleshooting.html, - although the parameter names have changed (suhosin instead - of hphp). See also the - SuhosinDisableWarning directive. -

- -

Configuration

- -

- 2.1 The error message "Warning: Cannot add header information - - headers already sent by ..." is displayed, what's the problem?

- -

Edit your config.inc.php file and ensure there is nothing - (I.E. no blank lines, no spaces, no characters...) neither before the - <?php tag at the beginning, neither after the ?> - tag at the end. We also got a report from a user under IIS, that used - a zipped distribution kit: the file libraries/Config.class.php - contained an end-of-line character (hex 0A) at the end; removing this character - cleared his errors.

- -

- 2.2 phpMyAdmin can't connect to MySQL. What's wrong?

- -

Either there is an error with your PHP setup or your username/password is - wrong. Try to make a small script which uses mysql_connect and see if it - works. If it doesn't, it may be you haven't even compiled MySQL support - into PHP.

- -

- 2.3 The error message "Warning: MySQL Connection Failed: Can't - connect to local MySQL server through socket '/tmp/mysql.sock' - (111) ..." is displayed. What can I do?

- -

For RedHat users, Harald Legner suggests this on the mailing list:

- -

On my RedHat-Box the socket of MySQL is /var/lib/mysql/mysql.sock. - In your php.ini you will find a line

- -
mysql.default_socket = /tmp/mysql.sock
- -

change it to

- -
mysql.default_socket = /var/lib/mysql/mysql.sock
- -

Then restart apache and it will work.

- -

Here is a fix suggested by Brad Ummer:

- -
  • First, you need to determine what socket is being used by MySQL.
    - To do this, telnet to your server and go to the MySQL bin directory. In - this directory there should be a file named mysqladmin. Type - ./mysqladmin variables, and this should give you a bunch of - info about your MySQL server, including the socket - (/tmp/mysql.sock, for example).
  • -
  • Then, you need to tell PHP to use this socket.
    To do this in - phpMyAdmin, you need to complete the socket information in the - config.inc.php.
    - For example: - - $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock'; -

    - - Please also make sure that the permissions of this file allow to be readable - by your webserver (i.e. '0755').
  • -
- -

Have also a look at the - - corresponding section of the MySQL documentation.

- -

- 2.4 Nothing is displayed by my browser when I try to run phpMyAdmin, - what can I do?

- -

Try to set the $cfg['OBGZip'] - directive to FALSE in the phpMyAdmin configuration file. It helps - sometime.
- Also have a look at your PHP version number: if it contains "4.0b..." - it means you're running a beta version of PHP. That's not a so good idea, - please upgrade to a plain revision.

- -

- 2.5 Each time I want to insert or change a record or drop a database - or a table, an error 404 (page not found) is displayed or, with HTTP or - cookie authentication, I'm asked to log in again. What's wrong?

- -

Check the value you set for the - $cfg['PmaAbsoluteUri'] - directive in the phpMyAdmin configuration file.

- -

- 2.6 I get an "Access denied for user: 'root@localhost' (Using - password: YES)"-error when trying to access a MySQL-Server on a - host which is port-forwarded for my localhost.

- -

When you are using a port on your localhost, which you redirect via - port-forwarding to another host, MySQL is not resolving the localhost - as expected.
- Erik Wasser explains: The solution is: if your host is "localhost" - MySQL (the commandline tool 'mysql' as well) always tries to use the socket - connection for speeding up things. And that doesn't work in this configuration - with port forwarding.
- If you enter "127.0.0.1" as hostname, everything is right and MySQL uses the - TCP connection.

- -

2.7 Using and creating themes

- -

Themes are configured with - $cfg['ThemePath'], - $cfg['ThemeManager'] and - $cfg['ThemeDefault'].
-
- Under $cfg['ThemePath'], you - should not delete the directory "original" or its underlying - structure, because this is the system theme used by phpMyAdmin. - "original" contains all images and styles, for backwards - compatibility and for all themes that would not include images or css-files. -

- - If $cfg['ThemeManager'] - is enabled, you can select your favorite theme on the main page. Your - selected theme will be stored in a cookie.

- -

To create a theme:

- -
  • make a new subdirectory (for example "your_theme_name") under - $cfg['ThemePath'] - (by default themes)
  • -
  • copy the files and directories from "original" to - "your_theme_name"
  • -
  • edit the css-files in "your_theme_name/css"
  • -
  • put your new images in "your_theme_name/img"
  • -
  • edit layout.inc.php in "your_theme_name"
  • -
  • edit info.inc.php in "your_theme_name" to - contain your chosen theme name, that will be visible in user interface
  • -
  • make a new screenshot of your theme and save it under - "your_theme_name/screen.png"
  • -
- -

In theme directory there is file info.inc.php which contains - theme verbose name, theme generation and theme version. These versions and - generations are enumerated from 1 and do not have any direct dependence on - phpMyAdmin version. Themes within same generation should be backwards - compatible - theme with version 2 should work in phpMyAdmin requiring - version 1. Themes with different generation are incompatible.

- -

If you do not want to use your own symbols and buttons, remove the - directory "img" in "your_theme_name". phpMyAdmin will - use the default icons and buttons (from the system-theme "original"). -

- -

- 2.8 I get "Missing parameters" errors, - what can I do?

- -

Here are a few points to check:

- -
  • In config.inc.php, try to leave the - $cfg['PmaAbsoluteUri'] - directive empty. See also - FAQ 4.7. -
  • -
  • Maybe you have a broken PHP installation or you need to upgrade - your Zend Optimizer. See - - http://bugs.php.net/bug.php?id=31134. -
  • -
  • If you are using Hardened PHP with the ini directive varfilter.max_request_variables - set to the default (200) or another low value, you could get this - error if your table has a high number of columns. Adjust this setting - accordingly. (Thanks to Klaus Dorninger for the hint). -
  • -
  • In the php.ini directive arg_separator.input, a value - of ";" will cause this error. Replace it with "&;". -
  • -
  • If you are using Hardened-PHP, - you might want to increase - request limits. -
  • -
  • The directory specified in the php.ini directive session.save_path does not exist or is read-only. -
  • -
- -

Known limitations

- -

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

- -

This is related to the authentication mechanism (protocol) used by - phpMyAdmin. To bypass this problem: just close all the opened - browser windows and then go back to phpMyAdmin. You should be able to - log in again.

- -

- 3.2 When dumping a large table in compressed mode, I get a memory - limit error or a time limit error.

- -

Compressed dumps are built in memory and because of this are limited to - php's memory limit. For GZip/BZip2 exports this can be overcome since 2.5.4 - using - $cfg['CompressOnFly'] - (enabled by default). Zip exports can not be handled this way, so if you need - Zip files for larger dump, you have to use another way.

- -

- 3.3 With InnoDB tables, I lose foreign key relationships when I rename - or alter a table.

- -

This seems to be a InnoDB bug (fixed in MySQL 3.23.50?).

- -

- 3.4 I am unable to import dumps I created with the mysqldump tool - bundled with the MySQL server distribution.

- -

The problem is that older versions of mysqldump created invalid comments like this:

- -
--- MySQL dump 8.22
---
--- Host: localhost Database: database
----------------------------------------------------------
--- Server version 3.23.54
-
- -

The invalid part of the code is the horizontal line made of dashes that - appears once in every dump created with mysqldump. If you want to run your - dump you have to turn it into valid MySQL. This means, you have to add a - whitespace after the first two dashes of the line or add a # before it: -
- - -- -------------------------------------------------------
-
- or
- - #--------------------------------------------------------- - -

- -

- 3.5 When using nested folders there are some multiple hierarchies - displayed in a wrong manner?! ($cfg['LeftFrameTableSeparator'])

- -

Please note that you should not use the separating string multiple times - without any characters between them, or at the beginning/end of your table - name. If you have to, think about using another TableSeparator or disabling - that feature

- -

- 3.6 What is currently not supported in phpMyAdmin about InnoDB?

- -

In Relation view, being able to choose a table in another database, - or having more than one index field in the foreign key.

- In Query-by-example (Query), automatic generation of the query - LEFT JOIN from the foreign table.

-

- -

- 3.7 I have table with many (100+) fields and when I try to browse table - I get series of errors like "Warning: unable to parse url". How - can this be fixed?

-

- Your table neither have a primary key nor an unique one, so we must use a - long expression to identify this row. This causes problems to parse_url - function. The workaround is to create a primary or unique key. -
-

- -

- 3.8 I cannot use (clickable) HTML-forms in fields where I put - a MIME-Transformation onto!

- -

Due to a surrounding form-container (for multi-row delete checkboxes), no - nested forms can be put inside the table where phpMyAdmin displays the results. - You can, however, use any form inside of a table if keep the parent - form-container with the target to tbl_row_delete.php and just put your own - input-elements inside. If you use a custom submit input field, the form will - submit itself to the displaying page again, where you can validate the - $HTTP_POST_VARS in a transformation. - - For a tutorial on how to effectively use transformations, see our - Link section - on the official phpMyAdmin-homepage.

- -

- 3.9 I get error messages when using "--sql_mode=ANSI" for the - MySQL server

- -

When MySQL is running in ANSI-compatibility mode, there are some major - differences in how SQL is - structured (see - http://dev.mysql.com/doc/mysql/en/ANSI_mode.html). Most important of all, - the quote-character (") is interpreted as an identifier quote character and - not as a string quote character, which makes many internal phpMyAdmin - operations into invalid SQL - statements. There is no workaround to this behaviour. News to this item will - be posted in Bug report - #816858 -

- -

- 3.10 Homonyms and no primary key: When the results of a SELECT display - more that one column with the same value - (for example SELECT lastname from employees where firstname like 'A%' and two "Smith" values are displayed), - if I click Edit I cannot be sure that I am editing the intended row.

- -

Please make sure that your table has a primary key, so that phpMyAdmin - can use it for the Edit and Delete links.

- -

- 3.11 The number of records for InnoDB tables is not correct.

- -

phpMyAdmin uses a quick method to get the row count, and this method - only returns an approximate count in the case of InnoDB tables. See - $cfg['MaxExactCount'] for - a way to modify those results, but - this could have a serious impact on performance.

- -

- 3.12 What are the phpMyAdmin limitations for MySQL 3?

- -

The number of records in queries containing COUNT and GROUP BY is - not correctly calculated. Also, sorting results of a query like - "SELECT * from table GROUP BY" ... is problematic.

- -

- 3.13 I get an error when entering USE followed by a db name - containing an hyphen. -

-

- The tests I have made with current MySQL 4.1.11 API shows that the - API does not accept this syntax for the USE command. Enclosing the - db name with backquotes works. For further confusion, no backquotes - are needed with command-line mysql. -

- -

- 3.14 I am not able to browse a table when I don't have the right to SELECT one of the columns.

-

- This has been a known limitation of phpMyAdmin since the beginning and - it's not likely to be solved in the future. -

- -

ISPs, multi-user installations

- -

- 4.1 I'm an ISP. Can I setup one central copy of phpMyAdmin or do I - need to install it for each customer. -

-

- Since version 2.0.3, you can setup a central copy of phpMyAdmin for all - your users. The development of this feature was kindly sponsored by - NetCologne GmbH. - This requires a properly setup MySQL user management and phpMyAdmin - HTTP or cookie authentication. See the install section on - "Using HTTP authentication". -

- -

- 4.2 What's the preferred way of making phpMyAdmin secure against evil - access. -

-

- This depends on your system.
- If you're running a server which cannot be accessed by other people, it's - sufficient to use the directory protection bundled with your webserver - (with Apache you can use .htaccess files, for example).
- If other people have telnet access to your server, you should use - phpMyAdmin's HTTP or cookie authentication features. -

- Suggestions: -

-
    -
  • - Your config.inc.php file should be chmod 660. -
  • -
  • - All your phpMyAdmin files should be chown -R phpmy.apache, where phpmy - is a user whose password is only known to you, and apache is the - group under which Apache runs. -
  • -
  • - You should use PHP safe mode, to protect from other users that try - to include your config.inc.php in their scripts. -
  • -
- -

- 4.3 I get errors about not being able to include a file in - /lang or in /libraries. -

-

- Check php.ini, or ask your sysadmin to check it. The - include_path must contain "." somewhere in it, and - open_basedir, if used, must contain "." and - "./lang" to allow normal operation of phpMyAdmin. -

- -

- 4.4 phpMyAdmin always gives "Access denied" when using HTTP - authentication. -

- -

This could happen for several reasons:

- - - -

- 4.5 Is it possible to let users create their own databases?

- -

Starting with 2.2.5, in the user management page, you can enter a wildcard - database name for a user (for example "joe%"), - and put the privileges you want. For example, - adding SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER - would let a user create/manage his/her database(s).

- -

- 4.6 How can I use the Host-based authentication additions?

- -

If you have existing rules from an old .htaccess file, you can take them - and add a username between the 'deny'/'allow' and - 'from' strings. Using the username wildcard of '%' would - be a major benefit here if your installation is suited to using it. Then - you can just add those updated lines into the - - $cfg['Servers'][$i]['AllowDeny']['rules'] array.

- -

If you want a pre-made sample, you can try this fragment. It stops the - 'root' user from logging in from any networks other than the private - network IP blocks.

- -
-//block root from logging in except from the private networks
-$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
-$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
-    'deny root from all',
-    'allow root from localhost',
-    'allow root from 10.0.0.0/8',
-    'allow root from 192.168.0.0/16',
-    'allow root from 172.16.0.0/12',
-    );
-
- -

- 4.7 Authentication window is displayed more than once, why?

- -

This happens if you are using a URL to start phpMyAdmin which is - different than the one set in your - $cfg['PmaAbsoluteUri']. - For example, a missing "www", or entering with an IP address - while a domain name is defined in the config file.

- -

- 4.8 Which parameters can I use in the URL that starts phpMyAdmin?

- -

When starting phpMyAdmin, you can use the db, pma_username, pma_password and server parameters. This last one can contain either the numeric host index (from $i of the configuration file) or one of the host names present in the configuration file. Using pma_username and pma_password has been tested along with the usage of 'cookie' auth_type.

- -

Browsers or client OS

- -

- 5.1 I get an out of memory error, and my controls are non-functional, - when trying to create a table with more than 14 fields. -

-

- We could reproduce this problem only under Win98/98SE. Testing under - WinNT4 or Win2K, we could easily create more than 60 fields. -
- A workaround is to create a smaller number of fields, then come back to - your table properties and add the other fields. -

- -

- 5.2 With Xitami 2.5b4, phpMyAdmin won't process form fields.

-

- This is not a phpMyAdmin problem but a Xitami known bug: you'll face it - with each script/website that use forms.
- Upgrade or downgrade your Xitami server. -

- -

- 5.3 I have problems dumping tables with Konqueror (phpMyAdmin 2.2.2).

-

- With Konqueror 2.1.1: plain dumps, zip and GZip dumps work ok, except that - the proposed file name for the dump is always 'tbl_dump.php'. Bzip2 dumps - don't seem to work.
- - With Konqueror 2.2.1: plain dumps work; zip dumps are placed into - the user's temporary directory, so they must be moved before closing - Konqueror, or else they disappear. GZip dumps give an error message.
- - Testing needs to be done for Konqueror 2.2.2.
-

- -

- 5.4 I can't use the cookie authentication mode because Internet - Explorer never stores the cookies. -

-

- MS Internet Explorer seems to be really buggy about cookies, at least till - version 6. And thanks to Andrew Zivolup we've traced also a PHP 4.1.1 bug - in this area! -
- Then, if you're running PHP 4.1.1, try to upgrade or downgrade... it may - work! -

- -

- 5.5 In Internet Explorer 5.0, I get JavaScript errors when browsing my - rows. -

-

- Upgrade to at least Internet Explorer 5.5 SP2.
-

- -

- 5.6 In Internet Explorer 5.0, 5.5 or 6.0, I get an error (like "Page not found") - when trying to modify a row in a table with many fields, or with a text field -

-

- Your table neither have a primary key nor an unique one, so we must use a - long URL to identify this row. There is a limit on the length of the URL in - those browsers, and this not happen in Netscape, for example. The - workaround is to create a primary or unique key, or use another browser. -
-

- -

- 5.7 I refresh (reload) my browser, and come back to the welcome - page. -

-

- Some browsers support right-clicking into the frame you want to refresh, - just do this in the right frame.
-

- -

- 5.8 With Mozilla 0.9.7 I have problems sending a query modified in the - query box. -

-

- Looks like a Mozilla bug: 0.9.6 was OK. We will keep an eye on future - Mozilla versions.
-

- -

- 5.9 With Mozilla 0.9.? to 1.0 and Netscape 7.0-PR1 I can't type a - whitespace in the SQL-Query edit area: the page scrolls down. -

-

- This is a Mozilla bug (see bug #26882 at - BugZilla).
-

- -

- 5.10 With Netscape 4.75 I get empty rows between each row of data in a - CSV exported file. -

-

- This is a known Netscape 4.75 bug: it adds some line feeds when exporting - data in octet-stream mode. Since we can't detect the specific Netscape - version, we cannot workaround this bug. -

- -

- 5.11 Extended-ASCII characters like German umlauts are displayed - wrong.

- -

Please ensure that you have set your browser's character set to the one of the - language file you have selected on phpMyAdmin's start page. - Alternatively, you can try the auto detection mode that is supported by the - recent versions of the most browsers.

- -

- 5.12 Mac OS X: Safari browser changes special characters to - "?".

- -

This issue has been reported by a OS X user, who adds that Chimera, - Netscape and Mozilla do not have this problem.

- -

- 5.13 With Internet Explorer 5.5 or 6, and HTTP authentication type, - I cannot manage two servers: I log in to the first one, then the other one, - but if I switch back to the first, I have to log in on each operation.

- -

This is a bug in Internet Explorer, other browsers do not behave this way.

- -

- 5.14 Using Opera6, I can manage to get to the authentication, - but nothing happens after that, only a blank screen.

- -

Having $cfg['QueryFrameJS'] set o TRUE, this leads to a - bug in Opera6, because it is not able to interpret frameset definitions - written by JavaScript. Please upgrade your phpMyAdmin installtion or to - Opera7 at least.

- -

- 5.15 I have display problems with Safari.

- -

Please upgrade to at least version 1.2.3.

- -

- 5.16 With Internet Explorer, I get "Access is denied" - Javascript errors. Or I cannot make phpMyAdmin work under Windows.

- -

Please check the following points:

-
  • Maybe you have defined your PmaAbsoluteUri setting - in config.inc.php to an IP - address and you are starting - phpMyAdmin with a URL - containing a domain name, or the reverse situation.
  • -
  • Security settings in IE and/or Microsoft Security Center are - too high, thus blocking scripts execution.
  • -
  • The Windows Firewall is blocking Apache and MySQL. You must - allow HTTP ports - (80 or 443) and MySQL port (usually 3306) - in the "in" and "out" directions.
  • -
- -

- 5.17 With Firefox, I cannot delete rows of data or drop a database.

-

Many users have confirmed that the Tabbrowser Extensions plugin they - installed in their Firefox is causing the problem.

- -

Using phpMyAdmin

- -

- 6.1 I can't insert new rows into a table / I can't create a table - - MySQL brings up a SQL-error. -

-

- Examine the SQL error with care. Often the problem is caused by - specifying a wrong field-type.
- Common errors include: -

-
    -
  • Using VARCHAR without a size argument
  • -
  • Using TEXT or BLOB with a size argument
  • -
-

- Also, look at the syntax chapter in the MySQL manual to confirm that your - syntax is correct. -

- -

- 6.2 When I create a table, I click the Index checkbox for 2 fields and - phpMyAdmin generates only one index with those 2 fields. -

-

- In phpMyAdmin 2.2.0 and 2.2.1, this is the way to create a multi-fields - index. If you want two indexes, create the first one when creating the - table, save, then display the table properties and click the Index link to - create the other index. -

- -

- 6.3 How can I insert a null value into my table?

-

- Since version 2.2.3, you have a checkbox for each field that can be null. - Before 2.2.3, you had to enter "null", without the quotes, as the - field's value. Since version 2.5.5, you have to use the checkbox to get - a real NULL value, so if you enter "NULL" this means you want - a literal NULL in the field, and not a NULL value (this works in PHP4). -

- -

- 6.4 How can I backup my database or table?

- -

Click on a database or table name in the left frame, the properties will be - displayed. Then on the menu, click "Export", you can dump - the structure, the data, or both. This will generate standard SQL - statements that can be used to recreate your database/table. -

- You will need to choose "Save as file", so that phpMyAdmin can - transmit the resulting dump to your station. Depending on your PHP - configuration, you will see options to compress the dump. See also the - $cfg['ExecTimeLimit'] - configuration variable.

- - For additional help on this subject, look for the word "dump" in - this document.

- -

- 6.5 How can I restore (upload) my database or table using a dump? - How can I run a ".sql" file? -

- -

Click on a database name in the left frame, the properties will be - displayed. Select "Import" from the list - of tabs in the right–hand frame (or "SQL" if your phpMyAdmin - version is previous to 2.7.0). In the "Location of the text file" section, type in - the path to your dump filename, or use the Browse button. Then click Go. -

- With version 2.7.0, the import engine has been re–written, if possible it is suggested - that you upgrade to take advantage of the new features. -

- For additional help on this subject, look for the word "upload" - in this document. -

- -

- 6.6 How can I use the relation table in Query-by-example?

- -

Here is an example with the tables persons, towns and countries, all - located in the database mydb. If you don't have a pma_relation - table, create it as explained in the configuration section. Then create the - example tables:

- -
-CREATE TABLE REL_countries (
-    country_code char(1) NOT NULL default '',
-    description varchar(10) NOT NULL default '',
-    PRIMARY KEY (country_code)
-) TYPE=MyISAM;
-
-INSERT INTO REL_countries VALUES ('C', 'Canada');
-
-CREATE TABLE REL_persons (
-    id tinyint(4) NOT NULL auto_increment,
-    person_name varchar(32) NOT NULL default '',
-    town_code varchar(5) default '0',
-    country_code char(1) NOT NULL default '',
-    PRIMARY KEY (id)
-) TYPE=MyISAM;
-
-INSERT INTO REL_persons VALUES (11, 'Marc', 'S', '');
-INSERT INTO REL_persons VALUES (15, 'Paul', 'S', 'C');
-
-CREATE TABLE REL_towns (
-    town_code varchar(5) NOT NULL default '0',
-    description varchar(30) NOT NULL default '',
-    PRIMARY KEY (town_code)
-) TYPE=MyISAM;
-
-INSERT INTO REL_towns VALUES ('S', 'Sherbrooke');
-INSERT INTO REL_towns VALUES ('M', 'Montréal');
-
- -

To setup appropriate links and display information:

- -
  • on table "REL_persons" click Structure, then Relation view
  • -
  • in Links, for "town_code" choose "REL_towns->code"
  • -
  • in Links, for "country_code" choose "REL_countries->country_code"
  • -
  • on table "REL_towns" click Structure, then Relation view
  • -
  • in "Choose field to display", choose "description"
  • -
  • repeat the two previous steps for table "REL_countries"
  • -
- -

Then test like this:

- -
  • Click on your db name in the left frame
  • -
  • Choose "Query"
  • -
  • Use tables: persons, towns, countries
  • -
  • Click "Update query"
  • -
  • In the fields row, choose persons.person_name and click the - "Show" tickbox
  • -
  • Do the same for towns.description and countries.descriptions in the - other 2 columns
  • -
  • Click "Update query" and you will see in the query box that - the correct joins have been generated
  • -
  • Click "Submit query"
  • -
- -

- 6.7 How can I use the "display field" feature?

-

- Starting from the previous example, create the pma_table_info as explained - in the configuration section, then browse your persons table, - and move the mouse over a town code or country code. -

- See also FAQ 6.21 for an additional feature that "display field" - enables: drop-down list of possible values. -

- -

- 6.8 How can I produce a PDF schema of my database?

-

- First the configuration variables "relation", - "table_coords" and "pdf_pages" have to be filled in. -

- Then you need to think about your schema layout. Which tables will go on - which pages? -

-
    -
  • Select your database in the left frame.
  • -
  • Choose "Operations" in the navigation bar at the top.
  • -
  • Choose "Edit PDF - Pages" near the bottom of the page.
  • -
  • Enter a name for the first PDF - page and click Go. If you like, you - can use the "automatic layout," which will put all your - linked tables onto the new page.
  • -
  • Select the name of the new page (making sure the Edit radio button - is selected) and click Go.
  • -
  • Select a table from the list, enter its coordinates and click Save.
    - Coordinates are relative; your diagram will - be automatically scaled to fit the page. When initially placing tables - on the page, just pick any coordinates -- say, 50x50. After clicking - Save, you can then use the graphical editor to - position the element correctly.
  • -
  • When you'd like to look at your PDF, - first be sure to click the Save - button beneath the list of tables and coordinates, to save any changes - you made there. Then scroll all the way down, select the - PDF options - you want, and click Go.
  • -
  • Internet Explorer for Windows may suggest an incorrect filename when - you try to save a generated PDF. - When saving a generated PDF, be - sure that the filename ends in ".pdf", for example - "schema.pdf". Browsers on other operating systems, and other - browsers on Windows, do not have this problem.
  • -
- -

- 6.9 phpMyAdmin is changing the type of one of my - columns!

- -

No, it's MySQL that is doing - silent - column type changing.

- -

- 6.10 When creating a privilege, what happens with - underscores in the database name?

- -

If you do not put a backslash before the underscore, this is a wildcard - grant, and the underscore means "any character". So, if the - database name is "john_db", the user would get rights to john1db, - john2db ...

- - If you put a backslash before the underscore, it means that the database - name will have a real underscore.

- -

- 6.11 What is the curious symbol ø in the - statistics pages?

- -

It means "average".

- -

- 6.12 I want to understand some Export options.

- -

Structure:

- -
  • "Add DROP TABLE" will add a line telling MySQL to - drop the table, - if it already exists during the import. It does NOT drop the table after - your export, it only affects the import file.
  • -
  • "If Not Exists" will only create the table if it doesn't exist. - Otherwise, you may get an error if the table name exists but has a - different structure.
  • -
  • "Add AUTO_INCREMENT value" ensures that AUTO_INCREMENT value - (if any) will be included in backup.
  • -
  • "Enclose table and field names with backquotes" ensures that - field and table names formed with special characters are protected.
  • -
  • "Add into comments" includes column comments, relations, and MIME - types set in the pmadb in the dump as - SQL comments (/* xxx */). -
  • -
- -

Data:

- -
  • "Complete inserts" adds the column names on every INSERT - command, for better documentation (but resulting file is bigger).
  • -
  • "Extended inserts" provides a shorter dump file by using only - once the INSERT verb and the table name.
  • -
  • "Delayed inserts" are best explained in the - MySQL manual. -
  • -
  • "Ignore inserts" treats errors as a warning instead. Again, - more info is provided in the - MySQL manual, - but basically with this selected, invalid values are adjusted and - inserted rather than causing the entire statement to fail.
  • -
- -

- 6.13 I would like to create a database with a dot - in its name.

- -

This is a bad idea, because in MySQL the syntax "database.table" - is the normal way to reference a database and table name. Worse, MySQL - will usually let you create a database with a dot, but then you cannot - work with it, nor delete it.

- -

- 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 - 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.
- 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.

- -

- 6.15 I want to add a BLOB field and put an index on - it, but MySQL says "BLOB column '...' used in key specification without - a key length".

- -

The right way to do this, is to create the field without any indexes, - then display the table structure and use the "Create an index" - dialog. On this page, you will be able to choose your BLOB field, and - set a size to the index, which is the condition to create an index on - a BLOB field.

- -

- 6.16 How can I simply move in page with plenty - editing fields?

- -

You can use Ctrl+arrows (Option+Arrows in Safari) for moving on most pages - with many editing fields (table structure changes, row editing, etc.) - (must be enabled in configuration - see. - $cfg['CtrlArrowsMoving']). - You can also have a look at the directive - $cfg['DefaultPropDisplay'] - ('vertical') and see if this eases up editing for you.

- -

- 6.17 Transformations: I can't enter my own mimetype! - WTF is this feature then useful for?

- -

Slow down :). Defining mimetypes is of no use, if you can't put transformations - on them. Otherwise you could just put a comment on the field. Because entering - your own mimetype will cause serious syntax checking issues and validation, - this introduces a high-risk false-user-input situation. Instead you have to - initialize mimetypes using functions or empty mimetype definitions.
- Plus, you have a whole overview of available mimetypes. Who knows all those - mimetypes by heart so he/she can enter it at will?

- -

- 6.18 Bookmarks: Where can I store bookmarks? Why - can't I see any bookmarks below the query box? What is this variable for? -

- -

Any query you have executed can be stored as a bookmark on the page where the - results are displayed. You will find a button labeled 'Bookmark this query' - just at the end of the page.
- As soon as you have stored a bookmark, it is related to the database you run - the query on. You can now access a bookmark dropdown on each page, the query - box appears on for that database.

- - Since phpMyAdmin 2.5.0 you are also able to store variables for the bookmarks. - Just use the string /*[VARIABLE]*/ anywhere in your query. Everything - which is put into the value input box on the query box page will - replace the string "/*[VARIABLE]*/" in your stored query. Just be - aware of that you HAVE to create a valid query, otherwise your query won't be - even able to be stored in the database.
- Also remember, that everything else inside the /*[VARIABLE]*/ string - for your query will remain the way it is, but will be stripped of the /**/ - chars. So you can use:

- - /*, [VARIABLE] AS myname */

- - which will be expanded to

- - , VARIABLE as myname

- - in your query, where VARIABLE is the string you entered in the input box. If - an empty string is provided, no replacements are made.

- - A more complex example. Say you have stored this query:

- SELECT Name, Address FROM addresses WHERE 1 /* AND Name LIKE '%[VARIABLE]%' */ -

- - Say, you now enter "phpMyAdmin" as the variable for the stored query, - the full query will be:

- - SELECT Name, Address FROM addresses WHERE 1 AND Name LIKE '%phpMyAdmin%' -

- - You can use multiple occurrences of /*[VARIABLE]*/ in a single query.
- NOTE THE ABSENCE OF SPACES inside the "/**/" construct. Any - spaces inserted there - will be later also inserted as spaces in your query and may lead to unexpected - results especially when - using the variable expansion inside of a "LIKE ''" expression.
- Your initial query which is going to be stored as a bookmark has to yield at - least one result row so - you can store the bookmark. You may have that to work around using well - positioned "/**/" comments.

- -

- 6.19 How can I create simple LATEX document to - include exported table?

- -

You can simply include table in your LATEX documents, minimal sample - document should look like following one (assuming you have table - exported in file table.tex):

- -
-\documentclass{article} % or any class you want
-\usepackage{longtable}  % for displaying table
-\begin{document}        % start of document
-\include{table}         % including exported table
-\end{document}          % end of document
-
- -

- 6.20 In MySQL 4, I see a lot of databases which are not mine, and cannot - access them. -

- -

Upgrading to MySQL 4 usually gives users those global privileges: CREATE - TEMPORARY TABLES, SHOW DATABASES, LOCK TABLES. Those privileges also - enable users to see all the database names. - See this bug report.

- - So if your users do not need those privileges, you can remove them and their - databases list will shorten.

- -

- 6.21 In edit/insert mode, how can I see a list of - possible values for a field, based on some foreign table?

- -

You have to setup appropriate links between the tables, and also - setup the "display field" in the foreign table. See - FAQ - 6.6 for an example. Then, if there are 200 values or less in the - foreign table, a drop-down list of values will be available. - You will see two lists of values, the first list containing the key - and the display field, the second list containing the display field - and the key. The reason for this is to be able to type the first - letter of either the key or the display field.

- - For 200 values or more, a distinct window will appear, to browse foreign - key values and choose one.

- -

- 6.22 Bookmarks: Can I execute a default bookmark - automatically when entering Browse mode for a table?

- -

Yes. If a bookmark has the same label as a table name, it will be executed. -

- -

- 6.23 Export: I heard phpMyAdmin can export Microsoft - Excel files, how can I enable that?

- -

Current version does support direct export to Microsoft Excel and Word - versions 2000 and newer. If you need export older versions, you can use - CSV suitable for Microsoft Excel, - which works out of the box or you can - try native experimental MS Excel exporter. This export has - several problems, most important are limitation of cell content to 255 - chars and no support for charsets, so think carefully whether you want to - enable this.. For enabling this you need to set - $cfg['TempDir'] to - place where web server user can write (for example './tmp') and - install PEAR - module Spreadsheet_Excel_Writer into php include path. The - installation can be done by following command:

- -
-pear -d preferred_state=beta install -a Spreadsheet_Excel_Writer
-
- -

First part of switches set we want to install beta version of that module - (no stable version available yet) and then we tell pear we want to satisfy - dependencies.

- -

If you are running in PHP safe mode, you will have to set - in php.ini the safe_mode_include_dir to the directory - where your PEAR - modules are located, for example:

- -
-safe_mode_include_dir = /usr/local/lib/php
-
- -

To create the temporary directory on a UNIX-based system, you can do:

- -
-cd phpMyAdmin
-mkdir tmp
-chmod o+rwx tmp
-
- -

- 6.24 Now that phpMyAdmin supports native MySQL 4.1.x column comments, - what happens to my column comments stored in pmadb?

- -

Automatic migration of a table's pmadb-style column comments to the native - ones is done whenever you enter Structure page for this table.

- -

phpMyAdmin project

- -

- 7.1 I have found a bug. How do I inform developers?

- -

Our Bug Tracker is located at - http://sf.net/projects/phpmyadmin/ - under the Bugs section.

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

- -

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

- -

Always use the current SVN version of your language file. - For a new language, start from english-iso-8859-1.inc.php. If you - don't know how to get the SVN version, please ask one of the developers. -
- Please note that we try not to use HTML entities like &eacute; in - 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.
- You can then put your translations, as a zip file to avoid losing special - characters, on the sourceforge.net translation tracker.
- 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.

- -

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

- -

The following method is preferred for new developers:

- -
  1. fetch the current SVN tree over anonymous SVN:
    - svn co https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin
    -
  2. -
  3. add your stuff
  4. -
  5. generate patch with your changes: - svn diff
    -
  6. -
  7. put the patch inside the patch - tracker of the phpMyAdmin project. -
  8. -
- -

Write access to the SVN tree is granted only to experienced developers who - have already contributed something useful to phpMyAdmin.
- Also, have a look at the Developers section.

- -

Security

- -

- 8.1 Where can I get information about the security alerts issued for phpMyAdmin?

- -

Please refer to - http://www.phpmyadmin.net/home_page/security.php -

- - -

Developers Information

- -

phpMyAdmin is Open Source, so you're invited to contribute to it. Many - great features have been written by other people and you too can help to - make phpMyAdmin a useful tool.

- -

If you're planning to contribute source, please read the following - information:

- -
  • All files include libraries/header.inc.php (layout),. - libraries/common.lib.php (common functions) and - config.inc.php.
    - Only configuration data should go in config.inc.php. Please keep - it free from other code.
    - Commonly used functions should be added to - libraries/common.lib.php and more specific ones may be added - within a library stored into the libraries sub-directory.
  • -
  • Obviously, you're free to use whatever coding style you want. But - please try to keep your code as simple as possible: beginners are - using phpMyAdmin as an example application.
    - As far as possible, we want the scripts to be XHTML1.0 and CSS2 - compliant on one hand, they fit the - - PEAR - coding standards - on the other hand. Please pay attention to this.
  • -
  • Please try to keep up the file-naming conventions. Table-related stuff - goes to tbl_*.php, db-related code to db_*.php, - server-related tools to server_*.php and so on.
  • -
  • Please don't use verbose strings in your code, instead add the string - (at least) to english-iso-8859-1.inc.php and print() it out.
  • -
  • If you want to be really helpful, write an entry for the ChangeLog.
  • -
  • - The DBG extension (PHP - Debugger DBG) is now supported by phpMyAdmin for developers to - better debug and profile their code.
    - Please see the - $cfg['DBG']* configuration - options for more information.
    - This is in memoriam of the Space Shuttle Columbia (STS-107) which was - lost during its re-entry into Earth's atmosphere and in memory of the - brave men and women who gave their lives for the people of Earth.
  • -
- - -

Credits

- -
-phpMyAdmin - Credits
-====================
-
-CREDITS, in chronological order
--------------------------------
-
-- Tobias Ratschiller <tobias_at_ratschiller.com>
-    * creator of the phpmyadmin project
-    * maintainer from 1998 to summer 2000
-
-- Marc Delisle <Marc.Delisle_at_cegepsherbrooke.qc.ca>
-    * multi-language version
-    * various fixes and improvements
-    * SQL analyser (most of it)
-    * current project maintainer
-
-- Olivier Müller <om_at_omnis.ch>
-    * started SourceForge phpMyAdmin project in March 2001
-    * sync'ed different existing CVS trees with new features and bugfixes
-    * multi-language improvements, dynamic language selection
-    * current project maintainer
-    * many bugfixes and improvements
-
-- Loïc Chapeaux <lolo_at_phpheaven.net>
-    * rewrote and optimized javascript, DHTML and DOM stuff
-    * rewrote the scripts so they fit the PEAR coding standards and
-      generate XHTML1.0 and CSS2 compliant codes
-    * improved the language detection system
-    * many bugfixes and improvements
-
-- Robin Johnson <robbat2_at_users.sourceforge.net>
-    * database maintenance controls
-    * table type code
-    * Host authentication IP Allow/Deny
-    * DB-based configuration (Not completed)
-    * SQL parser and pretty-printer
-    * SQL validator
-    * many bugfixes and improvements
-
-- Armel Fauveau <armel.fauveau_at_globalis-ms.com>
-    * bookmarks feature
-    * multiple dump feature
-    * gzip dump feature
-    * zip dump feature
-
-- Geert Lund <glund_at_silversoft.dk>
-    * various fixes
-    * moderator of the phpMyAdmin former users forum at phpwizard.net
-
-- Korakot Chaovavanich <korakot_at_iname.com>
-    * "insert as new row" feature
-
-- Pete Kelly <webmaster_at_trafficg.com>
-    * rewrote and fix dump code
-    * bugfixes
-
-- Steve Alberty <alberty_at_neptunlabs.de>
-    * rewrote dump code for PHP4
-    * mySQL table statistics
-    * bugfixes
-
-- Benjamin Gandon <gandon_at_isia.cma.fr>
-    * main author of the version 2.1.0.1
-    * bugfixes
-
-- Alexander M. Turek <me_at_derrabus.de>
-    * MySQL 4.0 / 4.1 / 5.0 compatibility
-    * abstract database interface (PMA_DBI) with MySQLi support
-    * privileges administration
-    * XML exports
-    * various features and fixes
-    * German language file updates
-
-- Mike Beck <mike.beck_at_web.de>
-    * automatic joins in QBE
-    * links column in printview
-    * Relation view
-
-- Michal Čihař <michal_at_cihar.com>
-    * enhanced index creation/display feature
-    * feature to use a different charset for HTML than for MySQL
-    * improvements of export feature
-    * various features and fixes
-    * Czech language file updates
-
-- Christophe Gesché from the "MySQL Form Generator for PHPMyAdmin"
-  (http://sf.net/projects/phpmysqlformgen/)
-    * suggested the patch for multiple table printviews
-
-- Garvin Hicking <me_at_supergarv.de>
-    * built the patch for vertical display of table rows
-    * built the Javascript based Query window + SQL history
-    * Improvement of column/db comments
-    * (MIME)-Transformations for columns
-    * Use custom alias names for Databases in left frame
-    * hierarchical/nested table display
-    * PDF-scratchboard for WYSIWYG-distribution of PDF relations
-    * new icon sets
-    * vertical display of column properties page
-    * some bugfixes, features, support, German language additions
-
-- Yukihiro Kawada <kawada_at_den.fujifilm.co.jp>
-    * japanese kanji encoding conversion feature
-
-- Piotr Roszatycki <d3xter_at_users.sourceforge.net> and Dan Wilson
-    * the Cookie authentication mode
-
-- Axel Sander <n8falke_at_users.sourceforge.net>
-    * table relation-links feature
-
-- Maxime Delorme <delorme.maxime_at_free.fr>
-    * PDF schema output, thanks also to Olivier Plathey for the
-      "FPDF" library (see http://www.fpdf.org/) and Steven Wittens
-      for the "UFPDF" library (see http://www.acko.net/node/56).
-
-- Olof Edlund <olof.edlund_at_upright.se>
-    * SQL validator server
-
-- Ivan R. Lanin <ivanlanin_at_users.sourceforge.net>
-    * phpMyAdmin logo (until June 2004)
-
-- Mike Cochrane <mike_at_graftonhall.co.nz>
-    * blowfish library from the Horde project
-
-- Marcel Tschopp <ne0x_at_users.sourceforge.net>
-    * mysqli support
-    * many bugfixes and improvements
-
-- Michael Keck <mkkeck_at_users.sourceforge.net>
-    * redesign for 2.6.0
-    * phpMyAdmin sailboat logo (June 2004)
-
-- Mathias Landhäußer
-    * Representation at conferences
-
-- Sebastian Mendel <cybot_tm_at_users.sourceforge.net>
-    * interface improvements
-    * various bugfixes
-
-- Ivan A Kirillov
-    * new relations Designer
-
-And also to the following people who have contributed minor changes,
-enhancements, bugfixes or support for a new language since version 2.1.0:
-
-Bora Alioglu, Ricardo ?, Sven-Erik Andersen, Alessandro Astarita,
-Péter Bakondy, Borges Botelho, Olivier Bussier, Neil Darlow,
-Mats Engstrom, Ian Davidson, Laurent Dhima, Kristof Hamann, Thomas Kläger,
-Lubos Klokner, Martin Marconcini, Girish Nair, David Nordenberg, Andreas Pauley,
-Bernard M. Piller, Laurent Haas, "Sakamoto", Yuval Sarna,
-www.securereality.com.au, Alexis Soulard, Alvar Soome, Siu Sun, Peter Svec,
-Michael Tacelosky, Rachim Tamsjadi, Kositer Uros,
-Luís V., Martijn W. van der Lee,
-Algis Vainauskas, Daniel Villanueva, Vinay, Ignacio Vazquez-Abrams, Chee Wai,
-Jakub Wilk, Thomas Michael Winningham, Vilius Zigmantas, "Manuzhai".
-
-
-Original Credits of Version 2.1.0
----------------------------------
-
-    This work is based on Peter Kuppelwieser's MySQL-Webadmin. It was his idea
-    to create a web-based interface to MySQL using PHP3. Although I have not
-    used any of his source-code, there are some concepts I've borrowed from
-    him. phpMyAdmin was created because Peter told me he wasn't going to
-    further develop his (great) tool.
-    Thanks go to
-    - Amalesh Kempf <ak-lsml_at_living-source.com> who contributed the
-      code for the check when dropping a table or database. He also suggested
-      that you should be able to specify the primary key on tbl_create.php3. To
-      version 1.1.1 he contributed the ldi_*.php3-set (Import text-files) as
-      well as a bug-report. Plus many smaller improvements.
-    - Jan Legenhausen <jan_at_nrw.net>: He made many of the changes that
-      were introduced in 1.3.0 (including quite significant ones like the
-      authentication). For 1.4.1 he enhanced the table-dump feature. Plus
-      bug-fixes and help.
-    - Marc Delisle <DelislMa_at_CollegeSherbrooke.qc.ca> made phpMyAdmin
-      language-independent by outsourcing the strings to a separate file. He
-      also contributed the French translation.
-    - Alexandr Bravo <abravo_at_hq.admiral.ru> who contributed
-      tbl_select.php3, a feature to display only some fields from a table.
-    - Chris Jackson <chrisj_at_ctel.net> added support for MySQL
-      functions in tbl_change.php3. He also added the
-      "Query by Example" feature in 2.0.
-    - Dave Walton <walton_at_nordicdms.com> added support for multiple
-      servers and is a regular contributor for bug-fixes.
-    - Gabriel Ash <ga244_at_is8.nyu.edu> contributed the random access
-      features for 2.0.6.
-    The following people have contributed minor changes, enhancements, bugfixes
-    or support for a new language:
-    Jim Kraai, Jordi Bruguera, Miquel Obrador, Geert Lund, Thomas Kleemann,
-    Alexander Leidinger, Kiko Albiol, Daniel C. Chao, Pavel Piankov,
-    Sascha Kettler, Joe Pruett, Renato Lins, Mark Kronsbein, Jannis Hermanns,
-    G. Wieggers.
-
-    And thanks to everyone else who sent me email with suggestions, bug-reports
-    and or just some feedback.
-
- -

Glossary

- -

From Wikipedia, the free encyclopedia

- -
    -
  • .htaccess - - the default name of Apache's directory-level configuration file.
  • -
  • Blowfish - - a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier.
  • -
  • Browser (Web Browser) - - a software application that enables a user to display and interact with - text, images, and other information typically located on a web page at a - website on the World Wide Web.
  • -
  • bzip2 - - a free software/open source data compression algorithm and program - developed by Julian Seward.
  • -
  • CGI (Common Gateway Interface) - - an important World Wide Web technology that enables a client web browser - to request data from a program executed on the Web server.
  • -
  • Changelog - - a log or record of changes made to a project.
  • -
  • Client - - a computer system that accesses a (remote) service on another computer - by some kind of network.
  • -
  • column - - a set of data values of a particular simple type, one for each row of - the table.
  • -
  • Cookie - - a packet of information sent by a server to a World Wide Web browser - and then sent back by the browser each time it accesses that server.
  • -
  • CSV - - Comma-seperated values
  • -
  • DB - look at Database.
  • -
  • database - - an organized collection of data.
  • -
  • Engine - look at Storage Engines.
  • -
  • extension - - a PHP module that extends PHP with additional functionality.
  • -
  • FAQ (Frequently Asked Questions) - - a list of commonly asked question and there answers.
  • -
  • Field - - one part of divided data/columns.
  • -
  • foreign key - - a field or group of fields in a database record that point to a key - field or group of fields forming a key of another database record in some - (usually different) table.
  • -
  • FPDF (FreePDF) - - the free PDF library
  • -
  • - GD Graphics Library - a library by Thomas Boutell and others for - dynamically manipulating images.
  • -
  • GD2 - look at GD Graphics Library.
  • -
  • gzip - - gzip is short for GNU zip, a GNU free software file compression - program.
  • -
  • host - - any machine connected to a computer network, a node that has a hostname.
  • -
  • hostname - - the unique name by which a network attached device is known on a network.
  • -
  • HTTP - (HyperText Transfer Protocol) - - the primary method used to transfer or convey information on the World - Wide Web.
  • -
  • https - - a HTTP-connection with - additional security measures.
  • -
  • IIS (Internet Information Services) - - a set of Internet-based services for servers using Microsoft Windows.
  • -
  • Index - - a feature that allows quick access to the rows in a table.
  • -
  • IP (Internet Protocol) - - a data-oriented protocol used by source and destination hosts for - communicating data across a packet-switched internetwork.
  • -
  • IP Address - - a unique number that devices use in order to identify and communicate - with each other on a network utilizing the Internet Protocol standard.
  • -
  • ISAPI - (Internet Server Application Programming Interface) - - the API of Internet Information Services (IIS).
  • -
  • ISP (Internet service provider) - - a business or organization that offers users access to the Internet and related services.
  • -
  • JPEG - - a most commonly used standard method of lossy compression for - photographic images.
  • -
  • JPG - look at JPEG.
  • -
  • Key - look at index.
  • -
  • LATEX - - a document preparation system for the TEX typesetting program.
  • -
  • Mac (Apple Macintosh) - - line of personal computers is designed, developed, manufactured, and - marketed by Apple Computer.
  • -
  • Mac OS X - - the operating system which is included with all currently shipping Apple - Macintosh computers in the consumer and professional markets.
  • -
  • MCrypt - - a cryptographic library.
  • -
  • mcrypt - - the MCrypt PHP extension.
  • -
  • MIME (Multipurpose Internet Mail Extensions) - - an Internet Standard for the format of e-mail.
  • -
  • module - - some sort of extension for the Apache Webserver.
  • -
  • MySQL - - a multithreaded, multi-user, SQL (Structured Query Language) Database - Management System (DBMS).
  • -
  • mysqli - - the improved MySQL client PHP extension.
  • -
  • mysql - - the MySQL client PHP extension.
  • -
  • OpenDocument - - open standard for office documents.
  • -
  • OS X - - look at Mac OS X.
  • -
  • PDF - (Portable Document Format) - - a file format developed by Adobe Systems for representing two - dimensional documents in a device independent and resolution independent - format.
  • -
  • PEAR - - the PHP Extension and Application Repository.
  • -
  • PCRE (Perl Compatible Regular Expressions) - - the perl-compatible regular expression functions for PHP
  • -
  • PHP - - short for "PHP: Hypertext Preprocessor", is an open-source, reflective - programming language used mainly for developing server-side applications - and dynamic web content, and more recently, a broader range of software - applications.
  • -
  • port - - a connection through which data is sent and received.
  • -
  • RFC - - Request for Comments (RFC) documents are a series of memoranda - encompassing new research, innovations, and methodologies applicable to - Internet technologies.
  • -
  • RFC 1952 - - GZIP file format specification version 4.3
  • -
  • Row (record, tulpel) - - represents a single, implicitly structured data item in a table.
  • -
  • Server - - a computer system that provides services to other computing - systems over a network.
  • -
  • Storage Engines - - handlers for different table types
  • -
  • socket - - a form of inter-process communication.
  • -
  • SSL (Secure - Sockets Layer) - - a cryptographic protocol which provides secure communication on the Internet.
  • -
  • SQL - - Structured Query Language
  • -
  • table - - a set of data elements (cells) that is organized, defined and stored as - horizontal rows and vertical columns where each item can be uniquely - identified by a label or key or by it?s position in relation to other items.
  • -
  • Table type
  • -
  • tar - - a type of archive file format: the Tape ARchive format.
  • -
  • TCP (Transmission Control Protocol) - - one of the core protocols of the Internet protocol suite.
  • -
  • UFPDF - - Unicode/UTF-8 extension for FPDF
  • -
  • URL (Uniform Resource Locator) - - a sequence of characters, conforming to a standardized format, that is - used for referring to resources, such as documents and images on the - Internet, by their location.
  • -
  • Webserver - - A computer (program) that is responsible for accepting HTTP requests - from clients and serving them Web pages.
  • -
  • XML (Extensible Markup Language) - - a W3C-recommended general-purpose markup language for creating - special-purpose markup languages, capable of describing many different - kinds of data.
  • -
  • ZIP - - a popular data compression and archival format.
  • -
  • zlib - - an open-source, cross-platform data compression library by Jean-loup - Gailly and Mark Adler.
  • -
- -

- - Valid XHTML 1.1 - - Valid CSS!

- - - diff --git a/htdocs/sql/Documentation.txt b/htdocs/sql/Documentation.txt deleted file mode 100755 --- a/htdocs/sql/Documentation.txt +++ /dev/null @@ -1,3328 +0,0 @@ - * Top - * Requirements - * Introduction - * Installation - * Setup script - * Configuration - * Transformations - * FAQ - * Developers - * Credits - * Translators - * Glossary - -phpMyAdmin 2.11.9.5 Documentation - - * phpMyAdmin homepage - * SourceForge phpMyAdmin project page - * Official phpMyAdmin wiki - * Local documents: - + Version history: ChangeLog - + General notes: README - + License: LICENSE - * Documentation version: $Id: Documentation.html 12317 2009-03-24 21:04:18Z - lem9 $ - -Requirements - - * PHP - + You need PHP 4.2.0 or newer, with session support (see FAQ 1.31) - + You need GD2 support in PHP to display inline thumbnails of JPEGs - ("image/jpeg: inline") with their original aspect ratio - + You need PHP 4.3.0 or newer to use the "text/plain: external" - MIME-based transformation - + When using the "cookie" authentication method, the mcrypt extension is - strongly suggested for most users and is required for 64?bit machines. - Not using mcrypt will cause phpMyAdmin to load pages significantly - slower. - * MySQL 3.23.32 or newer (details); - * Web browser with cookies enabled. - -Introduction - -phpMyAdmin can manage a whole MySQL server (needs a super-user) as well as a -single database. To accomplish the latter you'll need a properly set up MySQL -user who can read/write only the desired database. It's up to you to look up -the appropriate part in the MySQL manual. - -Currently phpMyAdmin can: - - * browse and drop databases, tables, views, fields and indexes - * create, copy, drop, rename and alter databases, tables, fields and indexes - * maintenance server, databases and tables, with proposals on server - configuration - * execute, edit and bookmark any SQL-statement, even batch-queries - * load text files into tables - * create^1 and read dumps of tables - * export^1 data to various formats: CSV, XML, PDF, ISO/IEC 26300 - - OpenDocument Text and Spreadsheet, Word, Excel and L^AT[E]X formats - * administer multiple servers - * manage MySQL users and privileges - * check referential integrity in MyISAM tables - * using Query-by-example (QBE), create complex queries automatically - connecting required tables - * create PDF graphics of your Database layout - * search globally in a database or a subset of it - * transform stored data into any format using a set of predefined functions, - like displaying BLOB-data as image or download-link - * support InnoDB tables and foreign keys (see FAQ 3.6) - * support mysqli, the improved MySQL extension (see FAQ 1.17) - * communicate in 54 different languages - -A word about users: - -Many people have difficulty understanding the concept of user management with -regards to phpMyAdmin. When a user logs in to phpMyAdmin, that username and -password are passed directly to MySQL. phpMyAdmin does no account management on -its own (other than allowing one to manipulate the MySQL user account -information); all users must be valid MySQL users. - -^1) phpMyAdmin can compress (Zip, GZip -RFC 1952- or Bzip2 formats) dumps and -CSV exports if you use PHP with Zlib support (--with-zlib) and/or Bzip2 support -(--with-bz2). Proper support may also need changes in php.ini. - -Installation - - 1. Quick Install - 2. Setup script usage - 3. Linked-tables infrastructure - 4. Upgrading from an older version - 5. Using authentication modes - -phpMyAdmin does not apply any special security methods to the MySQL database -server. It is still the system administrator's job to grant permissions on the -MySQL databases properly. phpMyAdmin's "Privileges" page can be used for this. - -Warning for Mac users: -if you are on a Mac OS version before OS X, StuffIt unstuffs with Mac formats. -So you'll have to resave as in BBEdit to Unix style ALL phpMyAdmin scripts -before uploading them to your server, as PHP seems not to like Mac-style end of -lines character ("\r"). - -Quick Install - - 1. Choose an appropriate distribution kit from the phpmyadmin.net Downloads - page. Some kits contain only the English messages, others contain all - languages in UTF-8 format (this should be fine in most situations), others - contain all languages and all character sets. We'll assume you chose a kit - whose name looks like phpMyAdmin-x.x.x-all-languages.tar.gz. - 2. Untar or unzip the distribution (be sure to unzip the subdirectories): tar - -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz in your webserver's document - root. If you don't have direct access to your document root, put the files - in a directory on your local machine, and, after step 4, transfer the - directory on your web server using, for example, ftp. - 3. Ensure that all the scripts have the appropriate owner (if PHP is running - in safe mode, having some scripts with an owner different from the owner of - other scripts will be a problem). See FAQ 4.2 and FAQ 1.26 for suggestions. - 4. Now you must configure your installation. There are two methods that can be - used. Traditionally, users have hand-edited a copy of config.inc.php, but - now a wizard-style setup script is provided for those who prefer a - graphical installation. Creating a config.inc.php file is still a quick way - to get started and needed for some advanced features. - + To manually create the file, simply use your text editor to create the - file config.inc.php (you can copy config.sample.inc.php to get minimal - configuration file) in the main (top-level) phpMyAdmin directory (the - one that contains index.php). phpMyAdmin first loads libraries/ - config.default.php and then overrides those values with anything found - in config.inc.php. If the default value is okay for a particular - setting, there is no need to include it in config.inc.php. You'll need - a few directives to get going, a simple configuration may look like - this: - - - - Or, if you prefer to not be prompted every time you log in: - - - - For a full explanation of possible configuration values, see the - Configuration Section of this document. - + Instead of manually editing config.inc.php, you can use the Setup - Script. First you must manually create a folder config in the - phpMyAdmin directory. This is a security measure. On a Linux/Unix - system you can use the following commands: - - cd phpMyAdmin - mkdir config # create directory for saving - chmod o+rw config # give it world writable permissions - - And to edit an existing configuration, copy it over first: - - cp config.inc.php config/ # copy current configuration for editing - chmod o+w config/config.inc.php # give it world writable permissions - - On other platforms, simply create the folder and ensure that your web - server has read and write access to it. FAQ 1.26 can help with this. - - Next, open scripts/setup.php in your browser. Note that changes are not - saved to disk until explicitly choose Save from the Configuration area - of the screen. Normally the script saves the new config.inc.php to the - config/ directory, but if the webserver does not have the proper - permissions you may see the error "Cannot load or save configuration." - Ensure that the config/ directory exists and has the proper permissions - - or use the Download link to save the config file locally and upload - (via FTP or some similar means) to the proper location. - - Once the file has been saved, it must be moved out of the config/ - directory and the permissions must be reset, again as a security - measure: - - mv config/config.inc.php . # move file to current directory - chmod o-rw config.inc.php # remove world read and write permissions - - Now the file is ready to be used. You can choose to review or edit the - file with your favorite editor, if you prefer to set some advanced - options which the setup script does not provide. - 5. If you are using the auth_type "config", it is suggested that you protect - the phpMyAdmin installation directory because using config does not require - a user to enter a password to access the phpMyAdmin installation. Use of an - alternate authentication method is recommended, for example with HTTP?AUTH - in a .htaccess file or switch to using auth_type cookie or http. See the - multi?user sub?section of this FAQ for additional information, especially - FAQ 4.4. - 6. Open the main phpMyAdmin directory in your browser. phpMyAdmin should now - display a welcome screen and your databases, or a login dialog if using - HTTP or cookie authentication mode. - 7. You should deny access to the ./libraries subfolder in your webserver - configuration. For Apache you can use supplied .htaccess file in that - folder, for other webservers, you should configure this yourself. Such - configuration prevents from possible path exposure and cross side scripting - vulnerabilities that might happen to be found in that code. - -Linked-tables infrastructure - -For a whole set of new features (bookmarks, comments, SQL-history, -PDF-generation, field contents transformation, etc.) you need to create a set -of special tables. Those tables can be located in your own database, or in a -central database for a multi-user installation (this database would then be -accessed by the controluser, so no other user should have rights to it). - -Please look at your ./scripts/ directory, where you should find a file called -create_tables.sql. (If you are using a Windows server, pay special attention to -FAQ 1.23). - -If your MySQL server's version is 4.1.2 or later, please use ./scripts/ -create_tables_mysql_4_1_2+.sql instead, for a new installation. - -If you already had this infrastructure and upgraded to MySQL 4.1.2 or later, -please use ./scripts/upgrade_tables_mysql_4_1_2+.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 and -tables, and that the script may need some tuning, depending on the database -name. - -After having imported the ./scripts/create_tables.sql file, you should specify -the table names in your ./config.inc.php file. The directives used for that can -be found in the Configuration section. You will also need to have a controluser -with the proper rights to those tables (see section Using authentication modes -below). - -Upgrading from an older version - -Simply copy ./config.inc.php from your previous installation into the newly -unpacked one. Configuration files from very old versions (2.3.0 or before) may -require some tweaking as some options have been changed or removed. For -compatibility with PHP 6, remove a set_magic_quotes_runtime(0); statement that -you might find near the end of your configuration file. - -You should not copy libraries/config.default.php over config.inc.php because -the default configuration file 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, -you should run the SQL script found in scripts/upgrade_tables_mysql_4_1_2+.sql. - -Using authentication modes - - * HTTP and cookie authentication modes are recommended in a multi-user - environment where you want to give users access to their own database and - don't want them to play around with others. - Nevertheless be aware that MS Internet Explorer seems to be really buggy - about cookies, at least till version 6, and PHP 4.1.1 is also a bit buggy - in this area! - Even in a single-user environment, you might prefer to use HTTP or cookie - mode so that your user/password pair are not in clear in the configuration - file. - * HTTP and cookie authentication modes are more secure: the MySQL login - information does not need to be set in the phpMyAdmin configuration file - (except possibly for the controluser). - However, keep in mind that the password travels in plain text, unless you - are using the HTTPS protocol. - 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 - your MySQL server is previous to 4.1.2, or is running with - --skip-show-database. - - For 'HTTP' and 'cookie' modes, phpMyAdmin needs a controluser that has only - the SELECT privilege on the `mysql`.`user` (all columns except `Password`), - `mysql`.`db` (all columns), `mysql`.`host` (all columns) and `mysql`. - `tables_priv` (all columns except `Grantor` and `Timestamp`) tables. - You must specify the details for the controluser in the config.inc.php file - under the $cfg['Servers'][$i]['controluser'] and $cfg['Servers'][$i] - ['controlpass'] settings. - The following example assumes you want to use pma as the controluser and - pmapass as the controlpass, but this is only an example: use something else - in your file! Input these statements from the phpMyAdmin SQL Query window - or mysql command?line client. - Of course you have to replace localhost with the webserver's host if it's - not the same as the MySQL server's one. - - GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass'; - GRANT SELECT ( - Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, - Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, - File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, - Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, - Execute_priv, Repl_slave_priv, Repl_client_priv - ) ON mysql.user TO 'pma'@'localhost'; - GRANT SELECT ON mysql.db TO 'pma'@'localhost'; - GRANT SELECT ON mysql.host TO 'pma'@'localhost'; - GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) - ON mysql.tables_priv TO 'pma'@'localhost'; - - If you are using an old MySQL version (below 4.0.2), please replace the - first GRANT SELECT query by this one: - - GRANT SELECT ( - Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, - Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, - File_priv, Grant_priv, References_priv, Index_priv, Alter_priv - ) ON mysql.user TO 'pma'@'localhost'; - - ... and if you want to use the many new relation and bookmark features: - - GRANT SELECT, INSERT, UPDATE, DELETE ON .* TO 'pma'@'localhost'; - - (this of course requires that your linked-tables infrastructure be set up). - Of course, the above queries only work if your MySQL version supports the - GRANT command. This is the case since 3.22.11. - * 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 privileges to - an ordinary user, unless you understand the impact of those privileges (for - example, you are creating a superuser). - For example, to grant the user real_user with all privileges on the - database user_base: - - GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password'; - - What the user may now do is controlled entirely by the MySQL user - management system. - With HTTP or cookie authentication mode, you don't need to fill the user/ - password fields inside the $cfg['Servers'] array. - -'HTTP' authentication mode - - * Uses HTTP Basic authentication method and allows you to log in as any valid - MySQL user. - * Is supported with most PHP configurations. For IIS (ISAPI) support using - CGI PHP see FAQ 1.32, for using with Apache CGI see FAQ 1.35. - * See also FAQ 4.4 about not using the .htaccess mechanism along with 'HTTP' - authentication mode. - -'cookie' authentication mode - - * You can use this method as a replacement for the HTTP authentication (for - example, if you're running IIS). - * Obviously, the user must enable cookies in the browser, but this is now a - requirement for all authentication modes. - * With this mode, the user can truly log out of phpMyAdmin and log in back - with the same username. - * If you want to log in to arbitrary server see $cfg['AllowArbitraryServer'] - directive. - * As mentioned in the requirements section, having the mcrypt extension will - speed up access considerably, but is not required. - -'signon' authentication mode - - * This mode is a convenient way of using credentials from another application - to authenticate to phpMyAdmin. - * The other application has to store login information into session data. - * More details in the auth_type section. - -'config' authentication mode - - * This mode is the less secure one because it requires you to fill the $cfg - ['Servers'][$i]['user'] and $cfg['Servers'][$i]['password'] fields (and as - a result, anyone who can read your config.inc.php can discover your - username and password). - But you don't need to setup a "controluser" here: using the $cfg['Servers'] - [$i]['only_db'] might be enough. - * In the ISP FAQ section, there is an entry explaining how to protect your - configuration file. - * For additional security in this mode, you may wish to consider the Host - authentication $cfg['Servers'][$i]['AllowDeny']['order'] and $cfg - ['Servers'][$i]['AllowDeny']['rules'] configuration directives. - * Unlike cookie and http, does not require a user to log in when first - loading the phpMyAdmin site. This is by design but could allow any user to - access your installation. Use of some restriction method is suggested, - perhaps a .htaccess file with the HTTP-AUTH directive or disallowing - incoming HTTP requests at one?s router or firewall will suffice (both of - which are beyond the scope of this manual but easily searchable with - Google). - -Configuration - -Warning for Mac users: PHP does not seem to like Mac end of lines character ("\ -r"). So ensure you choose the option that allows to use the *nix end of line -character ("\n") in your text editor before saving a script you have modified. - -Configuration note: Almost all configurable data is placed in config.inc.php. -If this file does not exist, please refer to the Quick install section to -create one. This file only needs to contain the parameters you want to change -from their corresponding default value in libraries/config.default.php. - -The parameters which relate to design (like colors) are placed in themes/ -themename/layout.inc.php. You might also want to create config.footer.inc.php -and config.header.inc.php files to add your site specific code to be included -on start and end of each page. - -$cfg['PmaAbsoluteUri'] string - Sets here the complete URL (with full path) to your phpMyAdmin - installation's directory. E.g. http://www.your_web.net/ - path_to_your_phpMyAdmin_directory/. Note also that the URL on some web - servers are case?sensitive. Don?t forget the trailing slash at the end. - - Starting with version 2.3.0, it is advisable to try leaving this blank. In - most cases phpMyAdmin automatically detects the proper setting. Users of - port forwarding will need to set PmaAbsoluteUri (more info). A good test is - to browse a table, edit a row and save it. There should be an error message - if phpMyAdmin is having trouble auto?detecting the correct value. If you - get an error that this must be set or if the autodetect code fails to - detect your path, please post a bug report on our bug tracker so we can - improve the code. -$cfg['PmaNoRelation_DisableWarning'] boolean - Starting with version 2.3.0 phpMyAdmin offers a lot of features to work - with master / foreign ? tables (see $cfg['Servers'][$i]['pmadb']). - If you tried to set this up and it does not work for you, have a look on - the "Structure" page of one database where you would like to use it. You - will find a link that will analyze why those features have been disabled. - If you do not want to use those features set this variable to TRUE to stop - this message from appearing. -$cfg['SuhosinDisableWarning'] boolean - A warning is displayed on the main page if Suhosin is detected. You can set - this parameter to TRUE to stop this message from appearing. -$cfg['AllowThirdPartyFraming'] boolean - Setting this to true allows a page located on a different domain to call - phpMyAdmin inside a frame, and is a potential security hole allowing - cross-frame scripting attacks. -$cfg['blowfish_secret'] string - The "cookie" auth_type uses blowfish algorithm to encrypt the password. - If you are using the "cookie" auth_type, enter here a random passphrase of - your choice. It will be used internally by the blowfish algorithm: you - won?t be prompted for this passphrase. The maximum number of characters for - this parameter seems to be 46. -$cfg['Servers'] array - Since version 1.4.2, phpMyAdmin supports the administration of multiple - MySQL servers. Therefore, a $cfg['Servers']-array has been added which - contains the login information for the different servers. The first $cfg - ['Servers'][$i]['host'] contains the hostname of the first server, the - second $cfg['Servers'][$i]['host'] the hostname of the second server, etc. - In ./libraries/config.default.php, there is only one section for server - definition, however you can put as many as you need in ./config.inc.php, - copy that block or needed parts (you don't have to define all settings, - just those you need to change). -$cfg['Servers'][$i]['host'] string - The hostname or IP address of your $i-th MySQL-server. E.g. localhost. -$cfg['Servers'][$i]['port'] string - The port-number of your $i-th MySQL-server. Default is 3306 (leave blank). - If you use "localhost" as the hostname, MySQL ignores this port number and - connects with the socket, so if you want to connect to a port different - from the default port, use "127.0.0.1" or the real hostname in $cfg - ['Servers'][$i]['host']. -$cfg['Servers'][$i]['socket'] string - The path to the socket to use. Leave blank for default. - To determine the correct socket, check your MySQL configuration or, using - the mysql command?line client, issue the status command. Among the - resulting information displayed will be the socket used. -$cfg['Servers'][$i]['ssl'] boolean - Whether to enable SSL for connection to MySQL server. -$cfg['Servers'][$i]['connect_type'] string - What type connection to use with the MySQL server. Your options are - 'socket' and 'tcp'. It defaults to 'tcp' as that is nearly guaranteed to be - available on all MySQL servers, while sockets are not supported on some - platforms. - - To use the socket mode, your MySQL server must be on the same machine as - the Web server. -$cfg['Servers'][$i]['extension'] string - What php MySQL extension to use for the connection. Valid options are: - - mysql : The classic MySQL extension. This is the recommended and default - method at this time. - - mysqli : The improved MySQL extension. This extension became available with - php 5.0.0 and is the recommended way to connect to a server running MySQL - 4.1.x. -$cfg['Servers'][$i]['compress'] boolean - Whether to use a compressed protocol for the MySQL server connection or not - (experimental). - This feature requires PHP >= 4.3.0. -$cfg['Servers'][$i]['controluser'] string - $cfg['Servers'][$i]['controlpass'] string - 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 --skip-show-database, to enable a - multi-user installation (HTTP or cookie authentication mode). - - When using HTTP or cookie authentication modes (or 'config' authentication - mode since phpMyAdmin 2.2.1), you need to supply the details of a MySQL - account that has SELECT privilege on the mysql.user (all columns except - "Password"), mysql.db (all columns) and mysql.tables_priv (all columns - except "Grantor" and "Timestamp") tables. This account is used to check - what databases the user will see at login. - Please see the install section on "Using authentication modes" for more - information. - - In phpMyAdmin versions before 2.2.5, those were called "stduser/stdpass". -$cfg['Servers'][$i]['auth_type'] string ['HTTP'|'http'|'cookie'|'config'| - 'signon'] - Whether config or cookie or HTTP or signon authentication should be used - for this server. - + 'config' authentication ($auth_type = 'config') is the plain old way: - username and password are stored in config.inc.php. - + 'cookie' authentication mode ($auth_type = 'cookie') as introduced in - 2.2.3 allows you to log in as any valid MySQL user with the help of - cookies. Username and password are stored in cookies during the session - and password is deleted when it ends. This can also allow you to log in - in arbitrary server if $cfg['AllowArbitraryServer'] enabled. - + 'HTTP' authentication (was called 'advanced' in previous versions and - can be written also as 'http') ($auth_type = 'HTTP') as introduced in - 1.3.0 allows you to log in as any valid MySQL user via HTTP-Auth. - + 'signon' authentication mode ($auth_type = 'signon') as introduced in - 2.10.0 allows you to log in from prepared PHP session data. This is - useful for implementing single signon from another application. Sample - way how to seed session is in signon example: scripts/signon.php. You - need to configure session name and signon URL to use this - authentication method. - Please see the install section on "Using authentication modes" for more - information. -$cfg['Servers'][$i]['user'] string - $cfg['Servers'][$i]['password'] string - When using auth_type = 'config', this is the user/password-pair which - phpMyAdmin will use to connect to the MySQL server. This user/password pair - is not needed when HTTP or cookie authentication is used and should be - empty. -$cfg['Servers'][$i]['nopassword'] boolean - Allow attempt to log in without password when a login with password fails. - This can be used together with http authentication, when authentication is - done some other way and phpMyAdmin gets user name from auth and uses empty - password for connecting to MySQL. Password login is still tried first, but - as fallback, no password method is tried. -$cfg['Servers'][$i]['only_db'] string or array - If set to a (an array of) database name(s), only this (these) database(s) - will be shown to the user. Since phpMyAdmin 2.2.1, this/these database(s) - name(s) may contain MySQL wildcards characters ("_" and "%"): if you want - to use literal instances of these characters, escape them (I.E. use 'my\ - _db' and not 'my_db'). - This setting is an efficient way to lower the server load since the latter - does not need to send MySQL requests to build the available database list. - But it does not replace the privileges rules of the MySQL database server. - If set, it just means only these databases will be displayed but not that - all other databases can't be used. - - An example of using more that one database: $cfg['Servers'][$i]['only_db'] - = array('db1', 'db2'); - - As of phpMyAdmin 2.5.5 the order inside the array is used for sorting the - databases in the left frame, so that you can individually arrange your - databases. - If you want to have certain databases at the top, but don't care about the - others, you do not need to specify all other databases. Use: $cfg - ['Servers'][$i]['only_db'] = array('db3', 'db4', '*'); instead to tell - phpMyAdmin that it should display db3 and db4 on top, and the rest in - alphabetic order. -$cfg['Servers'][$i]['hide_db'] string - Regular expression for hiding some databases. This only hides them from - listing, but a user is still able to access them (using, for example, the - SQL query area). To limit access, use the MySQL privilege system. - - For example, to hide all databases starting with the letter "a", use - - $cfg['Servers'][$i]['hide_db'] = '^a'; - - and to hide both "db1" and "db2" use - - $cfg['Servers'][$i]['hide_db'] = '(db1|db2)'; - - More information on regular expressions can be found in the PCRE pattern - syntax portion of the PHP reference manual. -$cfg['Servers'][$i]['verbose'] string - Only useful when using phpMyAdmin with multiple server entries. If set, - this string will be displayed instead of the hostname in the pull-down menu - on the main page. This can be useful if you want to show only certain - databases on your system, for example. For HTTP auth, all non-US-ASCII - characters will be stripped. -$cfg['Servers'][$i]['pmadb'] string - The name of the database containing the linked-tables infrastructure. - - See the Linked-tables infrastructure section in this document to see the - benefits of this infrastructure, and for a quick way of creating this - database and the needed tables. - - If you are the only user of this phpMyAdmin installation, you can use your - current database to store those special tables; in this 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. -$cfg['Servers'][$i]['bookmarktable'] string - Since release 2.2.0 phpMyAdmin allows users to bookmark queries. This can - be useful for queries you often run. - - To allow the usage of this functionality: - + set up pmadb and the linked-tables infrastructure - + enter the table name in $cfg['Servers'][$i]['bookmarktable'] -$cfg['Servers'][$i]['relation'] string - Since release 2.2.4 you can describe, in a special 'relation' table, which - field is a key in another table (a foreign key). phpMyAdmin currently uses - this to - + make clickable, when you browse the master table, the data values that - point to the foreign table; - + display in an optional tool-tip the "display field" when browsing the - master table, if you move the mouse to a column containing a foreign - key (use also the 'table_info' table); - (see FAQ 6.7) - + in edit/insert mode, display a drop-down list of possible foreign keys - (key value and "display field" are shown) - (see FAQ 6.21) - + display links on the table properties page, to check referential - integrity (display missing foreign keys) for each described key; - + in query-by-example, create automatic joins (see FAQ 6.6) - + enable you to get a PDF schema of your database (also uses the - table_coords table). - The keys can be numeric or character. - - To allow the usage of this functionality: - + set up pmadb and the linked-tables infrastructure - + put the relation table name in $cfg['Servers'][$i]['relation'] - + now as normal user open phpMyAdmin and for each one of your tables - where you want to use this feature, click "Structure/Relation view/" - and choose foreign fields. - Please note that in the current version, master_db must be the same as - foreign_db. Those fields have been put in future development of the - cross-db relations. -$cfg['Servers'][$i]['table_info'] string - Since release 2.3.0 you can describe, in a special 'table_info' table, - which field is to be displayed as a tool-tip when moving the cursor over - the corresponding key. - This configuration variable will hold the name of this special table. To - allow the usage of this functionality: - + set up pmadb and the linked-tables infrastructure - + put the table name in $cfg['Servers'][$i]['table_info'] - + then for each table where you want to use this feature, click - "Structure/Relation view/Choose field to display" to choose the field. - Usage tip: Display field. -$cfg['Servers'][$i]['table_coords'] string - $cfg['Servers'][$i]['pdf_pages'] string - Since release 2.3.0 you can have phpMyAdmin create PDF pages showing the - relations between your tables. To do this it needs two tables "pdf_pages" - (storing information about the available PDF pages) and "table_coords" - (storing coordinates where each table will be placed on a PDF schema - output). - - You must be using the "relation" feature. - - To allow the usage of this functionality: - + set up pmadb and the linked-tables infrastructure - + put the correct table names in $cfg['Servers'][$i]['table_coords'] and - $cfg['Servers'][$i]['pdf_pages'] - Usage tips: PDF output. -$cfg['Servers'][$i]['column_info'] string - Since release 2.3.0 you can store comments to describe each column for each - table. These will then be shown on the "printview". - - Starting with release 2.5.0, comments are consequently used on the table - property pages and table browse view, showing up as tool-tips above the - column name (properties page) or embedded within the header of table in - browse view. They can also be shown in a table dump. Please see the - relevant configuration directives later on. - - Also new in release 2.5.0 is a MIME-transformation system which is also - based on the following table structure. See Transformations for further - information. To use the MIME-transformation system, your column_info table - has to have the three new fields 'mimetype', 'transformation', - 'transformation_options'. - - To allow the usage of this functionality: - + set up pmadb and the linked-tables infrastructure - + put the table name in $cfg['Servers'][$i]['column_info'] - + to update your PRE-2.5.0 Column_comments Table use this: - - ALTER TABLE `pma_column_comments` - ADD `mimetype` VARCHAR( 255 ) NOT NULL, - ADD `transformation` VARCHAR( 255 ) NOT NULL, - ADD `transformation_options` VARCHAR( 255 ) NOT NULL; - - and remember that the Variable in config.inc.php has been renamed from - $cfg['Servers'][$i]['column_comments'] to $cfg['Servers'][$i] - ['column_info'] -$cfg['Servers'][$i]['history'] string - Since release 2.5.0 you can store your SQL history, which means all queries - you entered manually into the phpMyAdmin interface. If you don't want to - use a table-based history, you can use the JavaScript-based history. Using - that, all your history items are deleted when closing the window. - - Using $cfg['QueryHistoryMax'] you can specify an amount of history items - you want to have on hold. On every login, this list gets cut to the maximum - amount. - - The query history is only available if JavaScript is enabled in your - browser. - - To allow the usage of this functionality: - + set up pmadb and the linked-tables infrastructure - + put the table name in $cfg['Servers'][$i]['history'] -$cfg['Servers'][$i]['designer_coords'] string - Since release 2.10.0 a Designer interface is available; it permits to - visually manage the relations. - - To allow the usage of this functionality: - + set up pmadb and the linked-tables infrastructure - + put the table name in $cfg['Servers'][$i]['designer_coords'] -$cfg['Servers'][$i]['verbose_check'] boolean - Because release 2.5.0 introduced the new MIME-transformation support, the - column_info table got enhanced with three new fields. If the above variable - is set to TRUE (default) phpMyAdmin will check if you have the latest table - structure available. If not, it will emit a warning to the superuser. - - You can disable this checking behavior by setting the variable to false, - which should offer a performance increase. - - Recommended to set to FALSE, when you are sure, your table structure is up - to date. -$cfg['Servers'][$i]['AllowRoot'] boolean - Whether to allow root access. This is just simplification of rules below. -$cfg['Servers'][$i]['AllowDeny']['order'] string - If your rule order is empty, then IP authentication is disabled. - - If your rule order is set to 'deny,allow' then the system applies all deny - rules followed by allow rules. Access is allowed by default. Any client - which does not match a Deny command or does match an Allow command will be - allowed access to the server. - - If your rule order is set to 'allow,deny' then the system applies all allow - rules followed by deny rules. Access is denied by default. Any client which - does not match an Allow directive or does match a Deny directive will be - denied access to the server. - - If your rule order is set to 'explicit', the authentication is performed in - a similar fashion to rule order 'deny,allow', with the added restriction - that your host/username combination must be listed in the allow rules, and - not listed in the deny rules. This is the most secure means of using Allow/ - Deny rules, and was available in Apache by specifying allow and deny rules - without setting any order. - - Please also see $cfg['TrustedProxies'] for detecting IP address behind - proxies. -$cfg['Servers'][$i]['AllowDeny']['rules'] array of strings - The general format for the rules is as such: - - <'allow' | 'deny'> [from] - - If you wish to match all users, it is possible to use a '%' as a wildcard - in the username field. - There are a few shortcuts you can use in the ipmask field as well (please - note that those containing SERVER_ADDRESS might not be available on all - webservers): - - 'all' -> 0.0.0.0/0 - 'localhost' -> 127.0.0.1/8 - 'localnetA' -> SERVER_ADDRESS/8 - 'localnetB' -> SERVER_ADDRESS/16 - 'localnetC' -> SERVER_ADDRESS/24 - - Having an empty rule list is equivalent to either using 'allow % from all' - if your rule order is set to 'deny,allow' or 'deny % from all' if your rule - order is set to 'allow,deny' or 'explicit'. - - For the IP matching system, the following work: - xxx.xxx.xxx.xxx (an exact IP address) - xxx.xxx.xxx.[yyy-zzz] (an IP address range) - xxx.xxx.xxx.xxx/nn (CIDR, Classless Inter-Domain Routing type IP addresses) - But the following does not work: - xxx.xxx.xxx.xx[yyy-zzz] (partial IP address range) -$cfg['Servers'][$i]['SignonSession'] string - Name of session which will be used for signon authentication method. -$cfg['Servers'][$i]['SignonURL'] string - URL where user will be redirected to log in for signon authentication - method. Should be absolute including protocol. -$cfg['Servers'][$i]['LogoutURL'] string - URL where user will be redirected after logout (doesn't affect config - authentication method). Should be absolute including protocol. -$cfg['ServerDefault'] integer - If you have more than one server configured, you can set $cfg - ['ServerDefault'] to any one of them to autoconnect to that server when - phpMyAdmin is started, or set it to 0 to be given a list of servers without - logging in. - If you have only one server configured, $cfg['ServerDefault'] MUST be set - to that server. -$cfg['MaxDbList'] integer - The maximum number of database names to be displayed in the navigation - frame and the database list. -$cfg['MaxTableList'] integer - The maximum number of table names to be displayed in the main panel's list - (except on the Export page). This limit is also enforced in the navigation - panel when in Light mode. -$cfg['MaxCharactersInDisplayedSQL'] integer - The maximum number of characters when a SQL query is displayed. The default - limit of 1000 should be correct to avoid the display of tons of hexadecimal - codes that represent BLOBs, but some users have real SQL queries that are - longer than 1000 characters. Also, if a query's length exceeds this limit, - this query is not saved in the history. -$cfg['OBGzip'] string/boolean - Defines whether to use GZip output buffering for increased speed in HTTP - transfers. - Set to true/false for enabling/disabling. When set to 'auto' (string), - phpMyAdmin tries to enable output buffering and will automatically disable - it if your browser has some problems with buffering. IE6 with a certain - patch is known to cause data corruption when having enabled buffering. -$cfg['PersistentConnections'] boolean - Whether persistent connections should be used or not (mysql_connect or - mysql_pconnect). -$cfg['ForceSSL'] boolean - Whether to force using https while accessing phpMyAdmin. -$cfg['ExecTimeLimit'] integer [number of seconds] - Set the number of seconds a script is allowed to run. If seconds is set to - zero, no time limit is imposed. - This setting is used while importing/exporting dump files but has no effect - when PHP is running in safe mode. -$cfg['MemoryLimit'] integer [number of bytes] - Set the number of bytes a script is allowed to allocate. If number set to - zero, no limit is imposed. - This setting is used while importing/exporting dump files but has no effect - when PHP is running in safe mode. - You can also use any string as in php.ini, eg. '16M'. -$cfg['SkipLockedTables'] boolean - Mark used tables and make it possible to show databases with locked tables - (since MySQL 3.23.30). -$cfg['ShowSQL'] boolean - Defines whether SQL queries generated by phpMyAdmin should be displayed or - not. -$cfg['AllowUserDropDatabase'] boolean - Defines whether normal users (non-administrator) are allowed to delete - their own database or not. If set as FALSE, the link "Drop Database" will - not be shown, and even a "DROP DATABASE mydatabase" will be rejected. Quite - practical for ISP's with many customers. - Please note that this limitation of SQL queries is not as strict as when - using MySQL privileges. This is due to nature of SQL queries which might be - quite complicated. So this choice should be viewed as help to avoid - accidental dropping rather than strict privilege limitation. -$cfg['Confirm'] boolean - Whether a warning ("Are your really sure...") should be displayed when - you're about to lose data. -$cfg['LoginCookieRecall'] boolean - Define whether the previous login should be recalled or not in cookie - authentication mode. -$cfg['LoginCookieValidity'] integer [number of seconds] - Define how long is login cookie valid. -$cfg['LoginCookieStore'] integer [number of seconds] - Define how long is login cookie should be stored in browser. Default 0 - means that it will be kept for existing session. This is recommended for - not trusted environments. -$cfg['LoginCookieDeleteAll'] boolean - If enabled (default), logout deletes cookies for all servers, otherwise - only for current one. Setting this to false makes it easy to forget to log - out from other server, when you are using more of them. -$cfg['UseDbSearch'] boolean - Define whether the "search string inside database" is enabled or not. -$cfg['IgnoreMultiSubmitErrors'] boolean - Define whether phpMyAdmin will continue executing a multi-query statement - if one of the queries fails. Default is to abort execution. -$cfg['VerboseMultiSubmit'] boolean - Define whether phpMyAdmin will output the results of each query of a - multi-query statement embedded into the SQL output as inline comments. - Defaults to TRUE. -$cfg['AllowArbitraryServer'] boolean - If enabled allows you to log in to arbitrary servers using cookie auth. - - NOTE: Please use this carefully, as this may allow users access to MySQL - servers behind the firewall where your HTTP server is placed. -$cfg['LeftFrameLight'] boolean - Defines whether to use a select-based menu and display only the current - tables in the left frame (smaller page). Only in Non-Lightmode you can use - the feature to display nested folders using $cfg['LeftFrameTableSeparator'] -$cfg['LeftFrameDBTree'] boolean - In light mode, defines whether to display the names of databases (in the - selector) using a tree, see also $cfg['LeftFrameDBSeparator']. -$cfg['LeftFrameDBSeparator'] string - The string used to separate the parts of the database name when showing - them in a tree. -$cfg['LeftFrameTableSeparator'] string - Defines a string to be used to nest table spaces. Defaults to '__'. This - means if you have tables like 'first__second__third' this will be shown as - a three-level hierarchy like: first > second > third. If set to FALSE or - empty, the feature is disabled. NOTE: You should not use this separator at - the beginning or end of a table name or multiple times after another - without any other characters in between. -$cfg['LeftFrameTableLevel'] string - Defines how many sublevels should be displayed when splitting up tables by - the above separator. -$cfg['ShowTooltip'] boolean - Defines whether to display table comment as tool-tip in left frame or not. -$cfg['ShowTooltipAliasDB'] boolean - If tool-tips are enabled and a DB comment is set, this will flip the - comment and the real name. That means that if you have a table called - 'user0001' and add the comment 'MyName' on it, you will see the name - 'MyName' used consequently in the left frame and the tool-tip shows the - real name of the DB. -$cfg['ShowTooltipAliasTB'] boolean/string - Same as $cfg['ShowTooltipAliasDB'], except this works for table names. When - setting this to 'nested', the Alias of the Tablename is only used to split/ - nest the tables according to the $cfg['LeftFrameTableSeparator'] directive. - So only the folder is called like the Alias, the tablename itself stays the - real tablename. -$cfg['LeftDisplayLogo'] boolean - Defines whether or not to display the phpMyAdmin logo at the top of the - left frame. Defaults to TRUE. -$cfg['LeftLogoLink'] string - Enter URL where logo in the navigation frame will point to. For use - especially with self made theme which changes this. The default value for - this is main.php. -$cfg['LeftLogoLinkWindow'] string - Whether to open the linked page in the main window (main) or in a new one - (new). Note: use new if you are linking to phpmyadmin.net. -$cfg['LeftDisplayServers'] boolean - Defines whether or not to display a server choice at the top of the left - frame. Defaults to FALSE. -$cfg['DisplayServersList'] boolean - Defines whether to display this server choice as links instead of in a - drop-down. Defaults to FALSE (drop-down). -$cfg['DisplayDatabasesList'] boolean or text - Defines whether to display database choice in light navigation frame as - links instead of in a drop-down. Defaults to 'auto' - on main page list is - shown, when database is selected, only drop down is displayed. -$cfg['ShowStats'] boolean - Defines whether or not to display space usage and statistics about - databases and tables. - Note that statistics requires at least MySQL 3.23.3 and that, at this date, - MySQL doesn't return such information for Berkeley DB tables. -$cfg['ShowServerInfo'] boolean - Defines whether to display detailed server information on main page. You - can additionally hide more information by using $cfg['Servers'][$i] - ['verbose']. -$cfg['ShowPhpInfo'] boolean - $cfg['ShowChgPassword'] boolean - $cfg['ShowCreateDb'] boolean - Defines whether to display the "PHP information" and "Change password " - links and form for creating database or not at the starting main (right) - frame. This setting does not check MySQL commands entered directly. - - Please note that to block the usage of phpinfo() in scripts, you have to - put this in your php.ini: - - disable_functions = phpinfo() - - Also note that enabling the "Change password " link has no effect with - "config" authentication mode: because of the hard coded password value in - the configuration file, end users can't be allowed to change their - passwords. -$cfg['SuggestDBName'] boolean - Defines whether to suggest a database name on the "Create Database" form or - to keep the textfield empty. -$cfg['ShowBlob'] boolean - Defines whether or not BLOB fields are shown when browsing a table's - content. -$cfg['NavigationBarIconic'] string - Defines whether navigation bar buttons and the right panel top menu contain - text or symbols only. A value of TRUE displays icons, FALSE displays text - and 'both' displays both icons and text. -$cfg['ShowAll'] boolean - Defines whether a user should be displayed a "show all (records)" button in - browse mode or not. -$cfg['MaxRows'] integer - Number of rows displayed when browsing a result set. If the result set - contains more rows, "Previous" and "Next" links will be shown. -$cfg['Order'] string [DESC|ASC|SMART] - Defines whether fields are displayed in ascending (ASC) order, in - descending (DESC) order or in a "smart" (SMART) order - I.E. descending - order for fields of type TIME, DATE, DATETIME and TIMESTAMP, ascending - order else- by default. -$cfg['ProtectBinary'] boolean or string - Defines whether BLOB or BINARY fields are protected from editing when - browsing a table's content. Valid values are: - + FALSE to allow editing of all fields; - + 'blob' to allow editing of all fields except BLOBS; - + 'all' to disallow editing of all BINARY or BLOB fields. -$cfg['ShowFunctionFields'] boolean - Defines whether or not MySQL functions fields should be initially displayed - in edit/insert mode. Since version 2.10, the user can toggle this setting - from the interface. -$cfg['CharEditing'] string - Defines which type of editing controls should be used for CHAR and VARCHAR - fields. Possible values are: - + input - this allows to limit size of text to size of field in MySQL, - but has problems with newlines in fields - + textarea - no problems with newlines in fields, but also no length - limitations - Default is old behavior so input. -$cfg['InsertRows'] integer - Defines the maximum number of concurrent entries for the Insert page. -$cfg['ForeignKeyMaxLimit'] integer - If there are fewer items than this in the set of foreign keys, then a - drop-down box of foreign keys is presented, in the style described by the - $cfg['ForeignKeyDropdownOrder'] setting. -$cfg['ForeignKeyDropdownOrder'] array - For the foreign key drop-down fields, there are several methods of display, - offering both the key and value data. The contents of the array should be - one or both of the following strings: 'content-id', 'id-content'. -$cfg['ZipDump'] boolean - $cfg['GZipDump'] boolean - $cfg['BZipDump'] boolean - Defines whether to allow the use of zip/GZip/BZip2 compression when - creating a dump file -$cfg['CompressOnFly'] boolean - Defines whether to allow on the fly compression for GZip/BZip2 compressed - exports. This doesn't affect smaller dumps and allows users to create - larger dumps that won't otherwise fit in memory due to php memory limit. - Produced files contain more GZip/BZip2 headers, but all normal programs - handle this correctly. -$cfg['LightTabs'] boolean - If set to TRUE, use less graphically intense tabs on the top of the - mainframe. -$cfg['PropertiesIconic'] string - If set to TRUE, will display icons instead of text for db and table - properties links (like 'Browse', 'Select', 'Insert', ...). - Can be set to 'both' if you want icons AND text. - When set to FALSE, will only show text. -$cfg['PropertiesNumColumns'] integer - How many columns will be utilized to display the tables on the database - property view? Default is 1 column. When setting this to a value larger - than 1, the type of the database will be omitted for more display space. -$cfg['DefaultTabServer'] string - Defines the tab displayed by default on server view. Possible values: - "main.php" (recommended for multi-user setups), "server_databases.php", - "server_status.php", "server_variables.php", "server_privileges.php" or - "server_processlist.php". -$cfg['DefaultTabDatabase'] string - Defines the tab displayed by default on database view. Possible values: - "db_structure.php", "db_sql.php" or "db_search.php". -$cfg['DefaultTabTable'] string - Defines the tab displayed by default on table view. Possible values: - "tbl_structure.php", "tbl_sql.php", "tbl_select.php", "tbl_change.php" or - "sql.php". -$cfg['MySQLManualBase'] string - If set to an URL which points to the MySQL documentation (type depends on - $cfg['MySQLManualType']), appropriate help links are generated. - See MySQL Documentation page for more information about MySQL manuals and - their types. -$cfg['MySQLManualType'] string - Type of MySQL documentation: - + viewable - "viewable online", current one used on MySQL website - + searchable - "Searchable, with user comments" - + chapters - "HTML, one page per chapter" - + big - "HTML, all on one page" - + none - do not show documentation links -$cfg['DefaultLang'] string - Defines the default language to use, if not browser-defined or - user-defined. - See the select_lang.lib.php script to know the valid values for this - setting. -$cfg['DefaultConnectionCollation'] string - Defines the default connection collation to use, if not user-defined. - See the MySQL documentation for list of possible values. -$cfg['Lang'] string - Force: always use this language (must be defined in the select_lang.lib.php - script). -$cfg['FilterLanguages'] string - Limit list of available languages to those matching the given regular - expression. For example if you want only Czech and English, you should set - filter to '^(cs|en)'. -$cfg['DefaultCharset'] string - Default character set to use for recoding of MySQL queries. This must be - enabled and it's described by $cfg['AllowAnywhereRecoding'] option. - You can give here any character set which is in $cfg['AvailableCharsets'] - array and this is just default choice, user can select any of them. -$cfg['AllowAnywhereRecoding'] boolean - Allow character set recoding of MySQL queries. You need recode or iconv - support (compiled in or module) in PHP to allow MySQL queries recoding and - used language file must have it enabled (by default only these which are in - Unicode, just to avoid losing some characters). - - Setting this to TRUE also activates a pull-down menu in the Export page, to - choose the character set when exporting a file. -$cfg['RecodingEngine'] string - You can select here which functions will be used for character set - conversion. Possible values are: - + auto - automatically use available one (first is tested iconv, then - recode) - + iconv - use iconv or libiconv functions - + recode - use recode_string function - Default is auto. -$cfg['IconvExtraParams'] string - Specify some parameters for iconv used in charset conversion. See iconv - documentation for details. By default //TRANSLIT is used, so that invalid - characters will be transliterated. -$cfg['AvailableCharsets'] array - Available character sets for MySQL conversion. You can add your own (any of - supported by recode/iconv) or remove these which you don't use. Character - sets will be shown in same order as here listed, so if you frequently use - some of these move them to the top. -$cfg['TrustedProxies'] array - Lists proxies and HTTP headers which are trusted for IP Allow/Deny. This - list is by default empty, you need to fill in some trusted proxy servers if - you want to use rules for IP addresses behind proxy. - - The following example specifies that phpMyAdmin should trust a - HTTP_X_FORWARDED_FOR (X-Forwarded-For) header coming from the proxy - 1.2.3.4: - - $cfg['TrustedProxies'] = - array('1.2.3.4' => 'HTTP_X_FORWARDED_FOR'); - - The $cfg['Servers'][$i]['AllowDeny']['rules'] directive uses the client's - IP address as usual. -$cfg['GD2Available'] string - Specifies whether GD >= 2 is available. If yes it can be used for MIME - transformations. - Possible values are: - + auto - automatically detect, this is a bit expensive operation for php - < 4.3.0 so it is preferred to change this according to your server real - possibilities - + yes - GD 2 functions can be used - + no - GD 2 function cannot be used - Default is auto. -$cfg['NaviWidth'] integer - Navi frame width in pixels. See themes/themename/layout.inc.php. -$cfg['NaviBackground'] string [valid css code for background] - $cfg['MainBackground'] string [valid css code for background] - The background styles used for both the frames. See themes/themename/ - layout.inc.php. -$cfg['NaviPointerBackground'] string [valid css code for background] - $cfg['NaviPointerColor'] string [valid css color] - The style used for the pointer in the navi frame. See themes/themename/ - layout.inc.php. -$cfg['NaviDatabaseNameColor'] string [valid css code] - The color used for the database name in the navi frame. See themes/ - themename/layout.inc.php. -$cfg['LeftPointerEnable'] boolean - A value of TRUE activates the navi pointer (when LeftFrameLight is FALSE). -$cfg['Border'] integer - The size of a table's border. See themes/themename/layout.inc.php. -$cfg['ThBackground'] string [valid css code for background] - $cfg['ThColor'] string [valid css color] - The style used for table headers. See themes/themename/layout.inc.php. -$cfg['BgOne'] string [HTML color] - The color (HTML) #1 for table rows. See themes/themename/layout.inc.php. -$cfg['BgTwo'] string [HTML color] - The color (HTML) #2 for table rows. See themes/themename/layout.inc.php. -$cfg['BrowsePointerBackground'] string [HTML color] - $cfg['BrowsePointerColor'] string [HTML color] - $cfg['BrowseMarkerBackground'] string [HTML color] - $cfg['BrowseMarkerColor'] string [HTML color] - The colors (HTML) uses for the pointer and the marker in browse mode. - The former feature highlights the row over which your mouse is passing and - the latter lets you visually mark/unmark rows by clicking on them. - See themes/themename/layout.inc.php. -$cfg['FontFamily'] string - You put here a valid CSS font family value, for example arial, sans-serif. - See themes/themename/layout.inc.php. -$cfg['FontFamilyFixed'] string - You put here a valid CSS font family value, for example monospace. This one - is used in textarea. - See themes/themename/layout.inc.php. -$cfg['BrowsePointerEnable'] boolean - Whether to activate the browse pointer or not. -$cfg['BrowseMarkerEnable'] boolean - Whether to activate the browse marker or not. -$cfg['TextareaCols'] integer - $cfg['TextareaRows'] integer - $cfg['CharTextareaCols'] integer - $cfg['CharTextareaRows'] integer - Number of columns and rows for the textareas. - This value will be emphasized (*2) for SQL query textareas and (*1.25) for - SQL textareas inside the query window. - The Char* values are used for CHAR and VARCHAR editing (if configured via - $cfg['CharEditing']). -$cfg['LongtextDoubleTextarea'] boolean - Defines whether textarea for LONGTEXT fields should have double size. -$cfg['TextareaAutoSelect'] boolean - Defines if the whole textarea of the query box will be selected on click. -$cfg['CtrlArrowsMoving'] boolean - Enable Ctrl+Arrows (Option+Arrows in Safari) moving between fields when - editing. -$cfg['LimitChars'] integer - Maximum number of characters showen in any non-numeric field on browse - view. Can be turned off by a toggle button on the browse page. -$cfg['ModifyDeleteAtLeft'] boolean $cfg['ModifyDeleteAtRight'] boolean - Defines the place where modify and delete links would be put when tables - contents are displayed (you may have them displayed both at the left and at - the right). "Left" and "right" are parsed as "top" and "bottom" with - vertical display mode. -$cfg['DefaultDisplay'] string $cfg['HeaderFlipType'] string - There are 3 display modes: horizontal, horizontalflipped and vertical. - Define which one is displayed by default. The first mode displays each row - on a horizontal line, the second rotates the headers by 90 degrees, so you - can use descriptive headers even though fields only contain small values - and still print them out. The vertical mode sorts each row on a vertical - lineup. - - The HeaderFlipType can be set to 'css' or 'fake'. When using 'css' the - rotation of the header for horizontalflipped is done via CSS. If set to - 'fake' PHP does the transformation for you, but of course this does not - look as good as CSS. -$cfg['DefaultPropDisplay'] string or integer - When editing/creating new columns in a table all fields normally get lined - up one field a line. (default: 'horizontal'). If you set this to 'vertical' - you can have each field lined up vertically beneath each other. You can - save up a lot of place on the horizontal direction and no longer have to - scroll. If you set this to integer, editing of fewer columns will appear in - 'vertical' mode, while editing of more fields still in 'horizontal' mode. - This way you can still effectively edit large number of fields, while - having full view on few of them. -$cfg['ShowBrowseComments'] boolean - $cfg['ShowPropertyComments'] boolean - By setting the corresponding variable to TRUE you can enable the display of - column comments in Browse or Property display. In browse mode, the comments - are shown inside the header. In property mode, comments are displayed using - a CSS-formatted dashed-line below the name of the field. The comment is - shown as a tool-tip for that field. -$cfg['SQLQuery']['Edit'] boolean - Whether to display an edit link to change a query in any SQL Query box. -$cfg['SQLQuery']['Explain'] boolean - Whether to display a link to explain a SELECT query in any SQL Query box. -$cfg['SQLQuery']['ShowAsPHP'] boolean - Whether to display a link to wrap a query in PHP code in any SQL Query box. -$cfg['SQLQuery']['Validate'] boolean - Whether to display a link to validate a query in any SQL Query box. See - also $cfg_SQLValidator. -$cfg['SQLQuery']['Refresh'] boolean - Whether to display a link to refresh a query in any SQL Query box. -$cfg['UploadDir'] string - The name of the directory where SQL files have been uploaded by other means - than phpMyAdmin (for example, ftp). Those files are available under a - drop-down box when you click the database or table name, then the Import - tab. - - If you want different directory for each user, %u will be replaced with - username. - - Please note that the file names must have the suffix ".sql" (or ".sql.bz2" - or ".sql.gz" if support for compressed formats is enabled). - - This feature is useful when your file is too big to be uploaded via HTTP, - or when file uploads are disabled in PHP. - - Please note that if PHP is running in safe mode, this directory must be - owned by the same user as the owner of the phpMyAdmin scripts. - - See also FAQ 1.16 for alternatives. -$cfg['SaveDir'] string - The name of the directory where dumps can be saved. - - If you want different directory for each user, %u will be replaced with - username. - - Please note that the directory must exist and has to be writable for the - user running the webserver. - - Please note that if PHP is running in safe mode, this directory must be - owned by the same user as the owner of the phpMyAdmin scripts. -$cfg['TempDir'] string - The name of the directory where temporary files can be stored. - - This is needed for native MS Excel export, see FAQ 6.23 -$cfg['Export'] array - In this array are defined default parameters for export, names of items are - similar to texts seen on export page, so you can easily identify what they - mean. -$cfg['Import'] array - In this array are defined default parameters for import, names of items are - similar to texts seen on import page, so you can easily identify what they - mean. -$cfg['RepeatCells'] integer - Repeat the headers every X cells, or 0 to deactivate. -$cfg['EditInWindow'] boolean - $cfg['QueryWindowWidth'] integer - $cfg['QueryWindowHeight'] integer - $cfg['QueryHistoryDB'] boolean - $cfg['QueryWindowDefTab'] string - $cfg['QueryHistoryMax'] integer - All those variables affect the query window feature. A SQL link or icon is - always displayed on the left panel. If JavaScript is enabled in your - browser, a click on this opens a distinct query window, which is a direct - interface to enter SQL queries. Otherwise, the right panel changes to - display a query box. - - The size of this query window can be customized with $cfg - ['QueryWindowWidth'] and $cfg['QueryWindowWidth'] - both integers for the - size in pixels. Note that normally, those parameters will be modified in - layout.inc.php for the theme you are using. - - If $cfg['EditInWindow'] is set to true, a click on [Edit] from the results - page (in the "Showing Rows" section) opens the query window and puts the - current query inside it. If set to false, clicking on the link puts the SQL - query in the right panel's query box. - - The usage of the JavaScript query window is recommended if you have a - JavaScript enabled browser. Basic functions are used to exchange quite a - few variables, so most 4th generation browsers should be capable to use - that feature. It currently is only tested with Internet Explorer 6 and - Mozilla 1.x. - - If $cfg['QueryHistoryDB'] is set to TRUE, all your Queries are logged to a - table, which has to be created by you (see $cfg['Servers'][$i]['history']). - If set to FALSE, all your queries will be appended to the form, but only as - long as your window is opened they remain saved. - - When using the JavaScript based query window, it will always get updated - when you click on a new table/db to browse and will focus if you click on - "Edit SQL" after using a query. You can suppress updating the query window - by checking the box "Do not overwrite this query from outside the window" - below the query textarea. Then you can browse tables/databases in the - background without losing the contents of the textarea, so this is - especially useful when composing a query with tables you first have to look - in. The checkbox will get automatically checked whenever you change the - contents of the textarea. Please uncheck the button whenever you definitely - want the query window to get updated even though you have made alterations. - - If $cfg['QueryHistoryDB'] is set to TRUE you can specify the amount of - saved history items using $cfg['QueryHistoryMax']. - - The query window also has a custom tabbed look to group the features. Using - the variable $cfg['QueryWindowDefTab'] you can specify the default tab to - be used when opening the query window. It can be set to either 'sql', - 'files', 'history' or 'full'. -$cfg['BrowseMIME'] boolean - Enable MIME-transformations. -$cfg['MaxExactCount'] integer - For InnoDB tables, determines for how large tables phpMyAdmin should get - the exact row count using SELECT COUNT. If the approximate row count as - returned by SHOW TABLE STATUS is smaller than this value, SELECT COUNT will - be used, otherwise the approximate count will be used. -$cfg['MaxExactCountViews'] integer - For VIEWs, since obtaining the exact count could have an impact on - performance, this value is the maximum to be displayed, using a SELECT - COUNT ... LIMIT. The default value of 0 bypasses any row counting. -$cfg['WYSIWYG-PDF'] boolean - Utilizes a WYSIWYG editing control to easily place elements of a PDF page. - By clicking on the button 'toggle scratchboard' on the page where you edit - x/y coordinates of those elements you can activate a scratchboard where all - your elements are placed. By clicking on an element, you can move them - around in the pre-defined area and the x/y coordinates will get updated - dynamically. Likewise, when entering a new position directly into the input - field, the new position in the scratchboard changes after your cursor - leaves the input field. - You have to click on the 'OK'-button below the tables to save the new - positions. If you want to place a new element, first add it to the table of - elements and then you can drag the new element around. - By changing the paper size and the orientation you can change the size of - the scratchboard as well. You can do so by just changing the dropdown field - below, and the scratchboard will resize automatically, without interfering - with the current placement of the elements. - If ever an element gets out of range you can either enlarge the paper size - or click on the 'reset' button to place all elements below each other. - NOTE: You have to use a recent browser like IE6 or Mozilla to get this - control to work. The basic Drag&Drop script functionality was kindly - borrowed from www.youngpup.net and is underlying so specific license. -$cfg['NaturalOrder'] boolean - Sorts database and table names according to natural order (for example, t1, - t2, t10). Currently implemented in the left panel (Light mode) and in - Database view, for the table list. -$cfg['TitleTable'] string -$cfg['TitleDatabase'] string -$cfg['TitleServer'] string -$cfg['TitleDefault'] string - Allows you to specify window's title bar. Following magic string can be - used to get special values: - - @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 - @PHPMYADMIN@ - phpMyAdmin with version - -$cfg['ErrorIconic'] boolean - Uses icons for warnings, errors and informations. -$cfg['MainPageIconic'] boolean - Uses icons on main page in lists and menu tabs. -$cfg['ReplaceHelpImg'] boolean - Shows a help button instead of the "Documentation" message. -$cfg['ThemePath'] string - If theme manager is active, use this as the path of the subdirectory - containing all the themes. -$cfg['ThemeManager'] boolean - Enables user-selectable themes. See FAQ 2.7. -$cfg['ThemeDefault'] string - The default theme (a subdirectory under cfg['ThemePath']). -$cfg['ThemePerServer'] boolean - Whether to allow different theme for each server. -$cfg['DefaultQueryTable'] string - $cfg['DefaultQueryDatabase'] string - 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 field names. Note that %t and %f are only applicable to - $cfg['DefaultQueryTable']. -$cfg['SQP']['fmtType'] string [html|none] - The main use of the new SQL Parser is to pretty-print SQL queries. By - default we use HTML to format the query, but you can disable this by - setting this variable to 'none'. -$cfg['SQP']['fmtInd'] float - $cfg['SQP']['fmtIndUnit'] string [em|px|pt|ex] - For the pretty-printing of SQL queries, under some cases the part of a - query inside a bracket is indented. By changing $cfg['SQP']['fmtInd'] you - can change the amount of this indent. - Related in purpose is $cfg['SQP']['fmtIndUnit'] which specifies the units - of the indent amount that you specified. This is used via stylesheets. -$cfg['SQP']['fmtColor'] array of string tuples - This array is used to define the colours for each type of element of the - pretty-printed SQL queries. The tuple format is - class => [HTML colour code | empty string] - If you specify an empty string for the color of a class, it is ignored in - creating the stylesheet. You should not alter the class names, only the - colour strings. - Class name key: - + comment Applies to all comment sub-classes - + comment_mysql Comments as "#...\n" - + comment_ansi Comments as "-- ...\n" - + comment_c Comments as "/*...*/" - + digit Applies to all digit sub-classes - + digit_hex Hexadecimal numbers - + digit_integer Integer numbers - + digit_float Floating point numbers - + punct Applies to all punctuation sub-classes - + punct_bracket_open_round Opening brackets"(" - + punct_bracket_close_round Closing brackets ")" - + punct_listsep List item Separator "," - + punct_qualifier Table/Column Qualifier "." - + punct_queryend End of query marker ";" - + alpha Applies to all alphabetic classes - + alpha_columnType Identifiers matching a column type - + alpha_columnAttrib Identifiers matching a database/table/column - attribute - + alpha_functionName Identifiers matching a MySQL function name - + alpha_reservedWord Identifiers matching any other reserved word - + alpha_variable Identifiers matching a SQL variable "@foo" - + alpha_identifier All other identifiers - + quote Applies to all quotation mark classes - + quote_double Double quotes " - + quote_single Single quotes ' - + quote_backtick Backtick quotes ` -$cfg['SQLValidator'] boolean - - $cfg['SQLValidator']['use'] boolean - phpMyAdmin now supports use of the Mimer SQL Validator service, as - originally published on Slashdot. - For help in setting up your system to use the service, see the FAQ 6.14 - . - $cfg['SQLValidator']['username'] string - $cfg['SQLValidator']['password'] string - The SOAP service allows you to log in with anonymous and any password, - so we use those by default. Instead, if you have an account with them, - you can put your login details here, and it will be used in place of - the anonymous login. - -$cfg['DBG'] - DEVELOPERS ONLY! -$cfg['DBG']['enable'] boolean - DEVELOPERS ONLY! - Enable the DBG extension for debugging phpMyAdmin. Required for profiling - the code. - For help in setting up your system to this, see the Developers section. -$cfg['DBG']['profile']['enable'] boolean - DEVELOPERS ONLY! - Enable profiling support for phpMyAdmin. This will append a chunk of data - to the end of every page displayed in the main window with profiling - statistics for that page. - You may need to increase the maximum execution time for this to complete - successfully.Profiling was removed from the code for version 2.9.0 due to - licensing issues. -$cfg['DBG']['profile']['threshold'] float (units in milliseconds) - DEVELOPERS ONLY! - When profiling data is displayed, this variable controls the threshold of - display for any profiling data, based on the average time each time has - taken. If it is over the threshold it is displayed, otherwise it is not - displayed. This takes a value in milliseconds. In most cases you don't need - to edit this. -$cfg['ColumnTypes'] array - All possible types of a MySQL column. In most cases you don't need to edit - this. -$cfg['AttributeTypes'] array - Possible attributes for fields. In most cases you don't need to edit this. -$cfg['Functions'] array - A list of functions MySQL supports. In most cases you don't need to edit - this. -$cfg['RestrictColumnTypes'] array - Mapping of column types to meta types used for preferring displayed - functions. In most cases you don't need to edit this. -$cfg['RestrictFunctions'] array - Functions preferred for column meta types as defined in $cfg - ['RestrictColumnTypes']. In most cases you don't need to edit this. -$cfg['DefaultFunctions'] array - Functions selected by default when inserting/changing row, Functions are - defined for meta types from $cfg['RestrictColumnTypes'] and for - first_timestamp, which is used for first timestamp column in table. -$cfg['NumOperators'] array - Operators available for search operations on numeric and date fields. -$cfg['TextOperators'] array - Operators available for search operations on character fields. Note that we - put LIKE by default instead of LIKE %...%, to avoid unintended performance - problems in case of huge tables. -$cfg['EnumOperators'] array - Operators available for search operations on enum fields. -$cfg['NullOperators'] array - Additional operators available for search operations when the field can be - null. - -Transformations - - 1. Introduction - 2. Usage - 3. File structure - -1. Introduction - -To enable transformations, you have to setup the column_info table and the -proper directives. Please see the Configuration section on how to do so. - -You can apply different transformations to the contents of each field. The -transformation will take the content of each field and transform it with -certain rules defined in the selected transformation. - -Say you have a field 'filename' which contains a filename. Normally you would -see in phpMyAdmin only this filename. Using transformations you can transform -that filename into a HTML link, so you can click inside of the phpMyAdmin -structure on the field's link and will see the file displayed in a new browser -window. Using transformation options you can also specify strings to append/ -prepend to a string or the format you want the output stored in. - -For a general overview of all available transformations and their options, you -can consult your // -transformation_overview.php installation. - -For a tutorial on how to effectively use transformations, see our Link section -on the official phpMyAdmin homepage. - -2. Usage - -Go to your tbl_structure.php page (i.e. reached through clicking on the -'Structure' link for a table). There click on "Change" (or change icon) and -there you will see three new fields at the end of the line. They are called -'MIME-type', 'Browser transformation' and 'Transformation options'. - - * The field 'MIME-type' is a drop-down field. Select the MIME-type that - corresponds to the column's contents. Please note that transformations are - inactive as long as no MIME-type is selected. - * The field 'Browser transformation' is a drop-down field. You can choose - from a hopefully growing amount of pre-defined transformations. See below - for information on how to build your own transformation. - There are global transformations and mimetype-bound transformations. Global - transformations can be used for any mimetype. They will take the mimetype, - if necessary, into regard. Mimetype-bound transformations usually only - operate on a certain mimetype. There are transformations which operate on - the main mimetype (like 'image'), which will most likely take the subtype - into regard, and those who only operate on a specific subtype (like 'image/ - jpeg'). - You can use transformations on mimetypes for which the function was not - defined for. There is no security check for you selected the right - transformation, so take care of what the output will be like. - * The field 'Transformation options' is a free-type textfield. You have to - enter transform-function specific options here. Usually the transforms can - operate with default options, but it is generally a good idea to look up - the overview to see which options are necessary. - Much like the ENUM/SET-Fields, you have to split up several options using - the format 'a','b','c',...(NOTE THE MISSING BLANKS). This is because - internally the options will be parsed as an array, leaving the first value - the first element in the array, and so forth. - If you want to specify a MIME character set you can define it in the - transformation_options. You have to put that outside of the pre-defined - options of the specific mime-transform, as the last value of the set. Use - the format "'; charset=XXX'". If you use a transform, for which you can - specify 2 options and you want to append a character set, enter "'first - parameter','second parameter','charset=us-ascii'". You can, however use the - defaults for the parameters: "'','','charset=us-ascii'". - -3. File structure - -All mimetypes and their transformations are defined through single files in the -directory 'libraries/transformations/'. - -They are stored in files to ease up customization and easy adding of new -transformations. - -Because the user cannot enter own mimetypes, it is kept sure that -transformations always work. It makes no sense to apply a transformation to a -mimetype, the transform-function doesn't know to handle. - -One can, however, use empty mime-types and global transformations which should -work for many mimetypes. You can also use transforms on a different mimetype -they where built for, but pay attention to option usage as well as what the -transformation does to your field. - -There is a basic file called 'global.inc.php'. This function can be included by -any other transform function and provides some basic functions. - -There are 5 possible file names: - - 1. A mimetype+subtype transform: - - [mimetype]_[subtype]__[transform].inc.php - - Please not that mimetype and subtype are separated via '_', which shall not - be contained in their names. The transform function/filename may contain - only characters which cause no problems in the file system as well as the - PHP function naming convention. - - The transform function will the be called 'PMA_transform_[mimetype]_ - [subtype]__[transform]()'. - - Example: - - text_html__formatted.inc.php - PMA_transform_text_html__formatted() - 2. A mimetype (w/o subtype) transform: - - [mimetype]__[transform].inc.php - - Please note that there are no single '_' characters. The transform function - /filename may contain only characters which cause no problems in the file - system as well as the PHP function naming convention. - - The transform function will the be called 'PMA_transform_[mimetype]__ - [transform]()'. - - Example: - - text__formatted.inc.php - PMA_transform_text__formatted() - 3. A mimetype+subtype without specific transform function - - [mimetype]_[subtype].inc.php - - Please note that there are no '__' characters in the filename. Do not use - special characters in the filename causing problems with the file system. - - No transformation function is defined in the file itself. - - Example: - - text_plain.inc.php - (No function) - 4. A mimetype (w/o subtype) without specific transform function - - [mimetype].inc.php - - Please note that there are no '_' characters in the filename. Do not use - special characters in the filename causing problems with the file system. - - No transformation function is defined in the file itself. - - Example: - - text.inc.php - (No function) - 5. A global transform function with no specific mimetype - - global__[transform].inc.php - - The transform function will the be called 'PMA_transform_global__ - [transform]()'. - - Example: - - global__formatted - PMA_transform_global__formatted() - -So generally use '_' to split up mimetype and subtype, and '__' to provide a -transform function. - -All filenames containing no '__' in themselves are not shown as valid transform -functions in the dropdown. - -Please see the libraries/transformations/TEMPLATE file for adding your own -transform function. See the libraries/transformations/TEMPLATE_MIMETYPE for -adding a mimetype without a transform function. Also note the introduction of a -function description in the language files. For each function a -$strTransformation_[filename without .inc.php] has to exist. - -You can use the template generator to generate new functions and entries in the -language file. - -To create a new transform function please see libraries/transformations/ -template_generator.sh. To create a new, empty mimetype please see libraries/ -transformations/template_generator_mimetype.sh. - -A transform function always gets passed three variables: - - 1. $buffer - Contains the text inside of the column. This is the text, you - want to transform. - 2. $options - Contains any user-passed options to a transform function as an - array. - 3. $meta - Contains an object with field information to your column. The data - is drawn from the output of the mysql_fetch_field() function. This means, - all object properties described on the manual page are available in this - variable and can be used to transform a field accordingly to unsigned/ - zerofill/not_null/... properties. - The $meta->mimetype variable contains the original MIME-type of the field - (i.e. 'text/plain', 'image/jpeg' etc.) - -FAQ - Frequently Asked Questions - - 1. Server - 2. Configuration - 3. Known limitations - 4. ISPs, multi-user installations - 5. Browsers or client OS - 6. Using phpMyAdmin - 7. phpMyAdmin project - 8. Security - -Please have a look at our Link section on the official phpMyAdmin homepage for -in-depth coverage of phpMyAdmin's features and or interface. - -Server - -1.1 I'm running PHP 4+ and my server is crashing each time a specific action is -required or phpMyAdmin sends a blank page or a page full of cryptic characters -to my browser, what can I do? - -There are some known PHP bugs with output buffering and compression. -Try to set the $cfg['OBGzip'] directive to FALSE in your config.inc.php file -and the zlib.output_compression directive to Off in your php configuration -file. -Furthermore, we know about such problems connected to the release candidates of -PHP 4.2.0 (tested with PHP 4.2.0 RC1 to RC4) together with MS Internet -Explorer. Please upgrade to the release version PHP 4.2.0. - -1.2 My Apache server crashes when using phpMyAdmin. - -You should first try the latest versions of Apache (and possibly MySQL). -See also the FAQ 1.1 entry about PHP bugs with output buffering. -If your server keeps crashing, please ask for help in the various Apache -support groups. - -1.3 I'm running phpMyAdmin with "cookie" authentication mode under PHP 4.2.0 or -4.2.1 loaded as an Apache 2 module but can't enter the script: I'm always -displayed the login screen. - -This is a known PHP bug (see this bug report) from the official PHP bug -database. It means there is and won't be any phpMyAdmin fix against it because -there is no way to code a fix. - -1.4 Using phpMyAdmin on IIS, I'm displayed the error message: "The specified -CGI application misbehaved by not returning a complete set of HTTP headers -...". - -You just forgot to read the install.txt file from the php distribution. Have a -look at the last message in this bug report from the official PHP bug database. - -1.5 Using phpMyAdmin on IIS, I'm facing crashes and/or many error messages with -the HTTP or advanced authentication mode. - -This is a known problem with the PHP ISAPI filter: it's not so stable. Please -use instead the cookie authentication mode. - -1.6 I can't use phpMyAdmin on PWS: nothing is displayed! - -This seems to be a PWS bug. Filippo Simoncini found a workaround (at this time -there is no better fix): remove or comment the DOCTYPE declarations (2 lines) -from the scripts libraries/header.inc.php, libraries/header_printview.inc.php, -index.php, navigation.php and libraries/common.lib.php. - -1.7 How can I GZip or Bzip a dump or a CSV export? It does not seem to work. - -These features are based on the gzencode() and bzcompress() PHP functions to be -more independent of the platform (Unix/Windows, Safe Mode or not, and so on). -So, you must have PHP4 >= 4.0.4 and Zlib/Bzip2 support (--with-zlib and ---with-bz2). -We faced PHP crashes when trying to download a dump with MS Internet Explorer -when phpMyAdmin is run with a release candidate of PHP 4.2.0. In this case you -should switch to the release version of PHP 4.2.0. - -1.8 I cannot insert a text file in a table, and I get an error about safe mode -being in effect. - -Your uploaded file is saved by PHP in the "upload dir", as defined in php.ini -by the variable upload_tmp_dir (usually the system default is /tmp). -We recommend the following setup for Apache servers running in safe mode, to -enable uploads of files while being reasonably secure: - - * create a separate directory for uploads: mkdir /tmp/php - * give ownership to the Apache server's user.group: chown apache.apache /tmp/ - php - * give proper permission: chmod 600 /tmp/php - * put upload_tmp_dir = /tmp/php in php.ini - * restart Apache - -1.9 I'm having troubles when uploading files. In general file uploads don't -work on my system and uploaded files have a Content-Type: header in the first -line. - -It's not really phpMyAdmin related but RedHat 7.0. You have a RedHat 7.0 and -you updated your PHP RPM to php-4.0.4pl1-3.i386.rpm, didn't you? -So the problem is that this package has a serious bug that was corrected ages -ago in PHP (2001-01-28: see PHP's bug tracking system for more details). The -problem is that the bugged package is still available though it was corrected -(see RedHat's BugZilla for more details). -So please download the fixed package (4.0.4pl1-9) and the problem should go -away. -And that fixes the \r\n problem with file uploads! - -1.10 I'm having troubles when uploading files with phpMyAdmin running on a -secure server. My browser is Internet Explorer and I'm using the Apache server. - -As suggested by "Rob M" in the phpWizard forum, add this line to your -httpd.conf: - -SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown - -It seems to clear up many problems between Internet Explorer and SSL. - -1.11 I get an 'open_basedir restriction' while uploading a file from the query -box. - -Since version 2.2.4, phpMyAdmin supports servers with open_basedir -restrictions. Assuming that the restriction allows you to open files in the -current directory ('.'), all you have to do is create a 'tmp' directory under -the phpMyAdmin install directory, with permissions 777 and the same owner as -the owner of your phpMyAdmin directory. The uploaded files will be moved there, -and after execution of your SQL commands, removed. - -1.12 I have lost my MySQL root password, what can I do? - -The MySQL manual explains how to reset the permissions. - -1.13 I get an error 'No SQL query' when trying to execute a bookmark. - -If PHP does not have read/write access to its upload_tmp_dir, it cannot access -the uploaded query. - -1.14 I get an error 'No SQL query' when trying to submit a query from the -convenient text area. - -Check the post_max_size directive from your PHP configuration file and try to -increase it. - -1.15 I have problems with mysql.user field names. - -In previous MySQL versions, the User and Password fields were named user and -password. Please modify your field names to align with current standards. - -1.16 I cannot upload big dump files (memory, HTTP or timeout problems). - -Starting with version 2.7.0, the import engine has been re?written and these -problems should not occur. If possible, upgrade your phpMyAdmin to the latest -version to take advantage of the new import features. - -The first things to check (or ask your host provider to check) are the values -of upload_max_filesize, memory_limit and post_max_size in the php.ini -configuration file. All of these three settings limit the maximum size of data -that can be submitted and handled by PHP. One user also said that post_max_size -and memory_limit need to be larger than upload_max_filesize. - -There exist several workarounds if your upload is too big or your hosting -provider is unwilling to change the settings: - - * Look at the $cfg['UploadDir'] feature. This allows one to upload a file to - the server via scp, ftp, or your favorite file transfer method. PhpMyAdmin - is then able to import the files from the temporary directory. More - information is available in the Configuration section of this document. - * Using a utility (such as BigDump) to split the files before uploading. We - cannot support this or any third party applications, but are aware of users - having success with it. - * If you have shell (command line) access, use MySQL to import the files - directly. You can do this by issuing the "source" command from within - MySQL: source filename.sql. - -1.17 Which MySQL versions does phpMyAdmin support? - -All MySQL versions from 3.23.32 till 5.0 (except for 4.1.0 and 4.1.1) are fully -supported. Please note that the older your MySQL version is, the more -limitations you will have to face. -phpMyAdmin may connect to your MySQL server using php's classic MySQL extension -as well as the improved MySQL extension (MySQLi) that is available in php 5.0. -Either way, the developers of both extensions recommend to use the classic -extension for MySQL 4.0 and below and MySQLi for MySQL 4.1 and newer. -When compiling php, we strongly recommend that you manually link the MySQL -extension of your choice to a MySQL client library of at least the same minor -version since the one that is bundled with some php distributions is rather old -and might cause problems (see FAQ 1.17a). If your webserver is running on a -windows system, you might want to try MySQL's Connector/PHP instead of the -MySQL / MySQLi extensions that are bundled with the official php Win32 builds. -MySQL 5.1 is not yet supported. - -1.17a I cannot connect to the MySQL server. It always returns the error -message, "Client does not support authentication protocol requested by server; -consider upgrading MySQL client" - -You tried to access MySQL with an old MySQL client library. The version of your -MySQL client library can be checked in your phpinfo() output. In general, it -should have at least the same minor version as your server - as mentioned in -FAQ 1.17. - -This problem is generally caused by using MySQL version 4.1 or newer. MySQL -changed the authentication hash and your PHP is trying to use the old method. -The proper solution is to use the mysqli extension with the proper client -library to match your MySQL installation. Your chosen extension is specified in -$cfg['Servers'][$i]['extension']. More information (and several workarounds) -are located in the MySQL Documentation. - -1.18 I'm running MySQL <= 4.0.1 having lower_case_table_names set to 1. If I -create a new table with a capital letter in its name it is changed to lowercase -as it should. But if I try to DROP this table MySQL is unable to find the -corresponding file. - -This is a bug of MySQL <= 4.0.1. Please upgrade to at least MySQL 4.0.2 or turn -off your lower_case_table_names directive. - -1.19 I can't run the "display relations" feature because the script seems not -to know the font face I'm using! - -The "FPDF" library we're using for this feature requires some special files to -use font faces. -Please refers to the FPDF manual to build these files. - -1.20 I receive the error "cannot load MySQL extension, please check PHP -Configuration". - -To connect to a MySQL server, PHP needs a set of MySQL functions called "MySQL -extension". This extension may be part of the PHP distribution (compiled-in), -otherwise it needs to be loaded dynamically. Its name is probably mysql.so or -php_mysql.dll. phpMyAdmin tried to load the extension but failed. - -Usually, the problem is solved by installing a software package called -"PHP-MySQL" or something similar. - -1.21 I am running the CGI version of PHP under Unix, and I cannot log in using -cookie auth. - -In php.ini, set mysql.max_links higher than 1. - -1.22 I don't see the "Location of text file" field, so I cannot upload. - -This is most likely because in php.ini, your file_uploads parameter is not set -to "on". - -1.23 I'm running MySQL on a Win32 machine. Each time I create a new table the -table and field names are changed to lowercase! - -This happens because the MySQL directive lower_case_table_names defaults to 1 -(ON) in the Win32 version of MySQL. You can change this behavior by simply -changing the directive to 0 (OFF): -Just edit your my.ini file that should be located in your Windows directory and -add the following line to the group [mysqld]: - -set-variable = lower_case_table_names=0 - -Next, save the file and restart the MySQL service. You can always check the -value of this directive using the query - -SHOW VARIABLES LIKE 'lower_case_table_names'; - -1.24 Some characters are being truncated in my queries, or I get characters -randomly added. I am running PHP 4.2.3. - -This is a PHP 4.2.3 bug. - -1.25 I am running Apache with mod_gzip-1.3.26.1a on Windows XP, and I get -problems, such as undefined variables when I run a SQL query. - -A tip from Jose Fandos: put a comment on the following two lines in httpd.conf, -like this: - -# mod_gzip_item_include file \.php$ -# mod_gzip_item_include mime "application/x-httpd-php.*" - -as this version of mod_gzip on Apache (Windows) has problems handling PHP -scripts. Of course you have to restart Apache. - -1.26 I just installed phpMyAdmin in my document root of IIS but I get the error -"No input file specified" when trying to run phpMyAdmin. - -This is a permission problem. Right-click on the phpmyadmin folder and choose -properties. Under the tab Security, click on "Add" and select the user -"IUSR_machine" from the list. Now set his permissions and it should work. - -1.27 I get empty page when I want to view huge page (eg. db_structure.php with -plenty of tables). - -This is a PHP bug that occur when GZIP output buffering is enabled. If you turn -off it (by $cfg['OBGzip'] = false in config.inc.php), it should work. This bug -will be fixed in PHP 5.0.0. - -1.28 My MySQL server sometimes refuses queries and returns the message -'Errorcode: 13'. What does this mean? - -This can happen due to a MySQL bug when having database / table names with -upper case characters although lower_case_table_names is set to 1. To fix this, -turn off this directive, convert all database and table names to lower case and -turn it on again. Alternatively, there's a bug-fix available starting with -MySQL 3.23.56 / 4.0.11-gamma. - -1.29 When I create a table or modify a field, I get an error and the fields are -duplicated. - -It is possible to configure Apache in such a way that PHP has problems -interpreting .php files. - -The problems occur when two different (and conflicting) set of directives are -used: - -SetOutputFilter PHP -SetInputFilter PHP - -and - -AddType application/x-httpd-php .php - -In the case we saw, one set of directives was in /etc/httpd/conf/httpd.conf, -while the other set was in /etc/httpd/conf/addon-modules/php.conf. -The recommended way is with AddType, so just comment out the first set of lines -and restart Apache: - -#SetOutputFilter PHP -#SetInputFilter PHP - -1.30 I get the error "navigation.php: Missing hash". - -This problem is known to happen when the server is running Turck MMCache but -upgrading MMCache to version 2.3.21 solves the problem. - -1.31 Does phpMyAdmin support php5? - -Yes. -However, phpMyAdmin needs to be backwards compatible to php4. This is why -phpMyAdmin disables the E_STRICT error_level in error_reporting settings. - -1.32 Can I use HTTP authentication with IIS? - -Yes. This procedure was tested with phpMyAdmin 2.6.1, PHP 4.3.9 in ISAPI mode -under IIS 5.1. - - 1. In your php.ini file, set cgi.rfc2616_headers = 0 - 2. In Web Site Properties -> File/Directory Security -> Anonymous Access - dialog box, check the Anonymous access checkbox and uncheck any other - checkboxes (i.e. uncheck Basic authentication, Integrated Windows - authentication, and Digest if it's enabled.) Click OK. - 3. In Custom Errors, select the range of 401;1 through 401;5 and click the Set - to Default button. - -1.33 Is there a problem with the mysqli extension when running PHP 5.0.4 on -64-bit systems? - -Yes. This problem affects phpMyAdmin ("Call to undefined function -pma_reloadnavigation"), so upgrade your PHP to the next version. - -1.34 Can I access directly to database or table pages? - -Yes. Out of the box, you can use URLs like http://server/phpMyAdmin/index.php? -server=X&db=database&table=table&target=script. For server you use the server -number which refers to the order of the server paragraph in config.inc.php. -Table and script parts are optional. If you want http://server/phpMyAdmin/ -database[/table][/script] URLs, you need to do some configuration. Following -lines apply only for Apache web server. First make sure, that you have enabled -some features within global configuration. You need Options FollowSymLinks and -AllowOverride FileInfo enabled for directory where phpMyAdmin is installed and -you need mod_rewrite to be enabled. Then you just need to create following -.htaccess file in root folder of phpMyAdmin installation (don't forget to -change directory name inside of it): - -RewriteEngine On -RewriteBase /path_to_phpMyAdmin -RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R] -RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R] -RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R] -RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R] - -1.35 Can I use HTTP authentication with Apache CGI? - -Yes. However you need to pass authentication variable to CGI using following -rewrite rule: - -RewriteEngine On -RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L] - -1.36 I get an error "500 Internal Server Error". - -There can be many explanations to this and a look at your server's error log -file might give a clue. - -1.37 I run phpMyAdmin on cluster of different machines and password encryption -in cookie auth doesn't work. - -If your cluster consist of different architectures, PHP code used for -encryption/decryption won't work correct. This is caused by use of pack/unpack -functions in code. Only solution is to use mcrypt extension which works fine in -this case. - -1.38 Can I use phpMyAdmin on a server on which Suhosin is enabled? - -Yes but the default configuration values of Suhosin are known to cause problems -with some operations, for example editing a table with many columns and no -primary key. Tuning information is available at http://www.hardened-php.net/ -hphp/troubleshooting.html, although the parameter names have changed (suhosin -instead of hphp). See also the SuhosinDisableWarning directive. - -Configuration - -2.1 The error message "Warning: Cannot add header information - headers already -sent by ..." is displayed, what's the problem? - -Edit your config.inc.php file and ensure there is nothing (I.E. no blank lines, -no spaces, no characters...) neither before the tag at the end. We also got a report from a user under -IIS, that used a zipped distribution kit: the file libraries/Config.class.php -contained an end-of-line character (hex 0A) at the end; removing this character -cleared his errors. - -2.2 phpMyAdmin can't connect to MySQL. What's wrong? - -Either there is an error with your PHP setup or your username/password is -wrong. Try to make a small script which uses mysql_connect and see if it works. -If it doesn't, it may be you haven't even compiled MySQL support into PHP. - -2.3 The error message "Warning: MySQL Connection Failed: Can't connect to local -MySQL server through socket '/tmp/mysql.sock' (111) ..." is displayed. What can -I do? - -For RedHat users, Harald Legner suggests this on the mailing list: - -On my RedHat-Box the socket of MySQL is /var/lib/mysql/mysql.sock. In your -php.ini you will find a line - -mysql.default_socket = /tmp/mysql.sock - -change it to - -mysql.default_socket = /var/lib/mysql/mysql.sock - -Then restart apache and it will work. - -Here is a fix suggested by Brad Ummer: - - * First, you need to determine what socket is being used by MySQL. - To do this, telnet to your server and go to the MySQL bin directory. In - this directory there should be a file named mysqladmin. Type ./mysqladmin - variables, and this should give you a bunch of info about your MySQL - server, including the socket (/tmp/mysql.sock, for example). - * Then, you need to tell PHP to use this socket. - To do this in phpMyAdmin, you need to complete the socket information in - the config.inc.php. - For example: $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock'; - - Please also make sure that the permissions of this file allow to be - readable by your webserver (i.e. '0755'). - -Have also a look at the corresponding section of the MySQL documentation. - -2.4 Nothing is displayed by my browser when I try to run phpMyAdmin, what can I -do? - -Try to set the $cfg['OBGZip'] directive to FALSE in the phpMyAdmin -configuration file. It helps sometime. -Also have a look at your PHP version number: if it contains "4.0b..." it means -you're running a beta version of PHP. That's not a so good idea, please upgrade -to a plain revision. - -2.5 Each time I want to insert or change a record or drop a database or a -table, an error 404 (page not found) is displayed or, with HTTP or cookie -authentication, I'm asked to log in again. What's wrong? - -Check the value you set for the $cfg['PmaAbsoluteUri'] directive in the -phpMyAdmin configuration file. - -2.6 I get an "Access denied for user: 'root@localhost' (Using password: YES) -"-error when trying to access a MySQL-Server on a host which is port-forwarded -for my localhost. - -When you are using a port on your localhost, which you redirect via -port-forwarding to another host, MySQL is not resolving the localhost as -expected. -Erik Wasser explains: The solution is: if your host is "localhost" MySQL (the -commandline tool 'mysql' as well) always tries to use the socket connection for -speeding up things. And that doesn't work in this configuration with port -forwarding. -If you enter "127.0.0.1" as hostname, everything is right and MySQL uses the -TCP connection. - -2.7 Using and creating themes - -Themes are configured with $cfg['ThemePath'], $cfg['ThemeManager'] and $cfg -['ThemeDefault']. - -Under $cfg['ThemePath'], you should not delete the directory "original" or its -underlying structure, because this is the system theme used by phpMyAdmin. -"original" contains all images and styles, for backwards compatibility and for -all themes that would not include images or css-files. - -If $cfg['ThemeManager'] is enabled, you can select your favorite theme on the -main page. Your selected theme will be stored in a cookie. - - -To create a theme: - - * make a new subdirectory (for example "your_theme_name") under $cfg - ['ThemePath'] (by default themes) - * copy the files and directories from "original" to "your_theme_name" - * edit the css-files in "your_theme_name/css" - * put your new images in "your_theme_name/img" - * edit layout.inc.php in "your_theme_name" - * edit info.inc.php in "your_theme_name" to contain your chosen theme name, - that will be visible in user interface - * make a new screenshot of your theme and save it under "your_theme_name/ - screen.png" - -In theme directory there is file info.inc.php which contains theme verbose -name, theme generation and theme version. These versions and generations are -enumerated from 1 and do not have any direct dependence on phpMyAdmin version. -Themes within same generation should be backwards compatible - theme with -version 2 should work in phpMyAdmin requiring version 1. Themes with different -generation are incompatible. - -If you do not want to use your own symbols and buttons, remove the directory -"img" in "your_theme_name". phpMyAdmin will use the default icons and buttons -(from the system-theme "original"). - -2.8 I get "Missing parameters" errors, what can I do? - -Here are a few points to check: - - * In config.inc.php, try to leave the $cfg['PmaAbsoluteUri'] directive empty. - See also FAQ 4.7. - * Maybe you have a broken PHP installation or you need to upgrade your Zend - Optimizer. See http://bugs.php.net/bug.php?id=31134. - * If you are using Hardened PHP with the ini directive - varfilter.max_request_variables set to the default (200) or another low - value, you could get this error if your table has a high number of columns. - Adjust this setting accordingly. (Thanks to Klaus Dorninger for the hint). - * In the php.ini directive arg_separator.input, a value of ";" will cause - this error. Replace it with "&;". - * If you are using Hardened-PHP, you might want to increase request limits. - * The directory specified in the php.ini directive session.save_path does not - exist or is read-only. - -Known limitations - -3.1 When using HTTP authentication, an user who logged out can not log in again -in with the same nick. - -This is related to the authentication mechanism (protocol) used by phpMyAdmin. -To bypass this problem: just close all the opened browser windows and then go -back to phpMyAdmin. You should be able to log in again. - -3.2 When dumping a large table in compressed mode, I get a memory limit error -or a time limit error. - -Compressed dumps are built in memory and because of this are limited to php's -memory limit. For GZip/BZip2 exports this can be overcome since 2.5.4 using -$cfg['CompressOnFly'] (enabled by default). Zip exports can not be handled this -way, so if you need Zip files for larger dump, you have to use another way. - -3.3 With InnoDB tables, I lose foreign key relationships when I rename or alter -a table. - -This seems to be a InnoDB bug (fixed in MySQL 3.23.50?). - -3.4 I am unable to import dumps I created with the mysqldump tool bundled with -the MySQL server distribution. - -The problem is that older versions of mysqldump created invalid comments like -this: - --- MySQL dump 8.22 --- --- Host: localhost Database: database ---------------------------------------------------------- --- Server version 3.23.54 - -The invalid part of the code is the horizontal line made of dashes that appears -once in every dump created with mysqldump. If you want to run your dump you -have to turn it into valid MySQL. This means, you have to add a whitespace -after the first two dashes of the line or add a # before it: --- ------------------------------------------------------- -or -#--------------------------------------------------------- - -3.5 When using nested folders there are some multiple hierarchies displayed in -a wrong manner?! ($cfg['LeftFrameTableSeparator']) - -Please note that you should not use the separating string multiple times -without any characters between them, or at the beginning/end of your table -name. If you have to, think about using another TableSeparator or disabling -that feature - -3.6 What is currently not supported in phpMyAdmin about InnoDB? - -In Relation view, being able to choose a table in another database, or having -more than one index field in the foreign key. - -In Query-by-example (Query), automatic generation of the query LEFT JOIN from -the foreign table. - - -3.7 I have table with many (100+) fields and when I try to browse table I get -series of errors like "Warning: unable to parse url". How can this be fixed? - -Your table neither have a primary key nor an unique one, so we must use a long -expression to identify this row. This causes problems to parse_url function. -The workaround is to create a primary or unique key. - -3.8 I cannot use (clickable) HTML-forms in fields where I put a -MIME-Transformation onto! - -Due to a surrounding form-container (for multi-row delete checkboxes), no -nested forms can be put inside the table where phpMyAdmin displays the results. -You can, however, use any form inside of a table if keep the parent -form-container with the target to tbl_row_delete.php and just put your own -input-elements inside. If you use a custom submit input field, the form will -submit itself to the displaying page again, where you can validate the -$HTTP_POST_VARS in a transformation. For a tutorial on how to effectively use -transformations, see our Link section on the official phpMyAdmin-homepage. - -3.9 I get error messages when using "--sql_mode=ANSI" for the MySQL server - -When MySQL is running in ANSI-compatibility mode, there are some major -differences in how SQL is structured (see http://dev.mysql.com/doc/mysql/en/ -ANSI_mode.html). Most important of all, the quote-character (") is interpreted -as an identifier quote character and not as a string quote character, which -makes many internal phpMyAdmin operations into invalid SQL statements. There is -no workaround to this behaviour. News to this item will be posted in Bug report -#816858 - -3.10 Homonyms and no primary key: When the results of a SELECT display more -that one column with the same value (for example SELECT lastname from employees -where firstname like 'A%' and two "Smith" values are displayed), if I click -Edit I cannot be sure that I am editing the intended row. - -Please make sure that your table has a primary key, so that phpMyAdmin can use -it for the Edit and Delete links. - -3.11 The number of records for InnoDB tables is not correct. - -phpMyAdmin uses a quick method to get the row count, and this method only -returns an approximate count in the case of InnoDB tables. See $cfg -['MaxExactCount'] for a way to modify those results, but this could have a -serious impact on performance. - -3.12 What are the phpMyAdmin limitations for MySQL 3? - -The number of records in queries containing COUNT and GROUP BY is not correctly -calculated. Also, sorting results of a query like "SELECT * from table GROUP -BY" ... is problematic. - -3.13 I get an error when entering USE followed by a db name containing an -hyphen. - -The tests I have made with current MySQL 4.1.11 API shows that the API does not -accept this syntax for the USE command. Enclosing the db name with backquotes -works. For further confusion, no backquotes are needed with command-line mysql. - -3.14 I am not able to browse a table when I don't have the right to SELECT one -of the columns. - -This has been a known limitation of phpMyAdmin since the beginning and it's not -likely to be solved in the future. - -ISPs, multi-user installations - -4.1 I'm an ISP. Can I setup one central copy of phpMyAdmin or do I need to -install it for each customer. - -Since version 2.0.3, you can setup a central copy of phpMyAdmin for all your -users. The development of this feature was kindly sponsored by NetCologne GmbH. -This requires a properly setup MySQL user management and phpMyAdmin HTTP or -cookie authentication. See the install section on "Using HTTP authentication". - -4.2 What's the preferred way of making phpMyAdmin secure against evil access. - -This depends on your system. -If you're running a server which cannot be accessed by other people, it's -sufficient to use the directory protection bundled with your webserver (with -Apache you can use .htaccess files, for example). -If other people have telnet access to your server, you should use phpMyAdmin's -HTTP or cookie authentication features. - -Suggestions: - - * Your config.inc.php file should be chmod 660. - * All your phpMyAdmin files should be chown -R phpmy.apache, where phpmy is a - user whose password is only known to you, and apache is the group under - which Apache runs. - * You should use PHP safe mode, to protect from other users that try to - include your config.inc.php in their scripts. - -4.3 I get errors about not being able to include a file in /lang or in / -libraries. - -Check php.ini, or ask your sysadmin to check it. The include_path must contain -"." somewhere in it, and open_basedir, if used, must contain "." and "./lang" -to allow normal operation of phpMyAdmin. - -4.4 phpMyAdmin always gives "Access denied" when using HTTP authentication. - -This could happen for several reasons: - - * $cfg['Servers'][$i]['controluser'] and/or $cfg['Servers'][$i] - ['controlpass'] are wrong. - * The username/password you specify in the login dialog are invalid. - * You have already setup a security mechanism for the phpMyAdmin-directory, - eg. a .htaccess file. This would interfere with phpMyAdmin's - authentication, so remove it. - -4.5 Is it possible to let users create their own databases? - -Starting with 2.2.5, in the user management page, you can enter a wildcard -database name for a user (for example "joe%"), and put the privileges you want. -For example, adding SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER -would let a user create/manage his/her database(s). - -4.6 How can I use the Host-based authentication additions? - -If you have existing rules from an old .htaccess file, you can take them and -add a username between the 'deny'/'allow' and 'from' strings. Using the -username wildcard of '%' would be a major benefit here if your installation is -suited to using it. Then you can just add those updated lines into the $cfg -['Servers'][$i]['AllowDeny']['rules'] array. - -If you want a pre-made sample, you can try this fragment. It stops the 'root' -user from logging in from any networks other than the private network IP -blocks. - -//block root from logging in except from the private networks -$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow'; -$cfg['Servers'][$i]['AllowDeny']['rules'] = array( - 'deny root from all', - 'allow root from localhost', - 'allow root from 10.0.0.0/8', - 'allow root from 192.168.0.0/16', - 'allow root from 172.16.0.0/12', - ); - -4.7 Authentication window is displayed more than once, why? - -This happens if you are using a URL to start phpMyAdmin which is different than -the one set in your $cfg['PmaAbsoluteUri']. For example, a missing "www", or -entering with an IP address while a domain name is defined in the config file. - -4.8 Which parameters can I use in the URL that starts phpMyAdmin? - -When starting phpMyAdmin, you can use the db, pma_username, pma_password and -server parameters. This last one can contain either the numeric host index -(from $i of the configuration file) or one of the host names present in the -configuration file. Using pma_username and pma_password has been tested along -with the usage of 'cookie' auth_type. - -Browsers or client OS - -5.1 I get an out of memory error, and my controls are non-functional, when -trying to create a table with more than 14 fields. - -We could reproduce this problem only under Win98/98SE. Testing under WinNT4 or -Win2K, we could easily create more than 60 fields. -A workaround is to create a smaller number of fields, then come back to your -table properties and add the other fields. - -5.2 With Xitami 2.5b4, phpMyAdmin won't process form fields. - -This is not a phpMyAdmin problem but a Xitami known bug: you'll face it with -each script/website that use forms. -Upgrade or downgrade your Xitami server. - -5.3 I have problems dumping tables with Konqueror (phpMyAdmin 2.2.2). - -With Konqueror 2.1.1: plain dumps, zip and GZip dumps work ok, except that the -proposed file name for the dump is always 'tbl_dump.php'. Bzip2 dumps don't -seem to work. -With Konqueror 2.2.1: plain dumps work; zip dumps are placed into the user's -temporary directory, so they must be moved before closing Konqueror, or else -they disappear. GZip dumps give an error message. -Testing needs to be done for Konqueror 2.2.2. - -5.4 I can't use the cookie authentication mode because Internet Explorer never -stores the cookies. - -MS Internet Explorer seems to be really buggy about cookies, at least till -version 6. And thanks to Andrew Zivolup we've traced also a PHP 4.1.1 bug in -this area! -Then, if you're running PHP 4.1.1, try to upgrade or downgrade... it may work! - -5.5 In Internet Explorer 5.0, I get JavaScript errors when browsing my rows. - -Upgrade to at least Internet Explorer 5.5 SP2. - -5.6 In Internet Explorer 5.0, 5.5 or 6.0, I get an error (like "Page not -found") when trying to modify a row in a table with many fields, or with a text -field - -Your table neither have a primary key nor an unique one, so we must use a long -URL to identify this row. There is a limit on the length of the URL in those -browsers, and this not happen in Netscape, for example. The workaround is to -create a primary or unique key, or use another browser. - -5.7 I refresh (reload) my browser, and come back to the welcome page. - -Some browsers support right-clicking into the frame you want to refresh, just -do this in the right frame. - -5.8 With Mozilla 0.9.7 I have problems sending a query modified in the query -box. - -Looks like a Mozilla bug: 0.9.6 was OK. We will keep an eye on future Mozilla -versions. - -5.9 With Mozilla 0.9.? to 1.0 and Netscape 7.0-PR1 I can't type a whitespace in -the SQL-Query edit area: the page scrolls down. - -This is a Mozilla bug (see bug #26882 at BugZilla). - -5.10 With Netscape 4.75 I get empty rows between each row of data in a CSV -exported file. - -This is a known Netscape 4.75 bug: it adds some line feeds when exporting data -in octet-stream mode. Since we can't detect the specific Netscape version, we -cannot workaround this bug. - -5.11 Extended-ASCII characters like German umlauts are displayed wrong. - -Please ensure that you have set your browser's character set to the one of the -language file you have selected on phpMyAdmin's start page. Alternatively, you -can try the auto detection mode that is supported by the recent versions of the -most browsers. - -5.12 Mac OS X: Safari browser changes special characters to "?". - -This issue has been reported by a OS X user, who adds that Chimera, Netscape -and Mozilla do not have this problem. - -5.13 With Internet Explorer 5.5 or 6, and HTTP authentication type, I cannot -manage two servers: I log in to the first one, then the other one, but if I -switch back to the first, I have to log in on each operation. - -This is a bug in Internet Explorer, other browsers do not behave this way. - -5.14 Using Opera6, I can manage to get to the authentication, but nothing -happens after that, only a blank screen. - -Having $cfg['QueryFrameJS'] set o TRUE, this leads to a bug in Opera6, because -it is not able to interpret frameset definitions written by JavaScript. Please -upgrade your phpMyAdmin installtion or to Opera7 at least. - -5.15 I have display problems with Safari. - -Please upgrade to at least version 1.2.3. - -5.16 With Internet Explorer, I get "Access is denied" Javascript errors. Or I -cannot make phpMyAdmin work under Windows. - -Please check the following points: - - * Maybe you have defined your PmaAbsoluteUri setting in config.inc.php to an - IP address and you are starting phpMyAdmin with a URL containing a domain - name, or the reverse situation. - * Security settings in IE and/or Microsoft Security Center are too high, thus - blocking scripts execution. - * The Windows Firewall is blocking Apache and MySQL. You must allow HTTP - ports (80 or 443) and MySQL port (usually 3306) in the "in" and "out" - directions. - -5.17 With Firefox, I cannot delete rows of data or drop a database. - -Many users have confirmed that the Tabbrowser Extensions plugin they installed -in their Firefox is causing the problem. - -Using phpMyAdmin - -6.1 I can't insert new rows into a table / I can't create a table - MySQL -brings up a SQL-error. - -Examine the SQL error with care. Often the problem is caused by specifying a -wrong field-type. -Common errors include: - - * Using VARCHAR without a size argument - * Using TEXT or BLOB with a size argument - -Also, look at the syntax chapter in the MySQL manual to confirm that your -syntax is correct. - -6.2 When I create a table, I click the Index checkbox for 2 fields and -phpMyAdmin generates only one index with those 2 fields. - -In phpMyAdmin 2.2.0 and 2.2.1, this is the way to create a multi-fields index. -If you want two indexes, create the first one when creating the table, save, -then display the table properties and click the Index link to create the other -index. - -6.3 How can I insert a null value into my table? - -Since version 2.2.3, you have a checkbox for each field that can be null. -Before 2.2.3, you had to enter "null", without the quotes, as the field's -value. Since version 2.5.5, you have to use the checkbox to get a real NULL -value, so if you enter "NULL" this means you want a literal NULL in the field, -and not a NULL value (this works in PHP4). - -6.4 How can I backup my database or table? - -Click on a database or table name in the left frame, the properties will be -displayed. Then on the menu, click "Export", you can dump the structure, the -data, or both. This will generate standard SQL statements that can be used to -recreate your database/table. - -You will need to choose "Save as file", so that phpMyAdmin can transmit the -resulting dump to your station. Depending on your PHP configuration, you will -see options to compress the dump. See also the $cfg['ExecTimeLimit'] -configuration variable. - -For additional help on this subject, look for the word "dump" in this document. - -6.5 How can I restore (upload) my database or table using a dump? How can I run -a ".sql" file? - -Click on a database name in the left frame, the properties will be displayed. -Select "Import" from the list of tabs in the right?hand frame (or "SQL" if your -phpMyAdmin version is previous to 2.7.0). In the "Location of the text file" -section, type in the path to your dump filename, or use the Browse button. Then -click Go. - -With version 2.7.0, the import engine has been re?written, if possible it is -suggested that you upgrade to take advantage of the new features. - -For additional help on this subject, look for the word "upload" in this -document. - -6.6 How can I use the relation table in Query-by-example? - -Here is an example with the tables persons, towns and countries, all located in -the database mydb. If you don't have a pma_relation table, create it as -explained in the configuration section. Then create the example tables: - -CREATE TABLE REL_countries ( - country_code char(1) NOT NULL default '', - description varchar(10) NOT NULL default '', - PRIMARY KEY (country_code) -) TYPE=MyISAM; - -INSERT INTO REL_countries VALUES ('C', 'Canada'); - -CREATE TABLE REL_persons ( - id tinyint(4) NOT NULL auto_increment, - person_name varchar(32) NOT NULL default '', - town_code varchar(5) default '0', - country_code char(1) NOT NULL default '', - PRIMARY KEY (id) -) TYPE=MyISAM; - -INSERT INTO REL_persons VALUES (11, 'Marc', 'S', ''); -INSERT INTO REL_persons VALUES (15, 'Paul', 'S', 'C'); - -CREATE TABLE REL_towns ( - town_code varchar(5) NOT NULL default '0', - description varchar(30) NOT NULL default '', - PRIMARY KEY (town_code) -) TYPE=MyISAM; - -INSERT INTO REL_towns VALUES ('S', 'Sherbrooke'); -INSERT INTO REL_towns VALUES ('M', 'Montr?al'); - -To setup appropriate links and display information: - - * on table "REL_persons" click Structure, then Relation view - * in Links, for "town_code" choose "REL_towns->code" - * in Links, for "country_code" choose "REL_countries->country_code" - * on table "REL_towns" click Structure, then Relation view - * in "Choose field to display", choose "description" - * repeat the two previous steps for table "REL_countries" - -Then test like this: - - * Click on your db name in the left frame - * Choose "Query" - * Use tables: persons, towns, countries - * Click "Update query" - * In the fields row, choose persons.person_name and click the "Show" tickbox - * Do the same for towns.description and countries.descriptions in the other 2 - columns - * Click "Update query" and you will see in the query box that the correct - joins have been generated - * Click "Submit query" - -6.7 How can I use the "display field" feature? - -Starting from the previous example, create the pma_table_info as explained in -the configuration section, then browse your persons table, and move the mouse -over a town code or country code. - -See also FAQ 6.21 for an additional feature that "display field" enables: -drop-down list of possible values. - -6.8 How can I produce a PDF schema of my database? - -First the configuration variables "relation", "table_coords" and "pdf_pages" -have to be filled in. - -Then you need to think about your schema layout. Which tables will go on which -pages? - - * Select your database in the left frame. - * Choose "Operations" in the navigation bar at the top. - * Choose "Edit PDF Pages" near the bottom of the page. - * Enter a name for the first PDF page and click Go. If you like, you can use - the "automatic layout," which will put all your linked tables onto the new - page. - * Select the name of the new page (making sure the Edit radio button is - selected) and click Go. - * Select a table from the list, enter its coordinates and click Save. - Coordinates are relative; your diagram will be automatically scaled to fit - the page. When initially placing tables on the page, just pick any - coordinates -- say, 50x50. After clicking Save, you can then use the - graphical editor to position the element correctly. - * When you'd like to look at your PDF, first be sure to click the Save button - beneath the list of tables and coordinates, to save any changes you made - there. Then scroll all the way down, select the PDF options you want, and - click Go. - * Internet Explorer for Windows may suggest an incorrect filename when you - try to save a generated PDF. When saving a generated PDF, be sure that the - filename ends in ".pdf", for example "schema.pdf". Browsers on other - operating systems, and other browsers on Windows, do not have this problem. - -6.9 phpMyAdmin is changing the type of one of my columns! - -No, it's MySQL that is doing silent column type changing. - -6.10 When creating a privilege, what happens with underscores in the database -name? - -If you do not put a backslash before the underscore, this is a wildcard grant, -and the underscore means "any character". So, if the database name is -"john_db", the user would get rights to john1db, john2db ... - -If you put a backslash before the underscore, it means that the database name -will have a real underscore. - -6.11 What is the curious symbol ? in the statistics pages? - -It means "average". - -6.12 I want to understand some Export options. - -Structure: - - * "Add DROP TABLE" will add a line telling MySQL to drop the table, if it - already exists during the import. It does NOT drop the table after your - export, it only affects the import file. - * "If Not Exists" will only create the table if it doesn't exist. Otherwise, - you may get an error if the table name exists but has a different - structure. - * "Add AUTO_INCREMENT value" ensures that AUTO_INCREMENT value (if any) will - be included in backup. - * "Enclose table and field names with backquotes" ensures that field and - table names formed with special characters are protected. - * "Add into comments" includes column comments, relations, and MIME types set - in the pmadb in the dump as SQL comments (/* xxx */). - -Data: - - * "Complete inserts" adds the column names on every INSERT command, for - better documentation (but resulting file is bigger). - * "Extended inserts" provides a shorter dump file by using only once the - INSERT verb and the table name. - * "Delayed inserts" are best explained in the MySQL manual. - * "Ignore inserts" treats errors as a warning instead. Again, more info is - provided in the MySQL manual, but basically with this selected, invalid - values are adjusted and inserted rather than causing the entire statement - to fail. - -6.13 I would like to create a database with a dot in its name. - -This is a bad idea, because in MySQL the syntax "database.table" is the normal -way to reference a database and table name. Worse, MySQL will usually let you -create a database with a dot, but then you cannot work with it, nor delete it. - -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 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. -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. - -6.15 I want to add a BLOB field and put an index on it, but MySQL says "BLOB -column '...' used in key specification without a key length". - -The right way to do this, is to create the field without any indexes, then -display the table structure and use the "Create an index" dialog. On this page, -you will be able to choose your BLOB field, and set a size to the index, which -is the condition to create an index on a BLOB field. - -6.16 How can I simply move in page with plenty editing fields? - -You can use Ctrl+arrows (Option+Arrows in Safari) for moving on most pages with -many editing fields (table structure changes, row editing, etc.) (must be -enabled in configuration - see. $cfg['CtrlArrowsMoving']). You can also have a -look at the directive $cfg['DefaultPropDisplay'] ('vertical') and see if this -eases up editing for you. - -6.17 Transformations: I can't enter my own mimetype! WTF is this feature then -useful for? - -Slow down :). Defining mimetypes is of no use, if you can't put transformations -on them. Otherwise you could just put a comment on the field. Because entering -your own mimetype will cause serious syntax checking issues and validation, -this introduces a high-risk false-user-input situation. Instead you have to -initialize mimetypes using functions or empty mimetype definitions. -Plus, you have a whole overview of available mimetypes. Who knows all those -mimetypes by heart so he/she can enter it at will? - -6.18 Bookmarks: Where can I store bookmarks? Why can't I see any bookmarks -below the query box? What is this variable for? - -Any query you have executed can be stored as a bookmark on the page where the -results are displayed. You will find a button labeled 'Bookmark this query' -just at the end of the page. -As soon as you have stored a bookmark, it is related to the database you run -the query on. You can now access a bookmark dropdown on each page, the query -box appears on for that database. - -Since phpMyAdmin 2.5.0 you are also able to store variables for the bookmarks. -Just use the string /*[VARIABLE]*/ anywhere in your query. Everything which is -put into the value input box on the query box page will replace the string "/* -[VARIABLE]*/" in your stored query. Just be aware of that you HAVE to create a -valid query, otherwise your query won't be even able to be stored in the -database. -Also remember, that everything else inside the /*[VARIABLE]*/ string for your -query will remain the way it is, but will be stripped of the /**/ chars. So you -can use: - -/*, [VARIABLE] AS myname */ - -which will be expanded to - -, VARIABLE as myname - -in your query, where VARIABLE is the string you entered in the input box. If an -empty string is provided, no replacements are made. - -A more complex example. Say you have stored this query: - -SELECT Name, Address FROM addresses WHERE 1 /* AND Name LIKE '%[VARIABLE]%' */ - -Say, you now enter "phpMyAdmin" as the variable for the stored query, the full -query will be: - -SELECT Name, Address FROM addresses WHERE 1 AND Name LIKE '%phpMyAdmin%' - -You can use multiple occurrences of /*[VARIABLE]*/ in a single query. -NOTE THE ABSENCE OF SPACES inside the "/**/" construct. Any spaces inserted -there will be later also inserted as spaces in your query and may lead to -unexpected results especially when using the variable expansion inside of a -"LIKE ''" expression. -Your initial query which is going to be stored as a bookmark has to yield at -least one result row so you can store the bookmark. You may have that to work -around using well positioned "/**/" comments. - -6.19 How can I create simple L^AT[E]X document to include exported table? - -You can simply include table in your L^AT[E]X documents, minimal sample -document should look like following one (assuming you have table exported in -file table.tex): - -\documentclass{article} % or any class you want -\usepackage{longtable} % for displaying table -\begin{document} % start of document -\include{table} % including exported table -\end{document} % end of document - -6.20 In MySQL 4, I see a lot of databases which are not mine, and cannot access -them. - -Upgrading to MySQL 4 usually gives users those global privileges: CREATE -TEMPORARY TABLES, SHOW DATABASES, LOCK TABLES. Those privileges also enable -users to see all the database names. See this bug report. - -So if your users do not need those privileges, you can remove them and their -databases list will shorten. - -6.21 In edit/insert mode, how can I see a list of possible values for a field, -based on some foreign table? - -You have to setup appropriate links between the tables, and also setup the -"display field" in the foreign table. See FAQ 6.6 for an example. Then, if -there are 200 values or less in the foreign table, a drop-down list of values -will be available. You will see two lists of values, the first list containing -the key and the display field, the second list containing the display field and -the key. The reason for this is to be able to type the first letter of either -the key or the display field. - -For 200 values or more, a distinct window will appear, to browse foreign key -values and choose one. - -6.22 Bookmarks: Can I execute a default bookmark automatically when entering -Browse mode for a table? - -Yes. If a bookmark has the same label as a table name, it will be executed. - -6.23 Export: I heard phpMyAdmin can export Microsoft Excel files, how can I -enable that? - -Current version does support direct export to Microsoft Excel and Word versions -2000 and newer. If you need export older versions, you can use CSV suitable for -Microsoft Excel, which works out of the box or you can try native experimental -MS Excel exporter. This export has several problems, most important are -limitation of cell content to 255 chars and no support for charsets, so think -carefully whether you want to enable this.. For enabling this you need to set -$cfg['TempDir'] to place where web server user can write (for example './tmp') -and install PEAR module Spreadsheet_Excel_Writer into php include path. The -installation can be done by following command: - -pear -d preferred_state=beta install -a Spreadsheet_Excel_Writer - -First part of switches set we want to install beta version of that module (no -stable version available yet) and then we tell pear we want to satisfy -dependencies. - -If you are running in PHP safe mode, you will have to set in php.ini the -safe_mode_include_dir to the directory where your PEAR modules are located, for -example: - -safe_mode_include_dir = /usr/local/lib/php - -To create the temporary directory on a UNIX-based system, you can do: - -cd phpMyAdmin -mkdir tmp -chmod o+rwx tmp - -6.24 Now that phpMyAdmin supports native MySQL 4.1.x column comments, what -happens to my column comments stored in pmadb? - -Automatic migration of a table's pmadb-style column comments to the native ones -is done whenever you enter Structure page for this table. - -phpMyAdmin project - -7.1 I have found a bug. How do I inform developers? - -Our Bug Tracker is located at http://sf.net/projects/phpmyadmin/ under the Bugs -section. - -But please first discuss your bug with other users: -http://sf.net/projects/phpmyadmin/ (and choose Forums) - -7.2 I want to translate the messages to a new language or upgrade an existing -language, where do I start? - -Always use the current SVN version of your language file. For a new language, -start from english-iso-8859-1.inc.php. If you don't know how to get the SVN -version, please ask one of the developers. -Please note that we try not to use HTML entities like é in 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. -You can then put your translations, as a zip file to avoid losing special -characters, on the sourceforge.net translation tracker. -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. - -7.3 I would like to help out with the development of phpMyAdmin. How should I -proceed? - -The following method is preferred for new developers: - - 1. fetch the current SVN tree over anonymous SVN: - svn co https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/ - phpMyAdmin - 2. add your stuff - 3. generate patch with your changes: svn diff - 4. put the patch inside the patch tracker of the phpMyAdmin project. - -Write access to the SVN tree is granted only to experienced developers who have -already contributed something useful to phpMyAdmin. -Also, have a look at the Developers section. - -Security - -8.1 Where can I get information about the security alerts issued for -phpMyAdmin? - -Please refer to http://www.phpmyadmin.net/home_page/security.php - -Developers Information - -phpMyAdmin is Open Source, so you're invited to contribute to it. Many great -features have been written by other people and you too can help to make -phpMyAdmin a useful tool. - -If you're planning to contribute source, please read the following information: - - * All files include libraries/header.inc.php (layout),. libraries/ - common.lib.php (common functions) and config.inc.php. - Only configuration data should go in config.inc.php. Please keep it free - from other code. - Commonly used functions should be added to libraries/common.lib.php and - more specific ones may be added within a library stored into the libraries - sub-directory. - * Obviously, you're free to use whatever coding style you want. But please - try to keep your code as simple as possible: beginners are using phpMyAdmin - as an example application. - As far as possible, we want the scripts to be XHTML1.0 and CSS2 compliant - on one hand, they fit the PEAR coding standards on the other hand. Please - pay attention to this. - * Please try to keep up the file-naming conventions. Table-related stuff goes - to tbl_*.php, db-related code to db_*.php, server-related tools to - server_*.php and so on. - * Please don't use verbose strings in your code, instead add the string (at - least) to english-iso-8859-1.inc.php and print() it out. - * If you want to be really helpful, write an entry for the ChangeLog. - * The DBG extension (PHP Debugger DBG) is now supported by phpMyAdmin for - developers to better debug and profile their code. - Please see the $cfg['DBG']* configuration options for more information. - This is in memoriam of the Space Shuttle Columbia (STS-107) which was lost - during its re-entry into Earth's atmosphere and in memory of the brave men - and women who gave their lives for the people of Earth. - -Credits - -phpMyAdmin - Credits -==================== - -CREDITS, in chronological order -------------------------------- - -- Tobias Ratschiller - * creator of the phpmyadmin project - * maintainer from 1998 to summer 2000 - -- Marc Delisle - * multi-language version - * various fixes and improvements - * SQL analyser (most of it) - * current project maintainer - -- Olivier M?ller - * started SourceForge phpMyAdmin project in March 2001 - * sync'ed different existing CVS trees with new features and bugfixes - * multi-language improvements, dynamic language selection - * current project maintainer - * many bugfixes and improvements - -- Lo?c Chapeaux - * rewrote and optimized javascript, DHTML and DOM stuff - * rewrote the scripts so they fit the PEAR coding standards and - generate XHTML1.0 and CSS2 compliant codes - * improved the language detection system - * many bugfixes and improvements - -- Robin Johnson - * database maintenance controls - * table type code - * Host authentication IP Allow/Deny - * DB-based configuration (Not completed) - * SQL parser and pretty-printer - * SQL validator - * many bugfixes and improvements - -- Armel Fauveau - * bookmarks feature - * multiple dump feature - * gzip dump feature - * zip dump feature - -- Geert Lund - * various fixes - * moderator of the phpMyAdmin former users forum at phpwizard.net - -- Korakot Chaovavanich - * "insert as new row" feature - -- Pete Kelly - * rewrote and fix dump code - * bugfixes - -- Steve Alberty - * rewrote dump code for PHP4 - * mySQL table statistics - * bugfixes - -- Benjamin Gandon - * main author of the version 2.1.0.1 - * bugfixes - -- Alexander M. Turek - * MySQL 4.0 / 4.1 / 5.0 compatibility - * abstract database interface (PMA_DBI) with MySQLi support - * privileges administration - * XML exports - * various features and fixes - * German language file updates - -- Mike Beck - * automatic joins in QBE - * links column in printview - * Relation view - -- Michal ?iha? - * enhanced index creation/display feature - * feature to use a different charset for HTML than for MySQL - * improvements of export feature - * various features and fixes - * Czech language file updates - -- Christophe Gesch? from the "MySQL Form Generator for PHPMyAdmin" - (http://sf.net/projects/phpmysqlformgen/) - * suggested the patch for multiple table printviews - -- Garvin Hicking - * built the patch for vertical display of table rows - * built the Javascript based Query window + SQL history - * Improvement of column/db comments - * (MIME)-Transformations for columns - * Use custom alias names for Databases in left frame - * hierarchical/nested table display - * PDF-scratchboard for WYSIWYG-distribution of PDF relations - * new icon sets - * vertical display of column properties page - * some bugfixes, features, support, German language additions - -- Yukihiro Kawada - * japanese kanji encoding conversion feature - -- Piotr Roszatycki and Dan Wilson - * the Cookie authentication mode - -- Axel Sander - * table relation-links feature - -- Maxime Delorme - * PDF schema output, thanks also to Olivier Plathey for the - "FPDF" library (see http://www.fpdf.org/) and Steven Wittens - for the "UFPDF" library (see http://www.acko.net/node/56). - -- Olof Edlund - * SQL validator server - -- Ivan R. Lanin - * phpMyAdmin logo (until June 2004) - -- Mike Cochrane - * blowfish library from the Horde project - -- Marcel Tschopp - * mysqli support - * many bugfixes and improvements - -- Michael Keck - * redesign for 2.6.0 - * phpMyAdmin sailboat logo (June 2004) - -- Mathias Landh?u?er - * Representation at conferences - -- Sebastian Mendel - * interface improvements - * various bugfixes - -- Ivan A Kirillov - * new relations Designer - -And also to the following people who have contributed minor changes, -enhancements, bugfixes or support for a new language since version 2.1.0: - -Bora Alioglu, Ricardo ?, Sven-Erik Andersen, Alessandro Astarita, -P?ter Bakondy, Borges Botelho, Olivier Bussier, Neil Darlow, -Mats Engstrom, Ian Davidson, Laurent Dhima, Kristof Hamann, Thomas Kl?ger, -Lubos Klokner, Martin Marconcini, Girish Nair, David Nordenberg, Andreas Pauley, -Bernard M. Piller, Laurent Haas, "Sakamoto", Yuval Sarna, -www.securereality.com.au, Alexis Soulard, Alvar Soome, Siu Sun, Peter Svec, -Michael Tacelosky, Rachim Tamsjadi, Kositer Uros, -Lu?s V., Martijn W. van der Lee, -Algis Vainauskas, Daniel Villanueva, Vinay, Ignacio Vazquez-Abrams, Chee Wai, -Jakub Wilk, Thomas Michael Winningham, Vilius Zigmantas, "Manuzhai". - - -Original Credits of Version 2.1.0 ---------------------------------- - - This work is based on Peter Kuppelwieser's MySQL-Webadmin. It was his idea - to create a web-based interface to MySQL using PHP3. Although I have not - used any of his source-code, there are some concepts I've borrowed from - him. phpMyAdmin was created because Peter told me he wasn't going to - further develop his (great) tool. - Thanks go to - - Amalesh Kempf who contributed the - code for the check when dropping a table or database. He also suggested - that you should be able to specify the primary key on tbl_create.php3. To - version 1.1.1 he contributed the ldi_*.php3-set (Import text-files) as - well as a bug-report. Plus many smaller improvements. - - Jan Legenhausen : He made many of the changes that - were introduced in 1.3.0 (including quite significant ones like the - authentication). For 1.4.1 he enhanced the table-dump feature. Plus - bug-fixes and help. - - Marc Delisle made phpMyAdmin - language-independent by outsourcing the strings to a separate file. He - also contributed the French translation. - - Alexandr Bravo who contributed - tbl_select.php3, a feature to display only some fields from a table. - - Chris Jackson added support for MySQL - functions in tbl_change.php3. He also added the - "Query by Example" feature in 2.0. - - Dave Walton added support for multiple - servers and is a regular contributor for bug-fixes. - - Gabriel Ash contributed the random access - features for 2.0.6. - The following people have contributed minor changes, enhancements, bugfixes - or support for a new language: - Jim Kraai, Jordi Bruguera, Miquel Obrador, Geert Lund, Thomas Kleemann, - Alexander Leidinger, Kiko Albiol, Daniel C. Chao, Pavel Piankov, - Sascha Kettler, Joe Pruett, Renato Lins, Mark Kronsbein, Jannis Hermanns, - G. Wieggers. - - And thanks to everyone else who sent me email with suggestions, bug-reports - and or just some feedback. - -Glossary - -From Wikipedia, the free encyclopedia - - * .htaccess - the default name of Apache's directory-level configuration - file. - * Blowfish - a keyed, symmetric block cipher, designed in 1993 by Bruce - Schneier. - * Browser (Web Browser) - a software application that enables a user to - display and interact with text, images, and other information typically - located on a web page at a website on the World Wide Web. - * bzip2 - a free software/open source data compression algorithm and program - developed by Julian Seward. - * CGI (Common Gateway Interface) - an important World Wide Web technology - that enables a client web browser to request data from a program executed - on the Web server. - * Changelog - a log or record of changes made to a project. - * Client - a computer system that accesses a (remote) service on another - computer by some kind of network. - * column - a set of data values of a particular simple type, one for each row - of the table. - * Cookie - a packet of information sent by a server to a World Wide Web - browser and then sent back by the browser each time it accesses that - server. - * CSV - Comma-seperated values - * DB - look at Database. - * database - an organized collection of data. - * Engine - look at Storage Engines. - * extension - a PHP module that extends PHP with additional functionality. - * FAQ (Frequently Asked Questions) - a list of commonly asked question and - there answers. - * Field - one part of divided data/columns. - * foreign key - a field or group of fields in a database record that point to - a key field or group of fields forming a key of another database record in - some (usually different) table. - * FPDF (FreePDF) - the free PDF library - * GD Graphics Library - a library by Thomas Boutell and others for - dynamically manipulating images. - * GD2 - look at GD Graphics Library. - * gzip - gzip is short for GNU zip, a GNU free software file compression - program. - * host - any machine connected to a computer network, a node that has a - hostname. - * hostname - the unique name by which a network attached device is known on a - network. - * HTTP (HyperText Transfer Protocol) - the primary method used to transfer or - convey information on the World Wide Web. - * https - a HTTP-connection with additional security measures. - * IIS (Internet Information Services) - a set of Internet-based services for - servers using Microsoft Windows. - * Index - a feature that allows quick access to the rows in a table. - * IP (Internet Protocol) - a data-oriented protocol used by source and - destination hosts for communicating data across a packet-switched - internetwork. - * IP Address - a unique number that devices use in order to identify and - communicate with each other on a network utilizing the Internet Protocol - standard. - * ISAPI (Internet Server Application Programming Interface) - the API of - Internet Information Services (IIS). - * ISP (Internet service provider) - a business or organization that offers - users access to the Internet and related services. - * JPEG - a most commonly used standard method of lossy compression for - photographic images. - * JPG - look at JPEG. - * Key - look at index. - * L^AT[E]X - a document preparation system for the T[E]X typesetting program. - * Mac (Apple Macintosh) - line of personal computers is designed, developed, - manufactured, and marketed by Apple Computer. - * Mac OS X - the operating system which is included with all currently - shipping Apple Macintosh computers in the consumer and professional - markets. - * MCrypt - a cryptographic library. - * mcrypt - the MCrypt PHP extension. - * MIME (Multipurpose Internet Mail Extensions) - an Internet Standard for the - format of e-mail. - * module - some sort of extension for the Apache Webserver. - * MySQL - a multithreaded, multi-user, SQL (Structured Query Language) - Database Management System (DBMS). - * mysqli - the improved MySQL client PHP extension. - * mysql - the MySQL client PHP extension. - * OpenDocument - open standard for office documents. - * OS X - look at Mac OS X. - * PDF (Portable Document Format) - a file format developed by Adobe Systems - for representing two dimensional documents in a device independent and - resolution independent format. - * PEAR - the PHP Extension and Application Repository. - * PCRE (Perl Compatible Regular Expressions) - the perl-compatible regular - expression functions for PHP - * PHP - short for "PHP: Hypertext Preprocessor", is an open-source, - reflective programming language used mainly for developing server-side - applications and dynamic web content, and more recently, a broader range of - software applications. - * port - a connection through which data is sent and received. - * RFC - Request for Comments (RFC) documents are a series of memoranda - encompassing new research, innovations, and methodologies applicable to - Internet technologies. - * RFC 1952 - GZIP file format specification version 4.3 - * Row (record, tulpel) - represents a single, implicitly structured data item - in a table. - * Server - a computer system that provides services to other computing - systems over a network. - * Storage Engines - handlers for different table types - * socket - a form of inter-process communication. - * SSL (Secure Sockets Layer) - a cryptographic protocol which provides secure - communication on the Internet. - * SQL - Structured Query Language - * table - a set of data elements (cells) that is organized, defined and - stored as horizontal rows and vertical columns where each item can be - uniquely identified by a label or key or by it?s position in relation to - other items. - * Table type - * tar - a type of archive file format: the Tape ARchive format. - * TCP (Transmission Control Protocol) - one of the core protocols of the - Internet protocol suite. - * UFPDF - Unicode/UTF-8 extension for FPDF - * URL (Uniform Resource Locator) - a sequence of characters, conforming to a - standardized format, that is used for referring to resources, such as - documents and images on the Internet, by their location. - * Webserver - A computer (program) that is responsible for accepting HTTP - requests from clients and serving them Web pages. - * XML (Extensible Markup Language) - a W3C-recommended general-purpose markup - language for creating special-purpose markup languages, capable of - describing many different kinds of data. - * ZIP - a popular data compression and archival format. - * zlib - an open-source, cross-platform data compression library by Jean-loup - Gailly and Mark Adler. - -Valid XHTML 1.1 Valid CSS! - diff --git a/htdocs/sql/INSTALL b/htdocs/sql/INSTALL deleted file mode 100755 --- a/htdocs/sql/INSTALL +++ /dev/null @@ -1,9 +0,0 @@ -$Id: INSTALL 9537 2006-10-12 16:27:13Z nijel $ - -phpMyAdmin - Installation -------------------------- - - Please have a look to the Documentation.txt or - Documentation.html files. - - diff --git a/htdocs/sql/LICENSE b/htdocs/sql/LICENSE deleted file mode 100755 --- a/htdocs/sql/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/htdocs/sql/README b/htdocs/sql/README deleted file mode 100755 --- a/htdocs/sql/README +++ /dev/null @@ -1,74 +0,0 @@ -$Id: README 12317 2009-03-24 21:04:18Z lem9 $ - -phpMyAdmin - Readme -=================== - - A set of PHP-scripts to manage MySQL over the web. - - Version 2.11.9.5 - ---------------- - http://www.phpmyadmin.net/ - - Copyright (C) 1998-2000 Tobias Ratschiller - Copyright (C) 2001-2008 Marc Delisle - Olivier Müller - Robin Johnson - Alexander M. Turek - Michal Čihař - Garvin Hicking - Michael Keck - Sebastian Mendel - [check Documentation.txt/.html file for more details] - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2, - as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Requirements: - php 4.1.0 or later - MySQL 3.23.32 or later - a web-browser (doh!) - - Summary: - phpMyAdmin is intended to handle the administration of MySQL over the web. - For a summary of features, please see the Documentation.txt/.html file. - - Download: - You can get the newest version at http://www.phpmyadmin.net/. - - Credits: - Please see the Documentation.txt/.html file. - - Installation: - Please see the Documentation.txt/.html file. - - ChangeLog: - Now in ChangeLog - - Documentation: - Basic documentation available in Documentation.txt/.html - - Support: - See reference about support forums under http://www.phpmyadmin.net/ - - - Enjoy! - The phpMyAdmin Devel team - - - PS: Please, don't send us emails with question like "How do I compile - PHP with MySQL-support". We just don't have the time to be your - free helpdesk. - Please send your questions to the appropriate mailinglists / forums. - Before contacting us, please read the Documentation.html (esp. the - FAQ part). - diff --git a/htdocs/sql/RELEASE-DATE-2.11.9.5 b/htdocs/sql/RELEASE-DATE-2.11.9.5 deleted file mode 100755 --- a/htdocs/sql/RELEASE-DATE-2.11.9.5 +++ /dev/null @@ -1,1 +0,0 @@ -Tue Mar 24 21:05:17 UTC 2009 diff --git a/htdocs/sql/TODO b/htdocs/sql/TODO deleted file mode 100755 --- a/htdocs/sql/TODO +++ /dev/null @@ -1,10 +0,0 @@ -$Id: TODO 9537 2006-10-12 16:27:13Z nijel $ - -phpMyAdmin - Todo -================= - -We are currently using the Sourceforge Tracker as Todo list: - - http://sourceforge.net/tracker/?atid=377411&group_id=23067&func=browse - --- swix/20010704 diff --git a/htdocs/sql/browse_foreigners.php b/htdocs/sql/browse_foreigners.php deleted file mode 100755 --- a/htdocs/sql/browse_foreigners.php +++ /dev/null @@ -1,302 +0,0 @@ - - - $per_page)) { - $showall = ''; - } - - $session_max_rows = $per_page; - $pageNow = @floor($pos / $session_max_rows) + 1; - $nbTotalPage = @ceil($the_total / $session_max_rows); - - if ($the_total > $per_page) { - $gotopage = PMA_pageselector( - 'browse_foreigners.php?field=' . urlencode($field) . - '&' . PMA_generate_common_url($db, $table) - . $pk_uri . - '&fieldkey=' . (isset($fieldkey) ? urlencode($fieldkey) : '') . - '&foreign_filter=' . (isset($foreign_filter) ? urlencode($foreign_filter) : '') . - '&', - $session_max_rows, - $pageNow, - $nbTotalPage, - 200, - 5, - 5, - 20, - 10, - $GLOBALS['strPageNumber'] - ); - } -} -?> - - - - - phpMyAdmin - - - - - - - - -
-
- - - - - - - - - - - - - - - - - -
- - -
- - - - - - - '; - - echo '' . $header . '' . "\n" - .'' . $header . '' . "\n" - .'' . "\n"; - - $values = array(); - $keys = array(); - foreach ($disp_row as $relrow) { - if ($foreign_display != FALSE) { - $values[] = $relrow[$foreign_display]; - } else { - $values[] = ''; - } - - $keys[] = $relrow[$foreign_field]; - } - - asort($keys); - - $hcount = 0; - $odd_row = true; - $val_ordered_current_row = 0; - $val_ordered_current_equals_data = false; - $key_ordered_current_equals_data = false; - foreach ($keys as $key_ordered_current_row => $value) { - //for ($i = 0; $i < $count; $i++) { - $hcount++; - - if ($cfg['RepeatCells'] > 0 && $hcount > $cfg['RepeatCells']) { - echo $header; - $hcount = 0; - $odd_row = true; - } - - $key_ordered_current_key = $keys[$key_ordered_current_row]; - $key_ordered_current_val = $values[$key_ordered_current_row]; - - $val_ordered_current_key = $keys[$val_ordered_current_row]; - $val_ordered_current_val = $values[$val_ordered_current_row]; - - $val_ordered_current_row++; - - if (PMA_strlen($val_ordered_current_val) <= $cfg['LimitChars']) { - $val_ordered_current_val = htmlspecialchars($val_ordered_current_val); - $val_ordered_current_val_title = ''; - } else { - $val_ordered_current_val_title = - htmlspecialchars($val_ordered_current_val); - $val_ordered_current_val = - htmlspecialchars(PMA_substr($val_ordered_current_val, 0, - $cfg['LimitChars']) . '...'); - } - if (PMA_strlen($key_ordered_current_val) <= $cfg['LimitChars']) { - $key_ordered_current_val = htmlspecialchars($key_ordered_current_val); - $key_ordered_current_val_title = ''; - } else { - $key_ordered_current_val_title = - htmlspecialchars($key_ordered_current_val); - $key_ordered_current_val = - htmlspecialchars(PMA_substr($key_ordered_current_val, 0, - $cfg['LimitChars']) . '...'); - } - - if (! empty($data)) { - $val_ordered_current_equals_data = $val_ordered_current_key == $data; - $key_ordered_current_equals_data = $key_ordered_current_key == $data; - } - - ?> - - - - - - - - - - -
' . $strKeyname . '' . $strDescription . '' . $strDescription . '' . $strKeyname . '
- ' : '') - .'' - .htmlspecialchars($key_ordered_current_key) . '' . ($key_ordered_current_equals_data ? '' : ''); - ?> - ' : '') - . '' - . $key_ordered_current_val . '' . ($key_ordered_current_equals_data ? '' : ''); - ?> - - ' : '') - . '' - . $val_ordered_current_val . '' . ($val_ordered_current_equals_data ? '' : ''); - ?> - ' : '') . '' . htmlspecialchars($val_ordered_current_key) - . '' . ($val_ordered_current_equals_data ? '' : ''); - ?>
- - - - - diff --git a/htdocs/sql/calendar.php b/htdocs/sql/calendar.php deleted file mode 100755 --- a/htdocs/sql/calendar.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -
-
- - diff --git a/htdocs/sql/changelog.php b/htdocs/sql/changelog.php deleted file mode 100755 --- a/htdocs/sql/changelog.php +++ /dev/null @@ -1,87 +0,0 @@ - '\\1', - - // sourceforge users - '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*)@users.sourceforge.net>/i' - => '\\1 \\2', - '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i' - => 'thanks to \\1', - '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i' - => 'thanks to \\1', - - // mail adresse - '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*@.*)>/i' - => '\\1 \\2', - - // linking patches - '/patch\s*#?([0-9]{6,})/i' - => 'patch #\\1', - - // linking RFE - '/(?:rfe|feature)\s*#?([0-9]{6,})/i' - => 'RFE #\\1', - - // linking files - '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i' - => '\\1\\2', - - // FAQ entries - '/FAQ ([0-9]+)\.([0-9a-z]+)/i' - => 'FAQ \\1.\\2', - - // linking bugs - '/bug\s*#?([0-9]{6,})/i' - => 'bug #\\1', - - // all other 6+ digit numbers are treated as bugs - '/(? ' bug #\\1', - - // CVE/CAN entries - '/((CAN|CVE)-[0-9]+-[0-9]+)/' - => '\\1', - - // Highlight releases (with links) - '/(( ### )(([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+) (.*)))/' - => '\\2\\4.\\5.\\6.\\7 \\8', - '/(( ### )(([0-9]+)\.([0-9]+)\.([0-9]+) (.*)))/' - => '\\2\\4.\\5.\\6 \\7', - - // Highlight releases (not linkable) - '/( ### )(.*)/' - => '\\1\\2', - -); - -header('Content-type: text/html; charset=utf-8'); -echo ''; -?> - - - - - -phpMyAdmin - ChangeLog - - - -

phpMyAdmin - ChangeLog

-'; -echo preg_replace(array_keys($replaces), $replaces, $changelog); -echo ''; -?> - - diff --git a/htdocs/sql/chk_rel.php b/htdocs/sql/chk_rel.php deleted file mode 100755 --- a/htdocs/sql/chk_rel.php +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/htdocs/sql/config.inc.php b/htdocs/sql/config.inc.php deleted file mode 100755 --- a/htdocs/sql/config.inc.php +++ /dev/null @@ -1,60 +0,0 @@ -. - * - * @version $Id: config.sample.inc.php 12304 2009-03-24 12:56:58Z nijel $ - */ - -/* - * This is needed for cookie based authentication to encrypt password in - * cookie - */ -$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ - -/* - * Servers configuration - */ -$i = 0; - -/* - * First server - */ -$i++; -/* Authentication type */ -$cfg['Servers'][$i]['auth_type'] = 'cookie'; -/* Server parameters */ -$cfg['Servers'][$i]['host'] = 'localhost'; -$cfg['Servers'][$i]['connect_type'] = 'tcp'; -$cfg['Servers'][$i]['compress'] = false; -/* Select mysqli if your server has it */ -$cfg['Servers'][$i]['extension'] = 'mysql'; -/* User for advanced features */ -// $cfg['Servers'][$i]['controluser'] = 'pma'; -// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; -/* Advanced phpMyAdmin features */ -// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; -// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; -// $cfg['Servers'][$i]['relation'] = 'pma_relation'; -// $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; -// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; -// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; -// $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; -// $cfg['Servers'][$i]['history'] = 'pma_history'; -// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; - -/* - * End of servers configuration - */ - -/* - * Directories for saving/loading files from server - */ -$cfg['UploadDir'] = ''; -$cfg['SaveDir'] = ''; - -?> diff --git a/htdocs/sql/config.sample.inc.php b/htdocs/sql/config.sample.inc.php deleted file mode 100755 --- a/htdocs/sql/config.sample.inc.php +++ /dev/null @@ -1,60 +0,0 @@ -. - * - * @version $Id: config.sample.inc.php 12304 2009-03-24 12:56:58Z nijel $ - */ - -/* - * This is needed for cookie based authentication to encrypt password in - * cookie - */ -$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ - -/* - * Servers configuration - */ -$i = 0; - -/* - * First server - */ -$i++; -/* Authentication type */ -$cfg['Servers'][$i]['auth_type'] = 'cookie'; -/* Server parameters */ -$cfg['Servers'][$i]['host'] = 'localhost'; -$cfg['Servers'][$i]['connect_type'] = 'tcp'; -$cfg['Servers'][$i]['compress'] = false; -/* Select mysqli if your server has it */ -$cfg['Servers'][$i]['extension'] = 'mysql'; -/* User for advanced features */ -// $cfg['Servers'][$i]['controluser'] = 'pma'; -// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; -/* Advanced phpMyAdmin features */ -// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; -// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; -// $cfg['Servers'][$i]['relation'] = 'pma_relation'; -// $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; -// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; -// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; -// $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; -// $cfg['Servers'][$i]['history'] = 'pma_history'; -// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; - -/* - * End of servers configuration - */ - -/* - * Directories for saving/loading files from server - */ -$cfg['UploadDir'] = ''; -$cfg['SaveDir'] = ''; - -?> diff --git a/htdocs/sql/contrib/README b/htdocs/sql/contrib/README deleted file mode 100755 --- a/htdocs/sql/contrib/README +++ /dev/null @@ -1,12 +0,0 @@ -$Id: README 8657 2006-02-22 15:35:00Z nijel $ - -This directory contains various stuff contributed by users that might be -useful to other. There is no guarantee it will work for you. - -Current content of this directory: - -packaging - Contains files needed for creating packages for various - distributions. Please prefer official packages from your vendor if - possible. - -vim: expandtab ts=4 sw=4 sts=4 tw=78 diff --git a/htdocs/sql/contrib/packaging/Fedora/phpMyAdmin-http.conf b/htdocs/sql/contrib/packaging/Fedora/phpMyAdmin-http.conf deleted file mode 100755 --- a/htdocs/sql/contrib/packaging/Fedora/phpMyAdmin-http.conf +++ /dev/null @@ -1,12 +0,0 @@ -# -# MySQL server administration. -# -Alias /phpMyAdmin /var/www/myadmin - - - DirectoryIndex index.php - Options Indexes Includes ExecCGI - AllowOverride None - Order deny,allow - Allow from all - diff --git a/htdocs/sql/contrib/packaging/Fedora/phpMyAdmin.spec b/htdocs/sql/contrib/packaging/Fedora/phpMyAdmin.spec deleted file mode 100755 --- a/htdocs/sql/contrib/packaging/Fedora/phpMyAdmin.spec +++ /dev/null @@ -1,163 +0,0 @@ -%define _myadminpath /var/www/myadmin -%define pkgrelease rc1 -%define microrelease 1 - -Name: phpMyAdmin -Version: 2.8.0 -Release: %{pkgrelease}.%{microrelease} -License: GPL -Group: Applications/Databases/Interfaces -Source0: http://prdownloads.sourceforge.net/phpmyadmin/%{name}-%{version}-%{pkgrelease}.tar.bz2 -Source1: phpMyAdmin-http.conf -URL: http://sourceforge.net/projects/phpmyadmin/ -Requires: mysql -Requires: php-mysql -Buildarch: noarch -BuildRoot: %{_tmppath}/%{name}-root - -Summary: phpMyAdmin - web-based MySQL administration - -%description -phpMyAdmin can manage a whole MySQL-server (needs a super-user) but -also a single database. To accomplish the latter you'll need a -properly set up MySQL-user which can read/write only the desired -database. It's up to you to look up the appropiate part in the MySQL -manual. Currently phpMyAdmin can: - - create and drop databases - - create, copy, drop and alter tables - - delete, edit and add fields - - execute any SQL-statement, even batch-queries - - manage keys on fields - - load text files into tables - - create (*) and read dumps of tables - - export (*) and import data to CSV values - - administer multiple servers and single databases - - check referencial integrity - - create complex queries automatically connecting required tables - - create PDF graphics of your database layout - - communicate in more than 38 different languages - - -%prep -%setup -q -n %{name}-%{version}-%{pkgrelease} - - -%build - - -%install -[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d "${RPM_BUILD_ROOT}" ] && \ - rm -rf "${RPM_BUILD_ROOT}" - -# Create directories. - -install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/{css,js,lang,libraries,themes} -install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/libraries/{auth,dbg,dbi,engines} -install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/libraries/{export,tcpdf,import} -install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/libraries/transformations -install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/libraries/tcpdf/font -install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/themes/{darkblue_orange,original} -install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/themes/darkblue_orange/{css,img} -install -d "${RPM_BUILD_ROOT}%{_myadminpath}"/themes/original/{css,img} - -# Install files. - -install libraries/config.default.php \ - "${RPM_BUILD_ROOT}%{_myadminpath}"/config.inc.php -install *.{php,ico} "${RPM_BUILD_ROOT}%{_myadminpath}"/ -install ChangeLog LICENSE README "${RPM_BUILD_ROOT}%{_myadminpath}"/ -install Documentation.html docs.css "${RPM_BUILD_ROOT}%{_myadminpath}"/ -install css/* "${RPM_BUILD_ROOT}%{_myadminpath}/css"/ -install js/* "${RPM_BUILD_ROOT}%{_myadminpath}/js"/ -install lang/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/lang"/ -install libraries/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries"/ -install libraries/auth/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/auth"/ -install libraries/dbg/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/dbg"/ -install libraries/dbi/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/dbi"/ -install libraries/engines/*.php \ - "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/engines"/ -install libraries/export/*.php \ - "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/export"/ -install libraries/tcpdf/*.php "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/tcpdf"/ -install libraries/tcpdf/font/*.{php,z} \ - "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/tcpdf/font"/ -install libraries/import/*.php \ - "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/import"/ -install libraries/transformations/*.php \ - "${RPM_BUILD_ROOT}%{_myadminpath}/libraries/transformations"/ -install themes/darkblue_orange/*.{php,png} \ - "${RPM_BUILD_ROOT}%{_myadminpath}/themes/darkblue_orange"/ -install themes/darkblue_orange/css/*.php \ - "${RPM_BUILD_ROOT}%{_myadminpath}/themes/darkblue_orange/css"/ -install themes/darkblue_orange/img/*.{png,ico} \ - "${RPM_BUILD_ROOT}%{_myadminpath}/themes/darkblue_orange/img"/ -install themes/original/*.{php,png} \ - "${RPM_BUILD_ROOT}%{_myadminpath}/themes/original"/ -install themes/original/css/*.php \ - "${RPM_BUILD_ROOT}%{_myadminpath}/themes/original/css"/ -install themes/original/img/*.{png,ico} \ - "${RPM_BUILD_ROOT}%{_myadminpath}/themes/original/img"/ - -# Create documentation directories. - -DOCROOT="${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}" -install -d "${DOCROOT}" -install -d "${DOCROOT}"/{lang,scripts,transformations} - -# Install documentation files. - -install RELEASE-DATE-* "${DOCROOT}"/ -install CREDITS ChangeLog INSTALL LICENSE "${DOCROOT}"/ -install README TODO "${DOCROOT}"/ -install Documentation.* docs.css "${DOCROOT}"/ -install translators.html "${DOCROOT}"/ -install lang/*.sh "${DOCROOT}"/lang/ -install scripts/* "${DOCROOT}"/scripts/ -install libraries/tcpdf/README "${DOCROOT}"/README.tcpdf -install libraries/import/README "${DOCROOT}"/README.import -install libraries/transformations/README "${DOCROOT}"/transformations/ -install libraries/transformations/TEMPLATE* "${DOCROOT}"/transformations/ -install libraries/transformations/*.sh "${DOCROOT}"/transformations/ - -# Install configuration file for Apache. - -install -d "${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d" -install "%{SOURCE1}" \ - "${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/phpMyAdmin.conf" - -# Generate non-configuration file list. - -(cd "${RPM_BUILD_ROOT}"; ls -d ."%{_myadminpath}"/*) | - sed -e '/\/config\.inc\.php$/d' -e 's/^.//' > files.list - - - -%clean -[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d "${RPM_BUILD_ROOT}" ] && \ - rm -rf "${RPM_BUILD_ROOT}" - - -%files -f files.list -%defattr(644, root, root, 755) -%doc %{_docdir}/%{name}-%{version} -%dir %{_myadminpath} -%attr(640,root,apache) %config(noreplace) %verify(not size mtime md5) %{_myadminpath}/config.inc.php -%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/conf.d/* - - -%changelog -* Thu Feb 23 2006 Patrick Monnerat -- Version 2.8.0-rc1.1. - -* Thu Dec 22 2005 Patrick Monnerat -- Path "nullpw" to allow trying connection with null password after failure. -- Version 2.7.0-pl1.1. - -* Mon Aug 22 2005 Patrick Monnerat -- Version 2.6.3-pl1. - -* Wed Jul 21 2004 Patrick Monnerat -- Version 2.5.7-pl1. - -* Fri Nov 22 2002 Patrick Monnerat -- Version 2.3.0-rc1. diff --git a/htdocs/sql/db_create.php b/htdocs/sql/db_create.php deleted file mode 100755 --- a/htdocs/sql/db_create.php +++ /dev/null @@ -1,50 +0,0 @@ -= 40101) { - list($db_charset) = explode('_', $db_collation); - if (in_array($db_charset, $mysql_charsets) && in_array($db_collation, $mysql_collations[$db_charset])) { - $sql_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation); - } - unset($db_charset, $db_collation); -} -$sql_query .= ';'; - -$result = PMA_DBI_try_query($sql_query); - -if (! $result) { - $message = PMA_DBI_getError(); - // avoid displaying the not-created db name in header or navi panel - $GLOBALS['db'] = ''; - $GLOBALS['table'] = ''; - require_once './libraries/header.inc.php'; - require_once './main.php'; -} else { - $message = $strDatabase . ' ' . htmlspecialchars($new_db) . ' ' . $strHasBeenCreated; - $GLOBALS['db'] = $new_db; - require_once './libraries/header.inc.php'; - require_once './' . $cfg['DefaultTabDatabase']; -} -?> diff --git a/htdocs/sql/db_datadict.php b/htdocs/sql/db_datadict.php deleted file mode 100755 --- a/htdocs/sql/db_datadict.php +++ /dev/null @@ -1,326 +0,0 @@ - -

-

- = 40100) { - $comments = PMA_getComments($db, $table); - } - - if ($count != 0) { - echo '
' . "\n"; - } else { - echo '
' . "\n"; - } - - echo '

' . $table . '

' . "\n"; - - /** - * Gets table informations - */ - // The 'show table' statement works correct since 3.23.03 - $showtable = PMA_DBI_get_tables_full($db, $table); - $num_rows = (isset($showtable[$table]['TABLE_ROWS']) ? $showtable[$table]['TABLE_ROWS'] : 0); - $show_comment = (isset($showtable[$table]['TABLE_COMMENT']) ? $showtable[$table]['TABLE_COMMENT'] : ''); - unset($showtable); - - - /** - * Gets table keys and retains them - */ - - PMA_DBI_select_db($db); - $result = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($table) . ';'); - $primary = ''; - $indexes = array(); - $lastIndex = ''; - $indexes_info = array(); - $indexes_data = array(); - $pk_array = array(); // will be use to emphasis prim. keys in the table - // view - while ($row = PMA_DBI_fetch_assoc($result)) { - // Backups the list of primary keys - if ($row['Key_name'] == 'PRIMARY') { - $primary .= $row['Column_name'] . ', '; - $pk_array[$row['Column_name']] = 1; - } - // Retains keys informations - if ($row['Key_name'] != $lastIndex){ - $indexes[] = $row['Key_name']; - $lastIndex = $row['Key_name']; - } - $indexes_info[$row['Key_name']]['Sequences'][] = $row['Seq_in_index']; - $indexes_info[$row['Key_name']]['Non_unique'] = $row['Non_unique']; - if (isset($row['Cardinality'])) { - $indexes_info[$row['Key_name']]['Cardinality'] = $row['Cardinality']; - } - // I don't know what does following column mean.... - // $indexes_info[$row['Key_name']]['Packed'] = $row['Packed']; - - $indexes_info[$row['Key_name']]['Comment'] = $row['Comment']; - - $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Column_name'] = $row['Column_name']; - if (isset($row['Sub_part'])) { - $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Sub_part'] = $row['Sub_part']; - } - - } // end while - if ($result) { - PMA_DBI_free_result($result); - } - - - /** - * Gets fields properties - */ - $result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE); - $fields_cnt = PMA_DBI_num_rows($result); - - -// We need this to correctly learn if a TIMESTAMP is NOT NULL, since -// SHOW FULL FIELDS or INFORMATION_SCHEMA incorrectly says NULL -// and SHOW CREATE TABLE says NOT NULL (tested -// in MySQL 4.0.25 and 5.0.21, http://bugs.mysql.com/20910). - - $show_create_table = PMA_DBI_fetch_value( - 'SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), - 0, 1); - $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); - - // Check if we can use Relations (Mike Beck) - if (!empty($cfgRelation['relation'])) { - // Find which tables are related with the current one and write it in - // an array - $res_rel = PMA_getForeigners($db, $table); - - if (count($res_rel) > 0) { - $have_rel = TRUE; - } else { - $have_rel = FALSE; - } - } else { - $have_rel = FALSE; - } // end if - - - /** - * Displays the comments of the table if MySQL >= 3.23 - */ - if (!empty($show_comment)) { - echo $strTableComments . ': ' . htmlspecialchars($show_comment) . '

'; - } - - /** - * Displays the table structure - */ - ?> - - - - -*/ ?> - - -*/ ?> - ' . $strLinksTo . '' . "\n"; - } - if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { - echo ' ' . "\n"; - } - if ($cfgRelation['mimework']) { - echo ' ' . "\n"; - } - ?> - - NULL'; - } - } else { - $row['Default'] = htmlspecialchars($row['Default']); - } - $field_name = htmlspecialchars($row['Field']); - - // here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the - // NULL attribute, but SHOW CREATE TABLE says the contrary. Believe - // the latter. - /** - * @todo merge this logic with the one in tbl_structure.php - * or move it in a function similar to PMA_DBI_get_columns_full() - * but based on SHOW CREATE TABLE because information_schema - * cannot be trusted in this case (MySQL bug) - */ - if (!empty($analyzed_sql[0]['create_table_fields'][$field_name]['type']) && $analyzed_sql[0]['create_table_fields'][$field_name]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$field_name]['timestamp_not_null']) { - $row['Null'] = ''; - } - ?> - - - xml:lang="en" dir="ltr"> ->*/ ?> - - ->*/ ?> - '; - if (isset($res_rel[$field_name])) { - echo htmlspecialchars($res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field']); - } - echo '' . "\n"; - } - if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { - echo ' ' . "\n"; - } - if ($cfgRelation['mimework']) { - $mime_map = PMA_getMIME($db, $table, true); - - echo ' ' . "\n"; - } - ?> - - -
' . $strComments . 'MIME
- ' . $field_name . ''; - } else { - echo $field_name; - } - ?> - '; - if (isset($comments[$field_name])) { - echo htmlspecialchars($comments[$field_name]); - } - echo ''; - if (isset($mime_map[$field_name])) { - echo htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype'])); - } - echo '
-
- - -
'; - -require_once './libraries/footer.inc.php'; -?> diff --git a/htdocs/sql/db_export.php b/htdocs/sql/db_export.php deleted file mode 100755 --- a/htdocs/sql/db_export.php +++ /dev/null @@ -1,77 +0,0 @@ -' . $strNoTablesFound . '
'; - require './libraries/footer.inc.php'; - exit; -} // end if - -$checkall_url = 'db_export.php?' - . PMA_generate_common_url($db) - . '&goto=db_export.php'; - -$multi_values = '
'; -$multi_values .= '' . $strSelectAll . ' - / - ' . $strUnselectAll . '
'; - -$multi_values .= '

'; - -$export_type = 'database'; -require_once './libraries/display_export.lib.php'; - -/** - * Displays the footer - */ -require_once './libraries/footer.inc.php'; -?> diff --git a/htdocs/sql/db_import.php b/htdocs/sql/db_import.php deleted file mode 100755 --- a/htdocs/sql/db_import.php +++ /dev/null @@ -1,27 +0,0 @@ - - diff --git a/htdocs/sql/db_operations.php b/htdocs/sql/db_operations.php deleted file mode 100755 --- a/htdocs/sql/db_operations.php +++ /dev/null @@ -1,524 +0,0 @@ -build(); - } - - if (isset($GLOBALS['add_constraints'])) { - $GLOBALS['sql_constraints_query_full_db'] = ''; - } - - $tables_full = PMA_DBI_get_tables_full($db); - $views = array(); - foreach ($tables_full as $each_table => $tmp) { - // to be able to rename a db containing views, we - // first collect in $views all the views we find and we - // will handle them after the tables - /** - * @todo support a view of a view - * @todo support triggers - */ - if (PMA_Table::isView($db, $each_table)) { - $views[] = $each_table; - continue; - } - - $back = $sql_query; - $sql_query = ''; - - // value of $what for this table only - $this_what = $what; - - if (!isset($tables_full[$each_table]['Engine'])) { - $tables_full[$each_table]['Engine'] = $tables_full[$each_table]['Type']; - } - // do not copy the data from a Merge table - // note: on the calling FORM, 'data' means 'structure and data' - if ($tables_full[$each_table]['Engine'] == 'MRG_MyISAM') { - if ($this_what == 'data') { - $this_what = 'structure'; - } - if ($this_what == 'dataonly') { - $this_what = 'nocopy'; - } - } - - if ($this_what != 'nocopy') { - PMA_Table::moveCopy($db, $each_table, $newname, $each_table, - isset($this_what) ? $this_what : 'data', $move, 'db_copy'); - if (isset($GLOBALS['add_constraints'])) { - $GLOBALS['sql_constraints_query_full_db'] .= $GLOBALS['sql_constraints_query']; - unset($GLOBALS['sql_constraints_query']); - } - } - - $sql_query = $back . $sql_query; - } // end (foreach) - unset($each_table); - - // handle the views - foreach ($views as $view) { - PMA_Table::moveCopy($db, $view, $newname, $view, - 'structure', $move, 'db_copy'); - } - unset($view, $views); - - // now that all tables exist, create all the accumulated constraints - if (isset($GLOBALS['add_constraints'])) { - /** - * @todo this works with mysqli but not with mysql, because - * mysql extension does not accept more than one statement; maybe - * interface with the sql import plugin that handles statement delimiter - */ - PMA_DBI_query($GLOBALS['sql_constraints_query_full_db']); - - // and prepare to display them - $GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_constraints_query_full_db']; - unset($GLOBALS['sql_constraints_query_full_db']); - } - - if (PMA_MYSQL_INT_VERSION >= 50000) { - // here I don't use DELIMITER because it's not part of the - // language; I have to send each statement one by one - - // to avoid selecting alternatively the current and new db - // we would need to modify the CREATE definitions to qualify - // the db name - $procedure_names = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE'); - if ($procedure_names) { - foreach($procedure_names as $procedure_name) { - PMA_DBI_select_db($db); - $tmp_query = PMA_DBI_get_procedure_or_function_def($db, 'PROCEDURE', $procedure_name); - // collect for later display - $GLOBALS['sql_query'] .= "\n" . $tmp_query; - PMA_DBI_select_db($newname); - PMA_DBI_query($tmp_query); - } - } - - $function_names = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION'); - if ($function_names) { - foreach($function_names as $function_name) { - PMA_DBI_select_db($db); - $tmp_query = PMA_DBI_get_procedure_or_function_def($db, 'FUNCTION', $function_name); - // collect for later display - $GLOBALS['sql_query'] .= "\n" . $tmp_query; - PMA_DBI_select_db($newname); - PMA_DBI_query($tmp_query); - } - } - } - // go back to current db, just in case - PMA_DBI_select_db($db); - - // Duplicate the bookmarks for this db (done once for each db) - if ($db != $newname) { - $get_fields = array('user', 'label', 'query'); - $where_fields = array('dbase' => $db); - $new_fields = array('dbase' => $newname); - PMA_Table::duplicateInfo('bookmarkwork', 'bookmark', $get_fields, - $where_fields, $new_fields); - } - - if ($move) { - // cleanup pmadb stuff for this db - require_once './libraries/relation_cleanup.lib.php'; - PMA_relationsCleanupDatabase($db); - - // if someday the RENAME DATABASE reappears, do not DROP - $local_query = 'DROP DATABASE ' . PMA_backquote($db) . ';'; - $sql_query .= "\n" . $local_query; - PMA_DBI_query($local_query); - - $message = sprintf($strRenameDatabaseOK, htmlspecialchars($db), - htmlspecialchars($newname)); - } else { - $message = sprintf($strCopyDatabaseOK, htmlspecialchars($db), - htmlspecialchars($newname)); - } - $reload = true; - - /* Change database to be used */ - if ($move) { - $db = $newname; - } else { - if (isset($switch_to_new) && $switch_to_new == 'true') { - PMA_setCookie('pma_switch_to_new', 'true'); - $db = $newname; - } else { - PMA_setCookie('pma_switch_to_new', ''); - } - } - } -} -/** - * Settings for relations stuff - */ - -require_once './libraries/relation.lib.php'; -$cfgRelation = PMA_getRelationsParam(); - -/** - * Check if comments were updated - * (must be done before displaying the menu tabs) - */ -if ($cfgRelation['commwork'] && isset($db_comment) && $db_comment == 'true') { - PMA_SetComment($db, '', '(db_comment)', $comment); -} - -/** - * Prepares the tables list if the user where not redirected to this script - * because there is no table in the database ($is_info is true) - */ -if (empty($is_info)) { - require './libraries/db_common.inc.php'; - $url_query .= '&goto=db_operations.php'; - - // Gets the database structure - $sub_part = '_structure'; - require './libraries/db_info.inc.php'; - echo "\n"; -} - -if (PMA_MYSQL_INT_VERSION >= 40101) { - $db_collation = PMA_getDbCollation($db); -} -if (PMA_MYSQL_INT_VERSION < 50002 - || (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) { - $is_information_schema = false; -} else { - $is_information_schema = true; -} - -if (!$is_information_schema) { - - require './libraries/display_create_table.lib.php'; - - if ($cfgRelation['commwork']) { - /** - * database comment - */ - ?> -
- - -
- - '; - } - echo $strDBComment; - $comment = PMA_getComments($db); - ?> - - - -
-
- -
- ' . "\n"; - } - ?> - - - -
- - '; - } - echo $strDBRename . ':'; - ?> - - - = XYYZZ) { - // echo 'RENAME DATABASE'; - //} else { - echo 'INSERT INTO ... SELECT'; - //} - echo ')'; ?> - -
-
- - -
- ' . "\n"; - } - echo '' . "\n"; - echo PMA_generate_common_hidden_inputs($db); - ?> -
- - '; - } - echo $strDBCopy . ':'; - if (PMA_MYSQL_INT_VERSION >= 50000) { - $drop_clause = 'DROP TABLE / DROP VIEW'; - } else { - $drop_clause = 'DROP TABLE'; - } - ?> - -
- -
- -
- -
- - -
- -
- -
- -
- - - style="vertical-align: middle" /> - -
-
- -
-
- - = 40101) { - // MySQL supports setting default charsets / collations for databases since - // version 4.1.1. - echo '
' . "\n" - . PMA_generate_common_hidden_inputs($db, $table) - . '
' . "\n" - . ' '; - if ($cfg['PropertiesIconic']) { - echo ''; - } - echo ' ' . "\n" - . ' ' . "\n" - . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, - 'db_collation', 'select_db_collation', $db_collation, false, 3) - . ' ' . "\n" - . '
' . "\n" - . '
' . "\n"; - } - - if ($num_tables > 0 - && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { - /* Show error if user has configured something, notice elsewhere */ - if (!empty($cfg['Servers'][$server]['pmadb'])) { - echo '

' . $strError . '

'; - } else { - echo '
'; - } - printf($strRelationNotWorking, '', ''); - echo '
'; - } // end if -} // end if (!$is_information_schema) - - -// not sure about displaying the PDF dialog in case db is information_schema -if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?> - - - 0) { ?> - -
-
- - '; - } - echo $strDisplayPDF; - ?>: - - -
- - -
- -
- -
- -
- -
- - -
- - - -
-
- -
-
- '; - if ($cfg['PropertiesIconic']) { - echo ''; - } - echo $strEditPDFPages . ''; -} // end if - -/** - * Displays the footer - */ -require_once './libraries/footer.inc.php'; -?> diff --git a/htdocs/sql/db_printview.php b/htdocs/sql/db_printview.php deleted file mode 100755 --- a/htdocs/sql/db_printview.php +++ /dev/null @@ -1,269 +0,0 @@ - 0) { - while ($tmp = PMA_DBI_fetch_row($result)) { - // if in use memorize tablename - if (preg_match('@in_use=[1-9]+@i', $tmp[0])) { - $sot_cache[$tmp[0]] = true; - } - } - PMA_DBI_free_result($result); - - if (isset($sot_cache)) { - $result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE); - if ($result != false && PMA_DBI_num_rows($result) > 0) { - while ($tmp = PMA_DBI_fetch_row($result)) { - if (!isset($sot_cache[$tmp[0]])) { - $sts_result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\';'); - $sts_tmp = PMA_DBI_fetch_assoc($sts_result); - $tables[] = $sts_tmp; - } else { // table in use - $tables[] = array('Name' => $tmp[0]); - } - } - PMA_DBI_free_result($result); - $sot_ready = true; - } - } - unset($tmp, $result); - } -} - -if (! isset($sot_ready)) { - $result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ';'); - if (PMA_DBI_num_rows($result) > 0) { - while ($sts_tmp = PMA_DBI_fetch_assoc($result)) { - $tables[] = $sts_tmp; - } - PMA_DBI_free_result($result); - unset($res); - } -} - */ - -/** - * If there is at least one table, displays the printer friendly view, else - * an error message - */ -$tables = PMA_DBI_get_tables_full($db); -$num_tables = count($tables); - -echo '
'; - -// 1. No table -if ($num_tables == 0) { - echo $strNoTablesFound; -} -// 2. Shows table informations on mysql >= 3.23.03 - staybyte - 11 June 2001 -else { - ?> - - - - - - - ' . $strSize . ''; - } - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - ' . PMA_formatNumber($sts_data['TABLE_ROWS'], 0) . '' . "\n"; - } else { - echo PMA_formatNumber($sts_data['TABLE_ROWS'], 0) . "\n"; - } - ?> - - - - - - - - '; - } else { - $needs_break = ''; - } - - if (! empty($sts_data['Create_time']) - || ! empty($sts_data['Update_time']) - || ! empty($sts_data['Check_time'])) { - echo $needs_break; - ?> - - - - - - - - - - - - - - - - - -
- -
- - - - - -- - - -  
- - - -

- - - - diff --git a/htdocs/sql/db_qbe.php b/htdocs/sql/db_qbe.php deleted file mode 100755 --- a/htdocs/sql/db_qbe.php +++ /dev/null @@ -1,1039 +0,0 @@ - execute it, else display the headers - */ -if (isset($_REQUEST['submit_sql']) - && preg_match('@^SELECT@i', $_REQUEST['encoded_sql_query'])) { - $goto = 'db_sql.php'; - $zero_rows = htmlspecialchars($GLOBALS['strSuccess']); - $sql_query = urldecode($_REQUEST['encoded_sql_query']); - require './sql.php'; - exit; -} else { - $sub_part = '_qbe'; - require './libraries/db_common.inc.php'; - $url_query .= '&goto=db_qbe.php'; - $url_params['goto'] = 'db_qbe.php'; - require './libraries/db_info.inc.php'; -} - -if (isset($_REQUEST['submit_sql']) - && ! preg_match('@^SELECT@i', $_REQUEST['encoded_sql_query'])) { - echo '
' . $GLOBALS['strHaveToShow'] . '
'; -} - - -/** - * Initialize some variables - */ -$col_cnt = isset($_REQUEST['col_cnt']) ? (int) $_REQUEST['col_cnt'] : 3; -$add_col = isset($_REQUEST['add_col']) ? (int) $_REQUEST['add_col'] : 0; -$add_row = isset($_REQUEST['add_row']) ? (int) $_REQUEST['add_row'] : 0; - -$rows = isset($_REQUEST['rows']) ? (int) $_REQUEST['rows'] : 0; -$ins_col = isset($_REQUEST['ins_col']) ? $_REQUEST['ins_col'] : array(); -$del_col = isset($_REQUEST['del_col']) ? $_REQUEST['del_col'] : array(); - -$prev_criteria = isset($_REQUEST['prev_criteria']) - ? $_REQUEST['prev_criteria'] - : array(); -$criteria = isset($_REQUEST['criteria']) - ? $_REQUEST['criteria'] - : array_fill(0, $col_cnt, ''); - -$ins_row = isset($_REQUEST['ins_row']) - ? $_REQUEST['ins_row'] - : array_fill(0, $col_cnt, ''); -$del_row = isset($_REQUEST['del_row']) - ? $_REQUEST['del_row'] - : array_fill(0, $col_cnt, ''); -$and_or_row = isset($_REQUEST['and_or_row']) - ? $_REQUEST['and_or_row'] - : array_fill(0, $col_cnt, ''); -$and_or_col = isset($_REQUEST['and_or_col']) - ? $_REQUEST['and_or_col'] - : array_fill(0, $col_cnt, ''); - -// minimum width -$form_column_width = 12; -$col = max($col_cnt + $add_col, 0); -$row = max($rows + $add_row, 0); - - -// The tables list sent by a previously submitted form -if (!empty($TableList)) { - $cnt_table_list = count($TableList); - for ($x = 0; $x < $cnt_table_list; $x++) { - $tbl_names[urldecode($TableList[$x])] = ' selected="selected"'; - } -} // end if - - -// this was a work in progress, deactivated for now -//$columns = PMA_DBI_get_columns_full($GLOBALS['db']); -//$tables = PMA_DBI_get_columns_full($GLOBALS['db']); - - -/** - * Prepares the form - */ -$tbl_result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE); -$tbl_result_cnt = PMA_DBI_num_rows($tbl_result); -if (0 == $tbl_result_cnt) { - echo '
' . $strNoTablesFound . '
'; - require_once './libraries/footer.inc.php'; - exit; -} - -$i = 0; -$k = 0; - -// The tables list gets from MySQL -while ($i < $tbl_result_cnt) { - list($tbl) = PMA_DBI_fetch_row($tbl_result); - $fld_results = PMA_DBI_get_fields($db, $tbl); - $fld_results_cnt = ($fld_results) ? count($fld_results) : 0; - $j = 0; - - if (empty($tbl_names[$tbl]) && !empty($TableList)) { - $tbl_names[$tbl] = ''; - } else { - $tbl_names[$tbl] = ' selected="selected"'; - } // end if - - // The fields list per selected tables - if ($tbl_names[$tbl] == ' selected="selected"') { - $fld[$k++] = PMA_backquote($tbl) . '.*'; - while ($j < $fld_results_cnt) { - $fld[$k] = PMA_convert_display_charset($fld_results[$j]['Field']); - $fld[$k] = PMA_backquote($tbl) . '.' . PMA_backquote($fld[$k]); - - // increase the width if necessary - if (strlen($fld[$k]) > $form_column_width) { - $form_column_width = strlen($fld[$k]); - } //end if - - $k++; - $j++; - } // end while - } // end if - - $i++; -} // end if -PMA_DBI_free_result($tbl_result); - -// largest width found -$realwidth = $form_column_width . 'ex'; - - -/** - * Displays the Query by example form - */ - -function showColumnSelectCell($columns, $column_number, $selected = '') -{ - ?> - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
: - - - -
: - - - /> -
: - - - - -
- - - - - - - - - - - - -
- : - - - : - - /> -   -
- : - - - : - - /> -   -
-
- - - -
- - - - - - - - - - - - -
- : - - - : - - /> -
- : - - - : - - /> -
-
- - - -
: - : - /> -   : - /> -
- - -    - -
- : - /> -   : - /> -
- - -    - -
- - - -
-
- - - - - - - - - -
- : - -  : - -  
-
- - - - - - -
-
- - $val) { - $strTableListOptions .= ' '; - $strTableListOptions .= '' . "\n"; - $numTableListOptions++; -} -?> - -
-
- -
-
  -
- - - - -
-
- -
-
- - diff --git a/htdocs/sql/db_search.php b/htdocs/sql/db_search.php deleted file mode 100755 --- a/htdocs/sql/db_search.php +++ /dev/null @@ -1,377 +0,0 @@ - - */ - -/** - * - */ -require_once './libraries/common.inc.php'; - -/** - * Gets some core libraries and send headers - */ -require './libraries/db_common.inc.php'; - -/** - * init - */ -// If config variable $GLOBALS['cfg']['Usedbsearch'] is on false : exit. -if (! $GLOBALS['cfg']['UseDbSearch']) { - PMA_mysqlDie($GLOBALS['strAccessDenied'], '', false, $err_url); -} // end if -$url_query .= '&goto=db_search.php'; -$url_params['goto'] = 'db_search.php'; - -/** - * @global array list of tables from the current database - * but do not clash with $tables coming from db_info.inc.php - */ -$tables_names_only = PMA_DBI_get_tables($GLOBALS['db']); - -$search_options = array( - '1' => $GLOBALS['strSearchOption1'], - '2' => $GLOBALS['strSearchOption2'], - '3' => $GLOBALS['strSearchOption3'], - '4' => $GLOBALS['strSearchOption4'], -); - -if (empty($_REQUEST['search_option']) || ! is_string($_REQUEST['search_option']) - || ! array_key_exists($_REQUEST['search_option'], $search_options)) { - $search_option = 1; - unset($_REQUEST['submit_search']); -} else { - $search_option = (int) $_REQUEST['search_option']; - $option_str = $search_options[$_REQUEST['search_option']]; -} - -if (empty($_REQUEST['search_str']) || ! is_string($_REQUEST['search_str'])) { - unset($_REQUEST['submit_search']); - $searched = ''; -} else { - $searched = htmlspecialchars($_REQUEST['search_str']); - // For "as regular expression" (search option 4), we should not treat - // this as an expression that contains a LIKE (second parameter of - // PMA_sqlAddslashes()). - // - // Usage example: If user is seaching for a literal $ in a regexp search, - // he should enter \$ as the value. - $search_str = PMA_sqlAddslashes($_REQUEST['search_str'], ($search_option == 4 ? false : true)); -} - -$tables_selected = array(); -if (empty($_REQUEST['table_select']) || ! is_array($_REQUEST['table_select'])) { - unset($_REQUEST['submit_search']); -} elseif (! isset($_REQUEST['selectall']) && ! isset($_REQUEST['unselectall'])) { - $tables_selected = array_intersect($_REQUEST['table_select'], $tables_names_only); -} - -if (isset($_REQUEST['selectall'])) { - $tables_selected = $tables_names_only; -} elseif (isset($_REQUEST['unselectall'])) { - $tables_selected = array(); -} - -/** - * Displays top links - */ -$sub_part = ''; -require './libraries/db_info.inc.php'; - - -/** - * 1. Main search form has been submitted - */ -if (isset($_REQUEST['submit_search'])) { - - /** - * Builds the SQL search query - * - * @todo can we make use of fulltextsearch IN BOOLEAN MODE for this? - * @uses PMA_DBI_query - * PMA_MYSQL_INT_VERSION - * PMA_backquote - * PMA_DBI_free_result - * PMA_DBI_fetch_assoc - * $GLOBALS['db'] - * explode - * count - * strlen - * @param string the table name - * @param string the string to search - * @param integer type of search (1 -> 1 word at least, 2 -> all words, - * 3 -> exact string, 4 -> regexp) - * - * @return array 3 SQL querys (for count, display and delete results) - * - * @global string the url to return to in case of errors - * @global string charset connection - */ - function PMA_getSearchSqls($table, $search_str, $search_option) - { - global $err_url, $charset_connection; - - // Statement types - $sqlstr_select = 'SELECT'; - $sqlstr_delete = 'DELETE'; - - // Fields to select - $res = PMA_DBI_query('SHOW ' . (PMA_MYSQL_INT_VERSION >= 40100 ? 'FULL ' : '') . 'FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']) . ';'); - while ($current = PMA_DBI_fetch_assoc($res)) { - if (PMA_MYSQL_INT_VERSION >= 40100) { - list($current['Charset']) = explode('_', $current['Collation']); - } - $current['Field'] = PMA_backquote($current['Field']); - $tblfields[] = $current; - } // while - PMA_DBI_free_result($res); - unset($current, $res); - - // Table to use - $sqlstr_from = ' FROM ' . PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($table); - - $search_words = (($search_option > 2) ? array($search_str) : explode(' ', $search_str)); - $search_wds_cnt = count($search_words); - - $like_or_regex = (($search_option == 4) ? 'REGEXP' : 'LIKE'); - $automatic_wildcard = (($search_option <3) ? '%' : ''); - - $fieldslikevalues = array(); - foreach ($search_words as $search_word) { - // Eliminates empty values - // In MySQL 4.1, if a field has no collation we get NULL in Charset - // but in MySQL 5.0.x we get '' - if (strlen($search_word) === 0) { - continue; - } - - $thefieldlikevalue = array(); - foreach ($tblfields as $tblfield) { - if (PMA_MYSQL_INT_VERSION >= 40100 - && $tblfield['Charset'] != $charset_connection - && $tblfield['Charset'] != 'NULL' - && $tblfield['Charset'] != '') { - $prefix = 'CONVERT(_utf8 '; - $suffix = ' USING ' . $tblfield['Charset'] . ') COLLATE ' . $tblfield['Collation']; - } else { - $prefix = $suffix = ''; - } - $thefieldlikevalue[] = $tblfield['Field'] - . ' ' . $like_or_regex . ' ' - . $prefix - . "'" - . $automatic_wildcard - . $search_word - . $automatic_wildcard . "'" - . $suffix; - } // end for - - $fieldslikevalues[] = implode(' OR ', $thefieldlikevalue); - } // end for - - $implode_str = ($search_option == 1 ? ' OR ' : ' AND '); - $sqlstr_where = ' WHERE (' . implode(') ' . $implode_str . ' (', $fieldslikevalues) . ')'; - unset($fieldslikevalues); - - // Builds complete queries - $sql['select_fields'] = $sqlstr_select . ' * ' . $sqlstr_from . $sqlstr_where; - // here, I think we need to still use the COUNT clause, even for - // VIEWs, anyway we have a WHERE clause that should limit results - $sql['select_count'] = $sqlstr_select . ' COUNT(*) AS `count`' . $sqlstr_from . $sqlstr_where; - $sql['delete'] = $sqlstr_delete . $sqlstr_from . $sqlstr_where; - return $sql; - } // end of the "PMA_getSearchSqls()" function - - - /** - * Displays the results - */ - $this_url_params = array( - 'db' => $GLOBALS['db'], - 'goto' => 'db_sql.php', - 'pos' => 0, - 'is_js_confirmed' => 0, - ); - - // Displays search string - echo '
' . "\n" - .'' . "\n" - .'' . "\n"; - - $num_search_result_total = 0; - $odd_row = true; - - foreach ($tables_selected as $each_table) { - // Gets the SQL statements - $newsearchsqls = PMA_getSearchSqls($each_table, - $search_str, $search_option); - - // Executes the "COUNT" statement - $res_cnt = PMA_DBI_fetch_value($newsearchsqls['select_count']); - $num_search_result_total += $res_cnt; - - $sql_query .= $newsearchsqls['select_count']; - - echo '' - .'\n"; - - if ($res_cnt > 0) { - $this_url_params['sql_query'] = $newsearchsqls['select_fields']; - echo '\n"; - - $this_url_params['sql_query'] = $newsearchsqls['delete']; - echo '\n"; - - } else { - echo '' . "\n" - .'' . "\n"; - }// end if else - $odd_row = ! $odd_row; - echo '' . "\n"; - } // end for - - echo '
' . "\n" - .sprintf($GLOBALS['strSearchResultsFor'], - $searched, $option_str) . "\n" - .'
' . sprintf($GLOBALS['strNumSearchResultsInTable'], $res_cnt, - htmlspecialchars($each_table)) . "' . PMA_linkOrButton( - 'sql.php' . PMA_generate_common_url($this_url_params), - $GLOBALS['strBrowse'], '') . "' . PMA_linkOrButton( - 'sql.php' . PMA_generate_common_url($this_url_params), - $GLOBALS['strDelete'], $newsearchsqls['delete']) . "  
' . "\n"; - - if (count($tables_selected) > 1) { - echo '

' . sprintf($GLOBALS['strNumSearchResultsTotal'], - $num_search_result_total) . '

' . "\n"; - } -} // end 1. - - -/** - * 2. Displays the main search form - */ -?> - -
- -
- - - - - - - - - - - - - - -
- /> - 1
- /> - 1
- /> -
- /> - - -
-
- 1
- -' . "\n"; -foreach ($tables_names_only as $each_table) { - if (in_array($each_table, $tables_selected)) { - $is_selected = ' selected="selected"'; - } else { - $is_selected = ''; - } - - echo ' ' . "\n"; -} // end while - -echo ' ' . "\n"; -$alter_select = - '' . $GLOBALS['strSelectAll'] . '' - . ' / ' - . '' . $GLOBALS['strUnselectAll'] . ''; -?> -
-
-
-
- -
-
- - diff --git a/htdocs/sql/db_sql.php b/htdocs/sql/db_sql.php deleted file mode 100755 --- a/htdocs/sql/db_sql.php +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/htdocs/sql/db_structure.php b/htdocs/sql/db_structure.php deleted file mode 100755 --- a/htdocs/sql/db_structure.php +++ /dev/null @@ -1,559 +0,0 @@ -' . $strNoTablesFound . '

' . "\n"; - - if (empty($db_is_information_schema)) { - require './libraries/display_create_table.lib.php'; - } // end if (Create Table dialog) - - /** - * Displays the footer - */ - require_once './libraries/footer.inc.php'; - exit; -} - -// else -// 2. Shows table informations - staybyte - 11 June 2001 - -require_once './libraries/bookmark.lib.php'; - -if (PMA_MYSQL_INT_VERSION >= 40101) { - require_once './libraries/mysql_charsets.lib.php'; - $db_collation = PMA_getDbCollation($db); -} - -// Display function -/** - * void PMA_TableHeader([bool $db_is_information_schema = false]) - * display table header (...) - * - * @uses PMA_showHint() - * @uses PMA_MYSQL_INT_VERSION - * @uses $GLOBALS['cfg']['PropertiesNumColumns'] - * @uses $GLOBALS['is_show_stats'] - * @uses $GLOBALS['strTable'] - * @uses $GLOBALS['strAction'] - * @uses $GLOBALS['strRecords'] - * @uses $GLOBALS['strApproximateCount'] - * @uses $GLOBALS['strType'] - * @uses $GLOBALS['strCollation'] - * @uses $GLOBALS['strSize'] - * @uses $GLOBALS['strOverhead'] - * @uses $GLOBALS['structure_tbl_col_cnt'] - * @param boolean $db_is_information_schema - */ -function PMA_TableHeader($db_is_information_schema = false) -{ - $cnt = 0; // Let's count the columns... - - if ($db_is_information_schema) { - $action_colspan = 3; - } else { - $action_colspan = 6; - } - - echo '
' . "\n" - .'' . "\n" - .'' . "\n" - .' ' . "\n" - .' ' - .' ' . "\n"; - if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) { - echo ' ' . "\n"; - $cnt++; - if (PMA_MYSQL_INT_VERSION >= 40100) { - echo ' ' . "\n"; - $cnt++; - } - } - if ($GLOBALS['is_show_stats']) { - echo ' ' . "\n" - . ' ' . "\n"; - $cnt += 2; - } - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3; -} // end function PMA_TableHeader() - -$titles = array(); -if (true == $cfg['PropertiesIconic']) { - $titles['Browse'] = '' . $strBrowse . ''; - $titles['NoBrowse'] = '' . $strBrowse . ''; - $titles['Search'] = '' . $strSearch . ''; - $titles['NoSearch'] = '' . $strSearch . ''; - $titles['Insert'] = '' . $strInsert . ''; - $titles['NoInsert'] = '' . $strInsert . ''; - $titles['Structure'] = '' . $strStructure . ''; - $titles['Drop'] = '' . $strDrop . ''; - $titles['NoDrop'] = '' . $strDrop . ''; - $titles['Empty'] = '' . $strEmpty . ''; - $titles['NoEmpty'] = '' . $strEmpty . ''; - - if ('both' === $cfg['PropertiesIconic']) { - $titles['Browse'] .= $strBrowse; - $titles['Search'] .= $strSearch; - $titles['NoBrowse'] .= $strBrowse; - $titles['NoSearch'] .= $strSearch; - $titles['Insert'] .= $strInsert; - $titles['NoInsert'] .= $strInsert; - $titles['Structure'] .= $strStructure; - $titles['Drop'] .= $strDrop; - $titles['NoDrop'] .= $strDrop; - $titles['Empty'] .= $strEmpty; - $titles['NoEmpty'] .= $strEmpty; - } -} else { - $titles['Browse'] = $strBrowse; - $titles['Search'] = $strSearch; - $titles['NoBrowse'] = $strBrowse; - $titles['NoSearch'] = $strSearch; - $titles['Insert'] = $strInsert; - $titles['NoInsert'] = $strInsert; - $titles['Structure'] = $strStructure; - $titles['Drop'] = $strDrop; - $titles['NoDrop'] = $strDrop; - $titles['Empty'] = $strEmpty; - $titles['NoEmpty'] = $strEmpty; -} - -/** - * Displays the tables list - */ - -$_url_params = array( - 'pos' => $pos, - 'db' => $db); - -PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']); - -?> - - 1 ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1 : 0; -$row_count = 0; - - -$hidden_fields = array(); -$odd_row = true; -$at_least_one_view_exceeds_max_count = false; -$sum_row_count_pre = ''; - -foreach ($tables as $keyname => $each_table) { - if ($each_table['TABLE_ROWS'] === null || $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) { - $each_table['COUNTED'] = true; - $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db, - $each_table['TABLE_NAME'], $return = true, $force_exact = true); - } else { - $each_table['COUNTED'] = false; - } - - $table_encoded = urlencode($each_table['TABLE_NAME']); - // MySQL < 5.0.13 returns "view", >= 5.0.13 returns "VIEW" - $table_is_view = ($each_table['TABLE_TYPE'] === 'VIEW' - || $each_table['TABLE_TYPE'] === 'SYSTEM VIEW'); - - $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']])) - ? str_replace(' ', ' ', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']])) - : str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME'])); - $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']])) - ? str_replace(' ', ' ', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']])) - : str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME'])); - - // Sets parameters for links - $tbl_url_query = $url_query . '&table=' . $table_encoded; - $i++; - - $row_count++; - if ($table_is_view) { - $hidden_fields[] = ''; - } - - if ($each_table['TABLE_ROWS'] > 0) { - $browse_table = '' . $titles['Browse'] . ''; - $search_table = '' . $titles['Search'] . ''; - } else { - $browse_table = $titles['NoBrowse']; - $search_table = $titles['NoSearch']; - } - - if (! $db_is_information_schema) { - if (! empty($each_table['TABLE_ROWS'])) { - $empty_table = '' . $titles['Empty'] . ''; - } else { - $empty_table = $titles['NoEmpty']; - } - $drop_query = 'DROP ' - . ($table_is_view ? 'VIEW' : 'TABLE') - . ' ' . PMA_backquote($each_table['TABLE_NAME']); - $drop_message = sprintf( - $table_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped, - str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME']))); - } - - // loic1: Patch from Joshua Nye to get valid - // statistics whatever is the table type - - if (isset($each_table['TABLE_ROWS'])) { - // MyISAM, ISAM or Heap table: Row count, data size and index size - // is accurate. - if (preg_match('@^(MyISAM|ISAM|HEAP|MEMORY)$@', $each_table['ENGINE'])) { - if ($is_show_stats) { - $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']); - $sum_size += $tblsize; - list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); - if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) { - list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0); - $overhead_size += $each_table['Data_free']; - } - } - $sum_entries += $each_table['TABLE_ROWS']; - } elseif ($each_table['ENGINE'] == 'InnoDB') { - // InnoDB table: Row count is not accurate but data and index - // sizes are. - if ($is_show_stats) { - $tblsize = $each_table['Data_length'] + $each_table['Index_length']; - $sum_size += $tblsize; - list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); - } - //$display_rows = ' - '; - $sum_entries += $each_table['TABLE_ROWS']; - } elseif (preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $each_table['ENGINE'])) { - // Merge or BerkleyDB table: Only row count is accurate. - if ($is_show_stats) { - $formatted_size = ' - '; - $unit = ''; - } - $sum_entries += $each_table['TABLE_ROWS']; - } else { - // Unknown table type. - if ($is_show_stats) { - $formatted_size = 'unknown'; - $unit = ''; - } - } - - if (PMA_MYSQL_INT_VERSION >= 40100) { - if (isset($each_table['Collation'])) { - $collation = '' - . $each_table['Collation'] . ''; - } else { - $collation = '---'; - } - } - - if ($is_show_stats) { - if (isset($formatted_overhead)) { - $overhead = '' . $formatted_overhead - . ' ' . $overhead_unit . '' . "\n"; - unset($formatted_overhead); - $overhead_check .= - "document.getElementById('checkbox_tbl_$i').checked = true;"; - } else { - $overhead = '-'; - } - } // end if - } // end if (isset($each_table['TABLE_ROWS']) - - if ($num_columns > 0 && $num_tables > $num_columns - && (($row_count % $num_columns) == 0)) { - $row_count = 1; - $odd_row = true; - ?> - - -
' . $GLOBALS['strTable'] . '' . "\n" - .' ' . $GLOBALS['strAction'] . "\n" - .' ' . $GLOBALS['strRecords'] - .PMA_showHint($GLOBALS['strApproximateCount']) . "\n" - .' ' . $GLOBALS['strType'] . '' . $GLOBALS['strCollation'] . '' . $GLOBALS['strSize'] . '' . $GLOBALS['strOverhead'] . '
- - - - /> - - - - - - - - - - - - - - - - = $cfg['MaxExactCountViews']) { - $at_least_one_view_exceeds_max_count = true; - $row_count_pre = '~'; - $sum_row_count_pre = '~'; - $show_superscript = '1'; - } elseif($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) { - // InnoDB table: we did not get an accurate row count - $row_count_pre = '~'; - $sum_row_count_pre = '~'; - $show_superscript = ''; - } else { - $row_count_pre = ''; - $show_superscript = ''; - } - ?> - - 1)) { ?> - - - - - - - - - - - - - - - --- - - - - - - - - - - - - - - - - - - - - - - 1)) { - $default_engine = PMA_DBI_get_default_engine(); - echo ' ' . "\n" - . ' ' .$default_engine . '' . "\n"; - // Have to account for old MySQL with no collation (bug 1554885) - if (PMA_MYSQL_INT_VERSION >= 40100) { - // we got a case where $db_collation was empty - echo ' ' . "\n"; - if (! empty($db_collation)) { - echo ' ' . $db_collation - . ''; - } - echo ''; - } -} - -if ($is_show_stats) { - ?> - - - - - - - -
- -<?php echo $strWithChecked; ?> - - -/ - - - -/ - - - - - - - - -
- -' . "\n"; - echo '1' . PMA_sanitize(sprintf($strViewMaxExactCount, PMA_formatNumber($cfg['MaxExactCountViews'], 0), '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')) . "\n"; - echo '
' . "\n"; -} -// display again the table list navigator -PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']); -?> -
- -'; -echo ''; -if ($cfg['PropertiesIconic']) { - echo ''; -} -echo $strPrintView . ' '; - -echo ''; -if ($cfg['PropertiesIconic']) { - echo ''; -} -echo $strDataDict . ''; -echo '

'; - -if (empty($db_is_information_schema)) { - require './libraries/display_create_table.lib.php'; -} // end if (Create Table dialog) - -/** - * Displays the footer - */ -require_once './libraries/footer.inc.php'; -?> diff --git a/htdocs/sql/docs.css b/htdocs/sql/docs.css deleted file mode 100755 --- a/htdocs/sql/docs.css +++ /dev/null @@ -1,277 +0,0 @@ -/* $Id: docs.css 9263 2006-08-09 17:35:20Z lem9 $ */ -/* Stylesheet for phpMyAdmin documentation */ -/* vim: expandtab ts=4 sw=4 sts=4 tw=78 -*/ - -body { - background-color: #ffffff; - font-family: sans-serif; - color: #000000; - margin: 0; - padding: 2em 0 2em 0; -} - -img { - border: 0; -} - -abbr, acronym { - border-bottom: 1px dotted; -} - -abbr, acronym { - cursor: help; -} - -a { - text-decoration: none; - color: #000099; - background-color: #ffffff; -/* font-weight: normal;*/ -} - -a:hover { -/* background-color: #99CCFF;*/ - color: #000099; - background-color: #ffffff; - text-decoration: underline; -/* font-weight: bolder */ -} - -sup { - font-size: 0.7em; -} - -sup:before { - content: ' ['; -} - -sup:after { - content: ']'; -} - - -ul.header { - width: 100%; - background-color: #ddeeff; - color: #000000; - text-align: center; - padding: 0 0 2px 0; - border-bottom: 1px solid #000000; - font-weight: bold; - left: 0; - top: 0; - position: fixed; - margin: 0; - /* following MSIE hack was originally written by Riki Fridrich - * */ -/* position: expression("absolute");*/ -/* width: expression(document.body.clientWidth);*/ -/* top: expression(document.body.scrollTop + this.offsetHeight - this.offsetHeight);*/ -} - -ul.header li { - margin: 0; - padding: 0; - display: inline; -} - -ul.header li:before { - content: ' - '; -} -ul.header li:first-child:before { - content: ''; -} - -ul.header a { - text-decoration: none; - font-size: medium; - color: #000099; - background-color: #ddeeff; - font-weight: normal; -} -ul.header a:hover { - color: #000099; - background-color: #99CCFF; -/* font-weight: bolder;*/ -} - -h1 { - text-align: center; - padding-left: 8%; - margin-top: 1em; - color: #000000; - background-color: #ddeeff; - font-size: x-large; - border-top: 1px solid #000000; - border-bottom: 1px solid #000000; - clear: both; -} - -h2 { - padding-left: 8%; - padding-top: 2em; - margin-top: 1em; - color: #000000; - background-color: #ddeeff; - font-size: large; - border-top: 1px solid #000000; - border-bottom: 1px solid #000000; - clear: both; - /* counter-reset: heading3; - counter-increment: heading2; */ -} - -/*h2:before { - content: counter(heading2) '. '; -} */ - -h3 { - padding-left: 10%; - padding-top: 3em; - margin-top: 1em; - color: #000000; - background-color: #ddeeff; - font-size: medium; - border-top: 1px solid #000000; - border-bottom: 1px solid #000000; - clear: both; -/* counter-reset: heading4; - counter-increment: heading3; */ -} - -/*h3:before { - content: counter(heading2) '.' counter(heading3) '. '; -} */ - -h4, h5 { - padding: 3em 0 0 0; - margin: 10px 5% 2px 5%; - font-weight: bold; - color: #000099; - background-color: #ffffff; -/* counter-increment: heading4; */ -} - -/* h4:before { - content: counter(heading2) '.' counter(heading3) '.' counter(heading4) '. '; -} - -h5 { - counter-increment: heading5; -} - -h5:before { - content: counter(heading2) '.' counter(heading3) '.' counter(heading4) counter(heading5,lower-alpha); -} */ - -p { - margin: 2px 5% 1em 5%; -} - -table { - margin: 2px 5% 2px 5%; - border: none; -} - -table tr,table td,table th { - border: none; -} - -table.translators { - text-align: center; - display: table; margin-left: auto; margin-right: auto; - border-collapse: collapse; -} - -table.translators th { - color: #000000; - background-color: #d3dce3; -} - -table.translators td, table.translators th { - border: 1px solid #000000; - padding: 5px; -} - -ul { - margin: 2px 5% 2px 5%; -} - -pre { - margin: 1em 5% 1em 5%; - border: 1px solid silver; - color: #000000; - background-color: #eeeeee; - padding: 0.5em; -} - -/* no more intend inside li */ -li pre { - margin: 1em 0 1em 0; -} - -pre.wrap { - white-space: normal; -} - -dl { - margin: 1em 6% 1em 6%; -} -dt { - font-weight: bold; - margin-left: 2em; - padding-top: 3em; -} -dd { - margin-left: 4em; - margin-bottom: 1em; -} - -ol { - margin: 1em 6% 1em 6%; -} - -li { - margin-bottom: 1em; -} - -.configrule { - font-family: monospace; -} - -dt.configrule { - font-weight: bold; -} - -.important { - color: #bb0000; - background-color: #ffeeee; - padding: 0 0.5em 0 0.5em; -} - -p.important { - border: 1px dotted #ff0000; - padding: 0.5em; -} - -.important:first-word { - font-weight: bold; -} - -p.footnote { - margin: 0 5% 2px 7%; - padding-top: 3em; -} - -p.footnote:first-line { - margin-left: -2%; -} - -p#bottom { - text-align: right; -} - -p#bottom img { - margin: 1em; -} diff --git a/htdocs/sql/error.php b/htdocs/sql/error.php deleted file mode 100755 --- a/htdocs/sql/error.php +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - phpMyAdmin - - - - -

phpMyAdmin -

-

- - diff --git a/htdocs/sql/export.php b/htdocs/sql/export.php deleted file mode 100755 --- a/htdocs/sql/export.php +++ /dev/null @@ -1,684 +0,0 @@ - $export_type, 'single_table' => isset($single_table))); - -// Backward compatbility -$type = $what; - -// Check export type -if (!isset($export_list[$type])) { - die('Bad type!'); -} - -/** - * valid compression methods - */ -$compression_methods = array( - 'zip', - 'gzip', - 'bzip', -); - -/** - * init and variable checking - */ -$compression = false; -$onserver = false; -$save_on_server = false; -$buffer_needed = false; -if (empty($_REQUEST['asfile'])) { - $asfile = false; -} else { - $asfile = true; - if (in_array($_REQUEST['compression'], $compression_methods)) { - $compression = $_REQUEST['compression']; - $buffer_needed = true; - } - if (!empty($_REQUEST['onserver'])) { - $onserver = $_REQUEST['onserver']; - // Will we save dump on server? - $save_on_server = ! empty($cfg['SaveDir']) && $onserver; - } -} - -// Does export require to be into file? -if (isset($export_list[$type]['force_file']) && ! $asfile) { - $message = $strExportMustBeFile; - $GLOBALS['show_error_header'] = true; - $js_to_run = 'functions.js'; - require_once './libraries/header.inc.php'; - if ($export_type == 'server') { - $active_page = 'server_export.php'; - require './server_export.php'; - } elseif ($export_type == 'database') { - $active_page = 'db_export.php'; - require './db_export.php'; - } else { - $active_page = 'tbl_export.php'; - require './tbl_export.php'; - } - exit(); -} - -// Generate error url and check for needed variables -if ($export_type == 'server') { - $err_url = 'server_export.php?' . PMA_generate_common_url(); -} elseif ($export_type == 'database' && strlen($db)) { - $err_url = 'db_export.php?' . PMA_generate_common_url($db); - // Check if we have something to export - if (isset($table_select)) { - $tables = $table_select; - } else { - $tables = array(); - } -} elseif ($export_type == 'table' && strlen($db) && strlen($table)) { - $err_url = 'tbl_export.php?' . PMA_generate_common_url($db, $table); -} else { - die('Bad parameters!'); -} - -// Get the functions specific to the export type -require './libraries/export/' . PMA_securePath($type) . '.php'; - -/** - * Increase time limit for script execution and initializes some variables - */ -@set_time_limit($cfg['ExecTimeLimit']); -if (!empty($cfg['MemoryLimit'])) { - @ini_set('memory_limit', $cfg['MemoryLimit']); -} - -// Start with empty buffer -$dump_buffer = ''; -$dump_buffer_len = 0; - -// We send fake headers to avoid browser timeout when buffering -$time_start = time(); - - -/** - * Output handler for all exports, if needed buffering, it stores data into - * $dump_buffer, otherwise it prints thems out. - * - * @param string the insert statement - * - * @return bool Whether output suceeded - */ -function PMA_exportOutputHandler($line) -{ - global $time_start, $dump_buffer, $dump_buffer_len, $save_filename; - - // Kanji encoding convert feature - if ($GLOBALS['output_kanji_conversion']) { - $line = PMA_kanji_str_conv($line, $GLOBALS['knjenc'], isset($GLOBALS['xkana']) ? $GLOBALS['xkana'] : ''); - } - // If we have to buffer data, we will perform everything at once at the end - if ($GLOBALS['buffer_needed']) { - - $dump_buffer .= $line; - if ($GLOBALS['onfly_compression']) { - - $dump_buffer_len += strlen($line); - - if ($dump_buffer_len > $GLOBALS['memory_limit']) { - if ($GLOBALS['output_charset_conversion']) { - $dump_buffer = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $dump_buffer); - } - // as bzipped - if ($GLOBALS['compression'] == 'bzip' && @function_exists('bzcompress')) { - $dump_buffer = bzcompress($dump_buffer); - } - // as a gzipped file - elseif ($GLOBALS['compression'] == 'gzip' && @function_exists('gzencode')) { - // without the optional parameter level because it bug - $dump_buffer = gzencode($dump_buffer); - } - if ($GLOBALS['save_on_server']) { - $write_result = @fwrite($GLOBALS['file_handle'], $dump_buffer); - if (!$write_result || ($write_result != strlen($dump_buffer))) { - $GLOBALS['message'] = sprintf($GLOBALS['strNoSpace'], htmlspecialchars($save_filename)); - $GLOBALS['show_error_header'] = true; - return false; - } - } else { - echo $dump_buffer; - } - $dump_buffer = ''; - $dump_buffer_len = 0; - } - } else { - $time_now = time(); - if ($time_start >= $time_now + 30) { - $time_start = $time_now; - header('X-pmaPing: Pong'); - } // end if - } - } else { - if ($GLOBALS['asfile']) { - if ($GLOBALS['output_charset_conversion']) { - $line = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $line); - } - if ($GLOBALS['save_on_server'] && strlen($line) > 0) { - $write_result = @fwrite($GLOBALS['file_handle'], $line); - if (!$write_result || ($write_result != strlen($line))) { - $GLOBALS['message'] = sprintf($GLOBALS['strNoSpace'], htmlspecialchars($save_filename)); - $GLOBALS['show_error_header'] = true; - return false; - } - $time_now = time(); - if ($time_start >= $time_now + 30) { - $time_start = $time_now; - header('X-pmaPing: Pong'); - } // end if - } else { - // We export as file - output normally - echo $line; - } - } else { - // We export as html - replace special chars - echo htmlspecialchars($line); - } - } - return true; -} // end of the 'PMA_exportOutputHandler()' function - -// Defines the default format. For SQL always use \n as MySQL wants this on all platforms. -if ($what == 'sql') { - $crlf = "\n"; -} else { - $crlf = PMA_whichCrlf(); -} - -$output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xls'; - -// Do we need to convert charset? -$output_charset_conversion = $asfile && - $cfg['AllowAnywhereRecoding'] && $allow_recoding - && isset($charset_of_file) && $charset_of_file != $charset - && $type != 'xls'; - -// Use on fly compression? -$onfly_compression = $GLOBALS['cfg']['CompressOnFly'] && ($compression == 'gzip' | $compression == 'bzip'); -if ($onfly_compression) { - $memory_limit = trim(@ini_get('memory_limit')); - // 2 MB as default - if (empty($memory_limit)) { - $memory_limit = 2 * 1024 * 1024; - } - - if (strtolower(substr($memory_limit, -1)) == 'm') { - $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024; - } elseif (strtolower(substr($memory_limit, -1)) == 'k') { - $memory_limit = (int)substr($memory_limit, 0, -1) * 1024; - } elseif (strtolower(substr($memory_limit, -1)) == 'g') { - $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024; - } else { - $memory_limit = (int)$memory_limit; - } - - // Some of memory is needed for other thins and as treshold. - // Nijel: During export I had allocated (see memory_get_usage function) - // approx 1.2MB so this comes from that. - if ($memory_limit > 1500000) { - $memory_limit -= 1500000; - } - - // Some memory is needed for compression, assume 1/3 - $memory_limit /= 8; -} - -// Generate filename and mime type if needed -if ($asfile) { - $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']); - if ($export_type == 'server') { - if (isset($remember_template)) { - PMA_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)) { - PMA_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)) { - PMA_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)))); - } - - // convert filename to iso-8859-1, it is safer - if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) { - $filename = PMA_convert_string($charset, 'iso-8859-1', $filename); - } else { - $filename = PMA_convert_string($convcharset, 'iso-8859-1', $filename); - } - - // Grab basic dump extension and mime type - $filename .= '.' . $export_list[$type]['extension']; - $mime_type = $export_list[$type]['mime_type']; - - // If dump is going to be compressed, set correct encoding or mime_type and add - // compression to extension - $content_encoding = ''; - if ($compression == 'bzip') { - $filename .= '.bz2'; - // browsers don't like this: - //$content_encoding = 'x-bzip2'; - $mime_type = 'application/x-bzip2'; - } elseif ($compression == 'gzip') { - $filename .= '.gz'; - // Needed to avoid recompression by server modules like mod_gzip. - // It seems necessary to check about zlib.output_compression - // to avoid compressing twice - if (!@ini_get('zlib.output_compression')) { - // On Firefox 3, sending this content encoding corrupts the .gz - // (as tested on Windows and Linux) but detect GECKO 1.9 - if (! (PMA_USR_BROWSER_AGENT == 'GECKO' && PMA_USR_BROWSER_VER == '1.9')) { - $content_encoding = 'x-gzip'; - } - $mime_type = 'application/x-gzip'; - } - } elseif ($compression == 'zip') { - $filename .= '.zip'; - $mime_type = 'application/zip'; - } -} - -// Open file on server if needed -if ($save_on_server) { - $save_filename = PMA_userDir($cfg['SaveDir']) . preg_replace('@[/\\\\]@', '_', $filename); - unset($message); - if (file_exists($save_filename) && empty($onserverover)) { - $message = sprintf($strFileAlreadyExists, htmlspecialchars($save_filename)); - $GLOBALS['show_error_header'] = true; - } else { - if (is_file($save_filename) && !is_writable($save_filename)) { - $message = sprintf($strNoPermission, htmlspecialchars($save_filename)); - $GLOBALS['show_error_header'] = true; - } else { - if (!$file_handle = @fopen($save_filename, 'w')) { - $message = sprintf($strNoPermission, htmlspecialchars($save_filename)); - $GLOBALS['show_error_header'] = true; - } - } - } - if (isset($message)) { - $js_to_run = 'functions.js'; - require_once './libraries/header.inc.php'; - if ($export_type == 'server') { - $active_page = 'server_export.php'; - require './server_export.php'; - } elseif ($export_type == 'database') { - $active_page = 'db_export.php'; - require './db_export.php'; - } else { - $active_page = 'tbl_export.php'; - require './tbl_export.php'; - } - exit(); - } -} - -/** - * Send headers depending on whether the user chose to download a dump file - * or not - */ -if (!$save_on_server) { - if ($asfile) { - // Download - // (avoid rewriting data containing HTML with anchors and forms; - // this was reported to happen under Plesk) - @ini_set('url_rewriter.tags',''); - - if (!empty($content_encoding)) { - header('Content-Encoding: ' . $content_encoding); - } - header('Content-Type: ' . $mime_type); - header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - // lem9: Tested behavior of - // IE 5.50.4807.2300 - // IE 6.0.2800.1106 (small glitch, asks twice when I click Open) - // IE 6.0.2900.2180 - // Firefox 1.0.6 - // in http and https - header('Content-Disposition: attachment; filename="' . $filename . '"'); - if (PMA_USR_BROWSER_AGENT == 'IE') { - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - } else { - header('Pragma: no-cache'); - // test case: exporting a database into a .gz file with Safari - // would produce files not having the current time - if ('SAFARI' == PMA_USR_BROWSER_AGENT) { - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - } - } - } else { - // HTML - if ($export_type == 'database') { - $num_tables = count($tables); - if ($num_tables == 0) { - $message = $strNoTablesFound; - $js_to_run = 'functions.js'; - require_once './libraries/header.inc.php'; - $active_page = 'db_export.php'; - require './db_export.php'; - exit(); - } - } - $backup_cfgServer = $cfg['Server']; - require_once './libraries/header.inc.php'; - $cfg['Server'] = $backup_cfgServer; - unset($backup_cfgServer); - echo "\n" . '
' . "\n"; - //echo '
' . "\n";
-        echo '    
' . "\n" - // remove auto-select for now: there is no way to select - // only a part of the text; anyway, it should obey - // $cfg['TextareaAutoSelect'] - //. ' ' . "\n" - . '
' . "\n"; - echo '
' . "\n"; - echo "\n"; -?> - - diff --git a/htdocs/sql/favicon.ico b/htdocs/sql/favicon.ico deleted file mode 100755 index 2352b5fa4e6302b1a6009cb377bb74064d37ae7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ $db, - 'user' => $cfg['Bookmark']['user'], - 'query' => urlencode($import_text), - 'label' => $bkm_label - ); - - // Should we replace bookmark? - if (isset($bkm_replace)) { - $bookmarks = PMA_listBookmarks($db, $cfg['Bookmark']); - foreach ($bookmarks as $key => $val) { - if ($val == $bkm_label) { - PMA_deleteBookmarks($db, $cfg['Bookmark'], $key); - } - } - } - - PMA_addBookmarks($bfields, $cfg['Bookmark'], isset($bkm_all_users)); - - $bookmark_created = TRUE; -} // end store bookmarks - -// We can not read all at once, otherwise we can run out of memory -$memory_limit = trim(@ini_get('memory_limit')); -// 2 MB as default -if (empty($memory_limit)) { - $memory_limit = 2 * 1024 * 1024; -} -// In case no memory limit we work on 10MB chunks -if ($memory_limit = -1) { - $memory_limit = 10 * 1024 * 1024; -} - -// Calculate value of the limit -if (strtolower(substr($memory_limit, -1)) == 'm') { - $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024; -} elseif (strtolower(substr($memory_limit, -1)) == 'k') { - $memory_limit = (int)substr($memory_limit, 0, -1) * 1024; -} elseif (strtolower(substr($memory_limit, -1)) == 'g') { - $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024; -} else { - $memory_limit = (int)$memory_limit; -} - -$read_limit = $memory_limit / 8; // Just to be sure, there might be lot of memory needed for uncompression - -// handle filenames -if (!empty($local_import_file) && !empty($cfg['UploadDir'])) { - - // sanitize $local_import_file as it comes from a POST - $local_import_file = PMA_securePath($local_import_file); - - $import_file = PMA_userDir($cfg['UploadDir']) . $local_import_file; -} elseif (empty($import_file) || !is_uploaded_file($import_file)) { - $import_file = 'none'; -} - -// Do we have file to import? -if ($import_file != 'none' && !$error) { - // work around open_basedir and other limitations - $open_basedir = @ini_get('open_basedir'); - - // If we are on a server with open_basedir, we must move the file - // before opening it. The doc explains how to create the "./tmp" - // directory - - if (!empty($open_basedir)) { - - $tmp_subdir = (PMA_IS_WINDOWS ? '.\\tmp\\' : './tmp/'); - - // function is_writeable() is valid on PHP3 and 4 - if (is_writeable($tmp_subdir)) { - $import_file_new = $tmp_subdir . basename($import_file); - if (move_uploaded_file($import_file, $import_file_new)) { - $import_file = $import_file_new; - $file_to_unlink = $import_file_new; - } - } - } - - // Handle file compression - $compression = PMA_detectCompression($import_file); - if ($compression === FALSE) { - $message = $strFileCouldNotBeRead; - $show_error_header = TRUE; - $error = TRUE; - } else { - switch ($compression) { - case 'application/bzip2': - if ($cfg['BZipDump'] && @function_exists('bzopen')) { - $import_handle = @bzopen($import_file, 'r'); - } else { - $message = sprintf($strUnsupportedCompressionDetected, $compression); - $show_error_header = TRUE; - $error = TRUE; - } - break; - case 'application/gzip': - if ($cfg['GZipDump'] && @function_exists('gzopen')) { - $import_handle = @gzopen($import_file, 'r'); - } else { - $message = sprintf($strUnsupportedCompressionDetected, $compression); - $show_error_header = TRUE; - $error = TRUE; - } - break; - case 'application/zip': - if ($cfg['GZipDump'] && @function_exists('gzinflate')) { - include_once './libraries/unzip.lib.php'; - $import_handle = new SimpleUnzip(); - $import_handle->ReadFile($import_file); - if ($import_handle->Count() == 0) { - $message = $strNoFilesFoundInZip; - $show_error_header = TRUE; - $error = TRUE; - } elseif ($import_handle->GetError(0) != 0) { - $message = $strErrorInZipFile . ' ' . $import_handle->GetErrorMsg(0); - $show_error_header = TRUE; - $error = TRUE; - } else { - $import_text = $import_handle->GetData(0); - } - // We don't need to store it further - $import_handle = ''; - } else { - $message = sprintf($strUnsupportedCompressionDetected, $compression); - $show_error_header = TRUE; - $error = TRUE; - } - break; - case 'none': - $import_handle = @fopen($import_file, 'r'); - break; - default: - $message = sprintf($strUnsupportedCompressionDetected, $compression); - $show_error_header = TRUE; - $error = TRUE; - break; - } - } - if (!$error && $import_handle === FALSE) { - $message = $strFileCouldNotBeRead; - $show_error_header = TRUE; - $error = TRUE; - } -} elseif (!$error) { - if (!isset($import_text) || empty($import_text)) { - $message = $strNoDataReceived; - $show_error_header = TRUE; - $error = TRUE; - } -} - -// Convert the file's charset if necessary -if ($cfg['AllowAnywhereRecoding'] && $allow_recoding - && isset($charset_of_file)) { - if ($charset_of_file != $charset) { - $charset_conversion = TRUE; - } -} elseif (PMA_MYSQL_INT_VERSION >= 40100 - && isset($charset_of_file) && $charset_of_file != 'utf8') { - PMA_DBI_query('SET NAMES \'' . $charset_of_file . '\''); - // We can not show query in this case, it is in different charset - $sql_query_disabled = TRUE; - $reset_charset = TRUE; -} - -// Something to skip? -if (!$error && isset($skip)) { - $original_skip = $skip; - while ($skip > 0) { - PMA_importGetNextChunk($skip < $read_limit ? $skip : $read_limit); - $read_multiply = 1; // Disable read progresivity, otherwise we eat all memory! - $skip -= $read_limit; - } - unset($skip); -} - -if (!$error) { - // Check for file existance - if (!file_exists('./libraries/import/' . $format . '.php')) { - $error = TRUE; - $message = $strCanNotLoadImportPlugins; - $show_error_header = TRUE; - } else { - // Do the real import - $plugin_param = $import_type; - require './libraries/import/' . $format . '.php'; - } -} - -// Cleanup temporary file -if ($file_to_unlink != '') { - unlink($file_to_unlink); -} - -// Reset charset back, if we did some changes -if ($reset_charset) { - PMA_DBI_query('SET CHARACTER SET utf8'); - PMA_DBI_query('SET SESSION collation_connection =\'' . $collation_connection . '\''); -} - -// Show correct message -if (!empty($id_bookmark) && $action_bookmark == 2) { - $message = $strBookmarkDeleted; - $display_query = $import_text; - $error = FALSE; // unset error marker, it was used just to skip processing -} elseif (!empty($id_bookmark) && $action_bookmark == 1) { - $message = $strShowingBookmark; -} elseif ($bookmark_created) { - $special_message = '[br]' . sprintf($strBookmarkCreated, htmlspecialchars($bkm_label)); -} elseif ($finished && !$error) { - if ($import_type == 'query') { - $message = $strSuccess; - } else { - $message = sprintf($strImportSuccessfullyFinished, $executed_queries); - } -} - -// Did we hit timeout? Tell it user. -if ($timeout_passed) { - $message = $strTimeoutPassed; - if ($offset == 0 || (isset($original_skip) && $original_skip == $offset)) { - $message .= ' ' . $strTimeoutNothingParsed; - } -} - -// Parse and analyze the query, for correct db and table name -// in case of a query typed in the query window -require_once './libraries/parse_analyze.lib.php'; - -// There was an error? -if (isset($my_die)) { - foreach ($my_die AS $key => $die) { - PMA_mysqlDie($die['error'], $die['sql'], '', $err_url, $error); - } -} - -if ($go_sql) { - require './sql.php'; -} else { - $active_page = $goto; - require './' . $goto; -} -exit(); -?> diff --git a/htdocs/sql/index.php b/htdocs/sql/index.php deleted file mode 100755 --- a/htdocs/sql/index.php +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - -phpMyAdmin <?php echo PMA_VERSION; ?> - - <?php echo htmlspecialchars($HTTP_HOST); ?> - - - - - - - - - - - - - - <body> - <p><?php echo $GLOBALS['strNoFrames']; ?></p> - </body> - - - diff --git a/htdocs/sql/js/dom-drag.js b/htdocs/sql/js/dom-drag.js deleted file mode 100755 --- a/htdocs/sql/js/dom-drag.js +++ /dev/null @@ -1,121 +0,0 @@ -/************************************************** - * dom-drag.js - * 09.25.2001 - * www.youngpup.net - ************************************************** - * 10.28.2001 - fixed minor bug where events - * sometimes fired off the handle, not the root. - **************************************************/ - -var Drag = { - - obj : null, - - init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) - { - o.onmousedown = Drag.start; - - o.hmode = bSwapHorzRef ? false : true ; - o.vmode = bSwapVertRef ? false : true ; - - o.root = oRoot && oRoot != null ? oRoot : o ; - - if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px"; - if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px"; - if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px"; - if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px"; - - o.minX = typeof minX != 'undefined' ? minX : null; - o.minY = typeof minY != 'undefined' ? minY : null; - o.maxX = typeof maxX != 'undefined' ? maxX : null; - o.maxY = typeof maxY != 'undefined' ? maxY : null; - - o.xMapper = fXMapper ? fXMapper : null; - o.yMapper = fYMapper ? fYMapper : null; - - o.root.onDragStart = new Function(); - o.root.onDragEnd = new Function(); - o.root.onDrag = new Function(); - }, - - start : function(e) - { - var o = Drag.obj = this; - e = Drag.fixE(e); - var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); - var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); - o.root.onDragStart(x, y); - - o.lastMouseX = e.clientX; - o.lastMouseY = e.clientY; - - if (o.hmode) { - if (o.minX != null) o.minMouseX = e.clientX - x + o.minX; - if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX; - } else { - if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x; - if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x; - } - - if (o.vmode) { - if (o.minY != null) o.minMouseY = e.clientY - y + o.minY; - if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY; - } else { - if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y; - if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y; - } - - document.onmousemove = Drag.drag; - document.onmouseup = Drag.end; - - return false; - }, - - drag : function(e) - { - e = Drag.fixE(e); - var o = Drag.obj; - - var ey = e.clientY; - var ex = e.clientX; - var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); - var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); - var nx, ny; - - if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX); - if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX); - if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY); - if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY); - - nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1)); - ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1)); - - if (o.xMapper) nx = o.xMapper(y) - else if (o.yMapper) ny = o.yMapper(x) - - Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px"; - Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px"; - Drag.obj.lastMouseX = ex; - Drag.obj.lastMouseY = ey; - - Drag.obj.root.onDrag(nx, ny); - return false; - }, - - end : function() - { - document.onmousemove = null; - document.onmouseup = null; - Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), - parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"])); - Drag.obj = null; - }, - - fixE : function(e) - { - if (typeof e == 'undefined') e = window.event; - if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; - if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; - return e; - } -}; diff --git a/htdocs/sql/js/functions.js b/htdocs/sql/js/functions.js deleted file mode 100755 --- a/htdocs/sql/js/functions.js +++ /dev/null @@ -1,1219 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * general function, usally for data manipulation pages - * - * @version $Id: functions.js 10964 2007-12-05 17:01:48Z lem9 $ - */ - -/** - * @var sql_box_locked lock for the sqlbox textarea in the querybox/querywindow - */ -var sql_box_locked = false; - -/** - * @var array holds elements which content should only selected once - */ -var only_once_elements = new Array(); - -/** - * selects the content of a given object, f.e. a textarea - * - * @param object element element of which the content will be selected - * @param var lock variable which holds the lock for this element - * or true, if no lock exists - * @param boolean only_once if true this is only done once - * f.e. only on first focus - */ -function selectContent( element, lock, only_once ) { - if ( only_once && only_once_elements[element.name] ) { - return; - } - - only_once_elements[element.name] = true; - - if ( lock ) { - return; - } - - element.select(); -} - -/** - * Displays an confirmation box before to submit a "DROP DATABASE" query. - * This function is called while clicking links - * - * @param object the link - * @param object the sql query to submit - * - * @return boolean whether to run the query or not - */ -function confirmLinkDropDB(theLink, theSqlQuery) -{ - // Confirmation is not required in the configuration file - // or browser is Opera (crappy js implementation) - if (confirmMsg == '' || typeof(window.opera) != 'undefined') { - return true; - } - - var is_confirmed = confirm(confirmMsgDropDB + '\n' + confirmMsg + ' :\n' + theSqlQuery); - if (is_confirmed) { - theLink.href += '&is_js_confirmed=1'; - } - - return is_confirmed; -} // end of the 'confirmLinkDropDB()' function - -/** - * Displays an confirmation box before to submit a "DROP/DELETE/ALTER" query. - * This function is called while clicking links - * - * @param object the link - * @param object the sql query to submit - * - * @return boolean whether to run the query or not - */ -function confirmLink(theLink, theSqlQuery) -{ - // Confirmation is not required in the configuration file - // or browser is Opera (crappy js implementation) - if (confirmMsg == '' || typeof(window.opera) != 'undefined') { - return true; - } - - var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery); - if (is_confirmed) { - if ( typeof(theLink.href) != 'undefined' ) { - theLink.href += '&is_js_confirmed=1'; - } else if ( typeof(theLink.form) != 'undefined' ) { - theLink.form.action += '?is_js_confirmed=1'; - } - } - - return is_confirmed; -} // end of the 'confirmLink()' function - - -/** - * Displays an confirmation box before doing some action - * - * @param object the message to display - * - * @return boolean whether to run the query or not - */ -function confirmAction(theMessage) -{ - // TODO: Confirmation is not required in the configuration file - // or browser is Opera (crappy js implementation) - if (typeof(window.opera) != 'undefined') { - return true; - } - - var is_confirmed = confirm(theMessage); - - return is_confirmed; -} // end of the 'confirmAction()' function - - -/** - * Displays an error message if a "DROP DATABASE" statement is submitted - * while it isn't allowed, else confirms a "DROP/DELETE/ALTER" query before - * sumitting it if required. - * This function is called by the 'checkSqlQuery()' js function. - * - * @param object the form - * @param object the sql query textarea - * - * @return boolean whether to run the query or not - * - * @see checkSqlQuery() - */ -function confirmQuery(theForm1, sqlQuery1) -{ - // Confirmation is not required in the configuration file - if (confirmMsg == '') { - return true; - } - - // The replace function (js1.2) isn't supported - else if (typeof(sqlQuery1.value.replace) == 'undefined') { - return true; - } - - // js1.2+ -> validation with regular expressions - else { - // "DROP DATABASE" statement isn't allowed - if (noDropDbMsg != '') { - var drop_re = new RegExp('(^|;)\\s*DROP\\s+(IF EXISTS\\s+)?DATABASE\\s', 'i'); - if (drop_re.test(sqlQuery1.value)) { - alert(noDropDbMsg); - theForm1.reset(); - sqlQuery1.focus(); - return false; - } // end if - } // end if - - // Confirms a "DROP/DELETE/ALTER" statement - // - // TODO: find a way (if possible) to use the parser-analyser - // for this kind of verification - // For now, I just added a ^ to check for the statement at - // beginning of expression - - var do_confirm_re_0 = new RegExp('^\\s*DROP\\s+(IF EXISTS\\s+)?(TABLE|DATABASE|PROCEDURE)\\s', 'i'); - var do_confirm_re_1 = new RegExp('^\\s*ALTER\\s+TABLE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+DROP\\s', 'i'); - var do_confirm_re_2 = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i'); - if (do_confirm_re_0.test(sqlQuery1.value) - || do_confirm_re_1.test(sqlQuery1.value) - || do_confirm_re_2.test(sqlQuery1.value)) { - var message = (sqlQuery1.value.length > 100) - ? sqlQuery1.value.substr(0, 100) + '\n ...' - : sqlQuery1.value; - var is_confirmed = confirm(confirmMsg + ' :\n' + message); - // drop/delete/alter statement is confirmed -> update the - // "is_js_confirmed" form field so the confirm test won't be - // run on the server side and allows to submit the form - if (is_confirmed) { - theForm1.elements['is_js_confirmed'].value = 1; - return true; - } - // "DROP/DELETE/ALTER" statement is rejected -> do not submit - // the form - else { - window.focus(); - sqlQuery1.focus(); - return false; - } // end if (handle confirm box result) - } // end if (display confirm box) - } // end confirmation stuff - - return true; -} // end of the 'confirmQuery()' function - - -/** - * Displays an error message if the user submitted the sql query form with no - * sql query, else checks for "DROP/DELETE/ALTER" statements - * - * @param object the form - * - * @return boolean always false - * - * @see confirmQuery() - */ -function checkSqlQuery(theForm) -{ - var sqlQuery = theForm.elements['sql_query']; - var isEmpty = 1; - - // The replace function (js1.2) isn't supported -> basic tests - if (typeof(sqlQuery.value.replace) == 'undefined') { - isEmpty = (sqlQuery.value == '') ? 1 : 0; - if (isEmpty && typeof(theForm.elements['sql_file']) != 'undefined') { - isEmpty = (theForm.elements['sql_file'].value == '') ? 1 : 0; - } - if (isEmpty && typeof(theForm.elements['sql_localfile']) != 'undefined') { - isEmpty = (theForm.elements['sql_localfile'].value == '') ? 1 : 0; - } - if (isEmpty && typeof(theForm.elements['id_bookmark']) != 'undefined') { - isEmpty = (theForm.elements['id_bookmark'].value == null || theForm.elements['id_bookmark'].value == ''); - } - } - // js1.2+ -> validation with regular expressions - else { - var space_re = new RegExp('\\s+'); - if (typeof(theForm.elements['sql_file']) != 'undefined' && - theForm.elements['sql_file'].value.replace(space_re, '') != '') { - return true; - } - if (typeof(theForm.elements['sql_localfile']) != 'undefined' && - theForm.elements['sql_localfile'].value.replace(space_re, '') != '') { - return true; - } - if (isEmpty && typeof(theForm.elements['id_bookmark']) != 'undefined' && - (theForm.elements['id_bookmark'].value != null || theForm.elements['id_bookmark'].value != '') && - theForm.elements['id_bookmark'].selectedIndex != 0 - ) { - return true; - } - // Checks for "DROP/DELETE/ALTER" statements - if (sqlQuery.value.replace(space_re, '') != '') { - if (confirmQuery(theForm, sqlQuery)) { - return true; - } else { - return false; - } - } - theForm.reset(); - isEmpty = 1; - } - - if (isEmpty) { - sqlQuery.select(); - alert(errorMsg0); - sqlQuery.focus(); - return false; - } - - return true; -} // end of the 'checkSqlQuery()' function - - -/** - * Check if a form's element is empty - * should be - * - * @param object the form - * @param string the name of the form field to put the focus on - * - * @return boolean whether the form field is empty or not - */ -function emptyCheckTheField(theForm, theFieldName) -{ - var isEmpty = 1; - var theField = theForm.elements[theFieldName]; - // Whether the replace function (js1.2) is supported or not - var isRegExp = (typeof(theField.value.replace) != 'undefined'); - - if (!isRegExp) { - isEmpty = (theField.value == '') ? 1 : 0; - } else { - var space_re = new RegExp('\\s+'); - isEmpty = (theField.value.replace(space_re, '') == '') ? 1 : 0; - } - - return isEmpty; -} // end of the 'emptyCheckTheField()' function - - -/** - * Displays an error message if an element of a form hasn't been completed and - * should be - * - * @param object the form - * @param string the name of the form field to put the focus on - * - * @return boolean whether the form field is empty or not - */ -function emptyFormElements(theForm, theFieldName) -{ - var theField = theForm.elements[theFieldName]; - var isEmpty = emptyCheckTheField(theForm, theFieldName); - - if (isEmpty) { - theForm.reset(); - theField.select(); - alert(errorMsg0); - theField.focus(); - return false; - } - - return true; -} // end of the 'emptyFormElements()' function - - -/** - * Ensures a value submitted in a form is numeric and is in a range - * - * @param object the form - * @param string the name of the form field to check - * @param integer the minimum authorized value - * @param integer the maximum authorized value - * - * @return boolean whether a valid number has been submitted or not - */ -function checkFormElementInRange(theForm, theFieldName, message, min, max) -{ - var theField = theForm.elements[theFieldName]; - var val = parseInt(theField.value); - - if (typeof(min) == 'undefined') { - min = 0; - } - if (typeof(max) == 'undefined') { - max = Number.MAX_VALUE; - } - - // It's not a number - if (isNaN(val)) { - theField.select(); - alert(errorMsg1); - theField.focus(); - return false; - } - // It's a number but it is not between min and max - else if (val < min || val > max) { - theField.select(); - alert(message.replace('%d', val)); - theField.focus(); - return false; - } - // It's a valid number - else { - theField.value = val; - } - return true; - -} // end of the 'checkFormElementInRange()' function - - -function checkTableEditForm(theForm, fieldsCnt) -{ - // TODO: avoid sending a message if user just wants to add a line - // on the form but has not completed at least one field name - - var atLeastOneField = 0; - var i, elm, elm2, elm3, val, id; - - for (i=0; i 0 ) { - unique_id = this.id; - } else { - return; - } - - if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) { - marked_row[unique_id] = true; - } else { - marked_row[unique_id] = false; - } - - if ( marked_row[unique_id] ) { - this.className += ' marked'; - } else { - this.className = this.className.replace(' marked', ''); - } - - if ( checkbox && checkbox.disabled == false ) { - checkbox.checked = marked_row[unique_id]; - } - } - - // ... and disable label ... - var labeltag = rows[i].getElementsByTagName('label')[0]; - if ( labeltag ) { - labeltag.onclick = function() { - return false; - } - } - // .. and checkbox clicks - var checkbox = rows[i].getElementsByTagName('input')[0]; - if ( checkbox ) { - checkbox.onclick = function() { - // opera does not recognize return false; - this.checked = ! this.checked; - } - } - } -} -window.onload=PMA_markRowsInit; - -/** - * marks all rows and selects its first checkbox inside the given element - * the given element is usaly a table or a div containing the table or tables - * - * @param container DOM element - */ -function markAllRows( container_id ) { - var rows = document.getElementById(container_id).getElementsByTagName('tr'); - var unique_id; - var checkbox; - - for ( var i = 0; i < rows.length; i++ ) { - - checkbox = rows[i].getElementsByTagName( 'input' )[0]; - - if ( checkbox && checkbox.type == 'checkbox' ) { - unique_id = checkbox.name + checkbox.value; - if ( checkbox.disabled == false ) { - checkbox.checked = true; - if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) { - rows[i].className += ' marked'; - marked_row[unique_id] = true; - } - } - } - } - - return true; -} - -/** - * marks all rows and selects its first checkbox inside the given element - * the given element is usaly a table or a div containing the table or tables - * - * @param container DOM element - */ -function unMarkAllRows( container_id ) { - var rows = document.getElementById(container_id).getElementsByTagName('tr'); - var unique_id; - var checkbox; - - for ( var i = 0; i < rows.length; i++ ) { - - checkbox = rows[i].getElementsByTagName( 'input' )[0]; - - if ( checkbox && checkbox.type == 'checkbox' ) { - unique_id = checkbox.name + checkbox.value; - checkbox.checked = false; - rows[i].className = rows[i].className.replace(' marked', ''); - marked_row[unique_id] = false; - } - } - - return true; -} - -/** - * Sets/unsets the pointer and marker in browse mode - * - * @param object the table row - * @param integer the row number - * @param string the action calling this script (over, out or click) - * @param string the default background color - * @param string the color to use for mouseover - * @param string the color to use for marking a row - * - * @return boolean whether pointer is set or not - */ -function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor) -{ - var theCells = null; - - // 1. Pointer and mark feature are disabled or the browser can't get the - // row -> exits - if ((thePointerColor == '' && theMarkColor == '') - || typeof(theRow.style) == 'undefined') { - return false; - } - - // 1.1 Sets the mouse pointer to pointer on mouseover and back to normal otherwise. - if (theAction == "over" || theAction == "click") { - theRow.style.cursor='pointer'; - } else { - theRow.style.cursor='default'; - } - - // 2. Gets the current row and exits if the browser can't get it - if (typeof(document.getElementsByTagName) != 'undefined') { - theCells = theRow.getElementsByTagName('td'); - } - else if (typeof(theRow.cells) != 'undefined') { - theCells = theRow.cells; - } - else { - return false; - } - - // 3. Gets the current color... - var rowCellsCnt = theCells.length; - var domDetect = null; - var currentColor = null; - var newColor = null; - // 3.1 ... with DOM compatible browsers except Opera that does not return - // valid values with "getAttribute" - if (typeof(window.opera) == 'undefined' - && typeof(theCells[0].getAttribute) != 'undefined') { - currentColor = theCells[0].getAttribute('bgcolor'); - domDetect = true; - } - // 3.2 ... with other browsers - else { - currentColor = theCells[0].style.backgroundColor; - domDetect = false; - } // end 3 - - // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it - if (currentColor.indexOf("rgb") >= 0) - { - var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1, - currentColor.indexOf(')')); - var rgbValues = rgbStr.split(","); - currentColor = "#"; - var hexChars = "0123456789ABCDEF"; - for (var i = 0; i < 3; i++) - { - var v = rgbValues[i].valueOf(); - currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16); - } - } - - // 4. Defines the new color - // 4.1 Current color is the default one - if (currentColor == '' - || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) { - if (theAction == 'over' && thePointerColor != '') { - newColor = thePointerColor; - } - else if (theAction == 'click' && theMarkColor != '') { - newColor = theMarkColor; - marked_row[theRowNum] = true; - // Garvin: deactivated onclick marking of the checkbox because it's also executed - // when an action (like edit/delete) on a single item is performed. Then the checkbox - // would get deactived, even though we need it activated. Maybe there is a way - // to detect if the row was clicked, and not an item therein... - // document.getElementById('id_rows_to_delete' + theRowNum).checked = true; - } - } - // 4.1.2 Current color is the pointer one - else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() - && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) { - if (theAction == 'out') { - newColor = theDefaultColor; - } - else if (theAction == 'click' && theMarkColor != '') { - newColor = theMarkColor; - marked_row[theRowNum] = true; - // document.getElementById('id_rows_to_delete' + theRowNum).checked = true; - } - } - // 4.1.3 Current color is the marker one - else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) { - if (theAction == 'click') { - newColor = (thePointerColor != '') - ? thePointerColor - : theDefaultColor; - marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum]) - ? true - : null; - // document.getElementById('id_rows_to_delete' + theRowNum).checked = false; - } - } // end 4 - - // 5. Sets the new color... - if (newColor) { - var c = null; - // 5.1 ... with DOM compatible browsers except Opera - if (domDetect) { - for (c = 0; c < rowCellsCnt; c++) { - theCells[c].setAttribute('bgcolor', newColor, 0); - } // end for - } - // 5.2 ... with other browsers - else { - for (c = 0; c < rowCellsCnt; c++) { - theCells[c].style.backgroundColor = newColor; - } - } - } // end 5 - - return true; -} // end of the 'setPointer()' function - -/* - * Sets/unsets the pointer and marker in vertical browse mode - * - * @param object the table row - * @param integer the column number - * @param string the action calling this script (over, out or click) - * @param string the default background Class - * @param string the Class to use for mouseover - * @param string the Class to use for marking a row - * - * @return boolean whether pointer is set or not - * - * @author Garvin Hicking (rewrite of setPointer.) - */ -function setVerticalPointer(theRow, theColNum, theAction, theDefaultClass1, theDefaultClass2, thePointerClass, theMarkClass) { - // 1. Pointer and mark feature are disabled or the browser can't get the - // row -> exits - if ((thePointerClass == '' && theMarkClass == '') - || typeof(theRow.style) == 'undefined') { - return false; - } - - var tagSwitch = null; - - // 2. Gets the current row and exits if the browser can't get it - if (typeof(document.getElementsByTagName) != 'undefined') { - tagSwitch = 'tag'; - } else if (typeof(document.getElementById('table_results')) != 'undefined') { - tagSwitch = 'cells'; - } else { - return false; - } - - var theCells = null; - - if (tagSwitch == 'tag') { - theRows = document.getElementById('table_results').getElementsByTagName('tr'); - theCells = theRows[1].getElementsByTagName('td'); - } else if (tagSwitch == 'cells') { - theRows = document.getElementById('table_results').rows; - theCells = theRows[1].cells; - } - - // 3. Gets the current Class... - var currentClass = null; - var newClass = null; - - // 3.1 ... with DOM compatible browsers except Opera that does not return - // valid values with "getAttribute" - if (typeof(window.opera) == 'undefined' - && typeof(theCells[theColNum].getAttribute) != 'undefined') { - currentClass = theCells[theColNum].className; - } // end 3 - - // 4. Defines the new Class - // 4.1 Current Class is the default one - if (currentClass == '' - || currentClass.toLowerCase() == theDefaultClass1.toLowerCase() - || currentClass.toLowerCase() == theDefaultClass2.toLowerCase()) { - if (theAction == 'over' && thePointerClass != '') { - newClass = thePointerClass; - } else if (theAction == 'click' && theMarkClass != '') { - newClass = theMarkClass; - marked_row[theColNum] = true; - } - } - // 4.1.2 Current Class is the pointer one - else if (currentClass.toLowerCase() == thePointerClass.toLowerCase() && - (typeof(marked_row[theColNum]) == 'undefined' || !marked_row[theColNum]) || marked_row[theColNum] == false) { - if (theAction == 'out') { - if (theColNum % 2) { - newClass = theDefaultClass1; - } else { - newClass = theDefaultClass2; - } - } - else if (theAction == 'click' && theMarkClass != '') { - newClass = theMarkClass; - marked_row[theColNum] = true; - } - } - // 4.1.3 Current Class is the marker one - else if (currentClass.toLowerCase() == theMarkClass.toLowerCase()) { - if (theAction == 'click') { - newClass = (thePointerClass != '') - ? thePointerClass - : ((theColNum % 2) ? theDefaultClass2 : theDefaultClass1); - marked_row[theColNum] = false; - } - } // end 4 - - // 5 ... with DOM compatible browsers except Opera - - if (newClass) { - var c = null; - var rowCnt = theRows.length; - for (c = 0; c < rowCnt; c++) { - if (tagSwitch == 'tag') { - Cells = theRows[c].getElementsByTagName('td'); - } else if (tagSwitch == 'cells') { - Cells = theRows[c].cells; - } - - Cell = Cells[theColNum]; - - // 5.1 Sets the new Class... - Cell.className = Cell.className.replace(currentClass, newClass); - } // end for - } // end 5 - - return true; - } // end of the 'setVerticalPointer()' function - -/** - * Checks/unchecks all checkbox in given conainer (f.e. a form, fieldset or div) - * - * @param string container_id the container id - * @param boolean state new value for checkbox (true or false) - * @return boolean always true - */ -function setCheckboxes( container_id, state ) { - var checkboxes = document.getElementById(container_id).getElementsByTagName('input'); - - for ( var i = 0; i < checkboxes.length; i++ ) { - if ( checkboxes[i].type == 'checkbox' ) { - checkboxes[i].checked = state; - } - } - - return true; -} // end of the 'setCheckboxes()' function - - -// added 2004-05-08 by Michael Keck -// copy the checked from left to right or from right to left -// so it's easier for users to see, if $cfg['ModifyAtRight']=true, what they've checked ;) -function copyCheckboxesRange(the_form, the_name, the_clicked) -{ - if (typeof(document.forms[the_form].elements[the_name]) != 'undefined' && typeof(document.forms[the_form].elements[the_name + 'r']) != 'undefined') { - if (the_clicked !== 'r') { - if (document.forms[the_form].elements[the_name].checked == true) { - document.forms[the_form].elements[the_name + 'r'].checked = true; - }else { - document.forms[the_form].elements[the_name + 'r'].checked = false; - } - } else if (the_clicked == 'r') { - if (document.forms[the_form].elements[the_name + 'r'].checked == true) { - document.forms[the_form].elements[the_name].checked = true; - }else { - document.forms[the_form].elements[the_name].checked = false; - } - } - } -} - - -// added 2004-05-08 by Michael Keck -// - this was directly written to each td, so why not a function ;) -// setCheckboxColumn(\'id_rows_to_delete' . $row_no . ''\'); -function setCheckboxColumn(theCheckbox){ - if (document.getElementById(theCheckbox)) { - document.getElementById(theCheckbox).checked = (document.getElementById(theCheckbox).checked ? false : true); - if (document.getElementById(theCheckbox + 'r')) { - document.getElementById(theCheckbox + 'r').checked = document.getElementById(theCheckbox).checked; - } - } else { - if (document.getElementById(theCheckbox + 'r')) { - document.getElementById(theCheckbox + 'r').checked = (document.getElementById(theCheckbox +'r').checked ? false : true); - if (document.getElementById(theCheckbox)) { - document.getElementById(theCheckbox).checked = document.getElementById(theCheckbox + 'r').checked; - } - } - } -} - - -/** - * Checks/unchecks all options of a '; - for (i =0; i < 12; i++) { - if (i == month) selected = ' selected="selected"'; - else selected = ''; - str += ''; - } - str += ''; - str += ' »'; - str += ''; - str += ''; - str += '
'; - str += '« '; - str += ''; - str += ' »'; - str += '
'; - str += ''; - - str += ''; - for (i = 0; i < 7; i++) { - str += ""; - } - str += ""; - - var firstDay = new Date(year, month, 1).getDay(); - var lastDay = new Date(year, month + 1, 0).getDate(); - - str += ""; - - dayInWeek = 0; - for (i = 0; i < firstDay; i++) { - str += ""; - dayInWeek++; - } - for (i = 1; i <= lastDay; i++) { - if (dayInWeek == 7) { - str += ""; - dayInWeek = 0; - } - - dispmonth = 1 + month; - - if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') { - actVal = "" + formatNum4(year) + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum2(i, 'day'); - } else { - actVal = "" + formatNum4(year) + formatNum2(dispmonth, 'month') + formatNum2(i, 'day'); - } - if (i == day) { - style = ' class="selected"'; - current_date = actVal; - } else { - style = ''; - } - str += "" + i + "" - dayInWeek++; - } - for (i = dayInWeek; i < 7; i++) { - str += ""; - } - - str += "
" + day_names[i] + "
 
 
"; - - cnt.innerHTML = str; - - // Should we handle time also? - if (window.opener.dateType != 'date' && !clock_set) { - - if (document.getElementById) { - cnt = document.getElementById("clock_data"); - } else if (document.all) { - cnt = document.all["clock_data"]; - } - - str = ''; - init_hour = hour; - init_minute = minute; - init_second = second; - str += '
'; - str += '
'; - str += ':'; - str += ':'; - str += ''; - str += '  '; - str += ''; - str += '
'; - str += '
'; - - cnt.innerHTML = str; - clock_set = 1; - } - -} - -/** - * Returns date from calendar. - * - * @param string date text - */ -function returnDate(d) { - txt = d; - if (window.opener.dateType != 'date') { - // need to get time - h = parseInt(document.getElementById('hour').value,10); - m = parseInt(document.getElementById('minute').value,10); - s = parseInt(document.getElementById('second').value,10); - if (window.opener.dateType == 'datetime') { - txt += ' ' + formatNum2(h, 'hour') + ':' + formatNum2(m, 'minute') + ':' + formatNum2(s, 'second'); - } else { - // timestamp - txt += formatNum2(h, 'hour') + formatNum2(m, 'minute') + formatNum2(s, 'second'); - } - } - - window.opener.dateField.value = txt; - window.close(); -} diff --git a/htdocs/sql/js/tooltip.js b/htdocs/sql/js/tooltip.js deleted file mode 100755 --- a/htdocs/sql/js/tooltip.js +++ /dev/null @@ -1,197 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * Displays the Tooltips (hints), if we have some - * 2005-01-20 added by Michael Keck (mkkeck) - * - * @version $Id: tooltip.js 10142 2007-03-20 10:32:13Z cybot_tm $ - */ - -/** - * - */ -var ttXpos = 0, ttYpos = 0; -var ttXadd = 10, ttYadd = -10; -var ttDisplay = 0, ttHoldIt = 0; -// Check if browser does support dynamic content and dhtml -var ttNS4 = (document.layers) ? 1 : 0; // the old Netscape 4 -var ttIE4 = (document.all) ? 1 : 0; // browser wich uses document.all -var ttDOM = (document.getElementById) ? 1 : 0; // DOM-compatible browsers -if (ttDOM) { // if DOM-compatible, set the others to false - ttNS4 = 0; - ttIE4 = 0; -} - -var myTooltipContainer = null; - -if ( (ttDOM) || (ttIE4) || (ttNS4) ) { - // mouse-event - if ( ttNS4 ) { - document.captureEvents(Event.MOUSEMOVE); - } else { - document.onmousemove = mouseMove; - } -} - -/** - * init the tooltip and write the text into it - * - * @param string theText tooltip content - */ -function textTooltip(theText) { - if (ttDOM || ttIE4) { // document.getEelementById || document.all - myTooltipContainer.innerHTML = ""; // we should empty it first - myTooltipContainer.innerHTML = theText; - } else if (ttNS4) { // document.layers - var layerNS4 = myTooltipContainer.document; - layerNS4.write(theText); - layerNS4.close(); - } -} - -/** - * @var integer - */ -var ttTimerID = 0; - -/** - * swap the Tooltip // show and hide - * - * @param boolean stat view status - */ -function swapTooltip(stat) { - if (ttHoldIt!=1) { - if (stat!='default') { - if (stat=='true') - showTooltip(true); - else if (stat=='false') - showTooltip(false); - } else { - if (ttDisplay) - ttTimerID = setTimeout("showTooltip(false);",500); - else - showTooltip(true); - } - } else { - if (ttTimerID) { - clearTimeout(ttTimerID); - ttTimerID = 0; - } - showTooltip(true); - } -} - -/** - * show / hide the Tooltip - * - * @param boolean stat view status - */ -function showTooltip(stat) { - if (stat==false) { - if (ttNS4) - myTooltipContainer.visibility = "hide"; - else - myTooltipContainer.style.visibility = "hidden"; - ttDisplay = 0; - } else { - if (ttNS4) - myTooltipContainer.visibility = "show"; - else - myTooltipContainer.style.visibility = "visible"; - ttDisplay = 1; - } -} -/** - * hold it, if we create or move the mouse over the tooltip - */ -function holdTooltip() { - ttHoldIt = 1; - swapTooltip('true'); - ttHoldIt = 0; -} - -/** - * move the tooltip to mouse position - * - * @param integer posX horiz. position - * @param integer posY vert. position - */ -function moveTooltip(posX, posY) { - if (ttDOM || ttIE4) { - myTooltipContainer.style.left = posX + "px"; - myTooltipContainer.style.top = posY + "px"; - } else if (ttNS4) { - myTooltipContainer.left = posX; - myTooltipContainer.top = posY; - } -} - -/** - * build the tooltip - * - * @param string theText tooltip content - */ -function pmaTooltip( theText ) { - // reference to TooltipContainer - if ( null == myTooltipContainer ) { - if (ttNS4) { - myTooltipContainer = document.TooltipContainer; - } else if (ttIE4) { - myTooltipContainer = document.all('TooltipContainer'); - } else if (ttDOM) { - myTooltipContainer = document.getElementById('TooltipContainer'); - } else { - return; - } - - if ( typeof( myTooltipContainer ) == 'undefined' ) { - return; - } - } - - var plusX=0, plusY=0, docX=0, docY=0; - var divHeight = myTooltipContainer.clientHeight; - var divWidth = myTooltipContainer.clientWidth; - if (navigator.appName.indexOf("Explorer")!=-1) { - if (document.documentElement && document.documentElement.scrollTop) { - plusX = document.documentElement.scrollLeft; - plusY = document.documentElement.scrollTop; - docX = document.documentElement.offsetWidth + plusX; - docY = document.documentElement.offsetHeight + plusY; - } else { - plusX = document.body.scrollLeft; - plusY = document.body.scrollTop; - docX = document.body.offsetWidth + plusX; - docY = document.body.offsetHeight + plusY; - } - } else { - docX = document.body.clientWidth; - docY = document.body.clientHeight; - } - - ttXpos = ttXpos + plusX; - ttYpos = ttYpos + plusY; - - if ((ttXpos + divWidth) > docX) - ttXpos = ttXpos - (divWidth + (ttXadd * 2)); - if ((ttYpos + divHeight) > docY) - ttYpos = ttYpos - (divHeight + (ttYadd * 2)); - - textTooltip(theText); - moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd)); - holdTooltip(); -} - -/** - * register mouse moves - * - * @param event e - */ -function mouseMove(e) { - if ( typeof( event ) != 'undefined' ) { - ttXpos = event.x; - ttYpos = event.y; - } else { - ttXpos = e.pageX; - ttYpos = e.pageY; - } -} diff --git a/htdocs/sql/js/user_password.js b/htdocs/sql/js/user_password.js deleted file mode 100755 --- a/htdocs/sql/js/user_password.js +++ /dev/null @@ -1,196 +0,0 @@ -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * function used for password change form - * - * @version $Id: user_password.js 10142 2007-03-20 10:32:13Z cybot_tm $ - */ - -/** - * Validates the password field in a form - * - * @param object the form - * - * @return boolean whether the field value is valid or not - */ -function checkPassword(the_form) -{ - // Gets the elements pointers - if (the_form.name == 'addUserForm' || the_form.name == 'chgPassword') { - var pswd_index = 1; - var pswd1_name = 'pma_pw'; - var pswd2_name = 'pma_pw2'; - } else { - pswd_index = 2; - pswd1_name = 'new_pw'; - pswd2_name = 'new_pw2'; - } - - // Validates - if (the_form.elements['nopass'][pswd_index].checked) { - if (the_form.elements[pswd1_name].value == '') { - alert(jsPasswordEmpty); - the_form.elements[pswd2_name].value = ''; - the_form.elements[pswd1_name].focus(); - return false; - } else if (the_form.elements[pswd1_name].value != the_form.elements[pswd2_name].value) { - alert(jsPasswordNotSame); - the_form.elements[pswd1_name].value = ''; - the_form.elements[pswd2_name].value = ''; - the_form.elements[pswd1_name].focus(); - return false; - } // end if...else if - } // end if - - return true; -} // end of the 'checkPassword()' function - - -/** - * Validates the "add an user" form - * - * @return boolean whether the form is validated or not - */ -function checkAddUser() -{ - var the_form = document.forms['addUserForm']; - - if (the_form.elements['anyhost'][1].checked && the_form.elements['host'].value == '') { - alert(jsHostEmpty); - the_form.elements['host'].focus(); - return false; - } - - if (the_form.elements['anyuser'][1].checked && the_form.elements['pma_user'].value == '') { - alert(jsUserEmpty); - the_form.elements['pma_user'].focus(); - return false; - } - - return checkPassword(the_form); -} // end of the 'checkAddUser()' function - - -/** - * Validates the "update a profile" form - * - * @return boolean whether the form is validated or not - */ -function checkUpdProfile() -{ - var the_form = document.forms['updUserForm']; - - if (the_form.elements['anyhost'][1].checked && the_form.elements['new_server'].value == '') { - alert(jsHostEmpty); - the_form.elements['new_server'].focus(); - return false; - } - - if (the_form.elements['anyuser'][1].checked && the_form.elements['new_user'].value == '') { - alert(jsUserEmpty); - the_form.elements['new_user'].focus(); - return false; - } - - return checkPassword(the_form); -} // end of the 'checkUpdProfile()' function - - -/** - * Gets the list of selected options in combo - * - * @param object the form to check - * - * @return string the list of selected options - */ -function getSelected(the_field) { - var the_list = ''; - var opts = the_field.options; - var opts_cnt = opts.length; - - for (var i = 0; i < opts_cnt; i++) { - if (opts[i].selected) { - the_list += opts[i].text + ', '; - } - } // end for - - return the_list.substring(0, the_list.length - 2); -} // end of the 'getSelected()' function - - -/** - * Reloads the page to get tables names in a database or fields names in a - * table - * - * @param object the input text box to build the query from - */ -function change(the_field) { - var l = location.href; - var lpos = l.indexOf('?lang'); - var box_name = the_field.name; - var the_form = the_field.form.elements; - var sel_idx = null; - - if (box_name == 'newdb') { - the_form['anydb'][0].checked = true; - the_form['anytable'][0].checked = true; - the_form['anycolumn'][0].checked = true; - if (typeof(the_form['dbgrant']) != 'undefined') { - the_form['dbgrant'].selectedIndex = -1; - } - if (typeof(the_form['tablegrant']) != 'undefined') { - the_form['tablegrant'].selectedIndex = -1; - } - if (typeof(the_form['colgrant']) != 'undefined') { - the_form['colgrant'].selectedIndex = -1; - } - } - else { - if (lpos <= 0) { - l += '?lang=' + the_form['lang'].value - + '&convcharset=' . the_form['convcharset'].value - + '&server=' + the_form['server'].value - + '&grants=1' - + '&host=' + escape(the_form['host'].value) - + '&pma_user=' + escape(the_form['pma_user'].value); - sel_idx = the_form['dbgrant'].selectedIndex; - if (sel_idx > 0) { - l += '&dbgrant=' + escape(the_form['dbgrant'].options[sel_idx].text); - } - sel_idx = the_form['tablegrant'].selectedIndex; - if (sel_idx > 0) { - l += '&tablegrant=' + escape(the_form['tablegrant'].options[sel_idx].text); - } - } - - var lpos = l.indexOf('&' + box_name); - if (lpos > 0) { - l = l.substring(0, lpos); - } // end if - - location.href = l + '&' + box_name + '=' + escape(getSelected(the_field)); - } - -} // end of the 'change()' function - - -/** - * Checks/unchecks all privileges - * - * @param string the form name - * @param boolean whether to check or to uncheck the element - * - * @return boolean always true - */ -function checkForm(the_form, do_check) { - var elts = document.forms[the_form].elements; - var elts_cnt = elts.length; - - for (var i = 0; i < elts_cnt; i++) { - var whichElt = elts[i].name; - if (whichElt.indexOf('_priv') >= 0) { - document.forms[the_form].elements[whichElt].checked = do_check; - } // end if - } // end for - - return true; -} // end of the 'checkForm()' function diff --git a/htdocs/sql/lang/add_message.sh b/htdocs/sql/lang/add_message.sh deleted file mode 100755 --- a/htdocs/sql/lang/add_message.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# $Id: add_message.sh 9537 2006-10-12 16:27:13Z nijel $ -# -# Shell script that adds a message to all message files (Lem9) -# -# Example: add_message.sh '$strNewMessage' 'new message contents' -# - -if [ $# -ne 2 ] ; then - echo "usage: add_message.sh '\$strNewMessage' 'new message contents'" - exit 1 -fi - -for file in *.inc.php -do - echo $file " " - grep -v '?>' ${file} > ${file}.new - case $file in - english*) - echo "$1 = '"$2"';" >> ${file}.new - ;; - *) - echo "$1 = '"$2"'; //to translate" >> ${file}.new - ;; - esac - echo "?>" >> ${file}.new - rm $file - mv ${file}.new $file -done -./sort_lang.sh english* -echo " " -echo "Message added to all message files (including english)" diff --git a/htdocs/sql/lang/add_message_file.sh b/htdocs/sql/lang/add_message_file.sh deleted file mode 100755 --- a/htdocs/sql/lang/add_message_file.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# $Id: add_message_file.sh 7364 2005-09-24 08:49:52Z nijel $ -# -# Shell script that adds a message file to all message files -# adding "//to translate" on each line -# -# Example: add_message_file.sh xxx -# -if [ $# -ne 1 ] ; then - echo "usage: add_message_file.sh filename" - exit 1 -fi - -for file in *.inc.php -do - echo $file " " - grep -v '?>' ${file} > ${file}.new - case $file in - english*) - sed -n 's/\(.*\);/\1;/p' $1 >> ${file}.new - ;; - *) - sed -n 's/\(.*\);/\1; \/\/to translate/p' $1 >> ${file}.new - ;; - esac - echo "?>" >> ${file}.new - rm $file - mv ${file}.new $file -done -./sort_lang.sh english* -echo " " -echo "Messages added to add message files (including english)" diff --git a/htdocs/sql/lang/check_lang.sh b/htdocs/sql/lang/check_lang.sh deleted file mode 100755 --- a/htdocs/sql/lang/check_lang.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh -# $Id: check_lang.sh 9393 2006-09-08 11:28:23Z lem9 $ -## -# Shell script to check that all language files are syncronized -# Catches duplicate/missing strings -# -# Robin Johnson -# August 9, 2002 -## - -MASTER="english-iso-8859-1.inc.php" -TMPDIR="tmp-check" -FILEPAT="*.inc.php" -STRINGMATCH='^[[:space:]]*\$[[:alnum:]_]+[[:blank:]]+=' -IGNOREMATCH='strEncto|strKanjiEncodConvert|strXkana|allow_recoding|doc_lang' - -if [ "`which diffstat`" = "" ] ; then - echo 'You need diffstat to use this!' - exit 1 -fi - -rm -rf $TMPDIR -mkdir -p $TMPDIR - -# Build the list of variables in each file -echo "Building data" -for f in $FILEPAT; -do - awk "/$STRINGMATCH/ && ! /$IGNOREMATCH/ { print \$1 }" $f | sort > $TMPDIR/$f -done - - -# Build the diff files used for checking -# And if there are no differences, delete the empty files -echo "Comparing data" -for f in $FILEPAT; -do - if [ ! $MASTER = $f ]; then - if diff -u $TMPDIR/$MASTER $TMPDIR/$f >$TMPDIR/$f.diff ; then - rm -f $TMPDIR/$f.diff $TMPDIR/$f - fi - fi -done - -# Cleanup -rm -f $TMPDIR/$MASTER - -# Build the nice difference table -echo "Differences" -diffstat -f 0 $TMPDIR/*.diff >$TMPDIR/diffstat 2>/dev/null -echo "Dupe Miss Filename" -head -n -1 $TMPDIR/diffstat | \ -while read filename sep change add plus sub minus edits exclaim; -do - echo "$add $sub $filename"; -done - -echo -echo "Dupe = Duplicate Variables" -echo "Miss = Missing Variables" -echo "For exact problem listings, look in the $TMPDIR/ directory" -echo "Please remember to remove '$TMPDIR/' once you are done" diff --git a/htdocs/sql/lang/english-utf-8.inc.php b/htdocs/sql/lang/english-utf-8.inc.php deleted file mode 100755 --- a/htdocs/sql/lang/english-utf-8.inc.php +++ /dev/null @@ -1,1031 +0,0 @@ -$cfg[\'BZipDump\'] directive in your phpMyAdmin configuration file to FALSE. If you want to use the Bz2 compression features, you should upgrade to a newer PHP version. See PHP bug report %s for details.'; -$strBzip = '"bzipped"'; - -$strCalendar = 'Calendar'; -$strCancel = 'Cancel'; -$strCanNotLoadExportPlugins = 'Could not load export plugins, please check your installation!'; -$strCanNotLoadImportPlugins = 'Could not load import plugins, please check your installation!'; -$strCannotLogin = 'Cannot log in to the MySQL server'; -$strCantLoad = 'Cannot load [a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a] extension. Please check your PHP configuration.'; -$strCantLoadRecodeIconv = 'Couldn\'t load the iconv or recode extension needed for charset conversion. Either configure PHP to enable these extensions or disable charset conversion in phpMyAdmin.'; -$strCantRenameIdxToPrimary = 'Can\'t rename index to PRIMARY!'; -$strCantUseRecodeIconv = 'Couldn\'t use either the iconv, libiconv or recode_string functions, although the necessary extensions appear to be loaded. Check your PHP configuration.'; -$strCardinality = 'Cardinality'; -$strCaseInsensitive = 'case-insensitive'; -$strCaseSensitive = 'case-sensitive'; -$strCentralEuropean = 'Central European'; -$strChange = 'Change'; -$strChangeCopyModeCopy = '... keep the old one.'; -$strChangeCopyMode = 'Create a new user with the same privileges and ...'; -$strChangeCopyModeDeleteAndReload = ' ... delete the old one from the user tables and reload the privileges afterwards.'; -$strChangeCopyModeJustDelete = ' ... delete the old one from the user tables.'; -$strChangeCopyModeRevoke = ' ... revoke all active privileges from the old one and delete it afterwards.'; -$strChangeCopyUser = 'Change Login Information / Copy User'; -$strChangeDisplay = 'Choose field to display'; -$strChangePassword = 'Change password'; -$strCharset = 'Charset'; -$strCharsetOfFile = 'Character set of the file:'; -$strCharsetsAndCollations = 'Character Sets and Collations'; -$strCharsets = 'Charsets'; -$strCheckAll = 'Check All'; -$strCheckOverhead = 'Check tables having overhead'; -$strCheckPrivs = 'Check Privileges'; -$strCheckPrivsLong = 'Check privileges for database "%s".'; -$strCheckTable = 'Check table'; -$strChoosePage = 'Please choose a page to edit'; -$strColComFeat = 'Displaying Column Comments'; -$strCollation = 'Collation'; -$strColumnNames = 'Column names'; -$strColumnPrivileges = 'Column-specific privileges'; -$strCommand = 'Command'; -$strComments = 'Comments'; -$strCommentsForTable = 'COMMENTS FOR TABLE'; -$strCompatibleHashing = 'MySQL 4.0 compatible'; -$strCompleteInserts = 'Complete inserts'; -$strCompression = 'Compression'; -$strCompressionWillBeDetected = 'Imported file compression will be automatically detected from: %s'; -$strConfigDefaultFileError = 'Could not load default configuration from: "%1$s"'; -$strConfigFileError = 'phpMyAdmin was unable to read your configuration file!
This might happen if PHP finds a parse error in it or PHP cannot find the file.
Please call the configuration file directly using the link below and read the PHP error message(s) that you receive. In most cases a quote or a semicolon is missing somewhere.
If you receive a blank page, everything is fine.'; -$strConfigureTableCoord = 'Please configure the coordinates for table %s'; -$strConnectionError = 'Cannot connect: invalid settings.'; -$strConnections = 'Connections'; -$strConstraintsForDumped = 'Constraints for dumped tables'; -$strConstraintsForTable = 'Constraints for table'; -$strControluserFailed = 'Connection for controluser as defined in your configuration failed.'; -$strCookiesRequired = 'Cookies must be enabled past this point.'; -$strCopy = 'Copy'; -$strCopyDatabaseOK = 'Database %s has been copied to %s'; -$strCopyTable = 'Copy table to (database.table):'; -$strCopyTableOK = 'Table %s has been copied to %s.'; -$strCopyTableSameNames = 'Can\'t copy table to same one!'; -$strCouldNotKill = 'phpMyAdmin was unable to kill thread %s. It probably has already been closed.'; -$strCreate = 'Create'; -$strCreateDatabaseBeforeCopying = 'CREATE DATABASE before copying'; -$strCreateIndex = 'Create an index on %s columns'; -$strCreateIndexTopic = 'Create a new index'; -$strCreateNewDatabase = 'Create new database'; -$strCreateNewTable = 'Create new table on database %s'; -$strCreatePage = 'Create a new page'; -$strCreatePdfFeat = 'Creation of PDFs'; -$strCreateRelation = 'Create relation'; -$strCreateTable = 'Create table'; -$strCreateUserDatabase = 'Database for user'; -$strCreateUserDatabaseName = 'Create database with same name and grant all privileges'; -$strCreateUserDatabaseNone = 'None'; -$strCreateUserDatabaseWildcard = 'Grant all privileges on wildcard name (username\_%)'; -$strCreationDates = 'Creation/Update/Check dates'; -$strCriteria = 'Criteria'; -$strCroatian = 'Croatian'; -$strCSV = 'CSV'; -$strCyrillic = 'Cyrillic'; -$strCzech = 'Czech'; -$strCzechSlovak = 'Czech-Slovak'; - -$strDanish = 'Danish'; -$strDatabase = 'Database'; -$strDatabaseEmpty = 'The database name is empty!'; -$strDatabaseExportOptions = 'Database export options'; -$strDatabaseHasBeenDropped = 'Database %s has been dropped.'; -$strDatabases = 'Databases'; -$strDatabasesDropped = '%s databases have been dropped successfully.'; -$strDatabasesStats = 'Databases statistics'; -$strDatabasesStatsDisable = 'Disable Statistics'; -$strDatabasesStatsEnable = 'Enable Statistics'; -$strDatabasesStatsHeavyTraffic = 'Note: Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server.'; -$strData = 'Data'; -$strDataDict = 'Data Dictionary'; -$strDataOnly = 'Data only'; -$strDataPages = 'Pages containing data'; -$strDBComment = 'Database comment: '; -$strDBCopy = 'Copy database to'; -$strDbIsEmpty = 'Database seems to be empty!'; -$strDbPrivileges = 'Database-specific privileges'; -$strDBRename = 'Rename database to'; -$strDbSpecific = 'database-specific'; -$strDefault = 'Default'; -$strDefaultEngine = '%s is the default storage engine on this MySQL server.'; -$strDefaultValueHelp = 'For default values, please enter just a single value, without backslash escaping or quotes, using this format: a'; -$strDefragment = 'Defragment table'; -$strDelayedInserts = 'Use delayed inserts'; -$strDeleteAndFlush = 'Delete the users and reload the privileges afterwards.'; -$strDeleteAndFlushDescr = 'This is the cleanest way, but reloading the privileges may take a while.'; -$strDelete = 'Delete'; -$strDeletedRows = 'Deleted rows:'; -$strDeleted = 'The row has been deleted'; -$strDeleteNoUsersSelected = 'No users selected for deleting!'; -$strDeleteRelation = 'Delete relation'; -$strDeleting = 'Deleting %s'; -$strDelimiter = 'Delimiter'; -$strDelOld = 'The current page has references to tables that no longer exist. Would you like to delete those references?'; -$strDescending = 'Descending'; -$strDescription = 'Description'; -$strDesigner = 'Designer'; -$strDesignerHelpDisplayField = 'The display field is shown in pink. To set/unset a field as the display field, click the "Choose field to display" icon, then click on the appropriate field name.'; -$strDictionary = 'dictionary'; -$strDirectLinks = 'Direct links'; -$strDirtyPages = 'Dirty pages'; -$strDisabled = 'Disabled'; -$strDisableForeignChecks = 'Disable foreign key checks'; -$strDisplayFeat = 'Display Features'; -$strDisplayOrder = 'Display order:'; -$strDisplayPDF = 'Display PDF schema'; -$strDoAQuery = 'Do a "query by example" (wildcard: "%")'; -$strDocSQL = 'DocSQL'; -$strDocu = 'Documentation'; -$strDoYouReally = 'Do you really want to '; -$strDropDatabaseStrongWarning = 'You are about to DESTROY a complete database!'; -$strDrop = 'Drop'; -$strDropUsersDb = 'Drop the databases that have the same names as the users.'; -$strDumpingData = 'Dumping data for table'; -$strDumpSaved = 'Dump has been saved to file %s.'; -$strDumpXRows = 'Dump %s row(s) starting at record # %s.'; -$strDynamic = 'dynamic'; - -$strEdit = 'Edit'; -$strEditPDFPages = 'Edit PDF Pages'; -$strEditPrivileges = 'Edit Privileges'; -$strEffective = 'Effective'; -$strEmpty = 'Empty'; -$strEmptyResultSet = 'MySQL returned an empty result set (i.e. zero rows).'; -$strEnabled = 'Enabled'; -$strEncloseInTransaction = 'Enclose export in a transaction'; -$strEndCut = 'END CUT'; -$strEnd = 'End'; -$strEndRaw = 'END RAW'; -$strEngineAvailable = '%s is available on this MySQL server.'; -$strEngineDisabled = '%s has been disabled for this MySQL server.'; -$strEngines = 'Engines'; -$strEngineUnsupported = 'This MySQL server does not support the %s storage engine.'; -$strEnglish = 'English'; -$strEnglishPrivileges = ' Note: MySQL privilege names are expressed in English '; -$strError = 'Error'; -$strErrorInZipFile = 'Error in ZIP archive:'; -$strErrorRelationAdded = 'Error: Relation not added.'; -$strErrorRelationExists = 'Error: relation already exists.'; -$strErrorRenamingTable = 'Error renaming table %1$s to %2$s'; -$strErrorSaveTable = 'Error saving coordinates for Designer.'; -$strEscapeWildcards = 'Wildcards _ and % should be escaped with a \ to use them literally'; -$strEsperanto = 'Esperanto'; -$strEstonian = 'Estonian'; -$strEvent = 'Event'; -$strExcelEdition = 'Excel edition'; -$strExecuteBookmarked = 'Execute bookmarked query'; -$strExplain = 'Explain SQL'; -$strExport = 'Export'; -$strExportImportToScale = 'Export/Import to scale'; -$strExportMustBeFile = 'Selected export type has to be saved in file!'; -$strExtendedInserts = 'Extended inserts'; -$strExtra = 'Extra'; - -$strFailedAttempts = 'Failed attempts'; -$strField = 'Field'; -$strFieldHasBeenDropped = 'Field %s has been dropped'; -$strFieldInsertFromFileTempDirNotExists = 'Error moving the uploaded file, see FAQ 1.11'; -$strFieldsEnclosedBy = 'Fields enclosed by'; -$strFieldsEscapedBy = 'Fields escaped by'; -$strFields = 'Fields'; -$strFieldsTerminatedBy = 'Fields terminated by'; -$strFileAlreadyExists = 'File %s already exists on server, change filename or check overwrite option.'; -$strFileCouldNotBeRead = 'File could not be read'; -$strFileNameTemplateDescriptionDatabase = 'database name'; -$strFileNameTemplateDescriptionServer = 'server name'; -$strFileNameTemplateDescriptionTable = 'table name'; -$strFileNameTemplateDescription = 'This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is.'; -$strFileNameTemplate = 'File name template'; -$strFileNameTemplateRemember = 'remember template'; -$strFiles = 'Files'; -$strFileToImport = 'File to import'; -$strFixed = 'fixed'; -$strFlushPrivilegesNote = 'Note: phpMyAdmin gets the users\' privileges directly from MySQL\'s privilege tables. The content of these tables may differ from the privileges the server uses, if they have been changed manually. In this case, you should %sreload the privileges%s before you continue.'; -$strFlushQueryCache = 'Flush query cache'; -$strFlushTable = 'Flush the table ("FLUSH")'; -$strFlushTables = 'Flush (close) all tables'; -$strFontSize = 'Font size'; -$strForeignKeyError = 'Error creating foreign key (check data types)'; -$strFormat = 'Format'; -$strFormEmpty = 'Missing value in the form!'; -$strFreePages = 'Free pages'; -$strFullText = 'Full Texts'; -$strFunction = 'Function'; -$strFunctions = 'Functions'; - -$strGenBy = 'Generated by'; -$strGeneralRelationFeat = 'General relation features'; -$strGenerate = 'Generate'; -$strGeneratePassword = 'Generate Password'; -$strGenTime = 'Generation Time'; -$strGeorgian = 'Georgian'; -$strGerman = 'German'; -$strGlobal = 'global'; -$strGlobalPrivileges = 'Global privileges'; -$strGlobalValue = 'Global value'; -$strGo = 'Go'; -$strGrantOption = 'Grant'; -$strGreek = 'Greek'; -$strGzip = '"gzipped"'; - -$strHandler = 'Handler'; -$strHasBeenAltered = 'has been altered.'; -$strHasBeenCreated = 'has been created.'; -$strHaveToShow = 'You have to choose at least one column to display'; -$strHebrew = 'Hebrew'; -$strHelp = 'Help'; -$strHexForBLOB = 'Use hexadecimal for BLOB'; -$strHide = 'Hide'; -$strHideShowAll = 'Hide/Show all'; -$strHideShowNoRelation = 'Hide/Show Tables with no relation'; -$strHome = 'Home'; -$strHomepageOfficial = 'Official phpMyAdmin Homepage'; -$strHostEmpty = 'The host name is empty!'; -$strHost = 'Host'; -$strHTMLExcel = 'Microsoft Excel 2000'; -$strHTMLWord = 'Microsoft Word 2000'; -$strHungarian = 'Hungarian'; - -$strIcelandic = 'Icelandic'; -$strId = 'ID'; -$strIdxFulltext = 'Fulltext'; -$strIEUnsupported = 'Internet Explorer does not support this function.'; -$strIgnoreDuplicates = 'Ignore duplicate rows'; -$strIgnore = 'Ignore'; -$strIgnoreInserts = 'Use ignore inserts'; -$strImportExportCoords = 'Import/Export coordinates for PDF schema'; -$strImportFiles = 'Import files'; -$strImportFormat = 'Format of imported file'; -$strImport = 'Import'; -$strImportSuccessfullyFinished = 'Import has been successfully finished, %d queries executed.'; -$strIndexes = 'Indexes'; -$strIndexesSeemEqual = 'The following indexes appear to be equal and one of them should be removed:'; -$strIndexHasBeenDropped = 'Index %s has been dropped'; -$strIndex = 'Index'; -$strIndexName = 'Index name:'; -$strIndexType = 'Index type:'; -$strIndexWarningTable = 'Problems with indexes of table `%s`'; -$strInnoDBAutoextendIncrement = 'Autoextend increment'; -$strInnoDBAutoextendIncrementDesc = ' The increment size for extending the size of an autoextending tablespace when it becomes full.'; -$strInnoDBBufferPoolSize = 'Buffer pool size'; -$strInnoDBBufferPoolSizeDesc = 'The size of the memory buffer InnoDB uses to cache data and indexes of its tables.'; -$strInnoDBDataFilePath = 'Data files'; -$strInnoDBDataHomeDir = 'Data home directory'; -$strInnoDBDataHomeDirDesc = 'The common part of the directory path for all InnoDB data files.'; -$strInnoDBPages = 'pages'; -$strInnoDBRelationAdded = 'InnoDB relation added'; -$strInnodbStat = 'InnoDB Status'; -$strInsecureMySQL = 'Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole.'; -$strInsertAsNewRow = 'Insert as new row'; -$strInsertedRowId = 'Inserted row id:'; -$strInsertedRows = 'Inserted rows:'; -$strInsert = 'Insert'; -$strInternalNotNecessary = '* An internal relation is not necessary when it exists also in InnoDB.'; -$strInternalRelationAdded = 'Internal relation added'; -$strInternalRelations = 'Internal relations'; -$strInUse = 'in use'; -$strInvalidAuthMethod = 'Invalid authentication method set in configuration:'; -$strInvalidColumnCount = 'Column count has to be larger than zero.'; -$strInvalidColumn = 'Invalid column (%s) specified!'; -$strInvalidCSVFieldCount = 'Invalid field count in CSV input on line %d.'; -$strInvalidCSVFormat = 'Invalid format of CSV input on line %d.'; -$strInvalidCSVParameter = 'Invalid parameter for CSV import: %s'; -$strInvalidDatabase = 'Invalid database'; -$strInvalidFieldAddCount = 'You have to add at least one field.'; -$strInvalidFieldCount = 'Table must have at least one field.'; -$strInvalidLDIImport = 'This plugin does not support compressed imports!'; -$strInvalidRowNumber = '%d is not valid row number.'; -$strInvalidServerHostname = 'Invalid hostname for server %1$s. Please review your configuration.'; -$strInvalidServerIndex = 'Invalid server index: "%s"'; -$strInvalidTableName = 'Invalid table name'; - -$strJapanese = 'Japanese'; -$strJoins = 'Joins'; -$strJumpToDB = 'Jump to database "%s".'; -$strJustDeleteDescr = 'The "deleted" users will still be able to access the server as usual until the privileges are reloaded.'; -$strJustDelete = 'Just delete the users from the privilege tables.'; - -$strKeepPass = 'Do not change the password'; -$strKeyCache = 'Key cache'; -$strKeyname = 'Keyname'; -$strKill = 'Kill'; -$strKnownExternalBug = 'The %s functionality is affected by a known bug, see %s'; -$strKorean = 'Korean'; - -$strLandscape = 'Landscape'; -$strLanguage = 'Language'; -$strLanguageUnknown = 'Unknown language: %1$s.'; -$strLatchedPages = 'Latched pages'; -$strLatexCaption = 'Table caption'; -$strLatexContent = 'Content of table __TABLE__'; -$strLatexContinuedCaption = 'Continued table caption'; -$strLatexContinued = '(continued)'; -$strLatexIncludeCaption = 'Include table caption'; -$strLatexLabel = 'Label key'; -$strLaTeX = 'LaTeX'; -$strLatexStructure = 'Structure of table __TABLE__'; -$strLatvian = 'Latvian'; -$strLDI = 'CSV using LOAD DATA'; -$strLDILocal = 'Use LOCAL keyword'; -$strLengthSet = 'Length/Values'; -$strLimitNumRows = 'Number of rows per page'; -$strLinesTerminatedBy = 'Lines terminated by'; -$strLinkNotFound = 'Link not found'; -$strLinksTo = 'Links to'; -$strLithuanian = 'Lithuanian'; -$strLocalhost = 'Local'; -$strLocationTextfile = 'Location of the text file'; -$strLoginInformation = 'Login Information'; -$strLogin = 'Log in'; -$strLogout = 'Log out'; -$strLogPassword = 'Password:'; -$strLogServer = 'Server'; -$strLogUsername = 'Username:'; -$strLongOperation = 'This operation could take a long time. Proceed anyway?'; - -$strMaxConnects = 'max. concurrent connections'; -$strMaximalQueryLength = 'Maximal length of created query'; -$strMaximumSize = 'Max: %s%s'; -$strMbExtensionMissing = 'The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.'; -$strMbOverloadWarning = 'You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'; -$strMIME_available_mime = 'Available MIME types'; -$strMIME_available_transform = 'Available transformations'; -$strMIME_description = 'Description'; -$strMIME_MIMEtype = 'MIME type'; -$strMIME_nodescription = 'No description is available for this transformation.
Please ask the author what %s does.'; -$strMIME_transformation = 'Browser transformation'; -$strMIME_transformation_note = 'For a list of available transformation options and their MIME type transformations, click on %stransformation descriptions%s'; -$strMIME_transformation_options_note = 'Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'...
If you ever need to put a backslash ("\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'; -$strMIME_transformation_options = 'Transformation options'; -$strMIMETypesForTable = 'MIME TYPES FOR TABLE'; -$strMIME_without = 'MIME types printed in italics do not have a separate transformation function'; -$strModifications = 'Modifications have been saved'; -$strModifyIndexTopic = 'Modify an index'; -$strModify = 'Modify'; -$strMoveMenu = 'Move Menu'; -$strMoveTable = 'Move table to (database.table):'; -$strMoveTableOK = 'Table %s has been moved to %s.'; -$strMoveTableSameNames = 'Can\'t move table to same one!'; -$strMultilingual = 'multilingual'; -$strMyISAMDataPointerSize = 'Data pointer size'; -$strMyISAMDataPointerSizeDesc = 'The default pointer size in bytes, to be used by CREATE TABLE for MyISAM tables when no MAX_ROWS option is specified.'; -$strMyISAMMaxExtraSortFileSizeDesc = 'If the temporary file used for fast MyISAM index creation would be larger than using the key cache by the amount specified here, prefer the key cache method.'; -$strMyISAMMaxExtraSortFileSize = 'Maximum size for temporary files on index creation'; -$strMyISAMMaxSortFileSizeDesc = 'The maximum size of the temporary file MySQL is allowed to use while re-creating a MyISAM index (during REPAIR TABLE, ALTER TABLE, or LOAD DATA INFILE).'; -$strMyISAMMaxSortFileSize = 'Maximum size for temporary sort files'; -$strMyISAMRecoverOptions = 'Automatic recovery mode'; -$strMyISAMRecoverOptionsDesc = 'The mode for automatic recovery of crashed MyISAM tables, as set via the --myisam-recover server startup option.'; -$strMyISAMRepairThreadsDesc = 'If this value is greater than 1, MyISAM table indexes are created in parallel (each index in its own thread) during the repair by sorting process.'; -$strMyISAMRepairThreads = 'Repair threads'; -$strMyISAMSortBufferSizeDesc = 'The buffer that is allocated when sorting MyISAM indexes during a REPAIR TABLE or when creating indexes with CREATE INDEX or ALTER TABLE.'; -$strMyISAMSortBufferSize = 'Sort buffer size'; -$strMySQLCharset = 'MySQL charset'; -$strMysqlClientVersion = 'MySQL client version'; -$strMySQLConnectionCollation = 'MySQL connection collation'; -$strMysqlLibDiffersServerVersion = 'Your PHP MySQL library version %s differs from your MySQL server version %s. This may cause unpredictable behavior.'; -$strMySQLSaid = 'MySQL said: '; -$strMySQLShowProcess = 'Show processes'; -$strMySQLShowStatus = 'Show MySQL runtime information'; -$strMySQLShowVars = 'Show MySQL system variables'; - -$strName = 'Name'; -$strNext = 'Next'; -$strNoActivity = 'No activity within %s seconds; please log in again'; -$strNoDatabases = 'No databases'; -$strNoDatabasesSelected = 'No databases selected.'; -$strNoDataReceived = 'No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16.'; -$strNoDescription = 'no description'; -$strNoDetailsForEngine = 'There is no detailed status information available for this storage engine.'; -$strNoDropDatabases = '"DROP DATABASE" statements are disabled.'; -$strNoExplain = 'Skip Explain SQL'; -$strNoFilesFoundInZip = 'No files found inside ZIP archive!'; -$strNoFrames = 'phpMyAdmin is more friendly with a frames-capable browser.'; -$strNoIndex = 'No index defined!'; -$strNoIndexPartsDefined = 'No index parts defined!'; -$strNoModification = 'No change'; -$strNone = 'None'; -$strNo = 'No'; -$strNoOptions = 'This format has no options'; -$strNoPassword = 'No Password'; -$strNoPermission = 'The web server does not have permission to save the file %s.'; -$strNoPhp = 'Without PHP Code'; -$strNoPrivileges = 'No Privileges'; -$strNoRights = 'You don\'t have sufficient privileges to be here right now!'; -$strNoRowsSelected = 'No rows selected'; -$strNoSpace = 'Insufficient space to save the file %s.'; -$strNoTablesFound = 'No tables found in database.'; -$strNoThemeSupport = 'No themes support; please check your configuration and/or your themes in directory %s.'; -$strNotNumber = 'This is not a number!'; -$strNotOK = 'not OK'; -$strNotSet = '%s table not found or not set in %s'; -$strNoUsersFound = 'No user(s) found.'; -$strNoValidateSQL = 'Skip Validate SQL'; -$strNull = 'Null'; -$strNumberOfFields = 'Number of fields'; -$strNumberOfTables = 'Number of tables'; -$strNumSearchResultsInTable = '%s match(es) inside table %s'; -$strNumSearchResultsTotal = 'Total: %s match(es)'; -$strNumTables = 'Tables'; - -$strOK = 'OK'; -$strOpenDocumentSpreadsheet = 'Open Document Spreadsheet'; -$strOpenDocumentText = 'Open Document Text'; -$strOpenNewWindow = 'Open new phpMyAdmin window'; -$strOperations = 'Operations'; -$strOperator = 'Operator'; -$strOptimizeTable = 'Optimize table'; -$strOptions = 'Options'; -$strOr = 'Or'; -$strOverhead = 'Overhead'; -$strOverwriteExisting = 'Overwrite existing file(s)'; - -$strPageNumber = 'Page number:'; -$strPagesToBeFlushed = 'Pages to be flushed'; -$strPaperSize = 'Paper size'; -$strPartialImport = 'Partial import'; -$strPartialText = 'Partial Texts'; -$strPasswordChanged = 'The password for %s was changed successfully.'; -$strPasswordEmpty = 'The password is empty!'; -$strPasswordHashing = 'Password Hashing'; -$strPasswordNotSame = 'The passwords aren\'t the same!'; -$strPassword = 'Password'; -$strPdfDbSchema = 'Schema of the the "%s" database - Page %s'; -$strPdfInvalidTblName = 'The "%s" table doesn\'t exist!'; -$strPdfNoTables = 'No tables'; -$strPDF = 'PDF'; -$strPDFReportExplanation = '(Generates a report containing the data of a single table)'; -$strPDFReportTitle = 'Report title'; -$strPerHour = 'per hour'; -$strPerMinute = 'per minute'; -$strPerSecond = 'per second'; -$strPersian = 'Persian'; -$strPhoneBook = 'phone book'; -$strPHP40203 = 'You are using PHP 4.2.3, which has a serious bug with multi-byte strings (mbstring). See PHP bug report 19404. This version of PHP is not recommended for use with phpMyAdmin.'; -$strPhp = 'Create PHP Code'; -$strPHPVersion = 'PHP Version'; -$strPleaseSelectPrimaryOrUniqueKey = 'Please select the primary key or a unique key'; -$strPmaDocumentation = 'phpMyAdmin documentation'; -$strPmaUriError = 'The $cfg[\'PmaAbsoluteUri\'] directive MUST be set in your configuration file!'; -$strPmaWiki = 'phpMyAdmin wiki'; -$strPolish = 'Polish'; -$strPortrait = 'Portrait'; -$strPos1 = 'Begin'; -$strPrevious = 'Previous'; -$strPrimaryKeyHasBeenDropped = 'The primary key has been dropped'; -$strPrimaryKeyName = 'The name of the primary key must be "PRIMARY"!'; -$strPrimaryKeyWarning = '("PRIMARY" must be the name of and only of a primary key!)'; -$strPrimary = 'Primary'; -$strPrint = 'Print'; -$strPrintViewFull = 'Print view (with full texts)'; -$strPrintView = 'Print view'; -$strPrivDescAllPrivileges = 'Includes all privileges except GRANT.'; -$strPrivDescAlter = 'Allows altering the structure of existing tables.'; -$strPrivDescAlterRoutine = 'Allows altering and dropping stored routines.'; -$strPrivDescCreateDb = 'Allows creating new databases and tables.'; -$strPrivDescCreateRoutine = 'Allows creating stored routines.'; -$strPrivDescCreateTbl = 'Allows creating new tables.'; -$strPrivDescCreateTmpTable = 'Allows creating temporary tables.'; -$strPrivDescCreateUser = 'Allows creating, dropping and renaming user accounts.'; -$strPrivDescCreateView = 'Allows creating new views.'; -$strPrivDescDelete = 'Allows deleting data.'; -$strPrivDescDropDb = 'Allows dropping databases and tables.'; -$strPrivDescDropTbl = 'Allows dropping tables.'; -$strPrivDescExecute5 = 'Allows executing stored routines.'; -$strPrivDescExecute = 'Allows running stored procedures; has no effect in this MySQL version.'; -$strPrivDescFile = 'Allows importing data from and exporting data into files.'; -$strPrivDescGrant = 'Allows adding users and privileges without reloading the privilege tables.'; -$strPrivDescIndex = 'Allows creating and dropping indexes.'; -$strPrivDescInsert = 'Allows inserting and replacing data.'; -$strPrivDescLockTables = 'Allows locking tables for the current thread.'; -$strPrivDescMaxConnections = 'Limits the number of new connections the user may open per hour.'; -$strPrivDescMaxQuestions = 'Limits the number of queries the user may send to the server per hour.'; -$strPrivDescMaxUpdates = 'Limits the number of commands that change any table or database the user may execute per hour.'; -$strPrivDescMaxUserConnections = 'Limits the number of simultaneous connections the user may have.'; -$strPrivDescProcess3 = 'Allows killing processes of other users.'; -$strPrivDescProcess4 = 'Allows viewing the complete queries in the process list.'; -$strPrivDescReferences = 'Has no effect in this MySQL version.'; -$strPrivDescReload = 'Allows reloading server settings and flushing the server\'s caches.'; -$strPrivDescReplClient = 'Allows the user to ask where the slaves / masters are.'; -$strPrivDescReplSlave = 'Needed for the replication slaves.'; -$strPrivDescSelect = 'Allows reading data.'; -$strPrivDescShowDb = 'Gives access to the complete list of databases.'; -$strPrivDescShowView = 'Allows performing SHOW CREATE VIEW queries.'; -$strPrivDescShutdown = 'Allows shutting down the server.'; -$strPrivDescSuper = 'Allows connecting, even if maximum number of connections is reached; required for most administrative operations like setting global variables or killing threads of other users.'; -$strPrivDescUpdate = 'Allows changing data.'; -$strPrivDescUsage = 'No privileges.'; -$strPrivileges = 'Privileges'; -$strPrivilegesReloaded = 'The privileges were reloaded successfully.'; -$strProcedures = 'Procedures'; -$strProcesses = 'Processes'; -$strProcesslist = 'Process list'; -$strProfiling = 'Profiling'; -$strProtocolVersion = 'Protocol version'; -$strPutColNames = 'Put fields names in the first row'; - -$strQBEDel = 'Del'; -$strQBEIns = 'Ins'; -$strQBE = 'Query'; -$strQueryCache = 'Query cache'; -$strQueryFrame = 'Query window'; -$strQueryOnDb = 'SQL query on database %s:'; -$strQueryResultsOperations = 'Query results operations'; -$strQuerySQLHistory = 'SQL history'; -$strQueryStatistics = 'Query statistics: Since its startup, %s queries have been sent to the server.'; -$strQueryTime = 'Query took %01.4f sec'; -$strQueryType = 'Query type'; -$strQueryWindowLock = 'Do not overwrite this query from outside the window'; - -$strReadRequests = 'Read requests'; -$strReceived = 'Received'; -$strRecommended = 'recommended'; -$strRecords = 'Records'; -$strReferentialIntegrity = 'Check referential integrity:'; -$strRefresh = 'Refresh'; -$strRelationalSchema = 'Relational schema'; -$strRelationDeleted = 'Relation deleted'; -$strRelationNotWorking = 'The additional features for working with linked tables have been deactivated. To find out why click %shere%s.'; -$strRelationsForTable = 'RELATIONS FOR TABLE'; -$strRelations = 'Relations'; -$strRelationView = 'Relation view'; -$strReloadingThePrivileges = 'Reloading the privileges'; -$strReloadPrivileges = 'Reload privileges'; -$strReload = 'Reload'; -$strRemoveSelectedUsers = 'Remove selected users'; -$strRenameDatabaseOK = 'Database %s has been renamed to %s'; -$strRenameTableOK = 'Table %s has been renamed to %s'; -$strRenameTable = 'Rename table to'; -$strRepairTable = 'Repair table'; -$strReplaceNULLBy = 'Replace NULL by'; -$strReplaceTable = 'Replace table data with file'; -$strReplication = 'Replication'; -$strReset = 'Reset'; -$strResourceLimits = 'Resource limits'; -$strRestartInsertion = 'Restart insertion with %s rows'; -$strReType = 'Re-type'; -$strRevokeAndDeleteDescr = 'The users will still have the USAGE privilege until the privileges are reloaded.'; -$strRevokeAndDelete = 'Revoke all active privileges from the users and delete them afterwards.'; -$strRevokeMessage = 'You have revoked the privileges for %s'; -$strRevoke = 'Revoke'; -$strRomanian = 'Romanian'; -$strRoutineReturnType = 'Return type'; -$strRoutines = 'Routines'; -$strRowLength = 'Row length'; -$strRowsFrom = 'row(s) starting from record #'; -$strRowSize = ' Row size '; -$strRowsModeFlippedHorizontal = 'horizontal (rotated headers)'; -$strRowsModeHorizontal = 'horizontal'; -$strRowsModeOptions = 'in %s mode and repeat headers after %s cells'; -$strRowsModeVertical = 'vertical'; -$strRows = 'Rows'; -$strRowsStatistic = 'Row Statistics'; -$strRunning = 'running on %s'; -$strRunQuery = 'Submit Query'; -$strRunSQLQueryOnServer = 'Run SQL query/queries on server %s'; -$strRunSQLQuery = 'Run SQL query/queries on database %s'; -$strRussian = 'Russian'; - -$strSaveOnServer = 'Save on server in %s directory'; -$strSavePosition = 'Save position'; -$strSave = 'Save'; -$strScaleFactorSmall = 'The scale factor is too small to fit the schema on one page'; -$strSearchFormTitle = 'Search in database'; -$strSearchInTables = 'Inside table(s):'; -$strSearchNeedle = 'Word(s) or value(s) to search for (wildcard: "%"):'; -$strSearchOption1 = 'at least one of the words'; -$strSearchOption2 = 'all words'; -$strSearchOption3 = 'the exact phrase'; -$strSearchOption4 = 'as regular expression'; -$strSearchResultsFor = 'Search results for "%s" %s:'; -$strSearch = 'Search'; -$strSearchType = 'Find:'; -$strSecretRequired = 'The configuration file now needs a secret passphrase (blowfish_secret).'; -$strSelectADb = 'Please select a database'; -$strSelectAll = 'Select All'; -$strSelectBinaryLog = 'Select binary log to view'; -$strSelectFields = 'Select fields (at least one):'; -$strSelectForeignKey = 'Select Foreign Key'; -$strSelectNumRows = 'in query'; -$strSelectReferencedKey = 'Select referenced key'; -$strSelectTables = 'Select Tables'; -$strSend = 'Save as file'; -$strSent = 'Sent'; -$strServerChoice = 'Server Choice'; -$strServerNotResponding = 'The server is not responding'; -$strServer = 'Server'; -$strServers = 'Servers'; -$strServerStatusDelayedInserts = 'Delayed inserts'; -$strServerStatus = 'Runtime Information'; -$strServerStatusUptime = 'This MySQL server has been running for %s. It started up on %s.'; -$strServerTabVariables = 'Variables'; -$strServerTrafficNotes = 'Server traffic: These tables show the network traffic statistics of this MySQL server since its startup.'; -$strServerVars = 'Server variables and settings'; -$strServerVersion = 'Server version'; -$strSessionStartupErrorGeneral = 'Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.'; -$strSessionValue = 'Session value'; -$strSetEnumVal = 'If field type is "enum" or "set", please enter the values using this format: \'a\',\'b\',\'c\'...
If you ever need to put a backslash ("\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'; -$strShowAll = 'Show all'; -$strShowColor = 'Show color'; -$strShowDatadictAs = 'Data Dictionary Format'; -$strShowFullQueries = 'Show Full Queries'; -$strShowGrid = 'Show grid'; -$strShowHideLeftMenu = 'Show/Hide left menu'; -$strShowingBookmark = 'Showing bookmark'; -$strShowingPhp = 'Showing as PHP code'; -$strShowingRecords = 'Showing rows'; -$strShowingSQL = 'Showing SQL query'; -$strShowOpenTables = 'Show open tables'; -$strShowPHPInfo = 'Show PHP information'; -$strShow = 'Show'; -$strShowSlaveHosts = 'Show slave hosts'; -$strShowSlaveStatus = 'Show slave status'; -$strShowStatusBinlog_cache_disk_useDescr = 'The number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction.'; -$strShowStatusBinlog_cache_useDescr = 'The number of transactions that used the temporary binary log cache.'; -$strShowStatusCreated_tmp_disk_tablesDescr = 'The number of temporary tables on disk created automatically by the server while executing statements. If Created_tmp_disk_tables is big, you may want to increase the tmp_table_size value to cause temporary tables to be memory-based instead of disk-based.'; -$strShowStatusCreated_tmp_filesDescr = 'How many temporary files mysqld has created.'; -$strShowStatusCreated_tmp_tablesDescr = 'The number of in-memory temporary tables created automatically by the server while executing statements.'; -$strShowStatusDelayed_errorsDescr = 'The number of rows written with INSERT DELAYED for which some error occurred (probably duplicate key).'; -$strShowStatusDelayed_insert_threadsDescr = 'The number of INSERT DELAYED handler threads in use. Every different table on which one uses INSERT DELAYED gets its own thread.'; -$strShowStatusDelayed_writesDescr = 'The number of INSERT DELAYED rows written.'; -$strShowStatusFlush_commandsDescr = 'The number of executed FLUSH statements.'; -$strShowStatusHandler_commitDescr = 'The number of internal COMMIT statements.'; -$strShowStatusHandler_deleteDescr = 'The number of times a row was deleted from a table.'; -$strShowStatusHandler_discoverDescr = 'The MySQL server can ask the NDB Cluster storage engine if it knows about a table with a given name. This is called discovery. Handler_discover indicates the number of time tables have been discovered.'; -$strShowStatusHandler_read_firstDescr = 'The number of times the first entry was read from an index. If this is high, it suggests that the server is doing a lot of full index scans; for example, SELECT col1 FROM foo, assuming that col1 is indexed.'; -$strShowStatusHandler_read_keyDescr = 'The number of requests to read a row based on a key. If this is high, it is a good indication that your queries and tables are properly indexed.'; -$strShowStatusHandler_read_nextDescr = 'The number of requests to read the next row in key order. This is incremented if you are querying an index column with a range constraint or if you are doing an index scan.'; -$strShowStatusHandler_read_prevDescr = 'The number of requests to read the previous row in key order. This read method is mainly used to optimize ORDER BY ... DESC.'; -$strShowStatusHandler_read_rndDescr = 'The number of requests to read a row based on a fixed position. This is high if you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan whole tables or you have joins that don\'t use keys properly.'; -$strShowStatusHandler_read_rnd_nextDescr = 'The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.'; -$strShowStatusHandler_rollbackDescr = 'The number of internal ROLLBACK statements.'; -$strShowStatusHandler_updateDescr = 'The number of requests to update a row in a table.'; -$strShowStatusHandler_writeDescr = 'The number of requests to insert a row in a table.'; -$strShowStatusInnodb_buffer_pool_pages_dataDescr = 'The number of pages containing data (dirty or clean).'; -$strShowStatusInnodb_buffer_pool_pages_dirtyDescr = 'The number of pages currently dirty.'; -$strShowStatusInnodb_buffer_pool_pages_flushedDescr = 'The number of buffer pool pages that have been requested to be flushed.'; -$strShowStatusInnodb_buffer_pool_pages_freeDescr = 'The number of free pages.'; -$strShowStatusInnodb_buffer_pool_pages_latchedDescr = 'The number of latched pages in InnoDB buffer pool. These are pages currently being read or written or that can\'t be flushed or removed for some other reason.'; -$strShowStatusInnodb_buffer_pool_pages_miscDescr = 'The number of pages busy because they have been allocated for administrative overhead such as row locks or the adaptive hash index. This value can also be calculated as Innodb_buffer_pool_pages_total - Innodb_buffer_pool_pages_free - Innodb_buffer_pool_pages_data.'; -$strShowStatusInnodb_buffer_pool_pages_totalDescr = 'Total size of buffer pool, in pages.'; -$strShowStatusInnodb_buffer_pool_read_ahead_rndDescr = 'The number of "random" read-aheads InnoDB initiated. This happens when a query is to scan a large portion of a table but in random order.'; -$strShowStatusInnodb_buffer_pool_read_ahead_seqDescr = 'The number of sequential read-aheads InnoDB initiated. This happens when InnoDB does a sequential full table scan.'; -$strShowStatusInnodb_buffer_pool_read_requestsDescr = 'The number of logical read requests InnoDB has done.'; -$strShowStatusInnodb_buffer_pool_readsDescr = 'The number of logical reads that InnoDB could not satisfy from buffer pool and had to do a single-page read.'; -$strShowStatusInnodb_buffer_pool_wait_freeDescr = 'Normally, writes to the InnoDB buffer pool happen in the background. However, if it\'s necessary to read or create a page and no clean pages are available, it\'s necessary to wait for pages to be flushed first. This counter counts instances of these waits. If the buffer pool size was set properly, this value should be small.'; -$strShowStatusInnodb_buffer_pool_write_requestsDescr = 'The number writes done to the InnoDB buffer pool.'; -$strShowStatusInnodb_data_fsyncsDescr = 'The number of fsync() operations so far.'; -$strShowStatusInnodb_data_pending_fsyncsDescr = 'The current number of pending fsync() operations.'; -$strShowStatusInnodb_data_pending_readsDescr = 'The current number of pending reads.'; -$strShowStatusInnodb_data_pending_writesDescr = 'The current number of pending writes.'; -$strShowStatusInnodb_data_readDescr = 'The amount of data read so far, in bytes.'; -$strShowStatusInnodb_data_readsDescr = 'The total number of data reads.'; -$strShowStatusInnodb_data_writesDescr = 'The total number of data writes.'; -$strShowStatusInnodb_data_writtenDescr = 'The amount of data written so far, in bytes.'; -$strShowStatusInnodb_dblwr_pages_writtenDescr = 'The number of doublewrite writes that have been performed and the number of pages that have been written for this purpose.'; -$strShowStatusInnodb_dblwr_writesDescr = 'The number of doublewrite writes that have been performed and the number of pages that have been written for this purpose.'; -$strShowStatusInnodb_log_waitsDescr = 'The number of waits we had because log buffer was too small and we had to wait for it to be flushed before continuing.'; -$strShowStatusInnodb_log_write_requestsDescr = 'The number of log write requests.'; -$strShowStatusInnodb_log_writesDescr = 'The number of physical writes to the log file.'; -$strShowStatusInnodb_os_log_fsyncsDescr = 'The number of fsyncs writes done to the log file.'; -$strShowStatusInnodb_os_log_pending_fsyncsDescr = 'The number of pending log file fsyncs.'; -$strShowStatusInnodb_os_log_pending_writesDescr = 'Pending log file writes.'; -$strShowStatusInnodb_os_log_writtenDescr = 'The number of bytes written to the log file.'; -$strShowStatusInnodb_pages_createdDescr = 'The number of pages created.'; -$strShowStatusInnodb_page_sizeDescr = 'The compiled-in InnoDB page size (default 16KB). Many values are counted in pages; the page size allows them to be easily converted to bytes.'; -$strShowStatusInnodb_pages_readDescr = 'The number of pages read.'; -$strShowStatusInnodb_pages_writtenDescr = 'The number of pages written.'; -$strShowStatusInnodb_row_lock_current_waitsDescr = 'The number of row locks currently being waited for.'; -$strShowStatusInnodb_row_lock_time_avgDescr = 'The average time to acquire a row lock, in milliseconds.'; -$strShowStatusInnodb_row_lock_timeDescr = 'The total time spent in acquiring row locks, in milliseconds.'; -$strShowStatusInnodb_row_lock_time_maxDescr = 'The maximum time to acquire a row lock, in milliseconds.'; -$strShowStatusInnodb_row_lock_waitsDescr = 'The number of times a row lock had to be waited for.'; -$strShowStatusInnodb_rows_deletedDescr = 'The number of rows deleted from InnoDB tables.'; -$strShowStatusInnodb_rows_insertedDescr = 'The number of rows inserted in InnoDB tables.'; -$strShowStatusInnodb_rows_readDescr = 'The number of rows read from InnoDB tables.'; -$strShowStatusInnodb_rows_updatedDescr = 'The number of rows updated in InnoDB tables.'; -$strShowStatusKey_blocks_not_flushedDescr = 'The number of key blocks in the key cache that have changed but haven\'t yet been flushed to disk. It used to be known as Not_flushed_key_blocks.'; -$strShowStatusKey_blocks_unusedDescr = 'The number of unused blocks in the key cache. You can use this value to determine how much of the key cache is in use.'; -$strShowStatusKey_blocks_usedDescr = 'The number of used blocks in the key cache. This value is a high-water mark that indicates the maximum number of blocks that have ever been in use at one time.'; -$strShowStatusKey_read_requestsDescr = 'The number of requests to read a key block from the cache.'; -$strShowStatusKey_readsDescr = 'The number of physical reads of a key block from disk. If Key_reads is big, then your key_buffer_size value is probably too small. The cache miss rate can be calculated as Key_reads/Key_read_requests.'; -$strShowStatusKey_write_requestsDescr = 'The number of requests to write a key block to the cache.'; -$strShowStatusKey_writesDescr = 'The number of physical writes of a key block to disk.'; -$strShowStatusLast_query_costDescr = 'The total cost of the last compiled query as computed by the query optimizer. Useful for comparing the cost of different query plans for the same query. The default value of 0 means that no query has been compiled yet.'; -$strShowStatusNot_flushed_delayed_rowsDescr = 'The number of rows waiting to be written in INSERT DELAYED queues.'; -$strShowStatusOpened_tablesDescr = 'The number of tables that have been opened. If opened tables is big, your table cache value is probably too small.'; -$strShowStatusOpen_filesDescr = 'The number of files that are open.'; -$strShowStatusOpen_streamsDescr = 'The number of streams that are open (used mainly for logging).'; -$strShowStatusOpen_tablesDescr = 'The number of tables that are open.'; -$strShowStatusQcache_free_blocksDescr = 'The number of free memory blocks in query cache.'; -$strShowStatusQcache_free_memoryDescr = 'The amount of free memory for query cache.'; -$strShowStatusQcache_hitsDescr = 'The number of cache hits.'; -$strShowStatusQcache_insertsDescr = 'The number of queries added to the cache.'; -$strShowStatusQcache_lowmem_prunesDescr = 'The number of queries that have been removed from the cache to free up memory for caching new queries. This information can help you tune the query cache size. The query cache uses a least recently used (LRU) strategy to decide which queries to remove from the cache.'; -$strShowStatusQcache_not_cachedDescr = 'The number of non-cached queries (not cachable, or not cached due to the query_cache_type setting).'; -$strShowStatusQcache_queries_in_cacheDescr = 'The number of queries registered in the cache.'; -$strShowStatusQcache_total_blocksDescr = 'The total number of blocks in the query cache.'; -$strShowStatusReset = 'Reset'; -$strShowStatusRpl_statusDescr = 'The status of failsafe replication (not yet implemented).'; -$strShowStatusSelect_full_joinDescr = 'The number of joins that do not use indexes. If this value is not 0, you should carefully check the indexes of your tables.'; -$strShowStatusSelect_full_range_joinDescr = 'The number of joins that used a range search on a reference table.'; -$strShowStatusSelect_range_checkDescr = 'The number of joins without keys that check for key usage after each row. (If this is not 0, you should carefully check the indexes of your tables.)'; -$strShowStatusSelect_rangeDescr = 'The number of joins that used ranges on the first table. (It\'s normally not critical even if this is big.)'; -$strShowStatusSelect_scanDescr = 'The number of joins that did a full scan of the first table.'; -$strShowStatusSlave_open_temp_tablesDescr = 'The number of temporary tables currently open by the slave SQL thread.'; -$strShowStatusSlave_retried_transactionsDescr = 'Total (since startup) number of times the replication slave SQL thread has retried transactions.'; -$strShowStatusSlave_runningDescr = 'This is ON if this server is a slave that is connected to a master.'; -$strShowStatusSlow_launch_threadsDescr = 'The number of threads that have taken more than slow_launch_time seconds to create.'; -$strShowStatusSlow_queriesDescr = 'The number of queries that have taken more than long_query_time seconds.'; -$strShowStatusSort_merge_passesDescr = 'The number of merge passes the sort algorithm has had to do. If this value is large, you should consider increasing the value of the sort_buffer_size system variable.'; -$strShowStatusSort_rangeDescr = 'The number of sorts that were done with ranges.'; -$strShowStatusSort_rowsDescr = 'The number of sorted rows.'; -$strShowStatusSort_scanDescr = 'The number of sorts that were done by scanning the table.'; -$strShowStatusTable_locks_immediateDescr = 'The number of times that a table lock was acquired immediately.'; -$strShowStatusTable_locks_waitedDescr = 'The number of times that a table lock could not be acquired immediately and a wait was needed. If this is high, and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.'; -$strShowStatusThreads_cachedDescr = 'The number of threads in the thread cache. The cache hit rate can be calculated as Threads_created/Connections. If this value is red you should raise your thread_cache_size.'; -$strShowStatusThreads_connectedDescr = 'The number of currently open connections.'; -$strShowStatusThreads_createdDescr = 'The number of threads created to handle connections. If Threads_created is big, you may want to increase the thread_cache_size value. (Normally this doesn\'t give a notable performance improvement if you have a good thread implementation.)'; -$strShowStatusThreads_runningDescr = 'The number of threads that are not sleeping.'; -$strShowTableDimension = 'Show dimension of tables'; -$strShowTables = 'Show tables'; -$strShowThisQuery = ' Show this query here again '; -$strSimplifiedChinese = 'Simplified Chinese'; -$strSingly = '(singly)'; -$strSize = 'Size'; -$strSkipQueries = 'Number of records(queries) to skip from start'; -$strSlovak = 'Slovak'; -$strSlovenian = 'Slovenian'; -$strSmallBigAll = 'Small/Big All'; -$strSnapToGrid = 'Snap to grid'; -$strSocketProblem = '(or the local MySQL server\'s socket is not correctly configured)'; -$strSortByKey = 'Sort by key'; -$strSorting = 'Sorting'; -$strSort = 'Sort'; -$strSpaceUsage = 'Space usage'; -$strSpanish = 'Spanish'; -$strSplitWordsWithSpace = 'Words are separated by a space character (" ").'; -$strSQLCompatibility = 'SQL compatibility mode'; -$strSQLExportType = 'Export type'; -$strSQLParserBugMessage = 'There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:'; -$strSQLParserUserError = 'There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem'; -$strSQLQuery = 'SQL query'; -$strSQLResult = 'SQL result'; -$strSQL = 'SQL'; -$strSQPBugInvalidIdentifer = 'Invalid Identifer'; -$strSQPBugUnclosedQuote = 'Unclosed quote'; -$strSQPBugUnknownPunctuation = 'Unknown Punctuation String'; -$strStandInStructureForView = 'Stand-in structure for view'; -$strStatCheckTime = 'Last check'; -$strStatCreateTime = 'Creation'; -$strStatement = 'Statements'; -$strStatisticsOverrun = 'On a busy server, the byte counters may overrun, so those statistics as reported by the MySQL server may be incorrect.'; -$strStatUpdateTime = 'Last update'; -$strStatus = 'Status'; -$strStorageEngines = 'Storage Engines'; -$strStorageEngine = 'Storage Engine'; -$strStrucCSV = 'CSV'; -$strStrucData = 'Structure and data'; -$strStrucExcelCSV = 'CSV for MS Excel'; -$strStrucNativeExcel = 'Native MS Excel format'; -$strStrucOnly = 'Structure only'; -$strStructPropose = 'Propose table structure'; -$strStructureForView = 'Structure for view'; -$strStructure = 'Structure'; -$strSubmit = 'Submit'; -$strSuccess = 'Your SQL query has been executed successfully'; -$strSuhosin = 'Server running with Suhosin. Please refer to %sdocumentation%s for possible issues.'; -$strSum = 'Sum'; -$strSwedish = 'Swedish'; -$strSwitchToDatabase = 'Switch to copied database'; -$strSwitchToTable = 'Switch to copied table'; - -$strTableAlreadyExists = 'Table %s already exists!'; -$strTableComments = 'Table comments'; -$strTableEmpty = 'The table name is empty!'; -$strTableHasBeenDropped = 'Table %s has been dropped'; -$strTableHasBeenEmptied = 'Table %s has been emptied'; -$strTableHasBeenFlushed = 'Table %s has been flushed'; -$strTableIsEmpty = 'Table seems to be empty!'; -$strTableMaintenance = 'Table maintenance'; -$strTableName = 'Table name'; -$strTableOfContents = 'Table of contents'; -$strTableOptions = 'Table options'; -$strTables = '%s table(s)'; -$strTableStructure = 'Table structure for table'; -$strTable = 'Table'; -$strTakeIt = 'take it'; -$strTblPrivileges = 'Table-specific privileges'; -$strTempData = 'Temporary data'; -$strTextAreaLength = ' Because of its length,
this field might not be editable '; -$strThai = 'Thai'; -$strThemeDefaultNotFound = 'Default theme %s not found!'; -$strThemeNoPreviewAvailable = 'No preview available.'; -$strThemeNotFound = 'Theme %s not found!'; -$strThemeNoValidImgPath = 'No valid image path for theme %s found!'; -$strThemePathNotFound = 'Theme path not found for theme %s!'; -$strTheme = 'Theme / Style'; -$strThisHost = 'This Host'; -$strThreads = 'Threads'; -$strThreadSuccessfullyKilled = 'Thread %s was successfully killed.'; -$strTimeoutInfo = 'Previous import timed out, after resubmitting will continue from position %d.'; -$strTimeoutNothingParsed = 'However on last run no data has been parsed, this usually means phpMyAdmin won\'t be able to finish this import unless you increase php time limits.'; -$strTimeoutPassed = 'Script timeout passed, if you want to finish import, please resubmit same file and import will resume.'; -$strTime = 'Time'; -$strToFromPage = 'to/from page'; -$strToggleScratchboard = 'Toggle scratchboard'; -$strToggleSmallBig = 'Toggle small/big'; -$strToSelectRelation = 'To select relation, click :'; -$strTotal = 'total'; -$strTotalUC = 'Total'; -$strTraditionalChinese = 'Traditional Chinese'; -$strTraditionalSpanish = 'Traditional Spanish'; -$strTraffic = 'Traffic'; -$strTransactionCoordinator = 'Transaction coordinator'; -$strTransformation_application_octetstream__download = 'Displays a link to download the binary data of the field. You can use the first option to specify the filename, or use the second option as the name of a field which contains the filename. If you use the second option, you need to set the first option to the empty string.'; -$strTransformation_application_octetstream__hex = 'Displays hexadecimal representation of data. Optional first parameter specifies how often space will be added (defaults to 2 nibbles).'; -$strTransformation_image_jpeg__inline = 'Displays a clickable thumbnail. The options are the maximum width and height in pixels. The original aspect ratio is preserved.'; -$strTransformation_image_jpeg__link = 'Displays a link to download this image.'; -$strTransformation_image_png__inline = 'See image/jpeg: inline'; -$strTransformation_text_plain__dateformat = 'Displays a TIME, TIMESTAMP, DATETIME or numeric unix timestamp field as formatted date. The first option is the offset (in hours) which will be added to the timestamp (Default: 0). Use second option to specify a different date/time format string. Third option determines whether you want to see local date or UTC one (use "local" or "utc" strings) for that. According to 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.'; -$strTransformation_text_plain__external = 'LINUX ONLY: Launches an external application and feeds it the field 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 libraries/transformations/text_plain__external.inc.php and list the tools you want to make available. The first option is then the number of the program you want to use and the second option is the parameters for the program. 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).'; -$strTransformation_text_plain__formatted = 'Displays the contents of the field as-is, without running it through htmlspecialchars(). That is, the field is assumed to contain valid HTML.'; -$strTransformation_text_plain__imagelink = 'Displays an image and a link; the field 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.'; -$strTransformation_text_plain__link = 'Displays a link; the field contains the filename. The first option is a URL prefix like "http://www.example.com/". The second option is a title for the link.'; -$strTransformation_text_plain__sql = 'Formats text as SQL query with syntax highlighting.'; -$strTransformation_text_plain__substr = 'Displays a part of a string. The first option is the number of characters to skip from the beginning of the string (Default 0). The second option is the number of characters to return (Default: until end of string). The third option is the string to append and/or prepend when truncation occurs (Default: "...").'; -$strTriggers = 'Triggers'; -$strTruncateQueries = 'Truncate Shown Queries'; -$strTurkish = 'Turkish'; -$strType = 'Type'; - -$strUkrainian = 'Ukrainian'; -$strUncheckAll = 'Uncheck All'; -$strUnicode = 'Unicode'; -$strUnique = 'Unique'; -$strUnknown = 'unknown'; -$strUnselectAll = 'Unselect All'; -$strUnsupportedCompressionDetected = 'You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.'; -$strUpdatePrivMessage = 'You have updated the privileges for %s.'; -$strUpdateProfileMessage = 'The profile has been updated.'; -$strUpdateQuery = 'Update Query'; -$strUpdComTab = 'Please see the documentation on how to update your column_comments table'; -$strUpgrade = 'You should upgrade to %s %s or later.'; -$strUploadErrorCantWrite = 'Failed to write file to disk.'; -$strUploadErrorExtension = 'File upload stopped by extension.'; -$strUploadErrorFormSize = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.'; -$strUploadErrorIniSize = 'The uploaded file exceeds the upload_max_filesize directive in php.ini.'; -$strUploadErrorNoTempDir = 'Missing a temporary folder.'; -$strUploadErrorPartial = 'The uploaded file was only partially uploaded.'; -$strUploadErrorUnknown = 'Unknown error in file upload.'; -$strUploadLimit = 'You probably tried to upload too large file. Please refer to %sdocumentation%s for ways to workaround this limit.'; -$strUploadsNotAllowed = 'File uploads are not allowed on this server.'; -$strUsage = 'Usage'; -$strUseBackquotes = 'Enclose table and field names with backquotes'; -$strUsedPhpExtensions = 'Used PHP extensions'; -$strUseHostTable = 'Use Host Table'; -$strUserAlreadyExists = 'The user %s already exists!'; -$strUserEmpty = 'The user name is empty!'; -$strUserName = 'User name'; -$strUserNotFound = 'The selected user was not found in the privilege table.'; -$strUserOverview = 'User overview'; -$strUsersDeleted = 'The selected users have been deleted successfully.'; -$strUsersHavingAccessToDb = 'Users having access to "%s"'; -$strUser = 'User'; -$strUseTabKey = 'Use TAB key to move from value to value, or CTRL+arrows to move anywhere'; -$strUseTables = 'Use Tables'; -$strUseTextField = 'Use text field'; -$strUseThisValue = 'Use this value'; - -$strValidateSQL = 'Validate SQL'; -$strValidatorError = 'The SQL validator could not be initialized. Please check if you have installed the necessary PHP extensions as described in the %sdocumentation%s.'; -$strValue = 'Value'; -$strVar = 'Variable'; -$strVersionInformation = 'Version information'; -$strViewDumpDatabases = 'View dump (schema) of databases'; -$strViewDumpDB = 'View dump (schema) of database'; -$strViewDump = 'View dump (schema) of table'; -$strViewHasBeenDropped = 'View %s has been dropped'; -$strViewMaxExactCount = 'This view has more than %s rows. Please refer to %sdocumentation%s.'; -$strViewName = 'VIEW name'; -$strView = 'View'; - -$strWebServerUploadDirectoryError = 'The directory you set for upload work cannot be reached'; -$strWebServerUploadDirectory = 'web server upload directory'; -$strWelcome = 'Welcome to %s'; -$strWestEuropean = 'West European'; -$strWildcard = 'wildcard'; -$strWindowNotFound = 'The target browser window could not be updated. Maybe you have closed the parent window, or your browser\'s security settings are configured to block cross-window updates.'; -$strWithChecked = 'With selected:'; -$strWriteRequests = 'Write requests'; -$strWrongUser = 'Wrong username/password. Access denied.'; - -$strXML = 'XML'; - -$strYes = 'Yes'; - -$strZeroRemovesTheLimit = 'Note: Setting these options to 0 (zero) removes the limit.'; -$strZip = '"zipped"'; - -?> diff --git a/htdocs/sql/lang/remove_message.sh b/htdocs/sql/lang/remove_message.sh deleted file mode 100755 --- a/htdocs/sql/lang/remove_message.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# $Id: remove_message.sh 5152 2003-11-18 15:20:45Z nijel $ -# -# Shell script that removes a message from all message files (Lem9) -# it checks for the message, followed by a space -# -# Example: remove_message.sh 'strMessageToRemove' -# - -if [ $# -ne 1 ] ; then - echo "usage: remove_message.sh 'strMessageToRemove'" - exit 1 -fi - -for file in *.inc.php -do - echo "lines before:" `wc -l $file` - grep -v "$1 " ${file} > ${file}.new - rm $file - mv ${file}.new $file - echo " lines after:" `wc -l $file` -done -echo " " diff --git a/htdocs/sql/lang/sort_lang.sh b/htdocs/sql/lang/sort_lang.sh deleted file mode 100755 --- a/htdocs/sql/lang/sort_lang.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# $Id: sort_lang.sh 5206 2003-11-26 20:42:58Z nijel $ -## -# Shell script to make each language file neat and tidy -# -# Robin Johnson -# August 9, 2002 -## - -specialsort() -{ - in=$1 - out=$2 - - STRINGORDER="A B C D E F G H I J K L M N O P Q R S T U V W X Y Z" - - for i in $STRINGORDER; - do - egrep '^\$str'$i $in | sort >> $out - echo >> $out - done -} - -sortlang() -{ - f=$1 - targetdir=tmp-$f - mkdir -p $targetdir - - TRANSLATIONSTRING='//.*translate.*$' - STRINGSTRING='^\$str[[:alnum:]_]+' - WHITESPACE='^[[:blank:]]*$' - CVSID='/\* \$Id: sort_lang.sh 5206 2003-11-26 20:42:58Z nijel $ \*/' - - echo -n "Extracting:" - echo -n " head" - egrep -i -v $TRANSLATIONSTRING $f | \ - egrep -v "$STRINGSTRING|$CVSID|\?>|<\?php" >> $targetdir/head - - echo -n " cvs" - egrep "$CVSID" $f >>$targetdir/cvs - - echo -n " strings" - egrep -i -v "$WHITESPACE|$TRANSLATIONSTRING" $f | \ - egrep $STRINGSTRING > $targetdir/tmp-tosort - - echo -n " pending_translations" - egrep -i "$STRINGSTRING.*$TRANSLATIONSTRING" $f > $targetdir/tmp-translate - echo - - echo -n "Building:" - echo -n " strings" - specialsort $targetdir/tmp-tosort $targetdir/sort - - echo -n " pending_translations" - if [ -s $targetdir/tmp-translate ] ; then - echo '// To translate:' > $targetdir/translate - specialsort $targetdir/tmp-translate $targetdir/translate - else - echo -n > $targetdir/translate - fi - echo - - echo "Assembling final" - echo " $f - cat $targetdir/cvs $targetdir/head $targetdir/sort $targetdir/translate \ - | uniq >> $f - echo "?>" >> $f - - rm -rf $targetdir -} - -echo "-------------------------------------------------------------------" -for i in "$@"; -do - if [ ! -f $i ] ; then - echo "$i is not a file, skipping" - else - echo "Sorting $i" - sortlang $i - fi - echo "-------------------------------------------------------------------" -done; diff --git a/htdocs/sql/lang/sync_lang.sh b/htdocs/sql/lang/sync_lang.sh deleted file mode 100755 --- a/htdocs/sql/lang/sync_lang.sh +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/sh -# $Id: sync_lang.sh 11213 2008-04-23 17:13:43Z lem9 $ -## -# Shell script that synchronises all translations in phpMyAdmin -## -# Any parameters (except --iconv/--recode) will be passed to grep to filter -# processed translation, for example: './sync_lang.sh czech' will process only -# czech translation, './sync_lang.sh -e czech -e english' will process czech -# and english translations. -## -# Written by Michal Cihar -## -# Changes: -# 2005-12-08 -# * less verbose output to allow quick overview -# 2005-11-29 -# * hack for multibyte chars, so that \'; at the end will not fool PHP -# 2004-09-22 -# * default to iconv, as it doesn't break things as recode does -# 2004-09-03 -# * hack for hebrew -# 2003-11-18 -# * switch php3 -> php -# 2003-04-14 -# * convert only files that are needed to convert (checks mtime), --force to -# avoid this checking -# * get charset from filename when reading from file failed -# * report failed translations at the end -# 2002-09-18 -# * now accepts parameters --iconv/--recode for specifying which convertor -# to use -# 2002-08-13 -# * support for synchronisation only for selected language(s) -# 2002-07-18 -# * can exclude some languages from conversion -# 2002-07-17 -# * support for multiple convertors (recode added) -## - -## -# convertor setup -## -# CONVERTOR_PARAMS is used for printf and it also receives two params: source -# and target charset -# - -case "$1" in - --iconv) - echo Using iconv on user request - CONVERTOR=iconv - # the space on following is REQUIRED - CONVERTOR_PARAMS=" -f %s -t %s" - shift - ;; - --recode) - echo Using recode on user request - echo '(please use iconv for arabic)' - CONVERTOR=recode - CONVERTOR_PARAMS=" -f %s..%s" - shift - ;; - *) - echo Using iconv as default, force with --iconv/--recode - CONVERTOR=iconv - # the space on following is REQUIRED - CONVERTOR_PARAMS=" -f %s -t %s" - ;; -esac - -if [ "$1" = "--force" ] ; then - FORCE=1 - shift -else - FORCE=0 -fi - - -## -# names of translations to process -## -# Here should be listed all translations for which conversion should be done. -# The name is filename without inc.php. -# -BASE_TRANSLATIONS="afrikaans-iso-8859-1 -albanian-iso-8859-1 -arabic-windows-1256 -azerbaijani-iso-8859-9 -basque-iso-8859-1 -belarusian_cyrillic-windows-1251 -belarusian_latin-utf-8 -bosnian-windows-1250 -brazilian_portuguese-iso-8859-1 -bulgarian-utf-8 -catalan-iso-8859-1 -chinese_traditional-utf-8 -chinese_simplified-gb2312 -croatian-utf-8 -czech-utf-8 -danish-iso-8859-1 -dutch-iso-8859-1 -english-iso-8859-1 -estonian-iso-8859-1 -finnish-iso-8859-1 -french-iso-8859-1 -galician-iso-8859-1 -german-utf-8 -greek-iso-8859-7 -hebrew-iso-8859-8-i -hungarian-iso-8859-2 -indonesian-iso-8859-1 -italian-utf-8 -japanese-utf-8 -korean-utf-8 -latvian-windows-1257 -lithuanian-windows-1257 -malay-iso-8859-1 -macedonian_cyrillic-windows-1251 -norwegian-iso-8859-1 -persian-windows-1256 -polish-iso-8859-2 -portuguese-iso-8859-1 -romanian-utf-8 -russian-windows-1251 -serbian_cyrillic-utf-8 -serbian_latin-utf-8 -slovenian-iso-8859-2 -slovak-utf-8 -spanish-utf-8 -swedish-iso-8859-1 -tatarish-iso-8859-9 -thai-utf-8 -turkish-utf-8 -ukrainian-windows-1251" - -## -# which translations should not be translated to utf-8 -## -# List here any translation that should not be converted to utf-8. The name is -# same as above. -# -IGNORE_UTF="" - -## -# which translations should not be automatically generated -## -# List here any translation should not be automatically generated from base -# translation for that language (usually for those which are not correctly -# supported by convertor). -# -IGNORE_TRANSLATIONS=" -russian-cp-866" - -## -# end of configuration, you hopefully won't need to edit anything bellow -## - -TEMPFILE=`mktemp /tmp/pma-sync-lang.XXXXXX` - -cleanup() { - rm -f $TEMPFILE -} - -trap cleanup INT ABRT TERM - -FAILED="" - -echo "-------------------------------------------------------------------" -# go through all file we should process -for base in $BASE_TRANSLATIONS ; do - if [ "$#" -gt 0 ] ; then - if ( echo $base | grep -q "$@" ) ; then - true - else - continue - fi - fi - # grep language from basename - lang=$(echo $base|sed 's%-.*%%') - # which files will we create from current? - create_files=$(ls --color=none -1 $lang*.inc.php|grep -v $base.inc.php) - - for ignore in $IGNORE_TRANSLATIONS ; do - create_files=$(echo "$create_files" | grep -v $ignore) - done - - # charset of source file - src_charset=$(grep '\$charset' $base.inc.php | sed "s%^[^'\"]*['\"]\\([^'\"]*\\)['\"][^'\"]*$%\\1%") - replace_charset=$src_charset - # special case for hebrew - if [ $src_charset = 'iso-8859-8-i' ] ; then - src_charset=iso-8859-8 - fi - echo -n "$base [charset $src_charset]" - - # do we already have utf-8 translation? - if [ $src_charset = 'utf-8' ] ; then - is_utf=yes - else - is_utf=no - fi - - # at first update existing translations - for file in $create_files ; do - # charset of destination file - - # grepping from file causes problems when it is empty... - charset=$(grep '\$charset' $file | sed "s%^[^'\"]*['\"]\\([^'\"]*\\)['\"][^'\"]*$%\\1%") - if [ -z "$charset" ] ; then - charset=$(echo $file | sed -e 's/^[^-]*-//' -e 's/\.inc\.php\?$//') - fi - - if [ $charset = 'utf-8' ] ; then - is_utf=yes - fi - - # check whether we need to update translation - if [ ! "$base.inc.php" -nt "$file" -a "$FORCE" -eq 0 -a -s "$file" ] ; then - echo -n " ($file:ok)" - continue - fi - - echo -n " ($file:to $charset:" - if [ $charset = 'utf-8' ] ; then - # if we convert to utf-8, we should add allow_recoding - is_utf=yes - $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed -e "s/$replace_charset/$charset/" -e '/\$charset/a\ -$allow_recoding = TRUE;' > $TEMPFILE - elif [ $src_charset = 'utf-8' ] ; then - is_utf=yes - # if we convert from utf-8, we should remove allow_recoding - $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| grep -v allow_recoding | sed "s/$replace_charset/$charset/" > $TEMPFILE - else - # just convert - $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed "s/$replace_charset/$charset/" > $TEMPFILE - fi - if [ -s $TEMPFILE ] ; then - sed "s/\\\\';[[:space:]]\+$/\\\\\\\\';/" $TEMPFILE > $file - echo -n 'done)' - else - FAILED="$FAILED $file" - echo -n 'FAILED)' - fi - done - - # now check whether we found utf-8 translation - if [ $is_utf = no ] ; then - if ( echo $IGNORE_UTF | grep -q $base ) ; then - # utf-8 should not be created - true - else - # we should create utf-8 translation - charset=utf-8 - file=$lang-$charset.inc.php - echo -n " [$file:$charset:" - $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed -e "s/$replace_charset/$charset/" -e '/\$charset/a\ -$allow_recoding = TRUE;' > $TEMPFILE - if [ -s $TEMPFILE ] ; then - cat $TEMPFILE > $file - echo -n 'done)' - else - FAILED="$FAILED $file" - echo -n 'FAILED)' - fi - fi - fi - echo -done - -echo "-------------------------------------------------------------------" - -if [ -z "$FAILED" ] ; then - echo "Everything seems to went okay" -else - echo "!!!SOME CONVERSION FAILED!!!" - echo "Following file were NOT updated:" - echo - echo "$FAILED" - echo - echo "!!!SOME CONVERSION FAILED!!!" -fi - -cleanup diff --git a/htdocs/sql/lang/translatecount.sh b/htdocs/sql/lang/translatecount.sh deleted file mode 100755 --- a/htdocs/sql/lang/translatecount.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: translatecount.sh 5152 2003-11-18 15:20:45Z nijel $ -## -# Shell script to produce counts of just how out of date the translations are! -## -# Accepts optional parameters of a list of files to produce counts from -# Defaults to using all files -## -# Written by Robin Johnson -## -srcfilelist=${@} -destfilelist="" -translationmatch='//to translate' -suffixtoremove='.inc.php' -added=0 -if [ -z "${srcfilelist}" ]; then - srcfilelist="*.inc.php" - added=1 -fi; -for i in ${srcfilelist}; do - if [ ! -e ${i} ]; then - $i=`eval ${i}*php3` - fi - if [ -e ${i} ]; then - destfilelist="${destfilelist} ${i}" - fi; -done; -destfilelist=`echo ${destfilelist} | xargs -n1 | egrep '.inc.php$'` -if [ ! -z "${destfilelist}" ]; then - grep -c -- "${translationmatch}" ${destfilelist} | sort -t':' -n +1 | sed -e "s/${suffixtoremove}//g" | xargs -n1 | egrep -v ':0$' -fi; diff --git a/htdocs/sql/libraries/.htaccess b/htdocs/sql/libraries/.htaccess deleted file mode 100755 --- a/htdocs/sql/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/htdocs/sql/libraries/Config.class.php b/htdocs/sql/libraries/Config.class.php deleted file mode 100755 --- a/htdocs/sql/libraries/Config.class.php +++ /dev/null @@ -1,1054 +0,0 @@ -settings = array(); - - // functions need to refresh in case of config file changed goes in - // PMA_Config::load() - $this->load($source); - - // other settings, independant from config file, comes in - $this->checkSystem(); - - $this->checkIsHttps(); - } - - /** - * sets system and application settings - */ - function checkSystem() - { - $this->set('PMA_VERSION', '2.11.9.5'); - /** - * @deprecated - */ - $this->set('PMA_THEME_VERSION', 2); - /** - * @deprecated - */ - $this->set('PMA_THEME_GENERATION', 2); - - $this->checkPhpVersion(); - $this->checkWebServerOs(); - $this->checkWebServer(); - $this->checkGd2(); - $this->checkClient(); - $this->checkUpload(); - $this->checkUploadSize(); - $this->checkOutputCompression(); - } - - /** - * wether to use gzip output compression or not - */ - function checkOutputCompression() - { - // If zlib output compression is set in the php configuration file, no - // output buffering should be run - if (@ini_get('zlib.output_compression')) { - $this->set('OBGzip', false); - } - - // disable output-buffering (if set to 'auto') for IE6, else enable it. - if (strtolower($this->get('OBGzip')) == 'auto') { - if ($this->get('PMA_USR_BROWSER_AGENT') == 'IE' - && $this->get('PMA_USR_BROWSER_VER') >= 6 - && $this->get('PMA_USR_BROWSER_VER') < 7) { - $this->set('OBGzip', false); - } else { - $this->set('OBGzip', true); - } - } - } - - /** - * Determines platform (OS), browser and version of the user - * Based on a phpBuilder article: - * @see http://www.phpbuilder.net/columns/tim20000821.php - */ - function checkClient() - { - if (PMA_getenv('HTTP_USER_AGENT')) { - $HTTP_USER_AGENT = PMA_getenv('HTTP_USER_AGENT'); - } elseif (!isset($HTTP_USER_AGENT)) { - $HTTP_USER_AGENT = ''; - } - - // 1. Platform - if (strstr($HTTP_USER_AGENT, 'Win')) { - $this->set('PMA_USR_OS', 'Win'); - } elseif (strstr($HTTP_USER_AGENT, 'Mac')) { - $this->set('PMA_USR_OS', 'Mac'); - } elseif (strstr($HTTP_USER_AGENT, 'Linux')) { - $this->set('PMA_USR_OS', 'Linux'); - } elseif (strstr($HTTP_USER_AGENT, 'Unix')) { - $this->set('PMA_USR_OS', 'Unix'); - } elseif (strstr($HTTP_USER_AGENT, 'OS/2')) { - $this->set('PMA_USR_OS', 'OS/2'); - } else { - $this->set('PMA_USR_OS', 'Other'); - } - - // 2. browser and version - // (must check everything else before Mozilla) - - if (preg_match('@Opera(/| )([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) { - $this->set('PMA_USR_BROWSER_VER', $log_version[2]); - $this->set('PMA_USR_BROWSER_AGENT', 'OPERA'); - } elseif (preg_match('@MSIE ([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) { - $this->set('PMA_USR_BROWSER_VER', $log_version[1]); - $this->set('PMA_USR_BROWSER_AGENT', 'IE'); - } elseif (preg_match('@OmniWeb/([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) { - $this->set('PMA_USR_BROWSER_VER', $log_version[1]); - $this->set('PMA_USR_BROWSER_AGENT', 'OMNIWEB'); - //} elseif (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) { - // Konqueror 2.2.2 says Konqueror/2.2.2 - // Konqueror 3.0.3 says Konqueror/3 - } elseif (preg_match('@(Konqueror/)(.*)(;)@', $HTTP_USER_AGENT, $log_version)) { - $this->set('PMA_USR_BROWSER_VER', $log_version[2]); - $this->set('PMA_USR_BROWSER_AGENT', 'KONQUEROR'); - } elseif (preg_match('@Mozilla/([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version) - && preg_match('@Safari/([0-9]*)@', $HTTP_USER_AGENT, $log_version2)) { - $this->set('PMA_USR_BROWSER_VER', $log_version[1] . '.' . $log_version2[1]); - $this->set('PMA_USR_BROWSER_AGENT', 'SAFARI'); - } elseif (preg_match('@rv:1.9(.*)Gecko@', $HTTP_USER_AGENT)) { - $this->set('PMA_USR_BROWSER_VER', '1.9'); - $this->set('PMA_USR_BROWSER_AGENT', 'GECKO'); - } elseif (preg_match('@Mozilla/([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) { - $this->set('PMA_USR_BROWSER_VER', $log_version[1]); - $this->set('PMA_USR_BROWSER_AGENT', 'MOZILLA'); - } else { - $this->set('PMA_USR_BROWSER_VER', 0); - $this->set('PMA_USR_BROWSER_AGENT', 'OTHER'); - } - } - - /** - * Whether GD2 is present - */ - function checkGd2() - { - if ($this->get('GD2Available') == 'yes') { - $this->set('PMA_IS_GD2', 1); - } elseif ($this->get('GD2Available') == 'no') { - $this->set('PMA_IS_GD2', 0); - } else { - if (!@extension_loaded('gd')) { - PMA_dl('gd'); - } - if (!@function_exists('imagecreatetruecolor')) { - $this->set('PMA_IS_GD2', 0); - } else { - if (@function_exists('gd_info')) { - $gd_nfo = gd_info(); - if (strstr($gd_nfo["GD Version"], '2.')) { - $this->set('PMA_IS_GD2', 1); - } else { - $this->set('PMA_IS_GD2', 0); - } - } else { - /* We must do hard way... */ - ob_start(); - phpinfo(INFO_MODULES); /* Only modules */ - $a = strip_tags(ob_get_contents()); - ob_end_clean(); - /* Get GD version string from phpinfo output */ - if (preg_match('@GD Version[[:space:]]*\(.*\)@', $a, $v)) { - if (strstr($v, '2.')) { - $this->set('PMA_IS_GD2', 1); - } else { - $this->set('PMA_IS_GD2', 0); - } - } else { - $this->set('PMA_IS_GD2', 0); - } - } - } - } - } - - /** - * Whether the Web server php is running on is IIS - */ - function checkWebServer() - { - if (PMA_getenv('SERVER_SOFTWARE') - // some versions return Microsoft-IIS, some Microsoft/IIS - // we could use a preg_match() but it's slower - && stristr(PMA_getenv('SERVER_SOFTWARE'), 'Microsoft') - && stristr(PMA_getenv('SERVER_SOFTWARE'), 'IIS')) { - $this->set('PMA_IS_IIS', 1); - } else { - $this->set('PMA_IS_IIS', 0); - } - } - - /** - * Whether the os php is running on is windows or not - */ - function checkWebServerOs() - { - // Default to Unix or Equiv - $this->set('PMA_IS_WINDOWS', 0); - // If PHP_OS is defined then continue - if (defined('PHP_OS')) { - if (stristr(PHP_OS, 'win')) { - // Is it some version of Windows - $this->set('PMA_IS_WINDOWS', 1); - } elseif (stristr(PHP_OS, 'OS/2')) { - // Is it OS/2 (No file permissions like Windows) - $this->set('PMA_IS_WINDOWS', 1); - } - } - } - - /** - * detects PHP version - */ - function checkPhpVersion() - { - $match = array(); - if (! preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', - phpversion(), $match)) { - $result = preg_match('@([0-9]{1,2}).([0-9]{1,2})@', - phpversion(), $match); - } - if (isset($match) && ! empty($match[1])) { - if (! isset($match[2])) { - $match[2] = 0; - } - if (! isset($match[3])) { - $match[3] = 0; - } - $this->set('PMA_PHP_INT_VERSION', - (int) sprintf('%d%02d%02d', $match[1], $match[2], $match[3])); - } else { - $this->set('PMA_PHP_INT_VERSION', 0); - } - $this->set('PMA_PHP_STR_VERSION', phpversion()); - } - - /** - * re-init object after loading from session file - * checks config file for changes and relaods if neccessary - */ - function __wakeup() - { - if (! $this->checkConfigSource() - || $this->source_mtime !== filemtime($this->getSource()) - || $this->default_source_mtime !== filemtime($this->default_source) - || $this->error_config_file - || $this->error_config_default_file) { - $this->settings = array(); - $this->load(); - $this->checkSystem(); - } - - // check for https needs to be done everytime, - // as https and http uses same session so this info can not be stored - // in session - $this->checkIsHttps(); - - $this->checkCollationConnection(); - $this->checkFontsize(); - } - - /** - * loads default values from default source - * - * @uses file_exists() - * @uses $this->default_source - * @uses $this->error_config_default_file - * @uses $this->settings - * @return boolean success - */ - function loadDefaults() - { - $cfg = array(); - if (! file_exists($this->default_source)) { - $this->error_config_default_file = true; - return false; - } - include $this->default_source; - - $this->default_source_mtime = filemtime($this->default_source); - - $this->default_server = $cfg['Servers'][1]; - unset($cfg['Servers']); - - $this->settings = PMA_array_merge_recursive($this->settings, $cfg); - - $this->error_config_default_file = false; - - return true; - } - - /** - * loads configuration from $source, usally the config file - * should be called on object creation and from __wakeup if config file - * has changed - * - * @param string $source config file - */ - function load($source = null) - { - $this->loadDefaults(); - - if (null !== $source) { - $this->setSource($source); - } - - if (! $this->checkConfigSource()) { - return false; - } - - $cfg = array(); - - /** - * Parses the configuration file - */ - $old_error_reporting = error_reporting(0); - // avoid "headers already sent" error when file contains a BOM - ob_start(); - if (function_exists('file_get_contents')) { - $eval_result = - eval('?>' . trim(file_get_contents($this->getSource()))); - } else { - $eval_result = - eval('?>' . trim(implode("\n", file($this->getSource())))); - } - ob_end_clean(); - error_reporting($old_error_reporting); - - if ($eval_result === false) { - $this->error_config_file = true; - } else { - $this->error_config_file = false; - $this->source_mtime = filemtime($this->getSource()); - } - - /** - * Backward compatibility code - */ - if (!empty($cfg['DefaultTabTable'])) { - $cfg['DefaultTabTable'] = str_replace('_properties', '', str_replace('tbl_properties.php', 'tbl_sql.php', $cfg['DefaultTabTable'])); - } - if (!empty($cfg['DefaultTabDatabase'])) { - $cfg['DefaultTabDatabase'] = str_replace('_details', '', str_replace('db_details.php', 'db_sql.php', $cfg['DefaultTabDatabase'])); - } - - $this->checkFontsize(); - //$this->checkPmaAbsoluteUri(); - $this->settings = PMA_array_merge_recursive($this->settings, $cfg); - - // Handling of the collation must be done after merging of $cfg - // (from config.inc.php) so that $cfg['DefaultConnectionCollation'] - // can have an effect. Note that the presence of collation - // information in a cookie has priority over what is defined - // in the default or user's config files. - /** - * @todo check validity of $_COOKIE['pma_collation_connection'] - */ - if (! empty($_COOKIE['pma_collation_connection'])) { - $this->set('collation_connection', - strip_tags($_COOKIE['pma_collation_connection'])); - } else { - $this->set('collation_connection', - $this->get('DefaultConnectionCollation')); - } - // Now, a collation information could come from REQUEST - // (an example of this: the collation selector in main.php) - // so the following handles the setting of collation_connection - // and later, in common.inc.php, the cookie will be set - // according to this. - $this->checkCollationConnection(); - - return true; - } - - /** - * set source - * @param string $source - */ - function setSource($source) - { - $this->source = trim($source); - } - - /** - * checks if the config folder still exists and terminates app if true - */ - function checkConfigFolder() - { - // Refuse to work while there still might be some world writable dir: - if (is_dir('./config')) { - die('Remove "./config" directory before using phpMyAdmin!'); - } - } - - /** - * check config source - * - * @return boolean wether source is valid or not - */ - function checkConfigSource() - { - if (! $this->getSource()) { - // no configuration file set at all - return false; - } - - if (! file_exists($this->getSource())) { - // do not trigger error here - // https://sf.net/tracker/?func=detail&aid=1370269&group_id=23067&atid=377408 - /* - trigger_error( - 'phpMyAdmin-ERROR: unkown configuration source: ' . $source, - E_USER_WARNING); - */ - $this->source_mtime = 0; - return false; - } - - if (! is_readable($this->getSource())) { - $this->source_mtime = 0; - die('Existing configuration file (' . $this->getSource() . ') is not readable.'); - } - - // Check for permissions (on platforms that support it): - $perms = @fileperms($this->getSource()); - if (!($perms === false) && ($perms & 2)) { - // This check is normally done after loading configuration - $this->checkWebServerOs(); - if ($this->get('PMA_IS_WINDOWS') == 0) { - $this->source_mtime = 0; - die('Wrong permissions on configuration file, should not be world writable!'); - } - } - - return true; - } - - /** - * returns specific config setting - * @param string $setting - * @return mixed value - */ - function get($setting) - { - if (isset($this->settings[$setting])) { - return $this->settings[$setting]; - } - return null; - } - - /** - * sets configuration variable - * - * @uses $this->settings - * @param string $setting configuration option - * @param string $value new value for configuration option - */ - function set($setting, $value) - { - if (!isset($this->settings[$setting]) || $this->settings[$setting] != $value) { - $this->settings[$setting] = $value; - $this->set_mtime = time(); - } - } - - /** - * returns source for current config - * @return string config source - */ - function getSource() - { - return $this->source; - } - - /** - * old PHP 4 style constructor - * - * @deprecated - */ - function PMA_Config($source = null) - { - $this->__construct($source); - } - - /** - * returns a unique value to force a CSS reload if either the config - * or the theme changes; - * must also check the pma_fontsize cookie in case there is no - * config file - * @return int Unix timestamp - */ - function getThemeUniqueValue() - { - return intval((null !== $_SESSION['PMA_Config']->get('fontsize') ? $_SESSION['PMA_Config']->get('fontsize') : $_COOKIE['pma_fontsize'])) + ($this->source_mtime + $this->default_source_mtime + $_SESSION['PMA_Theme']->mtime_info + $_SESSION['PMA_Theme']->filesize_info); - } - - /** - * $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be - * set properly and, depending on browsers, inserting or updating a - * record might fail - */ - function checkPmaAbsoluteUri() - { - // Setup a default value to let the people and lazy syadmins work anyway, - // they'll get an error if the autodetect code doesn't work - $pma_absolute_uri = $this->get('PmaAbsoluteUri'); - $is_https = $this->get('is_https'); - - if (strlen($pma_absolute_uri) < 5 - // needed to catch http/https switch - || ($is_https && substr($pma_absolute_uri, 0, 6) != 'https:') - || (!$is_https && substr($pma_absolute_uri, 0, 5) != 'http:') - ) { - $url = array(); - - // At first we try to parse REQUEST_URI, it might contain full URL - if (PMA_getenv('REQUEST_URI')) { - $url = @parse_url(PMA_getenv('REQUEST_URI')); // produces E_WARNING if it cannot get parsed, e.g. '/foobar:/' - if ($url === false) { - $url = array('path' => $_SERVER['REQUEST_URI']); - } - } - - // If we don't have scheme, we didn't have full URL so we need to - // dig deeper - if (empty($url['scheme'])) { - // Scheme - if (PMA_getenv('HTTP_SCHEME')) { - $url['scheme'] = PMA_getenv('HTTP_SCHEME'); - } else { - $url['scheme'] = - PMA_getenv('HTTPS') && strtolower(PMA_getenv('HTTPS')) != 'off' - ? 'https' - : 'http'; - } - - // Host and port - if (PMA_getenv('HTTP_HOST')) { - if (strpos(PMA_getenv('HTTP_HOST'), ':') !== false) { - list($url['host'], $url['port']) = - explode(':', PMA_getenv('HTTP_HOST')); - } else { - $url['host'] = PMA_getenv('HTTP_HOST'); - } - } elseif (PMA_getenv('SERVER_NAME')) { - $url['host'] = PMA_getenv('SERVER_NAME'); - } else { - $this->error_pma_uri = true; - return false; - } - - // If we didn't set port yet... - if (empty($url['port']) && PMA_getenv('SERVER_PORT')) { - $url['port'] = PMA_getenv('SERVER_PORT'); - } - - // And finally the path could be already set from REQUEST_URI - if (empty($url['path'])) { - if (PMA_getenv('PATH_INFO')) { - $path = parse_url(PMA_getenv('PATH_INFO')); - } else { - // PHP_SELF in CGI often points to cgi executable, so use it - // as last choice - $path = parse_url(PMA_getenv('PHP_SELF')); - } - $url['path'] = $path['path']; - } - } - - // Make url from parts we have - $pma_absolute_uri = $url['scheme'] . '://'; - // Was there user information? - if (!empty($url['user'])) { - $pma_absolute_uri .= $url['user']; - if (!empty($url['pass'])) { - $pma_absolute_uri .= ':' . $url['pass']; - } - $pma_absolute_uri .= '@'; - } - // Add hostname - $pma_absolute_uri .= $url['host']; - // Add port, if it not the default one - if (! empty($url['port']) - && (($url['scheme'] == 'http' && $url['port'] != 80) - || ($url['scheme'] == 'https' && $url['port'] != 443))) { - $pma_absolute_uri .= ':' . $url['port']; - } - // And finally path, without script name, the 'a' is there not to - // strip our directory, when path is only /pmadir/ without filename. - // Backslashes returned by Windows have to be changed. - // Only replace backslashes by forward slashes if on Windows, - // as the backslash could be valid on a non-Windows system. - if ($this->get('PMA_IS_WINDOWS') == 1) { - $path = str_replace("\\", "/", dirname($url['path'] . 'a')); - } else { - $path = dirname($url['path'] . 'a'); - } - - // To work correctly within transformations overview: - if (defined('PMA_PATH_TO_BASEDIR') && PMA_PATH_TO_BASEDIR == '../../') { - if ($this->get('PMA_IS_WINDOWS') == 1) { - $path = str_replace("\\", "/", dirname(dirname($path))); - } else { - $path = dirname(dirname($path)); - } - } - // in vhost situations, there could be already an ending slash - if (substr($path, -1) != '/') { - $path .= '/'; - } - $pma_absolute_uri .= $path; - - // We used to display a warning if PmaAbsoluteUri wasn't set, but now - // the autodetect code works well enough that we don't display the - // warning at all. The user can still set PmaAbsoluteUri manually. - // See - // http://sf.net/tracker/?func=detail&aid=1257134&group_id=23067&atid=377411 - - } else { - // The URI is specified, however users do often specify this - // wrongly, so we try to fix this. - - // Adds a trailing slash et the end of the phpMyAdmin uri if it - // does not exist. - if (substr($pma_absolute_uri, -1) != '/') { - $pma_absolute_uri .= '/'; - } - - // If URI doesn't start with http:// or https://, we will add - // this. - if (substr($pma_absolute_uri, 0, 7) != 'http://' - && substr($pma_absolute_uri, 0, 8) != 'https://') { - $pma_absolute_uri = - (PMA_getenv('HTTPS') && strtolower(PMA_getenv('HTTPS')) != 'off' - ? 'https' - : 'http') - . ':' . (substr($pma_absolute_uri, 0, 2) == '//' ? '' : '//') - . $pma_absolute_uri; - } - } - $this->set('PmaAbsoluteUri', $pma_absolute_uri); - } - - /** - * check selected collation_connection - * @todo check validity of $_REQUEST['collation_connection'] - */ - function checkCollationConnection() - { - // (could be improved by executing it after the MySQL connection only if - // PMA_MYSQL_INT_VERSION >= 40100) - if (! empty($_REQUEST['collation_connection'])) { - $this->set('collation_connection', - strip_tags($_REQUEST['collation_connection'])); - } - } - - /** - * checks for font size configuration, and sets font size as requested by user - * - * @uses $_GET - * @uses $_POST - * @uses $_COOKIE - * @uses preg_match() - * @uses function_exists() - * @uses PMA_Config::set() - * @uses PMA_Config::get() - * @uses PMA_setCookie() - */ - function checkFontsize() - { - $new_fontsize = ''; - - if (isset($_GET['fontsize'])) { - $new_fontsize = $_GET['fontsize']; - } elseif (isset($_POST['fontsize'])) { - $new_fontsize = $_POST['fontsize']; - } elseif (isset($_COOKIE['pma_fontsize'])) { - $new_fontsize = $_COOKIE['pma_fontsize']; - } - - if (preg_match('/^[0-9.]+(px|em|pt|\%)$/', $new_fontsize)) { - $this->set('fontsize', $new_fontsize); - } elseif (! $this->get('fontsize')) { - // 80% would correspond to the default browser font size - // of 16, but use 82% to help read the monoface font - $this->set('fontsize', '82%'); - } - - if (function_exists('PMA_setCookie')) { - PMA_setCookie('pma_fontsize', $this->get('fontsize'), '82%'); - } - } - - /** - * checks if upload is enabled - * - */ - function checkUpload() - { - if (ini_get('file_uploads')) { - $this->set('enable_upload', true); - // if set "php_admin_value file_uploads Off" in httpd.conf - // ini_get() also returns the string "Off" in this case: - if ('off' == strtolower(ini_get('file_uploads'))) { - $this->set('enable_upload', false); - } - } else { - $this->set('enable_upload', false); - } - } - - /** - * Maximum upload size as limited by PHP - * Used with permission from Moodle (http://moodle.org) by Martin Dougiamas - * - * this section generates $max_upload_size in bytes - */ - function checkUploadSize() - { - if (! $filesize = ini_get('upload_max_filesize')) { - $filesize = "5M"; - } - - if ($postsize = ini_get('post_max_size')) { - $this->set('max_upload_size', - min(PMA_get_real_size($filesize), PMA_get_real_size($postsize))); - } else { - $this->set('max_upload_size', PMA_get_real_size($filesize)); - } - } - - /** - * check for https - */ - function checkIsHttps() - { - $this->set('is_https', PMA_Config::isHttps()); - } - - /** - * @static - */ - function isHttps() - { - $is_https = false; - - $url = array(); - - // At first we try to parse REQUEST_URI, it might contain full URL, - if (PMA_getenv('REQUEST_URI')) { - $url = @parse_url(PMA_getenv('REQUEST_URI')); // produces E_WARNING if it cannot get parsed, e.g. '/foobar:/' - if($url === false) { - $url = array(); - } - } - - // If we don't have scheme, we didn't have full URL so we need to - // dig deeper - if (empty($url['scheme'])) { - // Scheme - if (PMA_getenv('HTTP_SCHEME')) { - $url['scheme'] = PMA_getenv('HTTP_SCHEME'); - } else { - $url['scheme'] = - PMA_getenv('HTTPS') && strtolower(PMA_getenv('HTTPS')) != 'off' - ? 'https' - : 'http'; - } - } - - if (isset($url['scheme']) - && $url['scheme'] == 'https') { - $is_https = true; - } else { - $is_https = false; - } - - return $is_https; - } - - /** - * detect correct cookie path - */ - function checkCookiePath() - { - $this->set('cookie_path', PMA_Config::getCookiePath()); - } - - /** - * @static - */ - function getCookiePath() - { - static $cookie_path = null; - - if (null !== $cookie_path) { - return $cookie_path; - } - - $url = ''; - - if (PMA_getenv('REQUEST_URI')) { - $url = PMA_getenv('REQUEST_URI'); - } - - // If we don't have path - if (empty($url)) { - if (PMA_getenv('PATH_INFO')) { - $url = PMA_getenv('PATH_INFO'); - // on IIS with PHP-CGI: - } elseif (PMA_getenv('SCRIPT_NAME')) { - $url = PMA_getenv('SCRIPT_NAME'); - } elseif (PMA_getenv('PHP_SELF')) { - // PHP_SELF in CGI often points to cgi executable, so use it - // as last choice - $url = PMA_getenv('PHP_SELF'); - } - } - - $parsed_url = @parse_url($_SERVER['REQUEST_URI']); // produces E_WARNING if it cannot get parsed, e.g. '/foobar:/' - if ($parsed_url === false || empty($parsed_url['path'])) { - $parsed_url = array('path' => $url); - } - - $cookie_path = substr($parsed_url['path'], 0, strrpos($parsed_url['path'], '/')) . '/'; - - return $cookie_path; - } - - /** - * enables backward compatibility - */ - function enableBc() - { - $GLOBALS['cfg'] = $this->settings; - $GLOBALS['default_server'] = $this->default_server; - unset($this->default_server); - $GLOBALS['collation_connection'] = $this->get('collation_connection'); - $GLOBALS['is_upload'] = $this->get('enable_upload'); - $GLOBALS['max_upload_size'] = $this->get('max_upload_size'); - $GLOBALS['cookie_path'] = $this->get('cookie_path'); - $GLOBALS['is_https'] = $this->get('is_https'); - - $defines = array( - 'PMA_VERSION', - 'PMA_THEME_VERSION', - 'PMA_THEME_GENERATION', - 'PMA_PHP_STR_VERSION', - 'PMA_PHP_INT_VERSION', - 'PMA_IS_WINDOWS', - 'PMA_IS_IIS', - 'PMA_IS_GD2', - 'PMA_USR_OS', - 'PMA_USR_BROWSER_VER', - 'PMA_USR_BROWSER_AGENT' - ); - - foreach ($defines as $define) { - if (! defined($define)) { - define($define, $this->get($define)); - } - } - } - - /** - * @todo finish - */ - function save() {} - - /** - * returns options for font size selection - * - * @uses preg_replace() - * @uses ksort() - * @static - * @param string $current_size current selected font size with unit - * @return array selectable font sizes - */ - function getFontsizeOptions($current_size = '82%') - { - $unit = preg_replace('/[0-9.]*/', '', $current_size); - $value = preg_replace('/[^0-9.]*/', '', $current_size); - - $factors = array(); - $options = array(); - $options["$value"] = $value . $unit; - - if ($unit === '%') { - $factors[] = 1; - $factors[] = 5; - $factors[] = 10; - } elseif ($unit === 'em') { - $factors[] = 0.05; - $factors[] = 0.2; - $factors[] = 1; - } elseif ($unit === 'pt') { - $factors[] = 0.5; - $factors[] = 2; - } elseif ($unit === 'px') { - $factors[] = 1; - $factors[] = 5; - $factors[] = 10; - } else { - //unknown font size unit - $factors[] = 0.05; - $factors[] = 0.2; - $factors[] = 1; - $factors[] = 5; - $factors[] = 10; - } - - foreach ($factors as $key => $factor) { - $option_inc = $value + $factor; - $option_dec = $value - $factor; - while (count($options) < 21) { - $options["$option_inc"] = $option_inc . $unit; - if ($option_dec > $factors[0]) { - $options["$option_dec"] = $option_dec . $unit; - } - $option_inc += $factor; - $option_dec -= $factor; - if (isset($factors[$key + 1]) - && $option_inc >= $value + $factors[$key + 1]) { - break; - } - } - } - ksort($options); - return $options; - } - - /** - * returns html selectbox for font sizes - * - * @uses $_SESSION['PMA_Config'] - * @uses PMA_Config::get() - * @uses PMA_Config::getFontsizeOptions() - * @uses $GLOBALS['strFontSize'] - * @static - * @param string $current_size currently slected font size with unit - * @return string html selectbox - */ - function getFontsizeSelection() - { - $current_size = $_SESSION['PMA_Config']->get('fontsize'); - // for the case when there is no config file (this is supported) - if (empty($current_size)) { - if (isset($_COOKIE['pma_fontsize'])) { - $current_size = $_COOKIE['pma_fontsize']; - } else { - $current_size = '82%'; - } - } - $options = PMA_Config::getFontsizeOptions($current_size); - - $return = '' . "\n"; - $return .= ''; - - return $return; - } - - /** - * return complete font size selection form - * - * @uses PMA_generate_common_hidden_inputs() - * @uses PMA_Config::getFontsizeSelection() - * @uses $GLOBALS['strGo'] - * @static - * @param string $current_size currently slected font size with unit - * @return string html selectbox - */ - function getFontsizeForm() - { - return '
' . "\n" - . PMA_generate_common_hidden_inputs() . "\n" - . PMA_Config::getFontsizeSelection() . "\n" - . '' . "\n" - . '
'; - } -} -?> diff --git a/htdocs/sql/libraries/File.class.php b/htdocs/sql/libraries/File.class.php deleted file mode 100755 --- a/htdocs/sql/libraries/File.class.php +++ /dev/null @@ -1,880 +0,0 @@ -__construct($name); - } - - /** - * constructor - * - * @access public - * @uses PMA_File::setName() - * @param string $name file name - */ - function __construct($name = false) - { - if ($name) { - $this->setName($name); - } - } - - /** - * destructor - * - * @see PMA_File::cleanUp() - * @access public - * @uses PMA_File::cleanUp() - */ - function __destruct() - { - $this->cleanUp(); - } - - /** - * deletes file if it is temporary, usally from a moved upload file - * - * @access public - * @uses PMA_File::delet() - * @uses PMA_File::isTemp() - * @return boolean success - */ - function cleanUp() - { - if ($this->isTemp()) { - return $this->delete(); - } - - return true; - } - - /** - * deletes the file - * - * @access public - * @uses PMA_File::getName() - * @uses unlink() - * @return boolean success - */ - function delete() - { - return unlink($this->getName()); - } - - /** - * checks or sets the temp flag for this file - * file objects with temp flags are deleted with object destruction - * - * @access public - * @uses PMA_File::$_is_temp to set and read it - * @param boolean sets the temp flag - * @return boolean PMA_File::$_is_temp - */ - function isTemp($is_temp = null) - { - if (null !== $is_temp) { - $this->_is_temp = (bool) $is_temp; - } - - return $this->_is_temp; - } - - /** - * accessor - * - * @access public - * @uses PMA_File::$_name - * @param string $name file name - * @access public - */ - function setName($name) - { - $this->_name = trim($name); - } - - /** - * @access public - * @uses PMA_File::getName() - * @uses PMA_File::isUploaded() - * @uses PMA_File::checkUploadedFile() - * @uses PMA_File::isReadable() - * @uses PMA_File::$_content - * @uses function_exists() - * @uses file_get_contents() - * @uses filesize() - * @uses fread() - * @uses fopen() - * @uses bin2hex() - * @return string binary file content - */ - function getContent($as_binary = true, $offset = 0, $length = null) - { - if (null === $this->_content) { - if ($this->isUploaded() && ! $this->checkUploadedFile()) { - return false; - } - - if (! $this->isReadable()) { - return false; - } - - if (function_exists('file_get_contents')) { - $this->_content = file_get_contents($this->getName()); - } elseif ($size = filesize($this->getName())) { - $this->_content = fread(fopen($this->getName(), 'rb'), $size); - } - } - - if (! empty($this->_content) && $as_binary) { - return '0x' . bin2hex($this->_content); - } - - if (null !== $length) { - return substr($this->_content, $offset, $length); - } elseif ($offset > 0) { - return substr($this->_content, $offset); - } - - return $this->_content; - } - - /** - * @access public - * @uses PMA_File::getName() - * @uses is_uploaded_file() - */ - function isUploaded() - { - return is_uploaded_file($this->getName()); - } - - /** - * accessor - * - * @access public - * @uses PMA_File::$name as return value - * @return string PMA_File::$_name - */ - function getName() - { - return $this->_name; - } - - /** - * @todo replace error message with localized string - * @access public - * @uses PMA_File::isUploaded() - * @uses PMA_File::setName() - * @uses PMA_File::$_error_message - * @param string name of file uploaded - * @return boolean success - */ - function setUploadedFile($name) - { - $this->setName($name); - - if (! $this->isUploaded()) { - $this->setName(null); - $this->_error_message = 'not an uploaded file'; - return false; - } - - return true; - } - - /** - * @access public - * @uses PMA_File::fetchUploadedFromTblChangeRequestMultiple() - * @uses PMA_File::setUploadedFile() - * @uses PMA_File::$_error_message - * @uses $GLOBALS['strUploadErrorIniSize'] - * @uses $GLOBALS['strUploadErrorFormSize'] - * @uses $GLOBALS['strUploadErrorPartial'] - * @uses $GLOBALS['strUploadErrorNoTempDir'] - * @uses $GLOBALS['strUploadErrorCantWrite'] - * @uses $GLOBALS['strUploadErrorExtension'] - * @uses $GLOBALS['strUploadErrorUnknown'] - * @uses $_FILES - * @param string $key a numeric key used to identify the different rows - * @param string $primary_key - * @return boolean success - */ - function setUploadedFromTblChangeRequest($key, $primary = null) - { - if (! isset($_FILES['fields_upload_' . $key])) { - return false; - } - - $file = $_FILES['fields_upload_' . $key]; - if (null !== $primary) { - $file = PMA_File::fetchUploadedFromTblChangeRequestMultiple($file, $primary); - } - - // check for file upload errors - switch ($file['error']) { - // cybot_tm: we do not use the PHP constants here cause not all constants - // are defined in all versions of PHP - but the correct constants names - // are given as comment - case 0: //UPLOAD_ERR_OK: - return $this->setUploadedFile($file['tmp_name']); - break; - case 4: //UPLOAD_ERR_NO_FILE: - break; - case 1: //UPLOAD_ERR_INI_SIZE: - $this->_error_message = $GLOBALS['strUploadErrorIniSize']; - break; - case 2: //UPLOAD_ERR_FORM_SIZE: - $this->_error_message = $GLOBALS['strUploadErrorFormSize']; - break; - case 3: //UPLOAD_ERR_PARTIAL: - $this->_error_message = $GLOBALS['strUploadErrorPartial']; - break; - case 6: //UPLOAD_ERR_NO_TMP_DIR: - $this->_error_message = $GLOBALS['strUploadErrorNoTempDir']; - break; - case 7: //UPLOAD_ERR_CANT_WRITE: - $this->_error_message = $GLOBALS['strUploadErrorCantWrite']; - break; - case 8: //UPLOAD_ERR_EXTENSION: - $this->_error_message = $GLOBALS['strUploadErrorExtension']; - break; - default: - $this->_error_message = $GLOBALS['strUploadErrorUnknown']; - } // end switch - - return false; - } - - /** - * strips some dimension from the multi-dimensional array from $_FILES - * - * - * $file['name']['multi_edit'][$primary] = [value] - * $file['type']['multi_edit'][$primary] = [value] - * $file['size']['multi_edit'][$primary] = [value] - * $file['tmp_name']['multi_edit'][$primary] = [value] - * $file['error']['multi_edit'][$primary] = [value] - * - * // becomes: - * - * $file['name'] = [value] - * $file['type'] = [value] - * $file['size'] = [value] - * $file['tmp_name'] = [value] - * $file['error'] = [value] - * - * - * @todo re-check if requirements changes to PHP >= 4.2.0 - * @access public - * @static - * @param array $file the array - * @param string $primary - * @return array - */ - function fetchUploadedFromTblChangeRequestMultiple($file, $primary) - { - $new_file = array( - 'name' => $file['name']['multi_edit'][$primary], - 'type' => $file['type']['multi_edit'][$primary], - 'size' => $file['size']['multi_edit'][$primary], - 'tmp_name' => $file['tmp_name']['multi_edit'][$primary], - //'error' => $file['error']['multi_edit'][$primary], - ); - - // ['error'] exists since PHP 4.2.0 - if (isset($file['error'])) { - $new_file['error'] = $file['error']['multi_edit'][$primary]; - } - - return $new_file; - } - - /** - * sets the name if the file to the one selected in the tbl_change form - * - * @access public - * @uses $_REQUEST - * @uses PMA_File::setLocalSelectedFile() - * @uses is_string() - * @param string $key a numeric key used to identify the different rows - * @param string $primary_key - * @return boolean success - */ - function setSelectedFromTblChangeRequest($key, $primary = null) - { - if (null !== $primary) { - if (! empty($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]) - && is_string($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary])) { - // ... whether with multiple rows ... - return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]); - } else { - return false; - } - } elseif (! empty($_REQUEST['fields_uploadlocal_' . $key]) - && is_string($_REQUEST['fields_uploadlocal_' . $key])) { - return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]); - } - - return false; - } - - /** - * @access public - * @uses PMA_File->$_error_message as return value - * @return string error message - */ - function getError() - { - return $this->_error_message; - } - - /** - * @access public - * @uses PMA_File->$_error_message to check it - * @return boolean whether an error occured or not - */ - function isError() - { - return ! empty($this->_error_message); - } - - /** - * checks the superglobals provided if the tbl_change form is submitted - * and uses the submitted/selected file - * - * @access public - * @uses PMA_File::setUploadedFromTblChangeRequest() - * @uses PMA_File::setSelectedFromTblChangeRequest() - * @param string $key a numeric key used to identify the different rows - * @param string $primary_key - * @return boolean success - */ - function checkTblChangeForm($key, $primary_key) - { - if ($this->setUploadedFromTblChangeRequest($key, $primary_key)) { - // well done ... - $this->_error_message = ''; - return true; -/* - } elseif ($this->setUploadedFromTblChangeRequest($key)) { - // well done ... - $this->_error_message = ''; - return true; -*/ - } elseif ($this->setSelectedFromTblChangeRequest($key, $primary_key)) { - // well done ... - $this->_error_message = ''; - return true; -/* - } elseif ($this->setSelectedFromTblChangeRequest($key)) { - // well done ... - $this->_error_message = ''; - return true; -*/ - } - // all failed, whether just no file uploaded/selected or an error - - return false; - } - - /** - * - * @access public - * @uses $GLOBALS['strFileCouldNotBeRead'] - * @uses PMA_File::setName() - * @uses PMA_securePath() - * @uses PMA_userDir() - * @uses $GLOBALS['cfg']['UploadDir'] - * @param string $name - * @return boolean success - */ - function setLocalSelectedFile($name) - { - if (empty($GLOBALS['cfg']['UploadDir'])) return false; - - $this->setName(PMA_userDir($GLOBALS['cfg']['UploadDir']) . PMA_securePath($name)); - if (! $this->isReadable()) { - $this->_error_message = $GLOBALS['strFileCouldNotBeRead']; - $this->setName(null); - return false; - } - - return true; - } - - /** - * @access public - * @uses PMA_File::getName() - * @uses is_readable() - * @uses ob_start() - * @uses ob_end_clean() - * @return boolean whether the file is readable or not - */ - function isReadable() - { - // surpress warnings from beeing displayed, but not from beeing logged - // any file access outside of open_basedir will issue a warning - ob_start(); - $is_readable = is_readable($this->getName()); - ob_end_clean(); - return $is_readable; - } - - /** - * If we are on a server with open_basedir, we must move the file - * before opening it. The FAQ 1.11 explains how to create the "./tmp" - * directory - if needed - * - * @todo replace error message with localized string - * @todo move check of $cfg['TempDir'] into PMA_Config? - * @access public - * @uses $cfg['TempDir'] - * @uses $GLOBALS['strFieldInsertFromFileTempDirNotExists'] - * @uses PMA_File::isReadable() - * @uses PMA_File::getName() - * @uses PMA_File::setName() - * @uses PMA_File::isTemp() - * @uses PMA_File::$_error_message - * @uses is_dir() - * @uses mkdir() - * @uses chmod() - * @uses is_writable() - * @uses basename() - * @uses move_uploaded_file() - * @uses ob_start() - * @uses ob_end_clean() - * @return boolean whether uploaded fiel is fine or not - */ - function checkUploadedFile() - { - if ($this->isReadable()) { - return true; - } - - /** - * it is not important if open_basedir is set - we just cannot read the file - * so we try to move it - if ('' != ini_get('open_basedir')) { - */ - - // check tmp dir config - if (empty($GLOBALS['cfg']['TempDir'])) { - $GLOBALS['cfg']['TempDir'] = 'tmp/'; - } - - // surpress warnings from beeing displayed, but not from beeing logged - ob_start(); - // check tmp dir - if (! is_dir($GLOBALS['cfg']['TempDir'])) { - // try to create the tmp directory - if (@mkdir($GLOBALS['cfg']['TempDir'], 0777)) { - chmod($GLOBALS['cfg']['TempDir'], 0777); - } else { - // create tmp dir failed - $this->_error_message = $GLOBALS['strFieldInsertFromFileTempDirNotExists']; - ob_end_clean(); - return false; - } - } - ob_end_clean(); - - if (! is_writable($GLOBALS['cfg']['TempDir'])) { - // cannot create directory or access, point user to FAQ 1.11 - $this->_error_message = $GLOBALS['strFieldInsertFromFileTempDirNotExists']; - return false; - } - - $new_file_to_upload = $GLOBALS['cfg']['TempDir'] . '/' . basename($this->getName()); - - // surpress warnings from beeing displayed, but not from beeing logged - // any file access outside of open_basedir will issue a warning - ob_start(); - $move_uploaded_file_result = move_uploaded_file($this->getName(), $new_file_to_upload); - ob_end_clean(); - if (! $move_uploaded_file_result) { - $this->_error_message = 'error while moving uploaded file'; - return false; - } - - $this->setName($new_file_to_upload); - $this->isTemp(true); - - if (! $this->isReadable()) { - $this->_error_message = 'cannot read (moved) upload file'; - return false; - } - - return true; - } - - /** - * Detects what compression filse uses - * - * @todo move file read part into readChunk() or getChunk() - * @todo add support for compression plugins - * @uses $GLOBALS['strFileCouldNotBeRead'] - * @uses PMA_File::$_compression to set it - * @uses PMA_File::getName() - * @uses fopen() - * @uses fread() - * @uses strlen() - * @uses fclose() - * @uses chr() - * @uses substr() - * @access protected - * @return string MIME type of compression, none for none - */ - function _detectCompression() - { - // surpress warnings from beeing displayed, but not from beeing logged - // f.e. any file access outside of open_basedir will issue a warning - ob_start(); - $file = fopen($this->getName(), 'rb'); - ob_end_clean(); - - if (! $file) { - $this->_error_message = $GLOBALS['strFileCouldNotBeRead']; - return false; - } - - /** - * @todo - * get registered plugins for file compression - - foreach (PMA_getPlugins($type = 'compression') as $plugin) { - if (call_user_func_array(array($plugin['classname'], 'canHandle'), array($this->getName()))) { - $this->setCompressionPlugin($plugin); - break; - } - } - */ - - $test = fread($file, 4); - $len = strlen($test); - fclose($file); - - if ($len >= 2 && $test[0] == chr(31) && $test[1] == chr(139)) { - $this->_compression = 'application/gzip'; - } elseif ($len >= 3 && substr($test, 0, 3) == 'BZh') { - $this->_compression = 'application/bzip2'; - } elseif ($len >= 4 && $test == "PK\003\004") { - $this->_compression = 'application/zip'; - } else { - $this->_compression = 'none'; - } - - return $this->_compression; - } - - /** - * whether the content should be decompressed before returned - */ - function setDecompressContent($decompress) - { - $this->_decompress = (bool) $decompress; - } - - function getHandle() - { - if (null === $this->_handle) { - $this->open(); - } - return $this->_handle; - } - - function setHandle($handle) - { - $this->_handle = $handle; - } - - /** - * - */ - function open() - { - if (! $this->_decompress) { - $this->_handle = @fopen($this->getName(), 'r'); - } - - switch ($this->getCompression()) { - case false: - return false; - case 'application/bzip2': - if ($GLOBALS['cfg']['BZipDump'] && @function_exists('bzopen')) { - $this->_handle = @bzopen($this->getName(), 'r'); - } else { - $this->_error_message = sprintf($GLOBALS['strUnsupportedCompressionDetected'], $this->getCompression()); - return false; - } - break; - case 'application/gzip': - if ($GLOBALS['cfg']['GZipDump'] && @function_exists('gzopen')) { - $this->_handle = @gzopen($this->getName(), 'r'); - } else { - $this->_error_message = sprintf($GLOBALS['strUnsupportedCompressionDetected'], $this->getCompression()); - return false; - } - break; - case 'application/zip': - if ($GLOBALS['cfg']['GZipDump'] && @function_exists('gzinflate')) { - include_once './libraries/unzip.lib.php'; - $this->_handle = new SimpleUnzip(); - $this->_handle->ReadFile($this->getName()); - if ($this->_handle->Count() == 0) { - $this->_error_message = $GLOBALS['strNoFilesFoundInZip']; - return false; - } elseif ($this->_handle->GetError(0) != 0) { - $this->_error_message = $GLOBALS['strErrorInZipFile'] . ' ' . $this->_handle->GetErrorMsg(0); - return false; - } else { - $this->content_uncompressed = $this->_handle->GetData(0); - } - // We don't need to store it further - $this->_handle = null; - } else { - $this->_error_message = sprintf($GLOBALS['strUnsupportedCompressionDetected'], $this->getCompression()); - return false; - } - break; - case 'none': - $this->_handle = @fopen($this->getName(), 'r'); - break; - default: - $this->_error_message = sprintf($GLOBALS['strUnsupportedCompressionDetected'], $this->getCompression()); - return false; - break; - } - - - } - - function getCharset() - { - return $this->_charset; - } - - function setCharset($charset) - { - $this->_charset = $charset; - } - - /** - * @uses PMA_File::$_compression as return value - * @uses PMA_File::detectCompression() - * @return string MIME type of compression, none for none - * @access public - */ - function getCompression() - { - if (null === $this->_compression) { - return $this->_detectCompression(); - } - - return $this->_compression; - } - - /** - * advances the file pointer in the file handle by $length bytes/chars - * - * @param integer $length numbers of chars/bytes to skip - * @return boolean - */ - function advanceFilePointer($length) - { - while ($length > 0) { - // Disable read progresivity, otherwise we eat all memory! - $read_multiply = 1; // required? - $this->getNextChunk($length); - $length -= $this->getChunkSize(); - } - } - - /** - * http://bugs.php.net/bug.php?id=29532 - * bzip reads a maximum of 8192 bytes on windows systems - * - */ - function getNextChunk($max_size = null) - { - if (null !== $max_size) { - $size = min($max_size, $this->getChunkSize()); - } else { - $size = $this->getChunkSize(); - } - - // $result = $this->handler->getNextChunk($size); - $result = ''; - switch ($this->getCompression()) { - case 'application/bzip2': - $result = ''; - while (strlen($result) < $size - 8192 && ! feof($this->getHandle())) { - $result .= bzread($this->getHandle(), $size); - } - break; - case 'application/gzip': - $result = gzread($this->getHandle(), $size); - break; - case 'application/zip': - include_once './libraries/unzip.lib.php'; - $import_handle = new SimpleUnzip(); - $import_handle->ReadFile($this->getName()); - if ($import_handle->Count() == 0) { - $this->_error_message = $GLOBALS['strNoFilesFoundInZip']; - return false; - } elseif ($import_handle->GetError(0) != 0) { - $this->_error_message = $GLOBALS['strErrorInZipFile'] - . ' ' . $import_handle->GetErrorMsg(0); - return false; - } else { - $result = $import_handle->GetData(0); - } - break; - case 'none': - $result = fread($this->getHandle(), $size); - break; - default: - return false; - } - - echo $size . ' - '; - echo strlen($result) . ' - '; - echo (@$GLOBALS['__len__'] += strlen($result)) . ' - '; - echo $this->_error_message; - echo '
'; - - if ($GLOBALS['charset_conversion']) { - $result = PMA_convert_string($this->getCharset(), $GLOBALS['charset'], $result); - } else { - /** - * Skip possible byte order marks (I do not think we need more - * charsets, but feel free to add more, you can use wikipedia for - * reference: ) - * - * @todo BOM could be used for charset autodetection - */ - if ($this->getOffset() === 0) { - // UTF-8 - if (strncmp($result, "\xEF\xBB\xBF", 3) == 0) { - $result = substr($result, 3); - // UTF-16 BE, LE - } elseif (strncmp($result, "\xFE\xFF", 2) == 0 - || strncmp($result, "\xFF\xFE", 2) == 0) { - $result = substr($result, 2); - } - } - } - - $this->_offset += $size; - if (0 === $result) { - return true; - } - return $result; - } - - function getOffset() - { - return $this->_offset; - } - - function getChunkSize() - { - return $this->_chunk_size; - } - - function setChunkSize($chunk_size) - { - $this->_chunk_size = (int) $chunk_size; - } - - function getContentLength() - { - return strlen($this->_content); - } - - function eof() - { - if ($this->getHandle()) { - return feof($this->getHandle()); - } else { - return ($this->getOffset() >= $this->getContentLength()); - } - - } -} -?> diff --git a/htdocs/sql/libraries/List.class.php b/htdocs/sql/libraries/List.class.php deleted file mode 100755 --- a/htdocs/sql/libraries/List.class.php +++ /dev/null @@ -1,161 +0,0 @@ -items); - } - - /** - * returns item only if there is only one in the list - * - * @uses PMA_List::count() to decide what to return - * @uses PMA_List::getFirst() to return it - * @uses PMA_List::getEmpty() to return it - * @return single item - */ - function getSingleItem() - { - if ($this->count() === 1) { - return $this->getFirst(); - } - - return $this->getEmpty(); - } - - /** - * returns list item count - * - * @uses PMA_List::$items to count it items - * @uses count() to count items in PMA_List::$items - * @return integer PMA_List::$items count - */ - function count() - { - return count($this->items); - } - - /** - * defines what is an empty item (0, '', false or null) - * - * @uses PMA_List::$item_empty as return value - * @return mixed an empty item - */ - function getEmpty() - { - return $this->item_empty; - } - - /** - * checks if the given db names exists in the current list, if there is - * missing at least one item it reutrns false other wise true - * - * @uses PMA_List::$items to check for existence of specific item - * @uses func_get_args() - * @uses in_array() to check if given arguments exists in PMA_List::$items - * @param string $db_name,.. one or more mysql result resources - * @return boolean true if all items exists, otheriwse false - */ - function exists() - { - foreach (func_get_args() as $result) { - if (! in_array($result, $this->items)) { - return false; - } - } - - return true; - } - - /** - * returns HTML ' . "\n"; - } - $output .= '' . "\n"; - return $output; - } - - /** - * returns array of storage engines for MySQL < 4.1, hard coded - * Emulating SHOW STORAGE ENGINES... - * - * @static - * @access public - * @uses PMA_DBI_query() - * @uses PMA_DBI_fetch_row() - * @uses PMA_DBI_free_result() - * @uses substr() - * @return array of storage engines - */ - function getStorageEnginesBefore40102() - { - $storage_engines = array( - 'myisam' => array( - 'Engine' => 'MyISAM', - 'Support' => 'DEFAULT' - ), - 'merge' => array( - 'Engine' => 'MERGE', - 'Support' => 'YES' - ), - 'heap' => array( - 'Engine' => 'HEAP', - 'Support' => 'YES' - ), - 'memory' => array( - 'Engine' => 'MEMORY', - 'Support' => 'YES' - ) - ); - $known_engines = array( - 'archive' => 'ARCHIVE', - 'bdb' => 'BDB', - 'csv' => 'CSV', - 'innodb' => 'InnoDB', - 'isam' => 'ISAM', - 'gemini' => 'Gemini' - ); - $res = PMA_DBI_query('SHOW VARIABLES LIKE \'have\\_%\';'); - while ($row = PMA_DBI_fetch_row($res)) { - $current = substr($row[0], 5); - if (! empty($known_engines[$current])) { - $storage_engines[$current] = array( - 'Engine' => $known_engines[$current], - 'Support' => $row[1] - ); - } - } - PMA_DBI_free_result($res); - - return $storage_engines; - } - - - /** - * public static final PMA_StorageEngine getEngine() - * - * Loads the corresponding engine plugin, if available. - * - * @uses str_replace() - * @uses file_exists() - * @uses PMA_StorageEngine - * @param string $engine The engine ID - * @return object The engine plugin - */ - function getEngine($engine) - { - $engine = str_replace('/', '', str_replace('.', '', $engine)); - $engine_lowercase_filename = strtolower($engine); - if (file_exists('./libraries/engines/' . $engine_lowercase_filename . '.lib.php') - && include_once './libraries/engines/' . $engine_lowercase_filename . '.lib.php') { - $class_name = 'PMA_StorageEngine_' . $engine; - $engine_object = new $class_name($engine); - } else { - $engine_object = new PMA_StorageEngine($engine); - } - return $engine_object; - } - - /** - * return true if given engine name is supported/valid, otherwise false - * - * @static - * @uses PMA_StorageEngine::getStorageEngines() - * @param string $engine name of engine - * @reutrn boolean whether $engine is valid or not - */ - function isValid($engine) - { - $storage_engines = PMA_StorageEngine::getStorageEngines(); - return isset($storage_engines[$engine]); - } - - /** - * returns as HTML table of the engine's server variables - * - * @uses PMA_ENGINE_DETAILS_TYPE_SIZE - * @uses PMA_ENGINE_DETAILS_TYPE_NUMERIC - * @uses PMA_StorageEngine::getVariablesStatus() - * @uses $GLOBALS['strNoDetailsForEngine'] - * @uses PMA_showHint() - * @uses PMA_formatByteDown() - * @uses PMA_formatNumber() - * @uses htmlspecialchars() - * @return string The table that was generated based on the retrieved information - */ - function getHtmlVariables() - { - $odd_row = false; - $ret = ''; - - foreach ($this->getVariablesStatus() as $details) { - $ret .= '' . "\n" - . ' ' . "\n"; - if (!empty($details['desc'])) { - $ret .= ' ' . PMA_showHint($details['desc']) . "\n"; - } - $ret .= ' ' . "\n" - . ' ' . htmlspecialchars($details['title']) . '' . "\n" - . ' '; - switch ($details['type']) { - case PMA_ENGINE_DETAILS_TYPE_SIZE: - $parsed_size = PMA_formatByteDown($details['value']); - $ret .= $parsed_size[0] . ' ' . $parsed_size[1]; - unset($parsed_size); - break; - case PMA_ENGINE_DETAILS_TYPE_NUMERIC: - $ret .= PMA_formatNumber($details['value']) . ' '; - break; - default: - $ret .= htmlspecialchars($details['value']) . ' '; - } - $ret .= '' . "\n" - . '' . "\n"; - $odd_row = !$odd_row; - } - - if (! $ret) { - $ret = '

' . "\n" - . ' ' . $GLOBALS['strNoDetailsForEngine'] . "\n" - . '

' . "\n"; - } else { - $ret = '' . "\n" . $ret . '
' . "\n"; - } - - return $ret; - } - - /** - * returns array with detailed info about engine specific server variables - * - * @uses PMA_ENGINE_DETAILS_TYPE_PLAINTEXT - * @uses PMA_StorageEngine::getVariables() - * @uses PMA_StorageEngine::getVariablesLikePattern() - * @uses PMA_MYSQL_INT_VERSION - * @uses PMA_DBI_query() - * @uses PMA_DBI_fetch_assoc() - * @uses PMA_DBI_free_result() - * @return array with detailed info about specific engine server variables - */ - function getVariablesStatus() - { - $variables = $this->getVariables(); - $like = $this->getVariablesLikePattern(); - - if ($like) { - $like = " LIKE '" . $like . "' "; - } else { - $like = ''; - } - - if (PMA_MYSQL_INT_VERSION >= 40102) { - $global = ' GLOBAL '; - } else { - $global = ''; - } - - $mysql_vars = array(); - - $sql_query = 'SHOW ' . $global . ' VARIABLES ' . $like . ';'; - $res = PMA_DBI_query($sql_query); - while ($row = PMA_DBI_fetch_assoc($res)) { - if (isset($variables[$row['Variable_name']])) { - $mysql_vars[$row['Variable_name']] = $variables[$row['Variable_name']]; - } elseif (! $like - && strpos(strtolower($row['Variable_name']), strtolower($this->engine)) !== 0) { - continue; - } - $mysql_vars[$row['Variable_name']]['value'] = $row['Value']; - - if (empty($mysql_vars[$row['Variable_name']]['title'])) { - $mysql_vars[$row['Variable_name']]['title'] = $row['Variable_name']; - } - - if (! isset($mysql_vars[$row['Variable_name']]['type'])) { - $mysql_vars[$row['Variable_name']]['type'] = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT; - } - } - PMA_DBI_free_result($res); - - return $mysql_vars; - } - - /** - * Constructor - * - * @uses PMA_StorageEngine::getStorageEngines() - * @uses PMA_ENGINE_SUPPORT_DEFAULT - * @uses PMA_ENGINE_SUPPORT_YES - * @uses PMA_ENGINE_SUPPORT_DISABLED - * @uses PMA_ENGINE_SUPPORT_NO - * @uses $this->engine - * @uses $this->title - * @uses $this->comment - * @uses $this->support - * @param string $engine The engine ID - */ - function __construct($engine) - { - $storage_engines = PMA_StorageEngine::getStorageEngines(); - if (!empty($storage_engines[$engine])) { - $this->engine = $engine; - $this->title = $storage_engines[$engine]['Engine']; - $this->comment = - (isset($storage_engines[$engine]['Comment']) - ? $storage_engines[$engine]['Comment'] - : ''); - switch ($storage_engines[$engine]['Support']) { - case 'DEFAULT': - $this->support = PMA_ENGINE_SUPPORT_DEFAULT; - break; - case 'YES': - $this->support = PMA_ENGINE_SUPPORT_YES; - break; - case 'DISABLED': - $this->support = PMA_ENGINE_SUPPORT_DISABLED; - break; - case 'NO': - default: - $this->support = PMA_ENGINE_SUPPORT_NO; - } - } - } - - /** - * old PHP 4 style constructor - * @deprecated - * @see PMA_StorageEngine::__construct() - * @uses PMA_StorageEngine::__construct() - * @param string $engine engine name - */ - function PMA_StorageEngine($engine) - { - $this->__construct($engine); - } - - /** - * public String getTitle() - * - * Reveals the engine's title - * @uses $this->title - * @return string The title - */ - function getTitle() - { - return $this->title; - } - - /** - * public String getComment() - * - * Fetches the server's comment about this engine - * @uses $this->comment - * @return string The comment - */ - function getComment() - { - return $this->comment; - } - - /** - * public String getSupportInformationMessage() - * - * @uses $GLOBALS['strDefaultEngine'] - * @uses $GLOBALS['strEngineAvailable'] - * @uses $GLOBALS['strEngineDisabled'] - * @uses $GLOBALS['strEngineUnsupported'] - * @uses $GLOBALS['strEngineUnsupported'] - * @uses PMA_ENGINE_SUPPORT_DEFAULT - * @uses PMA_ENGINE_SUPPORT_YES - * @uses PMA_ENGINE_SUPPORT_DISABLED - * @uses PMA_ENGINE_SUPPORT_NO - * @uses $this->support - * @uses $this->title - * @uses sprintf - * @return string The localized message. - */ - function getSupportInformationMessage() - { - switch ($this->support) { - case PMA_ENGINE_SUPPORT_DEFAULT: - $message = $GLOBALS['strDefaultEngine']; - break; - case PMA_ENGINE_SUPPORT_YES: - $message = $GLOBALS['strEngineAvailable']; - break; - case PMA_ENGINE_SUPPORT_DISABLED: - $message = $GLOBALS['strEngineDisabled']; - break; - case PMA_ENGINE_SUPPORT_NO: - default: - $message = $GLOBALS['strEngineUnsupported']; - } - return sprintf($message, htmlspecialchars($this->title)); - } - - /** - * public string[][] getVariables() - * - * Generates a list of MySQL variables that provide information about this - * engine. This function should be overridden when extending this class - * for a particular engine. - * - * @abstract - * @return Array The list of variables. - */ - function getVariables() - { - return array(); - } - - /** - * returns string with filename for the MySQL helppage - * about this storage engne - * - * @return string mysql helppage filename - */ - function getMysqlHelpPage() - { - return $this->engine . '-storage-engine'; - } - - /** - * public string getVariablesLikePattern() - * - * @abstract - * @return string SQL query LIKE pattern - */ - function getVariablesLikePattern() - { - return false; - } - - /** - * public String[] getInfoPages() - * - * Returns a list of available information pages with labels - * - * @abstract - * @return array The list - */ - function getInfoPages() - { - return array(); - } - - /** - * public String getPage() - * - * Generates the requested information page - * - * @abstract - * @param string $id The page ID - * - * @return string The page - * boolean or false on error. - */ - function getPage($id) - { - return false; - } -} - -?> diff --git a/htdocs/sql/libraries/Table.class.php b/htdocs/sql/libraries/Table.class.php deleted file mode 100755 --- a/htdocs/sql/libraries/Table.class.php +++ /dev/null @@ -1,1075 +0,0 @@ -setName($table_name); - $this->setDbName($db_name); - } - - /** - * @see PMA_Table::getName() - */ - function __toString() - { - return $this->getName(); - } - - function getLastError() - { - return end($this->errors); - } - - function getLastMessage() - { - return end($this->messages); - } - - /** - * sets table anme - * - * @uses $this->name to set it - * @param string $table_name new table name - */ - function setName($table_name) - { - $this->name = $table_name; - } - - /** - * returns table name - * - * @uses $this->name as return value - * @param boolean wether to quote name with backticks `` - * @return string table name - */ - function getName($quoted = false) - { - if ($quoted) { - return PMA_backquote($this->name); - } - return $this->name; - } - - /** - * sets database name for this table - * - * @uses $this->db_name to set it - * @param string $db_name - */ - function setDbName($db_name) - { - $this->db_name = $db_name; - } - - /** - * returns database name for this table - * - * @uses $this->db_name as return value - * @param boolean wether to quote name with backticks `` - * @return string database name for this table - */ - function getDbName($quoted = false) - { - if ($quoted) { - return PMA_backquote($this->db_name); - } - return $this->db_name; - } - - /** - * returns full name for table, including database name - * - * @param boolean wether to quote name with backticks `` - */ - function getFullName($quoted = false) - { - return $this->getDbName($quoted) . '.' . $this->getName($quoted); - } - - function isView($db = null, $table = null) - { - if (strlen($db) && strlen($table)) { - return PMA_Table::_isView($db, $table); - } - - if (isset($this) && strpos($this->get('TABLE TYPE'), 'VIEW')) { - return true; - } - - return false; - } - - /** - * sets given $value for given $param - * - * @uses $this->settings to add or change value - * @param string param name - * @param mixed param value - */ - function set($param, $value) - { - $this->settings[$param] = $value; - } - - /** - * returns value for given setting/param - * - * @uses $this->settings to return value - * @param string name for value to return - * @return mixed value for $param - */ - function get($param) - { - if (isset($this->settings[$param])) { - return $this->settings[$param]; - } - - return null; - } - - /** - * loads structure data - */ - function loadStructure() - { - $table_info = PMA_DBI_get_tables_full($this->getDbName(), $this->getName()); - - if (false === $table_info) { - return false; - } - - $this->settings = $table_info; - - if ($this->get('TABLE_ROWS') === null) { - $this->set('TABLE_ROWS', PMA_Table::countRecords($this->getDbName(), - $this->getName(), true, true)); - } - - $create_options = explode(' ', $this->get('TABLE_ROWS')); - - // export create options by its name as variables into gloabel namespace - // f.e. pack_keys=1 becomes available as $pack_keys with value of '1' - foreach ($create_options as $each_create_option) { - $each_create_option = explode('=', $each_create_option); - if (isset($each_create_option[1])) { - $this->set($$each_create_option[0], $each_create_option[1]); - } - } - } - - /** - * old PHP 4style constructor - * - * @see PMA_Table::__construct() - */ - function PMA_Table($table_name, $db_name) - { - $this->__construct($table_name, $db_name); - } - - /** - * Checks if this "table" is a view - * - * @deprecated - * @todo see what we could do with the possible existence of $table_is_view - * @param string the database name - * @param string the table name - * - * @return boolean whether this is a view - * - * @access public - */ - function _isView($db, $table) { - // maybe we already know if the table is a view - if (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view']) { - return true; - } - // old MySQL version: no view - if (PMA_MYSQL_INT_VERSION < 50000) { - return false; - } - // This would be the correct way of doing the check but at least in - // MySQL 5.0.33 it's too slow when there are hundreds of databases - // and/or tables (more than 3 minutes for 400 tables) - /*if (false === PMA_DBI_fetch_value('SELECT TABLE_NAME FROM `information_schema`.`VIEWS` WHERE `TABLE_SCHEMA` = \'' . $db . '\' AND `TABLE_NAME` = \'' . $table . '\';')) { - return false; - } else { - return true; - } */ - // A more complete verification would be to check if all columns - // from the result set are NULL except Name and Comment. - // MySQL from 5.0.0 to 5.0.12 returns 'view', - // from 5.0.13 returns 'VIEW'. - $comment = strtoupper(PMA_DBI_fetch_value('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\'', 0, 'Comment')); - // use substr() because the comment might contain something like: - // (VIEW 'BASE2.VTEST' REFERENCES INVALID TABLE(S) OR COLUMN(S) OR FUNCTION) - return (substr($comment, 0, 4) == 'VIEW'); - } - - /** - * generates column/field specification for ALTER or CREATE TABLE syntax - * - * @todo move into class PMA_Column - * @todo on the interface, some js to clear the default value when the default - * current_timestamp is checked - * @static - * @param string $name name - * @param string $type type ('INT', 'VARCHAR', 'BIT', ...) - * @param string $length length ('2', '5,2', '', ...) - * @param string $attribute - * @param string $collation - * @param string $null with 'NULL' or 'NOT NULL' - * @param string $default default value - * @param boolean $default_current_timestamp whether default value is - * CURRENT_TIMESTAMP or not - * this overrides $default value - * @param string $extra 'AUTO_INCREMENT' - * @param string $comment field comment - * @param array &$field_primary list of fields for PRIMARY KEY - * @param string $index - * @param string $default_orig - * @return string field specification - */ - function generateFieldSpec($name, $type, $length = '', $attribute = '', - $collation = '', $null = false, $default = '', - $default_current_timestamp = false, $extra = '', $comment = '', - &$field_primary, $index, $default_orig = false) - { - - $is_timestamp = strpos(' ' . strtoupper($type), 'TIMESTAMP') == 1; - - // $default_current_timestamp has priority over $default - - /** - * @todo include db-name - */ - $query = PMA_backquote($name) . ' ' . $type; - - if ($length != '' - && !preg_match('@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT)$@i', $type)) { - $query .= '(' . $length . ')'; - } - - if ($attribute != '') { - $query .= ' ' . $attribute; - } - - if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($collation) - && $collation != 'NULL' - && preg_match('@^(TINYTEXT|TEXT|MEDIUMTEXT|LONGTEXT|VARCHAR|CHAR|ENUM|SET)$@i', $type)) { - $query .= PMA_generateCharsetQueryPart($collation); - } - - if ($null !== false) { - if (!empty($null)) { - $query .= ' NOT NULL'; - } else { - $query .= ' NULL'; - } - } - - if ($default_current_timestamp && $is_timestamp) { - $query .= ' DEFAULT CURRENT_TIMESTAMP'; - // auto_increment field cannot have a default value - } elseif ($extra !== 'AUTO_INCREMENT' - && (strlen($default) || $default != $default_orig)) { - if (strtoupper($default) == 'NULL') { - $query .= ' DEFAULT NULL'; - } else { - if (strlen($default)) { - if ($is_timestamp && $default == '0') { - // a TIMESTAMP does not accept DEFAULT '0' - // but DEFAULT 0 works - $query .= ' DEFAULT ' . PMA_sqlAddslashes($default); - } elseif ($default && $type == 'BIT') { - $query .= ' DEFAULT b\'' . preg_replace('/[^01]/', '0', $default) . '\''; - } else { - $query .= ' DEFAULT \'' . PMA_sqlAddslashes($default) . '\''; - } - } - } - } - - if (!empty($extra)) { - $query .= ' ' . $extra; - // Force an auto_increment field to be part of the primary key - // even if user did not tick the PK box; - if ($extra == 'AUTO_INCREMENT') { - $primary_cnt = count($field_primary); - if (1 == $primary_cnt) { - for ($j = 0; $j < $primary_cnt && $field_primary[$j] != $index; $j++) { - //void - } - if (isset($field_primary[$j]) && $field_primary[$j] == $index) { - $query .= ' PRIMARY KEY'; - unset($field_primary[$j]); - } - // but the PK could contain other columns so do not append - // a PRIMARY KEY clause, just add a member to $field_primary - } else { - $found_in_pk = false; - for ($j = 0; $j < $primary_cnt; $j++) { - if ($field_primary[$j] == $index) { - $found_in_pk = true; - break; - } - } // end for - if (! $found_in_pk) { - $field_primary[] = $index; - } - } - } // end if (auto_increment) - } - if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($comment)) { - $query .= " COMMENT '" . PMA_sqlAddslashes($comment) . "'"; - } - return $query; - } // end function - - /** - * Counts and returns (or displays) the number of records in a table - * - * Revision 13 July 2001: Patch for limiting dump size from - * vinay@sanisoft.com & girish@sanisoft.com - * - * @param string the current database name - * @param string the current table name - * @param boolean whether to retain or to displays the result - * @param boolean whether to force an exact count - * - * @return mixed the number of records if retain is required, true else - * - * @access public - */ - function countRecords($db, $table, $ret = false, $force_exact = false) - { - $row_count = false; - - if (! $force_exact) { - $row_count = PMA_DBI_fetch_value( - 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' - . PMA_sqlAddslashes($table, true) . '\';', - 0, 'Rows'); - } - - $tbl_is_view = PMA_Table::isView($db, $table); - - // for a VIEW, $row_count is always false at this point - if (false === $row_count || $row_count < $GLOBALS['cfg']['MaxExactCount']) { - if (! $tbl_is_view) { - $row_count = PMA_DBI_fetch_value( - 'SELECT COUNT(*) FROM ' . PMA_backquote($db) . '.' - . PMA_backquote($table)); - } else { - // For complex views, even trying to get a partial record - // count could bring down a server, so we offer an - // alternative: setting MaxExactCountViews to 0 will bypass - // completely the record counting for views - - if ($GLOBALS['cfg']['MaxExactCountViews'] == 0) { - $row_count = 0; - } else { - // Counting all rows of a VIEW could be too long, so use - // a LIMIT clause. - // Use try_query because it can fail (a VIEW is based on - // a table that no longer exists) - $result = PMA_DBI_try_query( - 'SELECT 1 FROM ' . PMA_backquote($db) . '.' - . PMA_backquote($table) . ' LIMIT ' - . $GLOBALS['cfg']['MaxExactCountViews'], - null, PMA_DBI_QUERY_STORE); - if (!PMA_DBI_getError()) { - $row_count = PMA_DBI_num_rows($result); - PMA_DBI_free_result($result); - } - } - } - } - - if ($ret) { - return $row_count; - } - - /** - * @deprecated at the moment nowhere is $return = false used - */ - // Note: as of PMA 2.8.0, we no longer seem to be using - // PMA_Table::countRecords() in display mode. - echo PMA_formatNumber($row_count, 0); - if ($tbl_is_view) { - echo ' ' - . sprintf($GLOBALS['strViewMaxExactCount'], - $GLOBALS['cfg']['MaxExactCount'], - '[a@./Documentation.html#cfg_MaxExactCount@_blank]', '[/a]'); - } - } // end of the 'PMA_Table::countRecords()' function - - /** - * @todo add documentation - */ - function generateAlter($oldcol, $newcol, $type, $length, - $attribute, $collation, $null, $default, $default_current_timestamp, - $extra, $comment='', $default_orig) - { - $empty_a = array(); - return PMA_backquote($oldcol) . ' ' - . PMA_Table::generateFieldSpec($newcol, $type, $length, $attribute, - $collation, $null, $default, $default_current_timestamp, $extra, - $comment, $empty_a, -1, $default_orig); - } // end function - - /** - * Inserts existing entries in a PMA_* table by reading a value from an old entry - * - * @param string The array index, which Relation feature to check - * ('relwork', 'commwork', ...) - * @param string The array index, which PMA-table to update - * ('bookmark', 'relation', ...) - * @param array Which fields will be SELECT'ed from the old entry - * @param array Which fields will be used for the WHERE query - * (array('FIELDNAME' => 'FIELDVALUE')) - * @param array Which fields will be used as new VALUES. These are the important - * keys which differ from the old entry. - * (array('FIELDNAME' => 'NEW FIELDVALUE')) - - * @global string relation variable - * - * @author Garvin Hicking - */ - function duplicateInfo($work, $pma_table, $get_fields, $where_fields, - $new_fields) - { - $last_id = -1; - - if (isset($GLOBALS['cfgRelation']) && $GLOBALS['cfgRelation'][$work]) { - $select_parts = array(); - $row_fields = array(); - foreach ($get_fields as $get_field) { - $select_parts[] = PMA_backquote($get_field); - $row_fields[$get_field] = 'cc'; - } - - $where_parts = array(); - foreach ($where_fields as $_where => $_value) { - $where_parts[] = PMA_backquote($_where) . ' = \'' - . PMA_sqlAddslashes($_value) . '\''; - } - - $new_parts = array(); - $new_value_parts = array(); - foreach ($new_fields as $_where => $_value) { - $new_parts[] = PMA_backquote($_where); - $new_value_parts[] = PMA_sqlAddslashes($_value); - } - - $table_copy_query = ' - SELECT ' . implode(', ', $select_parts) . ' - FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA_backquote($GLOBALS['cfgRelation'][$pma_table]) . ' - WHERE ' . implode(' AND ', $where_parts); - - // must use PMA_DBI_QUERY_STORE here, since we execute another - // query inside the loop - $table_copy_rs = PMA_query_as_cu($table_copy_query, true, - PMA_DBI_QUERY_STORE); - - while ($table_copy_row = @PMA_DBI_fetch_assoc($table_copy_rs)) { - $value_parts = array(); - foreach ($table_copy_row as $_key => $_val) { - if (isset($row_fields[$_key]) && $row_fields[$_key] == 'cc') { - $value_parts[] = PMA_sqlAddslashes($_val); - } - } - - $new_table_query = ' - INSERT IGNORE INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) - . '.' . PMA_backquote($GLOBALS['cfgRelation'][$pma_table]) . ' - (' . implode(', ', $select_parts) . ', - ' . implode(', ', $new_parts) . ') - VALUES - (\'' . implode('\', \'', $value_parts) . '\', - \'' . implode('\', \'', $new_value_parts) . '\')'; - - PMA_query_as_cu($new_table_query); - $last_id = PMA_DBI_insert_id(); - } // end while - - PMA_DBI_free_result($table_copy_rs); - - return $last_id; - } - - return true; - } // end of 'PMA_Table::duplicateInfo()' function - - - /** - * Copies or renames table - * @todo use RENAME for move operations - * - would work only if the databases are on the same filesystem, - * how can we check that? try the operation and - * catch an error? - * - for views, only if MYSQL > 50013 - * - still have to handle pmadb synch. - * - * @author Michal Cihar - */ - function moveCopy($source_db, $source_table, $target_db, $target_table, $what, $move, $mode) - { - global $err_url; - - // set export settings we need - $GLOBALS['sql_backquotes'] = 1; - $GLOBALS['asfile'] = 1; - - // Ensure the target is valid - if (! $GLOBALS['PMA_List_Database']->exists($source_db, $target_db)) { - /** - * @todo exit really needed here? or just a return? - */ - exit; - } - - $source = PMA_backquote($source_db) . '.' . PMA_backquote($source_table); - if (! isset($target_db) || ! strlen($target_db)) { - $target_db = $source_db; - } - - // Doing a select_db could avoid some problems with replicated databases, - // when moving table from replicated one to not replicated one - PMA_DBI_select_db($target_db); - - $target = PMA_backquote($target_db) . '.' . PMA_backquote($target_table); - - // do not create the table if dataonly - if ($what != 'dataonly') { - require_once './libraries/export/sql.php'; - - $no_constraints_comments = true; - $GLOBALS['sql_constraints_query'] = ''; - - $sql_structure = PMA_getTableDef($source_db, $source_table, "\n", $err_url, false, false); - unset($no_constraints_comments); - $parsed_sql = PMA_SQP_parse($sql_structure); - $analyzed_sql = PMA_SQP_analyze($parsed_sql); - $i = 0; - if (empty($analyzed_sql[0]['create_table_fields'])) { - // this is not a CREATE TABLE, so find the first VIEW - $target_for_view = PMA_backquote($target_db); - while (true) { - if ($parsed_sql[$i]['type'] == 'alpha_reservedWord' && $parsed_sql[$i]['data'] == 'VIEW') { - break; - } - $i++; - } - } - unset($analyzed_sql); - $server_sql_mode = PMA_DBI_fetch_value("SHOW VARIABLES LIKE 'sql_mode'", 0, 1); - if ('ANSI_QUOTES' == $server_sql_mode) { - $table_delimiter = 'quote_double'; - } else { - $table_delimiter = 'quote_backtick'; - } - unset($server_sql_mode); - - /* nijel: Find table name in query and replace it */ - while ($parsed_sql[$i]['type'] != $table_delimiter) { - $i++; - } - - /* no need to PMA_backquote() */ - if (isset($target_for_view)) { - // this a view definition; we just found the first db name - // that follows DEFINER VIEW - // so change it for the new db name - $parsed_sql[$i]['data'] = $target_for_view; - // then we have to find all references to the source db - // and change them to the target db, ensuring we stay into - // the $parsed_sql limits - $last = $parsed_sql['len'] - 1; - $backquoted_source_db = PMA_backquote($source_db); - for (++$i; $i <= $last; $i++) { - if ($parsed_sql[$i]['type'] == $table_delimiter && $parsed_sql[$i]['data'] == $backquoted_source_db) { - $parsed_sql[$i]['data'] = $target_for_view; - } - } - unset($last,$backquoted_source_db); - } else { - $parsed_sql[$i]['data'] = $target; - } - - /* Generate query back */ - $sql_structure = PMA_SQP_formatHtml($parsed_sql, 'query_only'); - // If table exists, and 'add drop table' is selected: Drop it! - $drop_query = ''; - if (isset($GLOBALS['drop_if_exists']) - && $GLOBALS['drop_if_exists'] == 'true') { - if (PMA_Table::_isView($target_db,$target_table)) { - $drop_query = 'DROP VIEW'; - } else { - $drop_query = 'DROP TABLE'; - } - $drop_query .= ' IF EXISTS ' - . PMA_backquote($target_db) . '.' - . PMA_backquote($target_table); - PMA_DBI_query($drop_query); - - $GLOBALS['sql_query'] .= "\n" . $drop_query . ';'; - - // garvin: If an existing table gets deleted, maintain any - // entries for the PMA_* tables - $maintain_relations = true; - } - - @PMA_DBI_query($sql_structure); - $GLOBALS['sql_query'] .= "\n" . $sql_structure . ';'; - - if (($move || isset($GLOBALS['add_constraints'])) - && !empty($GLOBALS['sql_constraints_query'])) { - $parsed_sql = PMA_SQP_parse($GLOBALS['sql_constraints_query']); - $i = 0; - - // find the first $table_delimiter, it must be the source table name - while ($parsed_sql[$i]['type'] != $table_delimiter) { - $i++; - // maybe someday we should guard against going over limit - //if ($i == $parsed_sql['len']) { - // break; - //} - } - - // replace it by the target table name, no need to PMA_backquote() - $parsed_sql[$i]['data'] = $target; - - // now we must remove all $table_delimiter that follow a CONSTRAINT - // keyword, because a constraint name must be unique in a db - - $cnt = $parsed_sql['len'] - 1; - - for ($j = $i; $j < $cnt; $j++) { - if ($parsed_sql[$j]['type'] == 'alpha_reservedWord' - && strtoupper($parsed_sql[$j]['data']) == 'CONSTRAINT') { - if ($parsed_sql[$j+1]['type'] == $table_delimiter) { - $parsed_sql[$j+1]['data'] = ''; - } - } - } - - // Generate query back - $GLOBALS['sql_constraints_query'] = PMA_SQP_formatHtml($parsed_sql, - 'query_only'); - if ($mode == 'one_table') { - PMA_DBI_query($GLOBALS['sql_constraints_query']); - } - $GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_constraints_query']; - if ($mode == 'one_table') { - unset($GLOBALS['sql_constraints_query']); - } - } - } else { - $GLOBALS['sql_query'] = ''; - } - - // Copy the data unless this is a VIEW - if (($what == 'data' || $what == 'dataonly') && ! PMA_Table::_isView($target_db,$target_table)) { - $sql_insert_data = - 'INSERT INTO ' . $target . ' SELECT * FROM ' . $source; - PMA_DBI_query($sql_insert_data); - $GLOBALS['sql_query'] .= "\n\n" . $sql_insert_data . ';'; - } - - require_once './libraries/relation.lib.php'; - $GLOBALS['cfgRelation'] = PMA_getRelationsParam(); - - // Drops old table if the user has requested to move it - if ($move) { - - // This could avoid some problems with replicated databases, when - // moving table from replicated one to not replicated one - PMA_DBI_select_db($source_db); - - if (PMA_Table::_isView($source_db,$source_table)) { - $sql_drop_query = 'DROP VIEW'; - } else { - $sql_drop_query = 'DROP TABLE'; - } - $sql_drop_query .= ' ' . $source; - PMA_DBI_query($sql_drop_query); - - // garvin: Move old entries from PMA-DBs to new table - if ($GLOBALS['cfgRelation']['commwork']) { - $remove_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['column_info']) - . ' SET table_name = \'' . PMA_sqlAddslashes($target_table) . '\', ' - . ' db_name = \'' . PMA_sqlAddslashes($target_db) . '\'' - . ' WHERE db_name = \'' . PMA_sqlAddslashes($source_db) . '\'' - . ' AND table_name = \'' . PMA_sqlAddslashes($source_table) . '\''; - PMA_query_as_cu($remove_query); - unset($remove_query); - } - - // garvin: updating bookmarks is not possible since only a single table is moved, - // and not the whole DB. - - if ($GLOBALS['cfgRelation']['displaywork']) { - $table_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['table_info']) - . ' SET db_name = \'' . PMA_sqlAddslashes($target_db) . '\', ' - . ' table_name = \'' . PMA_sqlAddslashes($target_table) . '\'' - . ' WHERE db_name = \'' . PMA_sqlAddslashes($source_db) . '\'' - . ' AND table_name = \'' . PMA_sqlAddslashes($source_table) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - } - - if ($GLOBALS['cfgRelation']['relwork']) { - $table_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['relation']) - . ' SET foreign_table = \'' . PMA_sqlAddslashes($target_table) . '\',' - . ' foreign_db = \'' . PMA_sqlAddslashes($target_db) . '\'' - . ' WHERE foreign_db = \'' . PMA_sqlAddslashes($source_db) . '\'' - . ' AND foreign_table = \'' . PMA_sqlAddslashes($source_table) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - - $table_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['relation']) - . ' SET master_table = \'' . PMA_sqlAddslashes($target_table) . '\',' - . ' master_db = \'' . PMA_sqlAddslashes($target_db) . '\'' - . ' WHERE master_db = \'' . PMA_sqlAddslashes($source_db) . '\'' - . ' AND master_table = \'' . PMA_sqlAddslashes($source_table) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - } - - /** - * @todo garvin: Can't get moving PDFs the right way. The page numbers - * always get screwed up independently from duplication because the - * numbers do not seem to be stored on a per-database basis. Would - * the author of pdf support please have a look at it? - */ - - if ($GLOBALS['cfgRelation']['pdfwork']) { - $table_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['table_coords']) - . ' SET table_name = \'' . PMA_sqlAddslashes($target_table) . '\',' - . ' db_name = \'' . PMA_sqlAddslashes($target_db) . '\'' - . ' WHERE db_name = \'' . PMA_sqlAddslashes($source_db) . '\'' - . ' AND table_name = \'' . PMA_sqlAddslashes($source_table) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - /* - $pdf_query = 'SELECT pdf_page_number ' - . ' FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['table_coords']) - . ' WHERE db_name = \'' . PMA_sqlAddslashes($target_db) . '\'' - . ' AND table_name = \'' . PMA_sqlAddslashes($target_table) . '\''; - $pdf_rs = PMA_query_as_cu($pdf_query); - - while ($pdf_copy_row = PMA_DBI_fetch_assoc($pdf_rs)) { - $table_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['pdf_pages']) - . ' SET db_name = \'' . PMA_sqlAddslashes($target_db) . '\'' - . ' WHERE db_name = \'' . PMA_sqlAddslashes($source_db) . '\'' - . ' AND page_nr = \'' . PMA_sqlAddslashes($pdf_copy_row['pdf_page_number']) . '\''; - $tb_rs = PMA_query_as_cu($table_query); - unset($table_query); - unset($tb_rs); - } - */ - } - - if ($GLOBALS['cfgRelation']['designerwork']) { - $table_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) - . ' SET table_name = \'' . PMA_sqlAddslashes($target_table) . '\',' - . ' db_name = \'' . PMA_sqlAddslashes($target_db) . '\'' - . ' WHERE db_name = \'' . PMA_sqlAddslashes($source_db) . '\'' - . ' AND table_name = \'' . PMA_sqlAddslashes($source_table) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - } - $GLOBALS['sql_query'] .= "\n\n" . $sql_drop_query . ';'; - // end if ($move) - } else { - // we are copying - // garvin: Create new entries as duplicates from old PMA DBs - if ($what != 'dataonly' && !isset($maintain_relations)) { - if ($GLOBALS['cfgRelation']['commwork']) { - // Get all comments and MIME-Types for current table - $comments_copy_query = 'SELECT - column_name, ' . PMA_backquote('comment') . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ' - FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['column_info']) . ' - WHERE - db_name = \'' . PMA_sqlAddslashes($source_db) . '\' AND - table_name = \'' . PMA_sqlAddslashes($source_table) . '\''; - $comments_copy_rs = PMA_query_as_cu($comments_copy_query); - - // Write every comment as new copied entry. [MIME] - while ($comments_copy_row = PMA_DBI_fetch_assoc($comments_copy_rs)) { - $new_comment_query = 'REPLACE INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['column_info']) - . ' (db_name, table_name, column_name, ' . PMA_backquote('comment') . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ') ' - . ' VALUES(' - . '\'' . PMA_sqlAddslashes($target_db) . '\',' - . '\'' . PMA_sqlAddslashes($target_table) . '\',' - . '\'' . PMA_sqlAddslashes($comments_copy_row['column_name']) . '\'' - . ($GLOBALS['cfgRelation']['mimework'] ? ',\'' . PMA_sqlAddslashes($comments_copy_row['comment']) . '\',' - . '\'' . PMA_sqlAddslashes($comments_copy_row['mimetype']) . '\',' - . '\'' . PMA_sqlAddslashes($comments_copy_row['transformation']) . '\',' - . '\'' . PMA_sqlAddslashes($comments_copy_row['transformation_options']) . '\'' : '') - . ')'; - PMA_query_as_cu($new_comment_query); - } // end while - PMA_DBI_free_result($comments_copy_rs); - unset($comments_copy_rs); - } - - // duplicating the bookmarks must not be done here, but - // just once per db - - $get_fields = array('display_field'); - $where_fields = array('db_name' => $source_db, 'table_name' => $source_table); - $new_fields = array('db_name' => $target_db, 'table_name' => $target_table); - PMA_Table::duplicateInfo('displaywork', 'table_info', $get_fields, $where_fields, $new_fields); - - - /** - * @todo revise this code when we support cross-db relations - */ - $get_fields = array('master_field', 'foreign_table', 'foreign_field'); - $where_fields = array('master_db' => $source_db, 'master_table' => $source_table); - $new_fields = array('master_db' => $target_db, 'foreign_db' => $target_db, 'master_table' => $target_table); - PMA_Table::duplicateInfo('relwork', 'relation', $get_fields, $where_fields, $new_fields); - - - $get_fields = array('foreign_field', 'master_table', 'master_field'); - $where_fields = array('foreign_db' => $source_db, 'foreign_table' => $source_table); - $new_fields = array('master_db' => $target_db, 'foreign_db' => $target_db, 'foreign_table' => $target_table); - PMA_Table::duplicateInfo('relwork', 'relation', $get_fields, $where_fields, $new_fields); - - - $get_fields = array('x', 'y', 'v', 'h'); - $where_fields = array('db_name' => $source_db, 'table_name' => $source_table); - $new_fields = array('db_name' => $target_db, 'table_name' => $target_table); - PMA_Table::duplicateInfo('designerwork', 'designer_coords', $get_fields, $where_fields, $new_fields); - - /** - * @todo garvin: Can't get duplicating PDFs the right way. The - * page numbers always get screwed up independently from - * duplication because the numbers do not seem to be stored on a - * per-database basis. Would the author of pdf support please - * have a look at it? - * - $get_fields = array('page_descr'); - $where_fields = array('db_name' => $source_db); - $new_fields = array('db_name' => $target_db); - $last_id = PMA_Table::duplicateInfo('pdfwork', 'pdf_pages', $get_fields, $where_fields, $new_fields); - - if (isset($last_id) && $last_id >= 0) { - $get_fields = array('x', 'y'); - $where_fields = array('db_name' => $source_db, 'table_name' => $source_table); - $new_fields = array('db_name' => $target_db, 'table_name' => $target_table, 'pdf_page_number' => $last_id); - PMA_Table::duplicateInfo('pdfwork', 'table_coords', $get_fields, $where_fields, $new_fields); - } - */ - } - } - - } - - /** - * checks if given name is a valid table name, - * currently if not empty, trailing spaces, '.', '/' and '\' - * - * @todo add check for valid chars in filename on current system/os - * @see http://dev.mysql.com/doc/refman/5.0/en/legal-names.html - * @param string $table_name name to check - * @return boolean whether the string is valid or not - */ - function isValidName($table_name) - { - if ($table_name !== trim($table_name)) { - // trailing spaces - return false; - } - - if (! strlen($table_name)) { - // zero length - return false; - } - - if (preg_match('/[.\/\\\\]+/i', $table_name)) { - // illegal char . / \ - return false; - } - - return true; - } - - /** - * renames table - * - * @param string new table name - * @param string new database name - * @return boolean success - */ - function rename($new_name, $new_db = null) - { - if (null !== $new_db && $new_db !== $this->getDbName()) { - // Ensure the target is valid - if (! $GLOBALS['PMA_List_Database']->exists($new_db)) { - $this->errors[] = $GLOBALS['strInvalidDatabase'] . ': ' . $new_db; - return false; - } - } else { - $new_db = $this->getDbName(); - } - - $new_table = new PMA_Table($new_name, $new_db); - - if ($this->getFullName() === $new_table->getFullName()) { - return true; - } - - if (! PMA_Table::isValidName($new_name)) { - $this->errors[] = $GLOBALS['strInvalidTableName'] . ': ' . $new_table->getFullName(); - return false; - } - - $GLOBALS['sql_query'] = ' - RENAME TABLE ' . $this->getFullName(true) . ' - TO ' . $new_table->getFullName(true) . ';'; - if (! PMA_DBI_query($GLOBALS['sql_query'])) { - $this->errors[] = sprintf($GLOBALS['strErrorRenamingTable'], $this->getFullName(), $new_table->getFullName()); - return false; - } - - $old_name = $this->getName(); - $old_db = $this->getDbName(); - $this->setName($new_name); - $this->setDbName($new_db); - - /** - * @todo move into extra function PMA_Relation::renameTable($new_name, $old_name, $new_db, $old_db) - */ - // garvin: Move old entries from comments to new table - require_once './libraries/relation.lib.php'; - $GLOBALS['cfgRelation'] = PMA_getRelationsParam(); - if ($GLOBALS['cfgRelation']['commwork']) { - $remove_query = ' - UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA_backquote($GLOBALS['cfgRelation']['column_info']) . ' - SET `db_name` = \'' . PMA_sqlAddslashes($new_db) . '\', - `table_name` = \'' . PMA_sqlAddslashes($new_name) . '\' - WHERE `db_name` = \'' . PMA_sqlAddslashes($old_db) . '\' - AND `table_name` = \'' . PMA_sqlAddslashes($old_name) . '\''; - PMA_query_as_cu($remove_query); - unset($remove_query); - } - - if ($GLOBALS['cfgRelation']['displaywork']) { - $table_query = ' - UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA_backquote($GLOBALS['cfgRelation']['table_info']) . ' - SET `db_name` = \'' . PMA_sqlAddslashes($new_db) . '\', - `table_name` = \'' . PMA_sqlAddslashes($new_name) . '\' - WHERE `db_name` = \'' . PMA_sqlAddslashes($old_db) . '\' - AND `table_name` = \'' . PMA_sqlAddslashes($old_name) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - } - - if ($GLOBALS['cfgRelation']['relwork']) { - $table_query = ' - UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA_backquote($GLOBALS['cfgRelation']['relation']) . ' - SET `foreign_db` = \'' . PMA_sqlAddslashes($new_db) . '\', - `foreign_table` = \'' . PMA_sqlAddslashes($new_name) . '\' - WHERE `foreign_db` = \'' . PMA_sqlAddslashes($old_db) . '\' - AND `foreign_table` = \'' . PMA_sqlAddslashes($old_name) . '\''; - PMA_query_as_cu($table_query); - - $table_query = ' - UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA_backquote($GLOBALS['cfgRelation']['relation']) . ' - SET `master_db` = \'' . PMA_sqlAddslashes($new_db) . '\', - `master_table` = \'' . PMA_sqlAddslashes($new_name) . '\' - WHERE `master_db` = \'' . PMA_sqlAddslashes($old_db) . '\' - AND `master_table` = \'' . PMA_sqlAddslashes($old_name) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - } - - if ($GLOBALS['cfgRelation']['pdfwork']) { - $table_query = ' - UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA_backquote($GLOBALS['cfgRelation']['table_coords']) . ' - SET `db_name` = \'' . PMA_sqlAddslashes($new_db) . '\', - `table_name` = \'' . PMA_sqlAddslashes($new_name) . '\' - WHERE `db_name` = \'' . PMA_sqlAddslashes($old_db) . '\' - AND `table_name` = \'' . PMA_sqlAddslashes($old_name) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - } - - if ($GLOBALS['cfgRelation']['designerwork']) { - $table_query = ' - UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) . ' - SET `db_name` = \'' . PMA_sqlAddslashes($new_db) . '\', - `table_name` = \'' . PMA_sqlAddslashes($new_name) . '\' - WHERE `db_name` = \'' . PMA_sqlAddslashes($old_db) . '\' - AND `table_name` = \'' . PMA_sqlAddslashes($old_name) . '\''; - PMA_query_as_cu($table_query); - unset($table_query); - } - - $this->messages[] = sprintf($GLOBALS['strRenameTableOK'], - htmlspecialchars($old_name), htmlspecialchars($new_name)); - return true; - } -} -?> diff --git a/htdocs/sql/libraries/Theme.class.php b/htdocs/sql/libraries/Theme.class.php deleted file mode 100755 --- a/htdocs/sql/libraries/Theme.class.php +++ /dev/null @@ -1,395 +0,0 @@ -getPath() . '/info.inc.php')) { - return false; - } - - if ($this->mtime_info === filemtime($this->getPath() . '/info.inc.php')) { - return true; - } - - @include $this->getPath() . '/info.inc.php'; - - // did it set correctly? - if (! isset($theme_name)) { - return false; - } - - $this->mtime_info = filemtime($this->getPath() . '/info.inc.php'); - $this->filesize_info = filesize($this->getPath() . '/info.inc.php'); - - if (isset($theme_full_version)) { - $this->setVersion($theme_full_version); - } elseif (isset($theme_generation, $theme_version)) { - $this->setVersion($theme_generation . '.' . $theme_version); - } - $this->setName($theme_name); - - return true; - } - - /** - * returns theme object loaded from given folder - * or false if theme is invalid - * - * @static - * @access public - * @uses PMA_Theme - * @uses PMA_Theme::setPath() - * @uses PMA_Theme::loadInfo() - * @uses PMA_Theme::checkImgPath() - * @param string $folder path to theme - * @return object PMA_Theme - */ - function load($folder) - { - $theme = new PMA_Theme(); - - $theme->setPath($folder); - - if (! $theme->loadInfo()) { - return false; - } - - $theme->checkImgPath(); - - return $theme; - } - - /** - * checks image path for existance - if not found use img from original theme - * - * @access public - * @uses PMA_Theme::getPath() - * @uses PMA_Theme::setImgPath() - * @uses PMA_Theme::getName() - * @uses $GLOBALS['cfg']['ThemePath'] - * @uses $GLOBALS['PMA_errors'] - * @uses $GLOBALS['strThemeNoValidImgPath'] - * @uses is_dir() - * @uses sprintf() - */ - function checkImgPath() - { - if (is_dir($this->getPath() . '/img/')) { - $this->setImgPath($this->getPath() . '/img/'); - return true; - } elseif (is_dir($GLOBALS['cfg']['ThemePath'] . '/original/img/')) { - $this->setImgPath($GLOBALS['cfg']['ThemePath'] . '/original/img/'); - return true; - } else { - $GLOBALS['PMA_errors'][] = - sprintf($GLOBALS['strThemeNoValidImgPath'], $this->getName()); - /* - trigger_error( - sprintf($GLOBALS['strThemeNoValidImgPath'], $this->getName()), - E_USER_WARNING); - */ - return false; - } - } - - /** - * returns path to theme - * - * @access public - * @uses PMA_Theme::$path as return value - * @return string $path path to theme - */ - function getPath() - { - return $this->path; - } - - /** - * returns layout file - * - * @access public - * @uses PMA_Theme::getPath() - * @return string layout file - */ - function getLayoutFile() - { - return $this->getPath() . '/layout.inc.php'; - } - - /** - * set path to theme - * - * @access public - * @uses PMA_Theme::$path to set it - * @param string $path path to theme - */ - function setPath($path) - { - $this->path = trim($path); - } - - /** - * sets version - * - * @access public - * @uses PMA_Theme::$version - * @param string new version - */ - function setVersion($version) - { - $this->version = trim($version); - } - - /** - * returns version - * - * @access public - * @uses PMA_Theme::$version - * @return string version - */ - function getVersion() - { - return $this->version; - } - - /** - * checks theme version agaisnt $version - * returns true if theme version is equal or higher to $version - * - * @access public - * @uses version_compare() - * @uses PMA_Theme::getVersion() - * @param string $version version to compare to - * @return boolean - */ - function checkVersion($version) - { - return version_compare($this->getVersion(), $version, 'lt'); - } - - /** - * sets name - * - * @access public - * @uses PMA_Theme::$name to set it - * @uses trim() - * @param string $name new name - */ - function setName($name) - { - $this->name = trim($name); - } - - /** - * returns name - * - * @access public - * @uses PMA_Theme::$name as return value - * @return string name - */ - function getName() - { - return $this->name; - } - - /** - * sets id - * - * @access public - * @uses PMA_Theme::$id to set it - * @param string $id new id - */ - function setId($id) - { - $this->id = trim($id); - } - - /** - * returns id - * - * @access public - * @uses PMA_Theme::$id as return value - * @return string id - */ - function getId() - { - return $this->id; - } - - /** - * @access public - * @uses PMA_Theme::$img_path to set it - * @param string path to images for this theme - */ - function setImgPath($path) - { - $this->img_path = $path; - } - - /** - * @access public - * @uses PMA_Theme::$img_path as retunr value - * @return string image path for this theme - */ - function getImgPath() - { - return $this->img_path; - } - - /** - * load css (send to stdout, normaly the browser) - * - * @access public - * @uses PMA_Theme::getPath() - * @uses PMA_Theme::$types - * @uses PMA_SQP_buildCssData() - * @uses file_exists() - * @uses in_array() - * @param string $type left, right or print - */ - function loadCss(&$type) - { - if (empty($type) || ! in_array($type, $this->types)) { - $type = 'left'; - } - - if ($type == 'right') { - echo PMA_SQP_buildCssData(); - } - - $_css_file = $this->getPath() - . '/css/theme_' . $type . '.css.php'; - - if (! file_exists($_css_file)) { - return false; - } - - if ($GLOBALS['text_dir'] === 'ltr') { - $right = 'right'; - $left = 'left'; - } else { - $right = 'left'; - $left = 'right'; - } - - include $_css_file; - return true; - } - - /** - * prints out the preview for this theme - * - * @access public - * @uses PMA_Theme::getName() - * @uses PMA_Theme::getVersion() - * @uses PMA_Theme::getId() - * @uses PMA_Theme::getPath() - * @uses $GLOBALS['strThemeNoPreviewAvailable'] - * @uses $GLOBALS['strTakeIt'] - * @uses PMA_generate_common_url() - * @uses addslashes() - * @uses file_exists() - * @uses htmlspecialchars() - */ - function printPreview() - { - echo ''; - } -} -?> diff --git a/htdocs/sql/libraries/Theme_Manager.class.php b/htdocs/sql/libraries/Theme_Manager.class.php deleted file mode 100755 --- a/htdocs/sql/libraries/Theme_Manager.class.php +++ /dev/null @@ -1,395 +0,0 @@ -init(); - } - - /** - * sets path to folder containing the themes - * - * @param string $path path to themes folder - * @return boolean success - */ - function setThemesPath($path) - { - if (! $this->_checkThemeFolder($path)) { - return false; - } - - $this->_themes_path = trim($path); - return true; - } - - /** - * @public - * @return string - */ - function getThemesPath() - { - return $this->_themes_path; - } - - /** - * sets if there are different themes per server - * - * @param boolean $per_server - */ - function setThemePerServer($per_server) - { - $this->per_server = (bool) $per_server; - } - - function init() - { - $this->themes = array(); - $this->theme_default = 'original'; - $this->active_theme = ''; - - if (! $this->setThemesPath($GLOBALS['cfg']['ThemePath'])) { - return false; - } - - $this->setThemePerServer($GLOBALS['cfg']['ThemePerServer']); - - $this->loadThemes(); - - $this->theme = new PMA_Theme; - - - if (! $this->checkTheme($GLOBALS['cfg']['ThemeDefault'])) { - $GLOBALS['PMA_errors'][] = sprintf($GLOBALS['strThemeDefaultNotFound'], - htmlspecialchars($GLOBALS['cfg']['ThemeDefault'])); - trigger_error( - sprintf($GLOBALS['strThemeDefaultNotFound'], - htmlspecialchars($GLOBALS['cfg']['ThemeDefault'])), - E_USER_WARNING); - $GLOBALS['cfg']['ThemeDefault'] = false; - } - - $this->theme_default = $GLOBALS['cfg']['ThemeDefault']; - - // check if user have a theme cookie - if (! $this->getThemeCookie() - || ! $this->setActiveTheme($this->getThemeCookie())) { - // otherwise use default theme - if ($GLOBALS['cfg']['ThemeDefault']) { - $this->setActiveTheme($GLOBALS['cfg']['ThemeDefault']); - } else { - // or original theme - $this->setActiveTheme('original'); - } - } - } - - function checkConfig() - { - if ($this->_themes_path != trim($GLOBALS['cfg']['ThemePath']) - || $this->theme_default != $GLOBALS['cfg']['ThemeDefault']) { - $this->init(); - } else { - // at least the theme path needs to be checked every time for new - // themes, as there is no other way at the moment to keep track of - // new or removed themes - $this->loadThemes(); - } - } - - function setActiveTheme($theme = null) - { - if (! $this->checkTheme($theme)) { - $GLOBALS['PMA_errors'][] = sprintf($GLOBALS['strThemeNotFound'], - htmlspecialchars($theme)); - /* Following code can lead to path disclossure, because headers will be sent later */ -/* trigger_error( - sprintf($GLOBALS['strThemeNotFound'], htmlspecialchars($theme)), - E_USER_WARNING);*/ - return false; - } - - $this->active_theme = $theme; - $this->theme = $this->themes[$theme]; - - // need to set later - //$this->setThemeCookie(); - - return true; - } - - /** - * @return string cookie name - */ - function getThemeCookieName() - { - // Allow different theme per server - if (isset($GLOBALS['server']) && $this->per_server) { - return $this->cookie_name . '-' . $GLOBALS['server']; - } else { - return $this->cookie_name; - } - } - - /** - * returns name of theme stored in the cookie - * @return string theme name from cookie - */ - function getThemeCookie() - { - if (isset($_COOKIE[$this->getThemeCookieName()])) { - return $_COOKIE[$this->getThemeCookieName()]; - } - - return false; - } - - /** - * save theme in cookie - * - * @uses PMA_setCookie(); - * @uses PMA_Theme_Manager::getThemeCookieName() - * @uses PMA_Theme_Manager::$theme - * @uses PMA_Theme_Manager::$theme_default - * @uses PMA_Theme::getId() - */ - function setThemeCookie() - { - PMA_setCookie($this->getThemeCookieName(), $this->theme->id, - $this->theme_default); - // force a change of a dummy session variable to avoid problems - // with the caching of phpmyadmin.css.php - $_SESSION['PMA_Config']->set('theme-update', $this->theme->id); - return true; - } - - /** - * old PHP 4 constructor - */ - function PMA_Theme_Manager() - { - $this->__construct(); - } - - /** - * @private - * @param string $folder - * @return boolean - */ - /*private*/ function _checkThemeFolder($folder) - { - if (! is_dir($folder)) { - $GLOBALS['PMA_errors'][] = - sprintf($GLOBALS['strThemePathNotFound'], - htmlspecialchars($folder)); - trigger_error( - sprintf($GLOBALS['strThemePathNotFound'], - htmlspecialchars($folder)), - E_USER_WARNING); - return false; - } - - return true; - } - - /** - * read all themes - */ - function loadThemes() - { - $this->themes = array(); - - if ($handleThemes = opendir($this->getThemesPath())) { - // check for themes directory - while (false !== ($PMA_Theme = readdir($handleThemes))) { - if (array_key_exists($PMA_Theme, $this->themes)) { - // this does nothing! - //$this->themes[$PMA_Theme] = $this->themes[$PMA_Theme]; - continue; - } - $new_theme = PMA_Theme::load($this->getThemesPath() . '/' . $PMA_Theme); - if ($new_theme) { - $new_theme->setId($PMA_Theme); - $this->themes[$PMA_Theme] = $new_theme; - } - } // end get themes - closedir($handleThemes); - } else { - trigger_error( - 'phpMyAdmin-ERROR: cannot open themes folder: ' . $this->getThemesPath(), - E_USER_WARNING); - return false; - } // end check for themes directory - - ksort($this->themes); - return true; - } - - /** - * checks if given theme name is a known theme - * - * @param string $theme name fo theme to check for - */ - function checkTheme($theme) - { - if (! array_key_exists($theme, $this->themes)) { - return false; - } - - return true; - } - - /** - * returns HTML selectbox, with or without form enclsoed - * - * @param boolean $form wether enclosed by from tags or not - */ - function getHtmlSelectBox($form = true) - { - $select_box = ''; - - if ($form) { - $select_box .= '
'; - $select_box .= PMA_generate_common_hidden_inputs(); - } - - $theme_selected = FALSE; - $theme_preview_path= './themes.php'; - $theme_preview_href = ''; - $select_box .= $theme_preview_href . $GLOBALS['strTheme'] . ':' . "\n"; - - $select_box .= ''; - - if ($form) { - $select_box .= ''; - $select_box .= '
'; - } - - return $select_box; - } - - /** - * enables backward compatibility - */ - function makeBc() - { - $GLOBALS['theme'] = $this->theme->getId(); - $GLOBALS['pmaThemePath'] = $this->theme->getPath(); - $GLOBALS['pmaThemeImage'] = $this->theme->getImgPath(); - - /** - * load layout file if exists - */ - if (@file_exists($GLOBALS['pmaThemePath'] . 'layout.inc.php')) { - include $GLOBALS['pmaThemePath'] . 'layout.inc.php'; - } - - - } - - /** - * prints out preview for every theme - * - * @uses $this->themes - * @uses PMA_Theme::printPreview() - */ - function printPreviews() - { - foreach ($this->themes as $each_theme) { - $each_theme->printPreview(); - } // end 'open themes' - } - - /** - * returns PMA_Theme object for fall back theme - * @return object PMA_Theme - */ - function getFallBackTheme() - { - if (isset($this->themes['original'])) { - return $this->themes['original']; - } - - return false; - } - - /** - * prints css data - */ - function printCss($type) - { - if ($this->theme->loadCss($type)) { - return true; - } - - // load css for this them failed, try default theme css - $fallback_theme = $this->getFallBackTheme(); - if ($fallback_theme && $fallback_theme->loadCss($type)) { - return true; - } - - return false; - } -} -?> diff --git a/htdocs/sql/libraries/auth/config.auth.lib.php b/htdocs/sql/libraries/auth/config.auth.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/auth/config.auth.lib.php +++ /dev/null @@ -1,152 +0,0 @@ - authentication failed - * - * @global string the MySQL error message PHP returns - * @global string the connection type (persistent or not) - * @global string the MySQL server port to use - * @global string the MySQL socket port to use - * @global array the current server settings - * @global string the font face to use in case of failure - * @global string the default font size to use in case of failure - * @global string the big font size to use in case of failure - * @global boolean tell the "PMA_mysqlDie()" function headers have been - * sent - * - * @return boolean always true (no return indeed) - * - * @access public - */ -function PMA_auth_fails() -{ - global $php_errormsg, $cfg; - - $conn_error = PMA_DBI_getError(); - if (!$conn_error) { - if (isset($php_errormsg)) { - $conn_error = $php_errormsg; - } else { - $conn_error = $GLOBALS['strConnectionError']; - } - } - - // Defines the charset to be used - header('Content-Type: text/html; charset=' . $GLOBALS['charset']); - /* HTML header */ - $page_title = $GLOBALS['strAccessDenied']; - require './libraries/header_meta_style.inc.php'; - ?> - - - -

-
-

-
-
- - - - - 1) { - // offer a chance to login to other servers if the current one failed - require_once './libraries/select_server.lib.php'; - echo '' . "\n"; - echo ' ' . "\n"; - echo '' . "\n"; - } - echo '
- -
- ' . $GLOBALS['strAccessDenied'] . '

' . "\n"; - } else { - // Check whether user has configured something - if ($_SESSION['PMA_Config']->source_mtime == 0) { - echo '

' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '', '') . '

' . "\n"; - } elseif (!isset($GLOBALS['errno']) || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) { - // if we display the "Server not responding" error, do not confuse users - // by telling them they have a settings problem - // (note: it's true that they could have a badly typed host name, but - // anyway the current $strAccessDeniedExplanation tells that the server - // rejected the connection, which is not really what happened) - // 2002 is the error given by mysqli - // 2003 is the error given by mysql - echo '

' . $GLOBALS['strAccessDeniedExplanation'] . '

' . "\n"; - } - PMA_mysqlDie($conn_error, '', true, '', false); - } - if (! empty($GLOBALS['PMA_errors']) && is_array($GLOBALS['PMA_errors'])) { - foreach ($GLOBALS['PMA_errors'] as $error) { - echo '
' . $error . '
' . "\n"; - } - } -?> -
' . "\n"; - PMA_select_server(TRUE, TRUE); - echo '
' . "\n"; - require_once './libraries/footer.inc.php'; - return TRUE; -} // end of the 'PMA_auth_fails()' function - -?> diff --git a/htdocs/sql/libraries/auth/cookie.auth.lib.php b/htdocs/sql/libraries/auth/cookie.auth.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/auth/cookie.auth.lib.php +++ /dev/null @@ -1,603 +0,0 @@ - and - * Dan Wilson who built this patch for the Debian package. - * - * @version $Id: cookie.auth.lib.php 11449 2008-08-01 19:00:36Z lem9 $ - */ - -if (! defined('PHPMYADMIN')) { - exit; -} - -if (function_exists('mcrypt_encrypt') || PMA_dl('mcrypt')) { - /** - * Uses faster mcrypt library if available - */ - require_once './libraries/mcrypt.lib.php'; -} else { - require_once './libraries/blowfish.php'; - /** - * display warning in main.php - */ - define('PMA_WARN_FOR_MCRYPT', 1); -} - - -/** - * Displays authentication form - * - * this function MUST exit/quit the application - * - * @uses $GLOBALS['server'] - * @uses $GLOBALS['PHP_AUTH_USER'] - * @uses $GLOBALS['pma_auth_server'] - * @uses $GLOBALS['text_dir'] - * @uses $GLOBALS['pmaThemeImage'] - * @uses $GLOBALS['charset'] - * @uses $GLOBALS['target'] - * @uses $GLOBALS['db'] - * @uses $GLOBALS['table'] - * @uses $GLOBALS['PMA_errors'] - * @uses $GLOBALS['convcharset'] - * @uses $GLOBALS['lang'] - * @uses $GLOBALS['strWelcome'] - * @uses $GLOBALS['strSecretRequired'] - * @uses $GLOBALS['strError'] - * @uses $GLOBALS['strLogin'] - * @uses $GLOBALS['strLogServer'] - * @uses $GLOBALS['strLogUsername'] - * @uses $GLOBALS['strLogPassword'] - * @uses $GLOBALS['strServerChoice'] - * @uses $GLOBALS['strGo'] - * @uses $GLOBALS['strCookiesRequired'] - * @uses $GLOBALS['strPmaDocumentation'] - * @uses $GLOBALS['pmaThemeImage'] - * @uses $cfg['Servers'] - * @uses $cfg['LoginCookieRecall'] - * @uses $cfg['Lang'] - * @uses $cfg['Server'] - * @uses $cfg['ReplaceHelpImg'] - * @uses $cfg['blowfish_secret'] - * @uses $cfg['AllowArbitraryServer'] - * @uses $_COOKIE - * @uses $_REQUEST['old_usr'] - * @uses PMA_sendHeaderLocation() - * @uses PMA_select_language() - * @uses PMA_select_server() - * @uses file_exists() - * @uses sprintf() - * @uses count() - * @uses htmlspecialchars() - * @uses is_array() - * @global string the last connection error - * - * @access public - */ -function PMA_auth() -{ - global $conn_error; - - /* Perform logout to custom URL */ - if (! empty($_REQUEST['old_usr']) - && ! empty($GLOBALS['cfg']['Server']['LogoutURL'])) { - PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']); - exit; - } - - if ($GLOBALS['cfg']['LoginCookieRecall']) { - $default_user = $GLOBALS['PHP_AUTH_USER']; - $default_server = $GLOBALS['pma_auth_server']; - $autocomplete = ''; - } else { - $default_user = ''; - $default_server = ''; - // skip the IE autocomplete feature. - $autocomplete = ' autocomplete="off"'; - } - - $cell_align = ($GLOBALS['text_dir'] == 'ltr') ? 'left' : 'right'; - - // Defines the charset to be used - header('Content-Type: text/html; charset=' . $GLOBALS['charset']); - // Defines the "item" image depending on text direction - $item_img = $GLOBALS['pmaThemeImage'] . 'item_' . $GLOBALS['text_dir'] . '.png'; - - /* HTML header; do not show here the PMA version to improve security */ - $page_title = 'phpMyAdmin '; - require './libraries/header_meta_style.inc.php'; - ?> - - - - - - - -
- -

- ' . $page_title . ''); - ?> -

-

' . $GLOBALS['strError'] . '

' . "\n"; - echo $conn_error . '
' . "\n"; - } - - // Displays the languages form - if (empty($GLOBALS['cfg']['Lang'])) { - require_once './libraries/display_select_lang.lib.php'; - // use fieldset, don't show doc link - PMA_select_language(true, false); - } - - // Displays the warning message and the login form - if (empty($GLOBALS['cfg']['blowfish_secret'])) { - ?> -

- -
- ' . "\n"; - if (file_exists('./config.footer.inc.php')) { - require './config.footer.inc.php'; - } - echo ''; - exit; - } - ?> -
- -
target="_top" class="login"> -
- - - - - -
- - -
- -
- - -
-
- - -
- 1) { - ?> -
- -
'; - } else { - echo ' '; - } // end if (server choice) - ?> -
-
- - - - ' . "\n"; - } - if (!empty($GLOBALS['db'])) { - echo ' ' . "\n"; - } - if (!empty($GLOBALS['table'])) { - echo ' ' . "\n"; - } - ?> -
-
- ' . $GLOBALS['strCookiesRequired'] . '' . "\n"; - } - if (! empty($GLOBALS['PMA_errors']) && is_array($GLOBALS['PMA_errors'])) { - foreach ($GLOBALS['PMA_errors'] as $error) { - echo '
' . $error . '
' . "\n"; - } - } - // the warning is also displayed on main page but show it also here, - // because on some PHP versions running on 64-bit, the blowfish library - // does not work and this would prevent login - if (defined('PMA_WARN_FOR_MCRYPT')) { - echo '
' . PMA_sanitize(sprintf($GLOBALS['strCantLoad'], 'mcrypt')) . '
' . "\n"; - } - ?> - - - - - $val) { - PMA_removeCookie('pmaPass-' . $key); - PMA_removeCookie('pmaServer-' . $key); - PMA_removeCookie('pmaUser-' . $key); - } - return false; - } - - if (! empty($_REQUEST['old_usr'])) { - // The user wants to be logged out - // -> delete his choices that were stored in session - session_destroy(); - // -> delete password cookie(s) - if ($GLOBALS['cfg']['LoginCookieDeleteAll']) { - foreach($GLOBALS['cfg']['Servers'] as $key => $val) { - PMA_removeCookie('pmaPass-' . $key); - if (isset($_COOKIE['pmaPass-' . $key])) { - unset($_COOKIE['pmaPass-' . $key]); - } - } - } else { - PMA_removeCookie('pmaPass-' . $GLOBALS['server']); - if (isset($_COOKIE['pmaPass-' . $GLOBALS['server']])) { - unset($_COOKIE['pmaPass-' . $GLOBALS['server']]); - } - } - } - - if (! empty($_REQUEST['pma_username'])) { - // The user just logged in - $GLOBALS['PHP_AUTH_USER'] = $_REQUEST['pma_username']; - $GLOBALS['PHP_AUTH_PW'] = empty($_REQUEST['pma_password']) ? '' : $_REQUEST['pma_password']; - if ($GLOBALS['cfg']['AllowArbitraryServer'] && isset($_REQUEST['pma_servername'])) { - $GLOBALS['pma_auth_server'] = $_REQUEST['pma_servername']; - } - return true; - } - - // At the end, try to set the $GLOBALS['PHP_AUTH_USER'] - // and $GLOBALS['PHP_AUTH_PW'] variables from cookies - - // servername - if ($GLOBALS['cfg']['AllowArbitraryServer'] - && ! empty($_COOKIE['pmaServer-' . $GLOBALS['server']])) { - $GLOBALS['pma_auth_server'] = $_COOKIE['pmaServer-' . $GLOBALS['server']]; - } - - // username - if (empty($_COOKIE['pmaUser-' . $GLOBALS['server']])) { - return false; - } - - $GLOBALS['PHP_AUTH_USER'] = PMA_blowfish_decrypt( - $_COOKIE['pmaUser-' . $GLOBALS['server']], - $GLOBALS['cfg']['blowfish_secret']); - - // user was never logged in since session start - if (empty($_SESSION['last_access_time'])) { - return false; - } - - // User inactive too long - if ($_SESSION['last_access_time'] < time() - $GLOBALS['cfg']['LoginCookieValidity']) { - $GLOBALS['no_activity'] = true; - PMA_auth_fails(); - exit; - } - - // password - if (empty($_COOKIE['pmaPass-' . $GLOBALS['server']])) { - return false; - } - - $GLOBALS['PHP_AUTH_PW'] = PMA_blowfish_decrypt( - $_COOKIE['pmaPass-' . $GLOBALS['server']], - $GLOBALS['cfg']['blowfish_secret'] /* . $_SESSION['last_access_time'] */); - - if ($GLOBALS['PHP_AUTH_PW'] == "\xff(blank)") { - $GLOBALS['PHP_AUTH_PW'] = ''; - } - - $GLOBALS['from_cookie'] = true; - - return true; -} // end of the 'PMA_auth_check()' function - - -/** - * Set the user and password after last checkings if required - * - * @uses $GLOBALS['PHP_AUTH_USER'] - * @uses $GLOBALS['PHP_AUTH_PW'] - * @uses $GLOBALS['server'] - * @uses $GLOBALS['from_cookie'] - * @uses $GLOBALS['pma_auth_server'] - * @uses $cfg['Server'] - * @uses $cfg['AllowArbitraryServer'] - * @uses $cfg['blowfish_secret'] - * @uses $cfg['LoginCookieStore'] - * @uses $cfg['PmaAbsoluteUri'] - * @uses $_SESSION['last_access_time'] - * @uses PMA_COMING_FROM_COOKIE_LOGIN - * @uses PMA_setCookie() - * @uses PMA_blowfish_encrypt() - * @uses PMA_removeCookie() - * @uses PMA_sendHeaderLocation() - * @uses time() - * @uses define() - * @return boolean always true - * - * @access public - */ -function PMA_auth_set_user() -{ - global $cfg; - - // Ensures valid authentication mode, 'only_db', bookmark database and - // table names and relation table name are used - if ($cfg['Server']['user'] != $GLOBALS['PHP_AUTH_USER']) { - foreach ($cfg['Servers'] as $idx => $current) { - if ($current['host'] == $cfg['Server']['host'] - && $current['port'] == $cfg['Server']['port'] - && $current['socket'] == $cfg['Server']['socket'] - && $current['ssl'] == $cfg['Server']['ssl'] - && $current['connect_type'] == $cfg['Server']['connect_type'] - && $current['user'] == $GLOBALS['PHP_AUTH_USER']) { - $GLOBALS['server'] = $idx; - $cfg['Server'] = $current; - break; - } - } // end foreach - } // end if - - $pma_server_changed = false; - if ($GLOBALS['cfg']['AllowArbitraryServer'] - && ! empty($GLOBALS['pma_auth_server']) - && $cfg['Server']['host'] != $GLOBALS['pma_auth_server']) { - $cfg['Server']['host'] = $GLOBALS['pma_auth_server']; - $pma_server_changed = true; - } - $cfg['Server']['user'] = $GLOBALS['PHP_AUTH_USER']; - $cfg['Server']['password'] = $GLOBALS['PHP_AUTH_PW']; - - $_SESSION['last_access_time'] = time(); - - // Name and password cookies needs to be refreshed each time - // Duration = one month for username - PMA_setCookie('pmaUser-' . $GLOBALS['server'], - PMA_blowfish_encrypt($cfg['Server']['user'], - $GLOBALS['cfg']['blowfish_secret'])); - - // Duration = as configured - PMA_setCookie('pmaPass-' . $GLOBALS['server'], - PMA_blowfish_encrypt(!empty($cfg['Server']['password']) ? $cfg['Server']['password'] : "\xff(blank)", - $GLOBALS['cfg']['blowfish_secret'] /* . $_SESSION['last_access_time'] */), - null, - $GLOBALS['cfg']['LoginCookieStore']); - - // Set server cookies if required (once per session) and, in this case, force - // reload to ensure the client accepts cookies - if (! $GLOBALS['from_cookie']) { - if ($GLOBALS['cfg']['AllowArbitraryServer']) { - if (! empty($GLOBALS['pma_auth_server'])) { - // Duration = one month for serverrname - PMA_setCookie('pmaServer-' . $GLOBALS['server'], $cfg['Server']['host']); - } else { - // Delete servername cookie - PMA_removeCookie('pmaServer-' . $GLOBALS['server']); - } - } - - // URL where to go: - $redirect_url = $cfg['PmaAbsoluteUri'] . 'index.php'; - - // any parameters to pass? - $url_params = array(); - if (strlen($GLOBALS['db'])) { - $url_params['db'] = $GLOBALS['db']; - } - if (strlen($GLOBALS['table'])) { - $url_params['table'] = $GLOBALS['table']; - } - // Language change from the login panel needs to be remembered - if (! empty($GLOBALS['lang'])) { - $url_params['lang'] = $GLOBALS['lang']; - } - // any target to pass? - if (! empty($GLOBALS['target']) && $GLOBALS['target'] != 'index.php') { - $url_params['target'] = $GLOBALS['target']; - } - - /** - * whether we come from a fresh cookie login - */ - define('PMA_COMING_FROM_COOKIE_LOGIN', true); - PMA_sendHeaderLocation($redirect_url . PMA_generate_common_url($url_params, '&')); - exit(); - } // end if - - return true; -} // end of the 'PMA_auth_set_user()' function - - -/** - * User is not allowed to login to MySQL -> authentication failed - * - * prepares error message and switches to PMA_auth() which display the error - * and the login form - * - * this function MUST exit/quit the application, - * currently doen by call to PMA_auth() - * - * @todo $php_errormsg is invalid here!? it will never be set in this scope - * @uses $GLOBALS['server'] - * @uses $GLOBALS['allowDeny_forbidden'] - * @uses $GLOBALS['strAccessDenied'] - * @uses $GLOBALS['strNoActivity'] - * @uses $GLOBALS['strCannotLogin'] - * @uses $GLOBALS['no_activity'] - * @uses $cfg['LoginCookieValidity'] - * @uses PMA_removeCookie() - * @uses PMA_getenv() - * @uses PMA_DBI_getError() - * @uses PMA_sanitize() - * @uses PMA_auth() - * @uses sprintf() - * @uses basename() - * @access public - */ -function PMA_auth_fails() -{ - global $conn_error; - - // Deletes password cookie and displays the login form - PMA_removeCookie('pmaPass-' . $GLOBALS['server']); - - if (! empty($GLOBALS['allowDeny_forbidden'])) { - $conn_error = $GLOBALS['strAccessDenied']; - } elseif (! empty($GLOBALS['no_activity'])) { - $conn_error = sprintf($GLOBALS['strNoActivity'], $GLOBALS['cfg']['LoginCookieValidity']); - // Remember where we got timeout to return on same place - if (PMA_getenv('SCRIPT_NAME')) { - $GLOBALS['target'] = basename(PMA_getenv('SCRIPT_NAME')); - // avoid "missing parameter: field" on re-entry - if ('tbl_alter.php' == $GLOBALS['target']) { - $GLOBALS['target'] = 'tbl_structure.php'; - } - } - } elseif (PMA_DBI_getError()) { - $conn_error = PMA_sanitize(PMA_DBI_getError()); - } elseif (isset($php_errormsg)) { - $conn_error = $php_errormsg; - } else { - $conn_error = $GLOBALS['strCannotLogin']; - } - - PMA_auth(); -} // end of the 'PMA_auth_fails()' function - -?> diff --git a/htdocs/sql/libraries/auth/http.auth.lib.php b/htdocs/sql/libraries/auth/http.auth.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/auth/http.auth.lib.php +++ /dev/null @@ -1,227 +0,0 @@ - - - - - -

-
-

-
-
-
- - - - - - ensure the new username is not the same - if (!empty($old_usr) - && (isset($PHP_AUTH_USER) && $old_usr == $PHP_AUTH_USER)) { - $PHP_AUTH_USER = ''; - // -> delete user's choices that were stored in session - session_destroy(); - } - - // Returns whether we get authentication settings or not - if (empty($PHP_AUTH_USER)) { - return false; - } else { - return true; - } -} // end of the 'PMA_auth_check()' function - - -/** - * Set the user and password after last checkings if required - * - * @global array the valid servers settings - * @global integer the id of the current server - * @global array the current server settings - * @global string the current username - * @global string the current password - * - * @return boolean always true - * - * @access public - */ -function PMA_auth_set_user() -{ - global $cfg, $server; - global $PHP_AUTH_USER, $PHP_AUTH_PW; - - // Ensures valid authentication mode, 'only_db', bookmark database and - // table names and relation table name are used - if ($cfg['Server']['user'] != $PHP_AUTH_USER) { - $servers_cnt = count($cfg['Servers']); - for ($i = 1; $i <= $servers_cnt; $i++) { - if (isset($cfg['Servers'][$i]) - && ($cfg['Servers'][$i]['host'] == $cfg['Server']['host'] && $cfg['Servers'][$i]['user'] == $PHP_AUTH_USER)) { - $server = $i; - $cfg['Server'] = $cfg['Servers'][$i]; - break; - } - } // end for - } // end if - - $cfg['Server']['user'] = $PHP_AUTH_USER; - $cfg['Server']['password'] = $PHP_AUTH_PW; - - return true; -} // end of the 'PMA_auth_set_user()' function - - -/** - * User is not allowed to login to MySQL -> authentication failed - * - * @return boolean always true (no return indeed) - * - * @access public - */ -function PMA_auth_fails() -{ - $error = PMA_DBI_getError(); - if ($error && $GLOBALS['errno'] != 1045) { - PMA_fatalError($error); - } else { - PMA_auth(); - return true; - } - -} // end of the 'PMA_auth_fails()' function - -?> diff --git a/htdocs/sql/libraries/auth/signon.auth.lib.php b/htdocs/sql/libraries/auth/signon.auth.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/auth/signon.auth.lib.php +++ /dev/null @@ -1,174 +0,0 @@ - authentication failed - * - * @return boolean always true (no return indeed) - * - * @access public - */ -function PMA_auth_fails() -{ - $error = PMA_DBI_getError(); - if ($error && $GLOBALS['errno'] != 1045) { - PMA_fatalError($error); - } else { - PMA_auth(); - return true; - } - -} // end of the 'PMA_auth_fails()' function - -?> diff --git a/htdocs/sql/libraries/blowfish.php b/htdocs/sql/libraries/blowfish.php deleted file mode 100755 --- a/htdocs/sql/libraries/blowfish.php +++ /dev/null @@ -1,563 +0,0 @@ - - * - * See the enclosed file COPYING for license information (LGPL). If you - * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. - * - * @author Mike Cochrane - * @version $Id: blowfish.php 10142 2007-03-20 10:32:13Z cybot_tm $ - * @since Horde 2.2 - * @package horde.cipher - */ - -// Change for phpMyAdmin by lem9: -//class Horde_Cipher_blowfish extends Horde_Cipher { -class Horde_Cipher_blowfish { - - /* Pi Array */ - var $p = array( - 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, - 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, - 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, - 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, - 0x9216D5D9, 0x8979FB1B); - - /* S Boxes */ - var $s1 = array( - 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, - 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, - 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, - 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, - 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE, - 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, - 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, - 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, - 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, - 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, - 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, - 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, - 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, - 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677, - 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, - 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, - 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88, - 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, - 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, - 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0, - 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, - 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, - 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88, - 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, - 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, - 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, - 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, - 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, - 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA, - 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, - 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, - 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09, - 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, - 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, - 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279, - 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, - 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, - 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82, - 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, - 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, - 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, - 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, - 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, - 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8, - 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, - 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, - 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, - 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, - 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, - 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1, - 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, - 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, - 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477, - 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, - 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, - 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, - 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, - 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, - 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41, - 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, - 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, - 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915, - 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, - 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A); - var $s2 = array( - 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, - 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, - 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, - 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, - 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6, - 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, - 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, - 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, - 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, - 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, - 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, - 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, - 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, - 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7, - 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, - 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, - 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF, - 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, - 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, - 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87, - 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, - 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, - 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16, - 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, - 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, - 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, - 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, - 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, - 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F, - 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, - 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, - 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960, - 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, - 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, - 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802, - 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, - 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, - 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF, - 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, - 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, - 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, - 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, - 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, - 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281, - 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, - 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, - 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128, - 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, - 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, - 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0, - 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, - 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, - 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3, - 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, - 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, - 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, - 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, - 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, - 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735, - 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, - 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, - 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340, - 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, - 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7); - var $s3 = array( - 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, - 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, - 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, - 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, - 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, - 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, - 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, - 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, - 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, - 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, - 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, - 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, - 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, - 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, - 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, - 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, - 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, - 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, - 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, - 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, - 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, - 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, - 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, - 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, - 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, - 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, - 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, - 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, - 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, - 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, - 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, - 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, - 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, - 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, - 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, - 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, - 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, - 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, - 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, - 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, - 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, - 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, - 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, - 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, - 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, - 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, - 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, - 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, - 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, - 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, - 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, - 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, - 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, - 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, - 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, - 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, - 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, - 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, - 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, - 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, - 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, - 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, - 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, - 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0); - var $s4 = array( - 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, - 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, - 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, - 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, - 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8, - 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, - 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, - 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, - 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, - 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, - 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, - 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, - 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, - 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51, - 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, - 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, - 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, - 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, - 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, - 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD, - 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, - 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, - 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB, - 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, - 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, - 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, - 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, - 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, - 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE, - 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, - 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, - 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, - 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, - 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, - 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84, - 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, - 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, - 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD, - 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, - 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, - 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, - 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, - 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, - 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525, - 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, - 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, - 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964, - 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, - 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, - 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D, - 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, - 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, - 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02, - 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, - 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, - 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, - 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, - 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, - 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0, - 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, - 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, - 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, - 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, - 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6); - - /* The number of rounds to do */ - var $_rounds = 16; - - /* Constructor */ - function Cipher_blowfish($params = null) - { - } - - /** - * Set the key to be used for en/decryption - * - * @param String $key The key to use - */ - function setKey($key) - { - $key = $this->_formatKey($key); - $keyPos = $keyXor = 0; - - $iMax = count($this->p); - $keyLen = count($key); - for ($i = 0; $i < $iMax; $i++) { - for ($t = 0; $t < 4; $t++) { - $keyXor = ($keyXor << 8) | (($key[$keyPos]) & 0x0ff); - if (++$keyPos == $keyLen) { - $keyPos = 0; - } - } - $this->p[$i] = $this->p[$i] ^ $keyXor; - } - - $encZero = array('L' => 0, 'R' => 0); - for ($i = 0; $i + 1 < $iMax; $i += 2) { - $encZero = $this->_encryptBlock($encZero['L'], $encZero['R']); - $this->p[$i] = $encZero['L']; - $this->p[$i + 1] = $encZero['R']; - } - - $iMax = count($this->s1); - for ($i = 0; $i < $iMax; $i += 2) { - $encZero = $this->_encryptBlock($encZero['L'], $encZero['R']); - $this->s1[$i] = $encZero['L']; - $this->s1[$i + 1] = $encZero['R']; - } - - $iMax = count($this->s2); - for ($i = 0; $i < $iMax; $i += 2) { - $encZero = $this->_encryptBlock($encZero['L'], $encZero['R']); - $this->s2[$i] = $encZero['L']; - $this->s2[$i + 1] = $encZero['R']; - } - - $iMax = count($this->s3); - for ($i = 0; $i < $iMax; $i += 2) { - $encZero = $this->_encryptBlock($encZero['L'], $encZero['R']); - $this->s3[$i] = $encZero['L']; - $this->s3[$i + 1] = $encZero['R']; - } - - $iMax = count($this->s4); - for ($i = 0; $i < $iMax; $i += 2) { - $encZero = $this->_encryptBlock($encZero['L'], $encZero['R']); - $this->s4[$i] = $encZero['L']; - $this->s4[$i + 1] = $encZero['R']; - } - - } - - /** - * Return the size of the blocks that this cipher needs - * - * @return Integer The number of characters per block - */ - function getBlockSize() - { - return 8; - } - - /** - * Encrypt a block on data. - * - * @param String $block The data to encrypt - * @param optional String $key The key to use - * - * @return String the encrypted output - */ - function encryptBlock($block, $key = null) - { - if (!is_null($key)) { - $this->setKey($key); - } - - list($L, $R) = array_values(unpack('N*', $block)); - $parts = $this->_encryptBlock($L, $R); - return pack("NN", $parts['L'], $parts['R']); - } - - /** - * Encrypt a block on data. - * - * @param String $L The data to encrypt. - * @param String $R The data to encrypt. - * - * @return String The encrypted output. - */ - function _encryptBlock($L, $R) - { - $L ^= $this->p[0]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[1]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[2]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[3]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[4]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[5]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[6]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[7]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[8]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[9]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[10]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[11]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[12]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[13]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[14]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[15]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[16]; - $R ^= $this->p[17]; - - return array('L' => $R, 'R' => $L); - } - - /** - * Decrypt a block on data. - * - * @param String $block The data to decrypt - * @param optional String $key The key to use - * - * @return String the decrypted output - */ - function decryptBlock($block, $key = null) - { - if (!is_null($key)) { - $this->setKey($key); - } - -// change for phpMyAdmin - $L = null; - $R = null; - - $retarray = array_values(unpack('N*', $block)); - if (isset($retarray[0])) { - $L = $retarray[0]; - } - if (isset($retarray[1])) { - $R = $retarray[1]; - } -// end change for phpMyAdmin - - $L ^= $this->p[17]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[16]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[15]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[14]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[13]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[12]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[11]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[10]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[9]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[8]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[7]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[6]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[5]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[4]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[3]; - $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[2]; - $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R & 0x0ff]) ^ $this->p[1]; - - $decrypted = pack("NN", $R ^ $this->p[0], $L); - return $decrypted; - } - - /** - * Converts a text key into an array. - * - * @return array The key. - */ - function _formatKey($key) - { - return array_values(unpack('C*', $key)); - } - -} - -// higher-level functions: - -/** - * String padding - * - * @param string input string - * @param integer length of the result - * @param string the filling string - * @param integer padding mode - * - * @return string the padded string - * - * @access public - */ -function full_str_pad($input, $pad_length, $pad_string = '', $pad_type = 0) { - $str = ''; - $length = $pad_length - strlen($input); - if ($length > 0) { // str_repeat doesn't like negatives - if ($pad_type == STR_PAD_RIGHT) { // STR_PAD_RIGHT == 1 - $str = $input.str_repeat($pad_string, $length); - } elseif ($pad_type == STR_PAD_BOTH) { // STR_PAD_BOTH == 2 - $str = str_repeat($pad_string, floor($length/2)); - $str .= $input; - $str .= str_repeat($pad_string, ceil($length/2)); - } else { // defaults to STR_PAD_LEFT == 0 - $str = str_repeat($pad_string, $length).$input; - } - } else { // if $length is negative or zero we don't need to do anything - $str = $input; - } - return $str; -} - -/** - * Encryption using blowfish algorithm - * - * @param string original data - * @param string the secret - * - * @return string the encrypted result - * - * @access public - * - * @author lem9 - */ -function PMA_blowfish_encrypt($data, $secret) { - $pma_cipher = new Horde_Cipher_blowfish; - $encrypt = ''; - for ($i=0; $iencryptBlock($block, $secret); - } - return base64_encode($encrypt); -} - -/** - * Decryption using blowfish algorithm - * - * @param string encrypted data - * @param string the secret - * - * @return string original data - * - * @access public - * - * @author lem9 - */ -function PMA_blowfish_decrypt($encdata, $secret) { - $pma_cipher = new Horde_Cipher_blowfish; - $decrypt = ''; - $data = base64_decode($encdata); - for ($i=0; $idecryptBlock(substr($data, $i, 8), $secret); - } - return trim($decrypt); -} - -?> diff --git a/htdocs/sql/libraries/bookmark.lib.php b/htdocs/sql/libraries/bookmark.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/bookmark.lib.php +++ /dev/null @@ -1,180 +0,0 @@ - no bookmark table - if ($server == 0) { - return ''; - } - - $cfgBookmark['user'] = $GLOBALS['cfg']['Server']['user']; - $cfgBookmark['db'] = $GLOBALS['cfg']['Server']['pmadb']; - $cfgBookmark['table'] = $GLOBALS['cfg']['Server']['bookmarktable']; - - return $cfgBookmark; -} // end of the 'PMA_getBookmarksParam()' function - - -/** - * Gets the list of bookmarks defined for the current database - * - * @global resource the controluser db connection handle - * - * @param string the current database name - * @param array the bookmark parameters for the current user - * - * @return mixed the bookmarks list if defined, false else - * - * @access public - */ -function PMA_listBookmarks($db, $cfgBookmark) -{ - global $controllink; - - if (empty($cfgBookmark['db']) || empty($cfgBookmark['table'])) { - return ''; - } - - $query = 'SELECT label, id FROM '. PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) - . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' - . ' AND (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' - . ' OR user = \'\')' - . ' ORDER BY label'; - $result = PMA_DBI_query($query, $controllink, PMA_DBI_QUERY_STORE); - - // There are some bookmarks -> store them - // use the unique id as the key - if ($result && PMA_DBI_num_rows($result) > 0) { - while ($row = PMA_DBI_fetch_row($result)) { - $bookmark_list[$row[1]] = $row[0]; - } // end while - return $bookmark_list; - } - // No bookmarks for the current database - else { - return FALSE; - } -} // end of the 'PMA_listBookmarks()' function - - -/** - * Gets the sql command from a bookmark - * - * @global resource the controluser db connection handle - * - * @param string the current database name - * @param array the bookmark parameters for the current user - * @param mixed the id of the bookmark to get - * @param string which field to look up the $id - * @param boolean TRUE: get all bookmarks regardless of the owning user - * - * @return string the sql query - * - * @access public - */ -function PMA_queryBookmarks($db, $cfgBookmark, $id, $id_field = 'id', $action_bookmark_all = FALSE) -{ - global $controllink; - - if (empty($cfgBookmark['db']) || empty($cfgBookmark['table'])) { - return ''; - } - - $query = 'SELECT query FROM ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) - . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\'' - . ($action_bookmark_all? '' : ' AND (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' - . ' OR user = \'\')') - . ' AND ' . PMA_backquote($id_field) . ' = ' . $id; - $result = PMA_DBI_try_query($query, $controllink); - if (!$result) { - return FALSE; - } - list($bookmark_query) = PMA_DBI_fetch_row($result) or array(FALSE); - - return $bookmark_query; -} // end of the 'PMA_queryBookmarks()' function - -/** - * Adds a bookmark - * - * @global resource the controluser db connection handle - * - * @param array the properties of the bookmark to add - * @param array the bookmark parameters for the current user - * @param boolean whether to make the bookmark available for all users - * - * @return boolean whether the INSERT succeeds or not - * - * @access public - */ -function PMA_addBookmarks($fields, $cfgBookmark, $all_users = false) -{ - global $controllink; - - $query = 'INSERT INTO ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) - . ' (id, dbase, user, query, label) VALUES (NULL, \'' . PMA_sqlAddslashes($fields['dbase']) . '\', \'' . ($all_users ? '' : PMA_sqlAddslashes($fields['user'])) . '\', \'' . PMA_sqlAddslashes(urldecode($fields['query'])) . '\', \'' . PMA_sqlAddslashes($fields['label']) . '\')'; - $result = PMA_DBI_query($query, $controllink); - - return TRUE; -} // end of the 'PMA_addBookmarks()' function - - -/** - * Deletes a bookmark - * - * @global resource the controluser db connection handle - * - * @param string the current database name - * @param array the bookmark parameters for the current user - * @param integer the id of the bookmark to get - * - * @access public - */ -function PMA_deleteBookmarks($db, $cfgBookmark, $id) -{ - global $controllink; - - $query = 'DELETE FROM ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) - . ' WHERE (user = \'' . PMA_sqlAddslashes($cfgBookmark['user']) . '\'' - . ' OR user = \'\')' - . ' AND id = ' . $id; - $result = PMA_DBI_try_query($query, $controllink); -} // end of the 'PMA_deleteBookmarks()' function - - -/** - * Bookmark Support - */ - -if (! isset($GLOBALS['cfgRelation'])) { - require_once './libraries/relation.lib.php'; - $GLOBALS['cfgRelation'] = PMA_getRelationsParam(); -} - -if ($GLOBALS['cfgRelation']['bookmarkwork']) { - $cfg['Bookmark'] = PMA_getBookmarksParam(); -} else { - $cfg['Bookmark'] = array(); -} - -?> diff --git a/htdocs/sql/libraries/charset_conversion.lib.php b/htdocs/sql/libraries/charset_conversion.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/charset_conversion.lib.php +++ /dev/null @@ -1,326 +0,0 @@ -= 40100)) { // lem9: even if AllowAnywhereRecoding is TRUE, do not recode for MySQL >= 4.1.x since MySQL does the job - return $what; - } elseif (is_array($what)) { - $result = array(); - foreach ($what AS $key => $val) { - if (is_string($val) || is_array($val)) { - if (is_string($key)) { - $result[PMA_convert_display_charset($key)] = PMA_convert_display_charset($val); - } else { - $result[$key] = PMA_convert_display_charset($val); - } - } else { - $result[$key] = $val; - } - } // end while - return $result; - } elseif (is_string($what)) { - - switch ($GLOBALS['PMA_recoding_engine']) { - case PMA_CHARSET_RECODE: - return recode_string($convcharset . '..' . $charset, $what); - case PMA_CHARSET_ICONV: - return iconv($convcharset, $charset . $cfg['IconvExtraParams'], $what); - case PMA_CHARSET_ICONV_AIX: - return PMA_aix_iconv_wrapper($convcharset, $charset . $cfg['IconvExtraParams'], $what); - case PMA_CHARSET_LIBICONV: - return libiconv($convcharset, $charset . $GLOBALS['cfg']['IconvExtraParams'], $what); - default: - return $what; - } - } elseif (is_object($what)) { - // isn't it object returned from mysql_fetch_field ? - if (@is_string($what->name)) { - $what->name = PMA_convert_display_charset($what->name); - } - if (@is_string($what->table)) { - $what->table = PMA_convert_display_charset($what->table); - } - if (@is_string($what->Database)) { - $what->Database = PMA_convert_display_charset($what->Database); - } - return $what; - } else { - // when we don't know what it is we don't touch it... - return $what; - } -} // end of the "PMA_convert_display_charset()" function - - -/** - * Converts encoding of text according to current settings. - * - * @param string what to convert - * - * @return string converted text - * - * @global array the configuration array - * @global boolean whether recoding is allowed or not - * @global string the current charset - * @global array the charset to convert to - * - * @access public - * - * @author nijel - */ -function PMA_convert_charset($what) { - global $cfg, $allow_recoding, $charset, $convcharset; - - if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding) - || $convcharset == $charset) { // rabus: if input and output charset are the same, we don't have to do anything... - return $what; - } else { - switch ($GLOBALS['PMA_recoding_engine']) { - case PMA_CHARSET_RECODE: - return recode_string($charset . '..' . $convcharset, $what); - case PMA_CHARSET_ICONV: - return iconv($charset, $convcharset . $cfg['IconvExtraParams'], $what); - case PMA_CHARSET_ICONV_AIX: - return PMA_aix_iconv_wrapper($charset, $convcharset . $cfg['IconvExtraParams'], $what); - case PMA_CHARSET_LIBICONV: - return libiconv($charset, $convcharset . $GLOBALS['cfg']['IconvExtraParams'], $what); - default: - return $what; - } - } -} // end of the "PMA_convert_charset()" function - -/** - * Converts encoding of text according to parameters with detected - * conversion function. - * - * @param string source charset - * @param string target charset - * @param string what to convert - * - * @return string converted text - * - * @access public - * - * @author nijel - */ -function PMA_convert_string($src_charset, $dest_charset, $what) { - if ($src_charset == $dest_charset) { - return $what; - } - switch ($GLOBALS['PMA_recoding_engine']) { - case PMA_CHARSET_RECODE: - return recode_string($src_charset . '..' . $dest_charset, $what); - case PMA_CHARSET_ICONV: - return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what); - case PMA_CHARSET_ICONV_AIX: - return PMA_aix_iconv_wrapper($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what); - case PMA_CHARSET_LIBICONV: - return libiconv($src_charset, $dest_charset, $what); - default: - return $what; - } -} // end of the "PMA_convert_string()" function - - -/** - * Converts encoding of file according to parameters with detected - * conversion function. The old file will be unlinked and new created and - * its file name is returned. - * - * @param string source charset - * @param string target charset - * @param string file to convert - * - * @return string new temporay file - * - * @access public - * - * @author nijel - */ -function PMA_convert_file($src_charset, $dest_charset, $file) { - switch ($GLOBALS['PMA_recoding_engine']) { - case PMA_CHARSET_RECODE: - case PMA_CHARSET_ICONV: - case PMA_CHARSET_LIBICONV: - $tmpfname = tempnam('', 'PMA_convert_file'); - $fin = fopen($file, 'r'); - $fout = fopen($tmpfname, 'w'); - if ($GLOBALS['PMA_recoding_engine'] == PMA_CHARSET_RECODE) { - recode_file($src_charset . '..' . $dest_charset, $fin, $fout); - } else { - while (!feof($fin)) { - $line = fgets($fin, 4096); - if ($GLOBALS['PMA_recoding_engine'] == PMA_CHARSET_ICONV) { - $dist = iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line); - } elseif ($GLOBALS['PMA_recoding_engine'] == PMA_CHARSET_ICONV_AIX) { - $dist = PMA_aix_iconv_wrapper($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line); - } else { - $dist = libiconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line); - } - fputs($fout, $dist); - } // end while - } - fclose($fin); - fclose($fout); - unlink($file); - - return $tmpfname; - default: - return $file; - } -} // end of the "PMA_convert_file()" function - -?> diff --git a/htdocs/sql/libraries/check_user_privileges.lib.php b/htdocs/sql/libraries/check_user_privileges.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/check_user_privileges.lib.php +++ /dev/null @@ -1,178 +0,0 @@ - 40100) { - $dbname_to_test = PMA_backquote($show_grants_dbname); - } else { - $dbname_to_test = $show_grants_dbname; - } - - if ((ereg($re0 . '%|_', $show_grants_dbname) - && !ereg('\\\\%|\\\\_', $show_grants_dbname)) - // does this db exist? - || (!PMA_DBI_try_query('USE ' . ereg_replace($re1 .'(%|_)', '\\1\\3', $dbname_to_test), null, PMA_DBI_QUERY_STORE) - && substr(PMA_DBI_getError(), 1, 4) != 1044) - ) { - $db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname)); - $db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create); - $is_create_db_priv = true; - - /** - * @todo collect $db_to_create into an array, to display a - * drop-down in the "Create new database" dialog - */ - // we don't break, we want all possible databases - //break; - } // end if - } // end elseif - } // end if - } // end while -} // end function - -// Detection for some CREATE privilege. - -// Since MySQL 4.1.2, we can easily detect current user's grants -// using $userlink (no control user needed) -// and we don't have to try any other method for detection - -if (PMA_MYSQL_INT_VERSION >= 40102) { - $rs_usr = PMA_DBI_try_query('SHOW GRANTS', $userlink, PMA_DBI_QUERY_STORE); - if ($rs_usr) { - PMA_analyseShowGrant($rs_usr, $is_create_db_priv, $db_to_create, $is_reload_priv, $dbs_where_create_table_allowed); - PMA_DBI_free_result($rs_usr); - unset($rs_usr); - } -} else { - -// Before MySQL 4.1.2, we first try to find a priv in mysql.user. Hopefuly -// the controluser is correctly defined; but here, $controllink could contain -// $userlink so maybe the SELECT will fail - - if (!$is_create_db_priv) { - $res = PMA_DBI_query('SELECT USER();', null, PMA_DBI_QUERY_STORE); - list($mysql_cur_user_and_host) = PMA_DBI_fetch_row($res); - $mysql_cur_user = substr($mysql_cur_user_and_host, 0, strrpos($mysql_cur_user_and_host, '@')); - - $local_query = 'SELECT Create_priv, Reload_priv FROM mysql.user WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($mysql_cur_user), 'quoted') . ' OR ' . PMA_convert_using('User') . ' = ' . PMA_convert_using('', 'quoted') . ';'; - $rs_usr = PMA_DBI_try_query($local_query, $controllink, PMA_DBI_QUERY_STORE); // Debug: or PMA_mysqlDie('', $local_query, false); - if ($rs_usr) { - while ($result_usr = PMA_DBI_fetch_assoc($rs_usr)) { - if (!$is_create_db_priv) { - $is_create_db_priv = ($result_usr['Create_priv'] == 'Y'); - } - if (!$is_reload_priv) { - $is_reload_priv = ($result_usr['Reload_priv'] == 'Y'); - } - } // end while - PMA_DBI_free_result($rs_usr); - unset($rs_usr, $result_usr); - if ($is_create_db_priv) { - $dbs_where_create_table_allowed[] = '*'; - } - } // end if - } // end if - - // If the user has Create priv on a inexistant db, show him in the dialog - // the first inexistant db name that we find, in most cases it's probably - // the one he just dropped :) - if (!$is_create_db_priv) { - $local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE ' . PMA_convert_using('Create_priv') . ' = ' . PMA_convert_using('Y', 'quoted') . ' AND (' . PMA_convert_using('User') . ' = ' .PMA_convert_using(PMA_sqlAddslashes($mysql_cur_user), 'quoted') . ' OR ' . PMA_convert_using('User') . ' = ' . PMA_convert_using('', 'quoted') . ');'; - - $rs_usr = PMA_DBI_try_query($local_query, $controllink, PMA_DBI_QUERY_STORE); - if ($rs_usr) { - $re0 = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards - $re1 = '(^|[^\])(\\\)+'; // escaped wildcards - while ($row = PMA_DBI_fetch_assoc($rs_usr)) { - $dbs_where_create_table_allowed[] = $row['Db']; - if (ereg($re0 . '(%|_)', $row['Db']) - || (!PMA_DBI_try_query('USE ' . ereg_replace($re1 . '(%|_)', '\\1\\3', $row['Db'])) && substr(PMA_DBI_getError(), 1, 4) != 1044)) { - $db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $row['Db'])); - $db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create); - $is_create_db_priv = true; - break; - } // end if - } // end while - PMA_DBI_free_result($rs_usr); - unset($rs_usr, $row, $re0, $re1); - } else { - // Finally, let's try to get the user's privileges by using SHOW - // GRANTS... - // Maybe we'll find a little CREATE priv there :) - $rs_usr = PMA_DBI_try_query('SHOW GRANTS FOR ' . $mysql_cur_user_and_host . ';', $controllink, PMA_DBI_QUERY_STORE); - if (!$rs_usr) { - // OK, now we'd have to guess the user's hostname, but we - // only try out the 'username'@'%' case. - $rs_usr = PMA_DBI_try_query('SHOW GRANTS FOR ' . PMA_convert_using(PMA_sqlAddslashes($mysql_cur_user), 'quoted') . ';', $controllink, PMA_DBI_QUERY_STORE); - } - unset($local_query); - if ($rs_usr) { - PMA_analyseShowGrant($rs_usr, $is_create_db_priv, $db_to_create, $is_reload_priv, $dbs_where_create_table_allowed); - PMA_DBI_free_result($rs_usr); - unset($rs_usr); - } // end if - } // end elseif - } // end if -} // end else (MySQL < 4.1.2) - -// If disabled, don't show it -if (!$cfg['SuggestDBName']) { - $db_to_create = ''; -} -?> diff --git a/htdocs/sql/libraries/cleanup.lib.php b/htdocs/sql/libraries/cleanup.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/cleanup.lib.php +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/htdocs/sql/libraries/common.inc.php b/htdocs/sql/libraries/common.inc.php deleted file mode 100755 --- a/htdocs/sql/libraries/common.inc.php +++ /dev/null @@ -1,923 +0,0 @@ - 1000) { - die('possible exploit'); -} - -/** - * Check for numeric keys - * (if register_globals is on, numeric key can be found in $GLOBALS) - */ -foreach ($GLOBALS as $key => $dummy) { - if (is_numeric($key)) { - die('numeric key detected'); - } -} -unset($dummy); - -/** - * PATH_INFO could be compromised if set, so remove it from PHP_SELF - * and provide a clean PHP_SELF here - */ -$PMA_PHP_SELF = PMA_getenv('PHP_SELF'); -$_PATH_INFO = PMA_getenv('PATH_INFO'); -if (! empty($_PATH_INFO) && ! empty($PMA_PHP_SELF)) { - $path_info_pos = strrpos($PMA_PHP_SELF, $_PATH_INFO); - if ($path_info_pos + strlen($_PATH_INFO) === strlen($PMA_PHP_SELF)) { - $PMA_PHP_SELF = substr($PMA_PHP_SELF, 0, $path_info_pos); - } -} -$PMA_PHP_SELF = htmlspecialchars($PMA_PHP_SELF); - - -/** - * just to be sure there was no import (registering) before here - * we empty the global space (but avoid unsetting $variables_list - * and $key in the foreach(), we still need them!) - */ -$variables_whitelist = array ( - 'GLOBALS', - '_SERVER', - '_GET', - '_POST', - '_REQUEST', - '_FILES', - '_ENV', - '_COOKIE', - '_SESSION', - 'PMA_PHP_SELF', - 'variables_whitelist', - 'key' -); - -foreach (get_defined_vars() as $key => $value) { - if (! in_array($key, $variables_whitelist)) { - unset($$key); - } -} -unset($key, $value, $variables_whitelist); - - -/** - * Subforms - some functions need to be called by form, cause of the limited URL - * length, but if this functions inside another form you cannot just open a new - * form - so phpMyAdmin uses 'arrays' inside this form - * - * - *
- * ... main form elments ... - * - * ... other subform data ... - * - * ... other subforms ... - * - * ... other subform data ... - * - * ... main form elments ... - * - *
- *
$tmp) { - PMA_removeCookie($cookie_name); - } - $_COOKIE = array(); - PMA_setCookie('pmaCookieVer', $pma_cookie_version); -} - -/** - * include deprecated grab_globals only if required - */ -if (empty($__redirect) && !defined('PMA_NO_VARIABLES_IMPORT')) { - require './libraries/grab_globals.lib.php'; -} - -/** - * include session handling after the globals, to prevent overwriting - */ -require_once './libraries/session.inc.php'; - -/** - * init some variables LABEL_variables_init - */ - -/** - * holds errors - * @global array $GLOBALS['PMA_errors'] - */ -$GLOBALS['PMA_errors'] = array(); - -/** - * holds parameters to be passed to next page - * @global array $GLOBALS['url_params'] - */ -$GLOBALS['url_params'] = array(); - -/** - * the whitelist for $GLOBALS['goto'] - * @global array $goto_whitelist - */ -$goto_whitelist = array( - //'browse_foreigners.php', - //'calendar.php', - //'changelog.php', - //'chk_rel.php', - 'db_create.php', - 'db_datadict.php', - 'db_sql.php', - 'db_export.php', - 'db_importdocsql.php', - 'db_qbe.php', - 'db_structure.php', - 'db_import.php', - 'db_operations.php', - 'db_printview.php', - 'db_search.php', - //'Documentation.html', - //'error.php', - 'export.php', - 'import.php', - //'index.php', - //'navigation.php', - //'license.php', - 'main.php', - 'pdf_pages.php', - 'pdf_schema.php', - //'phpinfo.php', - 'querywindow.php', - //'readme.php', - 'server_binlog.php', - 'server_collations.php', - 'server_databases.php', - 'server_engines.php', - 'server_export.php', - 'server_import.php', - 'server_privileges.php', - 'server_processlist.php', - 'server_sql.php', - 'server_status.php', - 'server_variables.php', - 'sql.php', - 'tbl_addfield.php', - 'tbl_alter.php', - 'tbl_change.php', - 'tbl_create.php', - 'tbl_import.php', - 'tbl_indexes.php', - 'tbl_move_copy.php', - 'tbl_printview.php', - 'tbl_sql.php', - 'tbl_export.php', - 'tbl_operations.php', - 'tbl_structure.php', - 'tbl_relation.php', - 'tbl_replace.php', - 'tbl_row_action.php', - 'tbl_select.php', - //'themes.php', - 'transformation_overview.php', - 'transformation_wrapper.php', - 'translators.html', - 'user_password.php', -); - -/** - * check $__redirect against whitelist - */ -if (! PMA_checkPageValidity($__redirect, $goto_whitelist)) { - $__redirect = null; -} - -/** - * holds page that should be displayed - * @global string $GLOBALS['goto'] - */ -$GLOBALS['goto'] = ''; -// Security fix: disallow accessing serious server files via "?goto=" -if (PMA_checkPageValidity($_REQUEST['goto'], $goto_whitelist)) { - $GLOBALS['goto'] = $_REQUEST['goto']; - $GLOBALS['url_params']['goto'] = $_REQUEST['goto']; -} else { - unset($_REQUEST['goto'], $_GET['goto'], $_POST['goto'], $_COOKIE['goto']); -} - -/** - * returning page - * @global string $GLOBALS['back'] - */ -if (PMA_checkPageValidity($_REQUEST['back'], $goto_whitelist)) { - $GLOBALS['back'] = $_REQUEST['back']; -} else { - unset($_REQUEST['back'], $_GET['back'], $_POST['back'], $_COOKIE['back']); -} - -/** - * Check whether user supplied token is valid, if not remove any possibly - * dangerous stuff from request. - * - * remember that some objects in the session with session_start and __wakeup() - * could access this variables before we reach this point - * f.e. PMA_Config: fontsize - * - * @todo variables should be handled by their respective owners (objects) - * f.e. lang, server, convcharset, collation_connection in PMA_Config - */ -if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['token']) { - /** - * List of parameters which are allowed from unsafe source - */ - $allow_list = array( - /* needed for direct access, see FAQ 1.34 - * also, server needed for cookie login screen (multi-server) - */ - 'server', 'db', 'table', 'target', - /* to change the language on login screen or main page */ - 'lang', - /* Session ID */ - 'phpMyAdmin', - /* Cookie preferences */ - 'pma_lang', 'pma_charset', 'pma_collation_connection', - /* Possible login form */ - 'pma_servername', 'pma_username', 'pma_password', - ); - /** - * Require cleanup functions - */ - require_once './libraries/cleanup.lib.php'; - /** - * Do actual cleanup - */ - PMA_remove_request_vars($allow_list); - -} - - -/** - * @global string $convcharset - * @see select_lang.lib.php - */ -if (isset($_REQUEST['convcharset'])) { - $convcharset = strip_tags($_REQUEST['convcharset']); -} - -/** - * current selected database - * @global string $GLOBALS['db'] - */ -$GLOBALS['db'] = ''; -if (PMA_isValid($_REQUEST['db'])) { - // can we strip tags from this? - // only \ and / is not allowed in db names for MySQL - $GLOBALS['db'] = $_REQUEST['db']; - $GLOBALS['url_params']['db'] = $GLOBALS['db']; -} - -/** - * current selected table - * @global string $GLOBALS['table'] - */ -$GLOBALS['table'] = ''; -if (PMA_isValid($_REQUEST['table'])) { - // can we strip tags from this? - // only \ and / is not allowed in table names for MySQL - $GLOBALS['table'] = $_REQUEST['table']; - $GLOBALS['url_params']['table'] = $GLOBALS['table']; -} - -/** - * SQL query to be executed - * @global string $GLOBALS['sql_query'] - */ -$GLOBALS['sql_query'] = ''; -if (PMA_isValid($_REQUEST['sql_query'])) { - $GLOBALS['sql_query'] = $_REQUEST['sql_query']; -} - -/** - * avoid problems in phpmyadmin.css.php in some cases - * @global string $js_frame - */ -$_REQUEST['js_frame'] = PMA_ifSetOr($_REQUEST['js_frame'], ''); - -//$_REQUEST['set_theme'] // checked later in this file LABEL_theme_setup -//$_REQUEST['server']; // checked later in this file -//$_REQUEST['lang']; // checked by LABEL_loading_language_file - - - -/******************************************************************************/ -/* parsing configuration file LABEL_parsing_config_file */ - -/** - * We really need this one! - */ -if (! function_exists('preg_replace')) { - PMA_fatalError('strCantLoad', 'pcre'); -} - -/** - * @global PMA_Config $_SESSION['PMA_Config'] - * force reading of config file, because we removed sensitive values - * in the previous iteration - */ -$_SESSION['PMA_Config'] = new PMA_Config('./config.inc.php'); - -if (!defined('PMA_MINIMUM_COMMON')) { - $_SESSION['PMA_Config']->checkPmaAbsoluteUri(); -} - -/** - * BC - enable backward compatibility - * exports all configuration settings into $GLOBALS ($GLOBALS['cfg']) - */ -$_SESSION['PMA_Config']->enableBc(); - - -/** - * check HTTPS connection - */ -if ($_SESSION['PMA_Config']->get('ForceSSL') - && !$_SESSION['PMA_Config']->get('is_https')) { - PMA_sendHeaderLocation( - preg_replace('/^http/', 'https', - $_SESSION['PMA_Config']->get('PmaAbsoluteUri')) - . PMA_generate_common_url($_GET)); - exit; -} - - -/******************************************************************************/ -/* loading language file LABEL_loading_language_file */ - -/** - * Added messages while developing: - */ -if (file_exists('./lang/added_messages.php')) { - include './lang/added_messages.php'; -} - -/** - * Includes the language file if it hasn't been included yet - */ -require './libraries/language.lib.php'; - - -/** - * check for errors occurred while loading configuration - * this check is done here after loading language files to present errors in locale - */ -if ($_SESSION['PMA_Config']->error_config_file) { - $GLOBALS['PMA_errors'][] = $strConfigFileError - . '

' - . ($_SESSION['PMA_Config']->getSource() == './config.inc.php' ? - '' . $_SESSION['PMA_Config']->getSource() . '' - : - '' . $_SESSION['PMA_Config']->getSource() . ''); -} -if ($_SESSION['PMA_Config']->error_config_default_file) { - $GLOBALS['PMA_errors'][] = sprintf($strConfigDefaultFileError, - $_SESSION['PMA_Config']->default_source); -} -if ($_SESSION['PMA_Config']->error_pma_uri) { - $GLOBALS['PMA_errors'][] = sprintf($strPmaUriError); -} - -/** - * current server - * @global integer $GLOBALS['server'] - */ -$GLOBALS['server'] = 0; - -/** - * Servers array fixups. - * $default_server comes from PMA_Config::enableBc() - * @todo merge into PMA_Config - */ -// Do we have some server? -if (!isset($cfg['Servers']) || count($cfg['Servers']) == 0) { - // No server => create one with defaults - $cfg['Servers'] = array(1 => $default_server); -} else { - // We have server(s) => apply default configuration - $new_servers = array(); - - foreach ($cfg['Servers'] as $server_index => $each_server) { - - // Detect wrong configuration - if (!is_int($server_index) || $server_index < 1) { - $GLOBALS['PMA_errors'][] = sprintf($strInvalidServerIndex, $server_index); - } - - $each_server = array_merge($default_server, $each_server); - - // Don't use servers with no hostname - if ($each_server['connect_type'] == 'tcp' && empty($each_server['host'])) { - $GLOBALS['PMA_errors'][] = sprintf($strInvalidServerHostname, $server_index); - } - - // Final solution to bug #582890 - // If we are using a socket connection - // and there is nothing in the verbose server name - // or the host field, then generate a name for the server - // in the form of "Server 2", localized of course! - if ($each_server['connect_type'] == 'socket' && empty($each_server['host']) && empty($each_server['verbose'])) { - $each_server['verbose'] = $GLOBALS['strServer'] . $server_index; - } - - $new_servers[$server_index] = $each_server; - } - $cfg['Servers'] = $new_servers; - unset($new_servers, $server_index, $each_server); -} - -// Cleanup -unset($default_server); - - -/******************************************************************************/ -/* setup themes LABEL_theme_setup */ - -/** - * @global PMA_Theme_Manager $_SESSION['PMA_Theme_Manager'] - */ -if (! isset($_SESSION['PMA_Theme_Manager'])) { - $_SESSION['PMA_Theme_Manager'] = new PMA_Theme_Manager; -} else { - /** - * @todo move all __wakeup() functionality into session.inc.php - */ - $_SESSION['PMA_Theme_Manager']->checkConfig(); -} - -// for the theme per server feature -if (isset($_REQUEST['server']) && !isset($_REQUEST['set_theme'])) { - $GLOBALS['server'] = $_REQUEST['server']; - $tmp = $_SESSION['PMA_Theme_Manager']->getThemeCookie(); - if (empty($tmp)) { - $tmp = $_SESSION['PMA_Theme_Manager']->theme_default; - } - $_SESSION['PMA_Theme_Manager']->setActiveTheme($tmp); - unset($tmp); -} -/** - * @todo move into PMA_Theme_Manager::__wakeup() - */ -if (isset($_REQUEST['set_theme'])) { - // if user selected a theme - $_SESSION['PMA_Theme_Manager']->setActiveTheme($_REQUEST['set_theme']); -} - -/** - * the theme object - * @global PMA_Theme $_SESSION['PMA_Theme'] - */ -$_SESSION['PMA_Theme'] = $_SESSION['PMA_Theme_Manager']->theme; - -// BC -/** - * the active theme - * @global string $GLOBALS['theme'] - */ -$GLOBALS['theme'] = $_SESSION['PMA_Theme']->getName(); -/** - * the theme path - * @global string $GLOBALS['pmaThemePath'] - */ -$GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath(); -/** - * the theme image path - * @global string $GLOBALS['pmaThemeImage'] - */ -$GLOBALS['pmaThemeImage'] = $_SESSION['PMA_Theme']->getImgPath(); - -/** - * load layout file if exists - */ -if (@file_exists($_SESSION['PMA_Theme']->getLayoutFile())) { - include $_SESSION['PMA_Theme']->getLayoutFile(); - /** - * @todo remove if all themes are update use Navi instead of Left as frame name - */ - if (! isset($GLOBALS['cfg']['NaviWidth']) - && isset($GLOBALS['cfg']['LeftWidth'])) { - $GLOBALS['cfg']['NaviWidth'] = $GLOBALS['cfg']['LeftWidth']; - } -} - -if (! defined('PMA_MINIMUM_COMMON')) { - /** - * Character set conversion. - */ - require_once './libraries/charset_conversion.lib.php'; - - /** - * String handling - */ - require_once './libraries/string.lib.php'; - - /** - * Lookup server by name - * by Arnold - Helder Hosting - * (see FAQ 4.8) - */ - if (! empty($_REQUEST['server']) && is_string($_REQUEST['server']) - && ! is_numeric($_REQUEST['server'])) { - foreach ($cfg['Servers'] as $i => $server) { - if ($server['host'] == $_REQUEST['server']) { - $_REQUEST['server'] = $i; - break; - } - } - if (is_string($_REQUEST['server'])) { - unset($_REQUEST['server']); - } - unset($i); - } - - /** - * If no server is selected, make sure that $cfg['Server'] is empty (so - * that nothing will work), and skip server authentication. - * We do NOT exit here, but continue on without logging into any server. - * This way, the welcome page will still come up (with no server info) and - * present a choice of servers in the case that there are multiple servers - * and '$cfg['ServerDefault'] = 0' is set. - */ - - if (isset($_REQUEST['server']) && (is_string($_REQUEST['server']) || is_numeric($_REQUEST['server'])) && ! empty($_REQUEST['server']) && ! empty($cfg['Servers'][$_REQUEST['server']])) { - $GLOBALS['server'] = $_REQUEST['server']; - $cfg['Server'] = $cfg['Servers'][$GLOBALS['server']]; - } else { - if (!empty($cfg['Servers'][$cfg['ServerDefault']])) { - $GLOBALS['server'] = $cfg['ServerDefault']; - $cfg['Server'] = $cfg['Servers'][$GLOBALS['server']]; - } else { - $GLOBALS['server'] = 0; - $cfg['Server'] = array(); - } - } - $GLOBALS['url_params']['server'] = $GLOBALS['server']; - - if (! empty($cfg['Server'])) { - - /** - * Loads the proper database interface for this server - */ - require_once './libraries/database_interface.lib.php'; - - // Gets the authentication library that fits the $cfg['Server'] settings - // and run authentication - - // to allow HTTP or http - $cfg['Server']['auth_type'] = strtolower($cfg['Server']['auth_type']); - if (! file_exists('./libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php')) { - PMA_fatalError($strInvalidAuthMethod . ' ' . $cfg['Server']['auth_type']); - } - /** - * the required auth type plugin - */ - require_once './libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php'; - - if (!PMA_auth_check()) { - PMA_auth(); - } else { - PMA_auth_set_user(); - } - - // Check IP-based Allow/Deny rules as soon as possible to reject the - // user - // Based on mod_access in Apache: - // http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/aaa/mod_access.c?rev=1.37&content-type=text/vnd.viewcvs-markup - // Look at: "static int check_dir_access(request_rec *r)" - // Robbat2 - May 10, 2002 - if (isset($cfg['Server']['AllowDeny']) - && isset($cfg['Server']['AllowDeny']['order'])) { - - /** - * ip based access library - */ - require_once './libraries/ip_allow_deny.lib.php'; - - $allowDeny_forbidden = false; // default - if ($cfg['Server']['AllowDeny']['order'] == 'allow,deny') { - $allowDeny_forbidden = true; - if (PMA_allowDeny('allow')) { - $allowDeny_forbidden = false; - } - if (PMA_allowDeny('deny')) { - $allowDeny_forbidden = true; - } - } elseif ($cfg['Server']['AllowDeny']['order'] == 'deny,allow') { - if (PMA_allowDeny('deny')) { - $allowDeny_forbidden = true; - } - if (PMA_allowDeny('allow')) { - $allowDeny_forbidden = false; - } - } elseif ($cfg['Server']['AllowDeny']['order'] == 'explicit') { - if (PMA_allowDeny('allow') - && !PMA_allowDeny('deny')) { - $allowDeny_forbidden = false; - } else { - $allowDeny_forbidden = true; - } - } // end if ... elseif ... elseif - - // Ejects the user if banished - if ($allowDeny_forbidden) { - PMA_auth_fails(); - } - unset($allowDeny_forbidden); //Clean up after you! - } // end if - - // is root allowed? - if (!$cfg['Server']['AllowRoot'] && $cfg['Server']['user'] == 'root') { - $allowDeny_forbidden = true; - PMA_auth_fails(); - unset($allowDeny_forbidden); //Clean up after you! - } - - $bkp_track_err = @ini_set('track_errors', 1); - - // Try to connect MySQL with the control user profile (will be used to - // get the privileges list for the current user but the true user link - // must be open after this one so it would be default one for all the - // scripts) - $controllink = false; - if ($cfg['Server']['controluser'] != '') { - $controllink = PMA_DBI_connect($cfg['Server']['controluser'], - $cfg['Server']['controlpass'], true); - } - if (! $controllink) { - $controllink = PMA_DBI_connect($cfg['Server']['user'], - $cfg['Server']['password'], true); - } // end if ... else - - // Pass #1 of DB-Config to read in master level DB-Config will go here - // Robbat2 - May 11, 2002 - - // Connects to the server (validates user's login) - $userlink = PMA_DBI_connect($cfg['Server']['user'], - $cfg['Server']['password'], false); - - // Pass #2 of DB-Config to read in user level DB-Config will go here - // Robbat2 - May 11, 2002 - - @ini_set('track_errors', $bkp_track_err); - unset($bkp_track_err); - - /** - * If we auto switched to utf-8 we need to reread messages here - */ - if (defined('PMA_LANG_RELOAD')) { - require './libraries/language.lib.php'; - } - - /** - * SQL Parser code - */ - require_once './libraries/sqlparser.lib.php'; - - /** - * SQL Validator interface code - */ - require_once './libraries/sqlvalidator.lib.php'; - - /** - * the PMA_List_Database class - */ - require_once './libraries/List_Database.class.php'; - $PMA_List_Database = new PMA_List_Database($userlink, $controllink); - - /** - * some resetting has to be done when switching servers - */ - if (isset($_SESSION['userconf']['previous_server']) && $_SESSION['userconf']['previous_server'] != $GLOBALS['server']) { - unset($_SESSION['userconf']['navi_limit_offset']); - } - $_SESSION['userconf']['previous_server'] = $GLOBALS['server']; - - } // end server connecting - - /** - * Kanji encoding convert feature appended by Y.Kawada (2002/2/20) - */ - if (@function_exists('mb_convert_encoding') - && strpos(' ' . $lang, 'ja-') - && file_exists('./libraries/kanji-encoding.lib.php')) { - require_once './libraries/kanji-encoding.lib.php'; - /** - * enable multibyte string support - */ - define('PMA_MULTIBYTE_ENCODING', 1); - } // end if - - /** - * save some settings in cookies - * @todo should be done in PMA_Config - */ - PMA_setCookie('pma_lang', $GLOBALS['lang']); - PMA_setCookie('pma_charset', $GLOBALS['convcharset']); - PMA_setCookie('pma_collation_connection', $GLOBALS['collation_connection']); - - $_SESSION['PMA_Theme_Manager']->setThemeCookie(); - - /** - * check if profiling was requested and remember it - * (note: when $cfg['ServerDefault'] = 0, constant is not defined) - */ - - if (PMA_profilingSupported() && isset($_REQUEST['profiling'])) { - $_SESSION['profiling'] = true; - } elseif (isset($_REQUEST['profiling_form'])) { - // the checkbox was unchecked - unset($_SESSION['profiling']); - } - -} // end if !defined('PMA_MINIMUM_COMMON') - -// remove sensitive values from session -$_SESSION['PMA_Config']->set('blowfish_secret', ''); -$_SESSION['PMA_Config']->set('Servers', ''); -$_SESSION['PMA_Config']->set('default_server', ''); - -if (!empty($__redirect) && in_array($__redirect, $goto_whitelist)) { - /** - * include subform target page - */ - require $__redirect; - exit(); -} -?> diff --git a/htdocs/sql/libraries/common.lib.php b/htdocs/sql/libraries/common.lib.php deleted file mode 100755 --- a/htdocs/sql/libraries/common.lib.php +++ /dev/null @@ -1,2367 +0,0 @@ -'; - } else { - return $alternate; - } -} - -/** - * Displays the maximum size for an upload - * - * @uses $GLOBALS['strMaximumSize'] - * @uses PMA_formatByteDown() - * @uses sprintf() - * @param integer the size - * - * @return string the message - * - * @access public - */ -function PMA_displayMaximumUploadSize($max_upload_size) -{ - list($max_size, $max_unit) = PMA_formatByteDown($max_upload_size); - return '(' . sprintf($GLOBALS['strMaximumSize'], $max_size, $max_unit) . ')'; -} - -/** - * Generates a hidden field which should indicate to the browser - * the maximum size for upload - * - * @param integer the size - * - * @return string the INPUT field - * - * @access public - */ - function PMA_generateHiddenMaxFileSize($max_size) - { - return ''; - } - -/** - * Add slashes before "'" and "\" characters so a value containing them can - * be used in a sql comparison. - * - * @uses str_replace() - * @param string the string to slash - * @param boolean whether the string will be used in a 'LIKE' clause - * (it then requires two more escaped sequences) or not - * @param boolean whether to treat cr/lfs as escape-worthy entities - * (converts \n to \\n, \r to \\r) - * - * @param boolean whether this function is used as part of the - * "Create PHP code" dialog - * - * @return string the slashed string - * - * @access public - */ -function PMA_sqlAddslashes($a_string = '', $is_like = false, $crlf = false, $php_code = false) -{ - if ($is_like) { - $a_string = str_replace('\\', '\\\\\\\\', $a_string); - } else { - $a_string = str_replace('\\', '\\\\', $a_string); - } - - if ($crlf) { - $a_string = str_replace("\n", '\n', $a_string); - $a_string = str_replace("\r", '\r', $a_string); - $a_string = str_replace("\t", '\t', $a_string); - } - - if ($php_code) { - $a_string = str_replace('\'', '\\\'', $a_string); - } else { - $a_string = str_replace('\'', '\'\'', $a_string); - } - - return $a_string; -} // end of the 'PMA_sqlAddslashes()' function - - -/** - * Add slashes before "_" and "%" characters for using them in MySQL - * database, table and field names. - * Note: This function does not escape backslashes! - * - * @uses str_replace() - * @param string the string to escape - * - * @return string the escaped string - * - * @access public - */ -function PMA_escape_mysql_wildcards($name) -{ - $name = str_replace('_', '\\_', $name); - $name = str_replace('%', '\\%', $name); - - return $name; -} // end of the 'PMA_escape_mysql_wildcards()' function - -/** - * removes slashes before "_" and "%" characters - * Note: This function does not unescape backslashes! - * - * @uses str_replace() - * @param string $name the string to escape - * @return string the escaped string - * @access public - */ -function PMA_unescape_mysql_wildcards($name) -{ - $name = str_replace('\\_', '_', $name); - $name = str_replace('\\%', '%', $name); - - return $name; -} // end of the 'PMA_unescape_mysql_wildcards()' function - -/** - * removes quotes (',",`) from a quoted string - * - * checks if the sting is quoted and removes this quotes - * - * @uses str_replace() - * @uses substr() - * @param string $quoted_string string to remove quotes from - * @param string $quote type of quote to remove - * @return string unqoted string - */ -function PMA_unQuote($quoted_string, $quote = null) -{ - $quotes = array(); - - if (null === $quote) { - $quotes[] = '`'; - $quotes[] = '"'; - $quotes[] = "'"; - } else { - $quotes[] = $quote; - } - - foreach ($quotes as $quote) { - if (substr($quoted_string, 0, 1) === $quote - && substr($quoted_string, -1, 1) === $quote) { - $unquoted_string = substr($quoted_string, 1, -1); - // replace escaped quotes - $unquoted_string = str_replace($quote . $quote, $quote, $unquoted_string); - return $unquoted_string; - } - } - - return $quoted_string; -} - -/** - * format sql strings - * - * @todo move into PMA_Sql - * @uses PMA_SQP_isError() - * @uses PMA_SQP_formatHtml() - * @uses PMA_SQP_formatNone() - * @uses is_array() - * @param mixed pre-parsed SQL structure - * - * @return string the formatted sql - * - * @global array the configuration array - * @global boolean whether the current statement is a multiple one or not - * - * @access public - * - * @author Robin Johnson - */ -function PMA_formatSql($parsed_sql, $unparsed_sql = '') -{ - global $cfg; - - // Check that we actually have a valid set of parsed data - // well, not quite - // first check for the SQL parser having hit an error - if (PMA_SQP_isError()) { - return $parsed_sql; - } - // then check for an array - if (!is_array($parsed_sql)) { - // We don't so just return the input directly - // This is intended to be used for when the SQL Parser is turned off - $formatted_sql = '
' . "\n"
-                        . (($cfg['SQP']['fmtType'] == 'none' && $unparsed_sql != '') ? $unparsed_sql : $parsed_sql) . "\n"
-                        . '
'; - return $formatted_sql; - } - - $formatted_sql = ''; - - switch ($cfg['SQP']['fmtType']) { - case 'none': - if ($unparsed_sql != '') { - $formatted_sql = "
\n" . PMA_SQP_formatNone(array('raw' => $unparsed_sql)) . "\n
"; - } else { - $formatted_sql = PMA_SQP_formatNone($parsed_sql); - } - break; - case 'html': - $formatted_sql = PMA_SQP_formatHtml($parsed_sql, 'color'); - break; - case 'text': - //$formatted_sql = PMA_SQP_formatText($parsed_sql); - $formatted_sql = PMA_SQP_formatHtml($parsed_sql, 'text'); - break; - default: - break; - } // end switch - - return $formatted_sql; -} // end of the "PMA_formatSql()" function - - -/** - * Displays a link to the official MySQL documentation - * - * @uses $cfg['MySQLManualType'] - * @uses $cfg['MySQLManualBase'] - * @uses $cfg['ReplaceHelpImg'] - * @uses $GLOBALS['mysql_4_1_doc_lang'] - * @uses $GLOBALS['mysql_5_1_doc_lang'] - * @uses $GLOBALS['mysql_5_0_doc_lang'] - * @uses $GLOBALS['strDocu'] - * @uses $GLOBALS['pmaThemeImage'] - * @uses PMA_MYSQL_INT_VERSION - * @uses strtolower() - * @uses str_replace() - * @param string chapter of "HTML, one page per chapter" documentation - * @param string contains name of page/anchor that is being linked - * @param bool whether to use big icon (like in left frame) - * - * @return string the html link - * - * @access public - */ -function PMA_showMySQLDocu($chapter, $link, $big_icon = false) -{ - global $cfg; - - if ($cfg['MySQLManualType'] == 'none' || empty($cfg['MySQLManualBase'])) { - return ''; - } - - // Fixup for newly used names: - $chapter = str_replace('_', '-', strtolower($chapter)); - $link = str_replace('_', '-', strtolower($link)); - - switch ($cfg['MySQLManualType']) { - case 'chapters': - if (empty($chapter)) { - $chapter = 'index'; - } - $url = $cfg['MySQLManualBase'] . '/' . $chapter . '.html#' . $link; - break; - case 'big': - $url = $cfg['MySQLManualBase'] . '#' . $link; - break; - case 'searchable': - if (empty($link)) { - $link = 'index'; - } - $url = $cfg['MySQLManualBase'] . '/' . $link . '.html'; - break; - case 'viewable': - default: - if (empty($link)) { - $link = 'index'; - } - $mysql = '5.0'; - $lang = 'en'; - if (defined('PMA_MYSQL_INT_VERSION')) { - if (PMA_MYSQL_INT_VERSION < 50000) { - $mysql = '4.1'; - if (!empty($GLOBALS['mysql_4_1_doc_lang'])) { - $lang = $GLOBALS['mysql_4_1_doc_lang']; - } - } elseif (PMA_MYSQL_INT_VERSION >= 50100) { - $mysql = '5.1'; - if (!empty($GLOBALS['mysql_5_1_doc_lang'])) { - $lang = $GLOBALS['mysql_5_1_doc_lang']; - } - } elseif (PMA_MYSQL_INT_VERSION >= 50000) { - $mysql = '5.0'; - if (!empty($GLOBALS['mysql_5_0_doc_lang'])) { - $lang = $GLOBALS['mysql_5_0_doc_lang']; - } - } - } - $url = $cfg['MySQLManualBase'] . '/' . $mysql . '/' . $lang . '/' . $link . '.html'; - break; - } - - if ($big_icon) { - return '' . $GLOBALS['strDocu'] . ''; - } elseif ($GLOBALS['cfg']['ReplaceHelpImg']) { - return '' . $GLOBALS['strDocu'] . ''; - } else { - return '[' . $GLOBALS['strDocu'] . ']'; - } -} // end of the 'PMA_showMySQLDocu()' function - -/** - * Displays a hint icon, on mouse over show the hint - * - * @uses $GLOBALS['pmaThemeImage'] - * @uses PMA_jsFormat() - * @param string the error message - * - * @access public - */ -function PMA_showHint($hint_message) -{ - //return '' . $hint_message . ''; - return 'Tip'; -} - -/** - * Displays a MySQL error message in the right frame. - * - * @uses footer.inc.php - * @uses header.inc.php - * @uses $GLOBALS['sql_query'] - * @uses $GLOBALS['strError'] - * @uses $GLOBALS['strSQLQuery'] - * @uses $GLOBALS['pmaThemeImage'] - * @uses $GLOBALS['strEdit'] - * @uses $GLOBALS['strMySQLSaid'] - * @uses $GLOBALS['cfg']['PropertiesIconic'] - * @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] - * @uses PMA_backquote() - * @uses PMA_DBI_getError() - * @uses PMA_formatSql() - * @uses PMA_generate_common_hidden_inputs() - * @uses PMA_generate_common_url() - * @uses PMA_showMySQLDocu() - * @uses PMA_sqlAddslashes() - * @uses PMA_SQP_isError() - * @uses PMA_SQP_parse() - * @uses PMA_SQP_getErrorString() - * @uses strtolower() - * @uses urlencode() - * @uses str_replace() - * @uses nl2br() - * @uses substr() - * @uses preg_replace() - * @uses preg_match() - * @uses explode() - * @uses implode() - * @uses is_array() - * @uses function_exists() - * @uses htmlspecialchars() - * @uses trim() - * @uses strstr() - * @param string the error message - * @param string the sql query that failed - * @param boolean whether to show a "modify" link or not - * @param string the "back" link url (full path is not required) - * @param boolean EXIT the page? - * - * @global string the curent table - * @global string the current db - * - * @access public - */ -function PMA_mysqlDie($error_message = '', $the_query = '', - $is_modify_link = true, $back_url = '', $exit = true) -{ - global $table, $db; - - /** - * start http output, display html headers - */ - require_once './libraries/header.inc.php'; - - if (!$error_message) { - $error_message = PMA_DBI_getError(); - } - if (!$the_query && !empty($GLOBALS['sql_query'])) { - $the_query = $GLOBALS['sql_query']; - } - - // --- Added to solve bug #641765 - // Robbat2 - 12 January 2003, 9:46PM - // Revised, Robbat2 - 13 January 2003, 2:59PM - if (!function_exists('PMA_SQP_isError') || PMA_SQP_isError()) { - $formatted_sql = htmlspecialchars($the_query); - } elseif (empty($the_query) || trim($the_query) == '') { - $formatted_sql = ''; - } else { - if (strlen($the_query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { - $formatted_sql = substr($the_query, 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]'; - } else { - $formatted_sql = PMA_formatSql(PMA_SQP_parse($the_query), $the_query); - } - } - // --- - echo "\n" . '' . "\n"; - echo '

' . $GLOBALS['strError'] . '

' . "\n"; - // if the config password is wrong, or the MySQL server does not - // respond, do not show the query that would reveal the - // username/password - if (!empty($the_query) && !strstr($the_query, 'connect')) { - // --- Added to solve bug #641765 - // Robbat2 - 12 January 2003, 9:46PM - // Revised, Robbat2 - 13 January 2003, 2:59PM - if (function_exists('PMA_SQP_isError') && PMA_SQP_isError()) { - echo PMA_SQP_getErrorString() . "\n"; - echo '
' . "\n"; - } - // --- - // modified to show me the help on sql errors (Michael Keck) - echo '

' . $GLOBALS['strSQLQuery'] . ':' . "\n"; - if (strstr(strtolower($formatted_sql), 'select')) { // please show me help to the error on select - echo PMA_showMySQLDocu('SQL-Syntax', 'SELECT'); - } - if ($is_modify_link && strlen($db)) { - if (strlen($table)) { - $doedit_goto = ''; - } else { - $doedit_goto = ''; - } - if ($GLOBALS['cfg']['PropertiesIconic']) { - echo $doedit_goto - . '' . $GLOBALS['strEdit'] .'' - . ''; - } else { - echo ' [' - . $doedit_goto . $GLOBALS['strEdit'] . '' - . ']' . "\n"; - } - } // end if - echo '

' . "\n" - .'

' . "\n" - .' ' . $formatted_sql . "\n" - .'

' . "\n"; - } // end if - - $tmp_mysql_error = ''; // for saving the original $error_message - if (!empty($error_message)) { - $tmp_mysql_error = strtolower($error_message); // save the original $error_message - $error_message = htmlspecialchars($error_message); - $error_message = preg_replace("@((\015\012)|(\015)|(\012)){3,}@", "\n\n", $error_message); - } - // modified to show me the help on error-returns (Michael Keck) - // (now error-messages-server) - echo '

' . "\n" - . ' ' . $GLOBALS['strMySQLSaid'] . '' - . PMA_showMySQLDocu('Error-messages-server', 'Error-messages-server') - . "\n" - . '

' . "\n"; - - // The error message will be displayed within a CODE segment. - // To preserve original formatting, but allow wordwrapping, we do a couple of replacements - - // Replace all non-single blanks with their HTML-counterpart - $error_message = str_replace(' ', '  ', $error_message); - // Replace TAB-characters with their HTML-counterpart - $error_message = str_replace("\t", '    ', $error_message); - // Replace linebreaks - $error_message = nl2br($error_message); - - echo '' . "\n" - . $error_message . "\n" - . '
' . "\n"; - echo '
'; - echo '
'; - - if (!empty($back_url) && $exit) { - $goto_back_url=''; - echo '[ ' . $goto_back_url . $GLOBALS['strBack'] . ' ]'; - } - echo '
' . "\n\n"; - if ($exit) { - /** - * display footer and exit - */ - require_once './libraries/footer.inc.php'; - } -} // end of the 'PMA_mysqlDie()' function - -/** - * Returns a string formatted with CONVERT ... USING - * if MySQL supports it - * - * @uses PMA_MYSQL_INT_VERSION - * @uses $GLOBALS['collation_connection'] - * @uses explode() - * @param string the string itself - * @param string the mode: quoted or unquoted (this one by default) - * - * @return the formatted string - * - * @access private - */ -function PMA_convert_using($string, $mode='unquoted', $force_utf8 = false) -{ - if ($mode == 'quoted') { - $possible_quote = "'"; - } else { - $possible_quote = ""; - } - - if (PMA_MYSQL_INT_VERSION >= 40100) { - if ($force_utf8) { - $charset = 'utf8'; - $collate = ' COLLATE utf8_bin'; - } else { - list($charset) = explode('_', $GLOBALS['collation_connection']); - $collate = ''; - } - $converted_string = "CONVERT(" . $possible_quote . $string . $possible_quote . " USING " . $charset . ")" . $collate; - } else { - $converted_string = $possible_quote . $string . $possible_quote; - } - return $converted_string; -} // end function - -/** - * Send HTTP header, taking IIS limits into account (600 seems ok) - * - * @uses PMA_IS_IIS - * @uses PMA_COMING_FROM_COOKIE_LOGIN - * @uses PMA_get_arg_separator() - * @uses SID - * @uses strlen() - * @uses strpos() - * @uses header() - * @uses session_write_close() - * @uses headers_sent() - * @uses function_exists() - * @uses debug_print_backtrace() - * @uses trigger_error() - * @uses defined() - * @param string $uri the header to send - * @return boolean always true - */ -function PMA_sendHeaderLocation($uri) -{ - if (PMA_IS_IIS && strlen($uri) > 600) { - - echo '- - -' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - - } else { - if (SID) { - if (strpos($uri, '?') === false) { - header('Location: ' . $uri . '?' . SID); - } else { - $separator = PMA_get_arg_separator(); - header('Location: ' . $uri . $separator . SID); - } - } else { - session_write_close(); - if (headers_sent()) { - if (function_exists('debug_print_backtrace')) { - echo '
';
-                    debug_print_backtrace();
-                    echo '
'; - } - trigger_error('PMA_sendHeaderLocation called when headers are already sent!', E_USER_ERROR); - } - // bug #1523784: IE6 does not like 'Refresh: 0', it - // results in a blank page - // but we need it when coming from the cookie login panel) - if (PMA_IS_IIS && defined('PMA_COMING_FROM_COOKIE_LOGIN')) { - header('Refresh: 0; ' . $uri); - } else { - header('Location: ' . $uri); - } - } - } -} - -/** - * returns array with tables of given db with extended information and grouped - * - * @uses $cfg['LeftFrameTableSeparator'] - * @uses $cfg['LeftFrameTableLevel'] - * @uses $cfg['ShowTooltipAliasTB'] - * @uses $cfg['NaturalOrder'] - * @uses PMA_backquote() - * @uses count() - * @uses array_merge - * @uses uksort() - * @uses strstr() - * @uses explode() - * @param string $db name of db - * @param string $tables name of tables - * return array (recursive) grouped table list - */ -function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count = false) -{ - $sep = $GLOBALS['cfg']['LeftFrameTableSeparator']; - - if (null === $tables) { - $tables = PMA_DBI_get_tables_full($db, false, false, null, $limit_offset, $limit_count); - if ($GLOBALS['cfg']['NaturalOrder']) { - uksort($tables, 'strnatcasecmp'); - } - } - - if (count($tables) < 1) { - return $tables; - } - - $default = array( - 'Name' => '', - 'Rows' => 0, - 'Comment' => '', - 'disp_name' => '', - ); - - $table_groups = array(); - - foreach ($tables as $table_name => $table) { - - // check for correct row count - if (null === $table['Rows']) { - // Do not check exact row count here, - // if row count is invalid possibly the table is defect - // and this would break left frame; - // but we can check row count if this is a view, - // since PMA_Table::countRecords() returns a limited row count - // in this case. - - // set this because PMA_Table::countRecords() can use it - $tbl_is_view = PMA_Table::isView($db, $table['Name']); - - if ($tbl_is_view) { - $table['Rows'] = PMA_Table::countRecords($db, $table['Name'], - $return = true); - } - } - - // in $group we save the reference to the place in $table_groups - // where to store the table info - if ($GLOBALS['cfg']['LeftFrameDBTree'] - && $sep && strstr($table_name, $sep)) - { - $parts = explode($sep, $table_name); - - $group =& $table_groups; - $i = 0; - $group_name_full = ''; - while ($i < count($parts) - 1 - && $i < $GLOBALS['cfg']['LeftFrameTableLevel']) { - $group_name = $parts[$i] . $sep; - $group_name_full .= $group_name; - - if (!isset($group[$group_name])) { - $group[$group_name] = array(); - $group[$group_name]['is' . $sep . 'group'] = true; - $group[$group_name]['tab' . $sep . 'count'] = 1; - $group[$group_name]['tab' . $sep . 'group'] = $group_name_full; - } elseif (!isset($group[$group_name]['is' . $sep . 'group'])) { - $table = $group[$group_name]; - $group[$group_name] = array(); - $group[$group_name][$group_name] = $table; - unset($table); - $group[$group_name]['is' . $sep . 'group'] = true; - $group[$group_name]['tab' . $sep . 'count'] = 1; - $group[$group_name]['tab' . $sep . 'group'] = $group_name_full; - } else { - $group[$group_name]['tab' . $sep . 'count']++; - } - $group =& $group[$group_name]; - $i++; - } - } else { - if (!isset($table_groups[$table_name])) { - $table_groups[$table_name] = array(); - } - $group =& $table_groups; - } - - - if ($GLOBALS['cfg']['ShowTooltipAliasTB'] - && $GLOBALS['cfg']['ShowTooltipAliasTB'] !== 'nested') { - // switch tooltip and name - $table['Comment'] = $table['Name']; - $table['disp_name'] = $table['Comment']; - } else { - $table['disp_name'] = $table['Name']; - } - - $group[$table_name] = array_merge($default, $table); - } - - return $table_groups; -} - -/* ----------------------- Set of misc functions ----------------------- */ - - -/** - * Adds backquotes on both sides of a database, table or field name. - * and escapes backquotes inside the name with another backquote - * - * example: - * - * echo PMA_backquote('owner`s db'); // `owner``s db` - * - * - * - * @uses PMA_backquote() - * @uses is_array() - * @uses strlen() - * @uses str_replace() - * @param mixed $a_name the database, table or field name to "backquote" - * or array of it - * @param boolean $do_it a flag to bypass this function (used by dump - * functions) - * @return mixed the "backquoted" database, table or field name if the - * current MySQL release is >= 3.23.6, the original one - * else - * @access public - */ -function PMA_backquote($a_name, $do_it = true) -{ - if (! $do_it) { - return $a_name; - } - - if (is_array($a_name)) { - $result = array(); - foreach ($a_name as $key => $val) { - $result[$key] = PMA_backquote($val); - } - return $result; - } - - // '0' is also empty for php :-( - if (strlen($a_name) && $a_name !== '*') { - return '`' . str_replace('`', '``', $a_name) . '`'; - } else { - return $a_name; - } -} // end of the 'PMA_backquote()' function - - -/** - * Defines the value depending on the user OS. - * - * @uses PMA_USR_OS - * @return string the value to use - * - * @access public - */ -function PMA_whichCrlf() -{ - $the_crlf = "\n"; - - // The 'PMA_USR_OS' constant is defined in "./libraries/Config.class.php" - // Win case - if (PMA_USR_OS == 'Win') { - $the_crlf = "\r\n"; - } - // Others - else { - $the_crlf = "\n"; - } - - return $the_crlf; -} // end of the 'PMA_whichCrlf()' function - -/** - * Reloads navigation if needed. - * - * @uses $GLOBALS['reload'] - * @uses $GLOBALS['db'] - * @uses PMA_generate_common_url() - * @global array configuration - * - * @access public - */ -function PMA_reloadNavigation() -{ - global $cfg; - - // Reloads the navigation frame via JavaScript if required - if (isset($GLOBALS['reload']) && $GLOBALS['reload']) { - // one of the reasons for a reload is when a table is dropped - // in this case, get rid of the table limit offset, otherwise - // we have a problem when dropping a table on the last page - // and the offset becomes greater than the total number of tables - unset($_SESSION['userconf']['table_limit_offset']); - echo "\n"; - $reload_url = './navigation.php?' . PMA_generate_common_url($GLOBALS['db'], '', '&'); - ?> - - ' . "\n"; - echo '//' . "\n"; - echo '' . "\n"; - } // end if - } // end if ... elseif - - // Checks if the table needs to be repaired after a TRUNCATE query. - // @todo what about $GLOBALS['display_query']??? - // @todo this is REALLY the wrong place to do this - very unexpected here - if (strlen($GLOBALS['table']) - && $GLOBALS['sql_query'] == 'TRUNCATE TABLE ' . PMA_backquote($GLOBALS['table'])) { - if (!isset($tbl_status)) { - $result = @PMA_DBI_try_query('SHOW TABLE STATUS FROM ' . PMA_backquote($GLOBALS['db']) . ' LIKE \'' . PMA_sqlAddslashes($GLOBALS['table'], true) . '\''); - if ($result) { - $tbl_status = PMA_DBI_fetch_assoc($result); - PMA_DBI_free_result($result); - } - } - if (isset($tbl_status) && (int) $tbl_status['Index_length'] > 1024) { - PMA_DBI_try_query('REPAIR TABLE ' . PMA_backquote($GLOBALS['table'])); - } - } - unset($tbl_status); - echo '
' . "\n"; - - echo '
' . "\n"; - if (!empty($GLOBALS['show_error_header'])) { - echo '
' . "\n"; - echo '

' . $GLOBALS['strError'] . '

' . "\n"; - } - - echo '
'; - echo PMA_sanitize($message); - if (isset($GLOBALS['special_message'])) { - echo PMA_sanitize($GLOBALS['special_message']); - unset($GLOBALS['special_message']); - } - echo '
'; - - if (!empty($GLOBALS['show_error_header'])) { - echo '
'; - } - - if ($cfg['ShowSQL'] == true && ! empty($sql_query)) { - // Basic url query part - $url_qpart = '?' . PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']); - - // Html format the query to be displayed - // The nl2br function isn't used because its result isn't a valid - // xhtml1.0 statement before php4.0.5 ("
" and not "
") - // If we want to show some sql code it is easiest to create it here - /* SQL-Parser-Analyzer */ - - if (!empty($GLOBALS['show_as_php'])) { - $new_line = '\'
' . "\n" . '        . \' '; - } - if (isset($new_line)) { - /* SQL-Parser-Analyzer */ - $query_base = PMA_sqlAddslashes(htmlspecialchars($sql_query), false, false, true); - /* SQL-Parser-Analyzer */ - $query_base = preg_replace("@((\015\012)|(\015)|(\012))+@", $new_line, $query_base); - } else { - $query_base = $sql_query; - } - - if (strlen($query_base) > $cfg['MaxCharactersInDisplayedSQL']) { - $query_too_big = true; - $query_base = nl2br(htmlspecialchars($sql_query)); - unset($GLOBALS['parsed_sql']); - } - - // Parse SQL if needed - // (here, use "! empty" because when deleting a bookmark, - // $GLOBALS['parsed_sql'] is set but empty - if (! empty($GLOBALS['parsed_sql']) && $query_base == $GLOBALS['parsed_sql']['raw']) { - $parsed_sql = $GLOBALS['parsed_sql']; - } else { - // when the query is large (for example an INSERT of binary - // data), the parser chokes; so avoid parsing the query - if (! $query_too_big) { - $parsed_sql = PMA_SQP_parse($query_base); - } - } - - // Analyze it - if (isset($parsed_sql)) { - $analyzed_display_query = PMA_SQP_analyze($parsed_sql); - } - - // Here we append the LIMIT added for navigation, to - // enable its display. Adding it higher in the code - // to $sql_query would create a problem when - // using the Refresh or Edit links. - - // Only append it on SELECTs. - - /** - * @todo what would be the best to do when someone hits Refresh: - * use the current LIMITs ? - */ - - if (isset($analyzed_display_query[0]['queryflags']['select_from']) - && isset($GLOBALS['sql_limit_to_append'])) { - $query_base = $analyzed_display_query[0]['section_before_limit'] . "\n" . $GLOBALS['sql_limit_to_append'] . $analyzed_display_query[0]['section_after_limit']; - // Need to reparse query - $parsed_sql = PMA_SQP_parse($query_base); - } - - if (!empty($GLOBALS['show_as_php'])) { - $query_base = '$sql = \'' . $query_base; - } elseif (!empty($GLOBALS['validatequery'])) { - $query_base = PMA_validateSQL($query_base); - } else { - if (isset($parsed_sql)) { - $query_base = PMA_formatSql($parsed_sql, $query_base); - } - } - - // Prepares links that may be displayed to edit/explain the query - // (don't go to default pages, we must go to the page - // where the query box is available) - - $edit_target = strlen($GLOBALS['db']) ? (strlen($GLOBALS['table']) ? 'tbl_sql.php' : 'db_sql.php') : 'server_sql.php'; - - if (isset($cfg['SQLQuery']['Edit']) - && ($cfg['SQLQuery']['Edit'] == true) - && (!empty($edit_target)) - && ! $query_too_big) { - - if ($cfg['EditInWindow'] == true) { - $onclick = 'window.parent.focus_querywindow(\'' . PMA_jsFormat($sql_query, false) . '\'); return false;'; - } else { - $onclick = ''; - } - - $edit_link = $edit_target - . $url_qpart - . '&sql_query=' . urlencode($sql_query) - . '&show_query=1#querybox'; - $edit_link = ' [' . PMA_linkOrButton($edit_link, $GLOBALS['strEdit'], array('onclick' => $onclick)) . ']'; - } else { - $edit_link = ''; - } - - // Want to have the query explained (Mike Beck 2002-05-22) - // but only explain a SELECT (that has not been explained) - /* SQL-Parser-Analyzer */ - if (isset($cfg['SQLQuery']['Explain']) - && $cfg['SQLQuery']['Explain'] == true - && ! $query_too_big) { - - // Detect if we are validating as well - // To preserve the validate uRL data - if (!empty($GLOBALS['validatequery'])) { - $explain_link_validate = '&validatequery=1'; - } else { - $explain_link_validate = ''; - } - - $explain_link = 'import.php' - . $url_qpart - . $explain_link_validate - . '&sql_query='; - - if (preg_match('@^SELECT[[:space:]]+@i', $sql_query)) { - $explain_link .= urlencode('EXPLAIN ' . $sql_query); - $message = $GLOBALS['strExplain']; - } elseif (preg_match('@^EXPLAIN[[:space:]]+SELECT[[:space:]]+@i', $sql_query)) { - $explain_link .= urlencode(substr($sql_query, 8)); - $message = $GLOBALS['strNoExplain']; - } else { - $explain_link = ''; - } - if (!empty($explain_link)) { - $explain_link = ' [' . PMA_linkOrButton($explain_link, $message) . ']'; - } - } else { - $explain_link = ''; - } //show explain - - // Also we would like to get the SQL formed in some nice - // php-code (Mike Beck 2002-05-22) - if (isset($cfg['SQLQuery']['ShowAsPHP']) - && $cfg['SQLQuery']['ShowAsPHP'] == true - && ! $query_too_big) { - $php_link = 'import.php' - . $url_qpart - . '&show_query=1' - . '&sql_query=' . urlencode($sql_query) - . '&show_as_php='; - - if (!empty($GLOBALS['show_as_php'])) { - $php_link .= '0'; - $message = $GLOBALS['strNoPhp']; - } else { - $php_link .= '1'; - $message = $GLOBALS['strPhp']; - } - $php_link = ' [' . PMA_linkOrButton($php_link, $message) . ']'; - - if (isset($GLOBALS['show_as_php'])) { - $runquery_link - = 'import.php' - . $url_qpart - . '&show_query=1' - . '&sql_query=' . urlencode($sql_query); - $php_link .= ' [' . PMA_linkOrButton($runquery_link, $GLOBALS['strRunQuery']) . ']'; - } - - } else { - $php_link = ''; - } //show as php - - // Refresh query - if (isset($cfg['SQLQuery']['Refresh']) - && $cfg['SQLQuery']['Refresh'] - && preg_match('@^(SELECT|SHOW)[[:space:]]+@i', $sql_query)) { - - $refresh_link = 'import.php' - . $url_qpart - . '&show_query=1' - . '&sql_query=' . urlencode($sql_query); - $refresh_link = ' [' . PMA_linkOrButton($refresh_link, $GLOBALS['strRefresh']) . ']'; - } else { - $refresh_link = ''; - } //show as php - - if (isset($cfg['SQLValidator']['use']) - && $cfg['SQLValidator']['use'] == true - && isset($cfg['SQLQuery']['Validate']) - && $cfg['SQLQuery']['Validate'] == true) { - $validate_link = 'import.php' - . $url_qpart - . '&show_query=1' - . '&sql_query=' . urlencode($sql_query) - . '&validatequery='; - if (!empty($GLOBALS['validatequery'])) { - $validate_link .= '0'; - $validate_message = $GLOBALS['strNoValidateSQL'] ; - } else { - $validate_link .= '1'; - $validate_message = $GLOBALS['strValidateSQL'] ; - } - $validate_link = ' [' . PMA_linkOrButton($validate_link, $validate_message) . ']'; - } else { - $validate_link = ''; - } //validator - - // why this? - //unset($sql_query); - - // Displays the message - echo '
' . "\n"; - echo ' ' . $GLOBALS['strSQLQuery'] . ':'; - echo '
'; - // when uploading a 700 Kio binary file into a LONGBLOB, - // I get a white page, strlen($query_base) is 2 x 700 Kio - // so put a hard limit here (let's say 1000) - if ($query_too_big) { - echo ' ' . substr($query_base, 0, $cfg['MaxCharactersInDisplayedSQL']) . '[...]'; - } else { - echo ' ' . $query_base; - } - - //Clean up the end of the PHP - if (!empty($GLOBALS['show_as_php'])) { - echo '\';'; - } - echo '
'; - echo '
' . "\n"; - - if (!empty($edit_target)) { - echo '
'; - // avoid displaying a Profiling checkbox that could - // be checked, which would reexecute an INSERT, for example - if (! empty($refresh_link)) { - PMA_profilingCheckbox($sql_query); - } - echo $edit_link . $explain_link . $php_link . $refresh_link . $validate_link; - echo '
'; - } - } - echo '

' . "\n"; -} // end of the 'PMA_showMessage()' function - - -/** - * Verifies if current MySQL server supports profiling - * - * @access public - * @return boolean whether profiling is supported - * - * @author Marc Delisle - */ -function PMA_profilingSupported() { - // 5.0.37 has profiling but for example, 5.1.20 does not - // (avoid a trip to the server for MySQL before 5.0.37) - // and do not set a constant as we might be switching servers - if (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION >= 50037 && PMA_DBI_fetch_value("SHOW VARIABLES LIKE 'profiling'")) { - return true; - } else { - return false; - } -} - -/** - * Displays a form with the Profiling checkbox - * - * @param string $sql_query - * @access public - * - * @author Marc Delisle - */ -function PMA_profilingCheckbox($sql_query) { - if (PMA_profilingSupported()) { - echo '
' . "\n"; - echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '
' . "\n"; - } -} - -/** - * Displays the results of SHOW PROFILE - * - * @param array the results - * @access public - * - * @author Marc Delisle - */ -function PMA_profilingResults($profiling_results) { - echo '
' . $GLOBALS['strProfiling'] . '' . "\n"; - echo '' . "\n"; - echo ' ' . "\n"; - echo ' ' . "\n"; - echo ' ' . "\n"; - echo ' ' . "\n"; - - foreach($profiling_results as $one_result) { - echo ' ' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - } - echo '
' . $GLOBALS['strStatus'] . '' . $GLOBALS['strTime'] . '
' . $one_result['Status'] . '' . $one_result['Duration'] . '
' . "\n"; - echo '
' . "\n"; -} - -/** - * Formats $value to byte view - * - * @param double the value to format - * @param integer the sensitiveness - * @param integer the number of decimals to retain - * - * @return array the formatted value and its unit - * - * @access public - * - * @author staybyte - * @version 1.2 - 18 July 2002 - */ -function PMA_formatByteDown($value, $limes = 6, $comma = 0) -{ - $dh = PMA_pow(10, $comma); - $li = PMA_pow(10, $limes); - $return_value = $value; - $unit = $GLOBALS['byteUnits'][0]; - - for ($d = 6, $ex = 15; $d >= 1; $d--, $ex-=3) { - if (isset($GLOBALS['byteUnits'][$d]) && $value >= $li * PMA_pow(10, $ex)) { - // use 1024.0 to avoid integer overflow on 64-bit machines - $value = round($value / (PMA_pow(1024, $d) / $dh)) /$dh; - $unit = $GLOBALS['byteUnits'][$d]; - break 1; - } // end if - } // end for - - if ($unit != $GLOBALS['byteUnits'][0]) { - // if the unit is not bytes (as represented in current language) - // reformat with max length of 5 - // 4th parameter=true means do not reformat if value < 1 - $return_value = PMA_formatNumber($value, 5, $comma, true); - } else { - // do not reformat, just handle the locale - $return_value = PMA_formatNumber($value, 0); - } - - return array($return_value, $unit); -} // end of the 'PMA_formatByteDown' function - -/** - * Formats $value to the given length and appends SI prefixes - * $comma is not substracted from the length - * with a $length of 0 no truncation occurs, number is only formated - * to the current locale - * - * examples: - * - * echo PMA_formatNumber(123456789, 6); // 123,457 k - * echo PMA_formatNumber(-123456789, 4, 2); // -123.46 M - * echo PMA_formatNumber(-0.003, 6); // -3 m - * echo PMA_formatNumber(0.003, 3, 3); // 0.003 - * echo PMA_formatNumber(0.00003, 3, 2); // 0.03 m - * echo PMA_formatNumber(0, 6); // 0 - * - * - * @param double $value the value to format - * @param integer $length the max length - * @param integer $comma the number of decimals to retain - * @param boolean $only_down do not reformat numbers below 1 - * - * @return string the formatted value and its unit - * - * @access public - * - * @author staybyte, sebastian mendel - * @version 1.1.0 - 2005-10-27 - */ -function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false) -{ - //number_format is not multibyte safe, str_replace is safe - if ($length === 0) { - return str_replace(array(',', '.'), - array($GLOBALS['number_thousands_separator'], $GLOBALS['number_decimal_separator']), - number_format($value, $comma)); - } - - // this units needs no translation, ISO - $units = array( - -8 => 'y', - -7 => 'z', - -6 => 'a', - -5 => 'f', - -4 => 'p', - -3 => 'n', - -2 => 'µ', - -1 => 'm', - 0 => ' ', - 1 => 'k', - 2 => 'M', - 3 => 'G', - 4 => 'T', - 5 => 'P', - 6 => 'E', - 7 => 'Z', - 8 => 'Y' - ); - - // we need at least 3 digits to be displayed - if (3 > $length + $comma) { - $length = 3 - $comma; - } - - // check for negative value to retain sign - if ($value < 0) { - $sign = '-'; - $value = abs($value); - } else { - $sign = ''; - } - - $dh = PMA_pow(10, $comma); - $li = PMA_pow(10, $length); - $unit = $units[0]; - - if ($value >= 1) { - for ($d = 8; $d >= 0; $d--) { - if (isset($units[$d]) && $value >= $li * PMA_pow(1000, $d-1)) { - $value = round($value / (PMA_pow(1000, $d) / $dh)) /$dh; - $unit = $units[$d]; - break 1; - } // end if - } // end for - } elseif (!$only_down && (float) $value !== 0.0) { - for ($d = -8; $d <= 8; $d++) { - if (isset($units[$d]) && $value <= $li * PMA_pow(1000, $d-1)) { - $value = round($value / (PMA_pow(1000, $d) / $dh)) /$dh; - $unit = $units[$d]; - break 1; - } // end if - } // end for - } // end if ($value >= 1) elseif (!$only_down && (float) $value !== 0.0) - - //number_format is not multibyte safe, str_replace is safe - $value = str_replace(array(',', '.'), - array($GLOBALS['number_thousands_separator'], $GLOBALS['number_decimal_separator']), - number_format($value, $comma)); - - return $sign . $value . ' ' . $unit; -} // end of the 'PMA_formatNumber' function - -/** - * Extracts ENUM / SET options from a type definition string - * - * @param string The column type definition - * - * @return array The options or - * boolean false in case of an error. - * - * @author rabus - */ -function PMA_getEnumSetOptions($type_def) -{ - $open = strpos($type_def, '('); - $close = strrpos($type_def, ')'); - if (!$open || !$close) { - return false; - } - $options = substr($type_def, $open + 2, $close - $open - 3); - $options = explode('\',\'', $options); - return $options; -} // end of the 'PMA_getEnumSetOptions' function - -/** - * Writes localised date - * - * @param string the current timestamp - * - * @return string the formatted date - * - * @access public - */ -function PMA_localisedDate($timestamp = -1, $format = '') -{ - global $datefmt, $month, $day_of_week; - - if ($format == '') { - $format = $datefmt; - } - - if ($timestamp == -1) { - $timestamp = time(); - } - - $date = preg_replace('@%[aA]@', $day_of_week[(int)strftime('%w', $timestamp)], $format); - $date = preg_replace('@%[bB]@', $month[(int)strftime('%m', $timestamp)-1], $date); - - return strftime($date, $timestamp); -} // end of the 'PMA_localisedDate()' function - - -/** - * returns a tab for tabbed navigation. - * If the variables $link and $args ar left empty, an inactive tab is created - * - * @uses $GLOBALS['PMA_PHP_SELF'] - * @uses $GLOBALS['strEmpty'] - * @uses $GLOBALS['strDrop'] - * @uses $GLOBALS['active_page'] - * @uses $GLOBALS['url_query'] - * @uses $cfg['MainPageIconic'] - * @uses $GLOBALS['pmaThemeImage'] - * @uses PMA_generate_common_url() - * @uses E_USER_NOTICE - * @uses htmlentities() - * @uses urlencode() - * @uses sprintf() - * @uses trigger_error() - * @uses array_merge() - * @uses basename() - * @param array $tab array with all options - * @return string html code for one tab, a link if valid otherwise a span - * @access public - */ -function PMA_getTab($tab) -{ - // default values - $defaults = array( - 'text' => '', - 'class' => '', - 'active' => false, - 'link' => '', - 'sep' => '?', - 'attr' => '', - 'args' => '', - 'warning' => '', - 'fragment' => '', - ); - - $tab = array_merge($defaults, $tab); - - // determine additionnal style-class - if (empty($tab['class'])) { - if ($tab['text'] == $GLOBALS['strEmpty'] - || $tab['text'] == $GLOBALS['strDrop']) { - $tab['class'] = 'caution'; - } elseif (!empty($tab['active']) - || (isset($GLOBALS['active_page']) - && $GLOBALS['active_page'] == $tab['link']) - || (basename($GLOBALS['PMA_PHP_SELF']) == $tab['link'] && empty($tab['warning']))) - { - $tab['class'] = 'active'; - } - } - - if (!empty($tab['warning'])) { - $tab['class'] .= ' warning'; - $tab['attr'] .= ' title="' . htmlspecialchars($tab['warning']) . '"'; - } - - // build the link - if (!empty($tab['link'])) { - $tab['link'] = htmlentities($tab['link']); - $tab['link'] = $tab['link'] . $tab['sep'] - .(empty($GLOBALS['url_query']) ? - PMA_generate_common_url() : $GLOBALS['url_query']); - if (!empty($tab['args'])) { - foreach ($tab['args'] as $param => $value) { - $tab['link'] .= '&' . urlencode($param) . '=' - . urlencode($value); - } - } - } - - if (! empty($tab['fragment'])) { - $tab['link'] .= $tab['fragment']; - } - - // display icon, even if iconic is disabled but the link-text is missing - if (($GLOBALS['cfg']['MainPageIconic'] || empty($tab['text'])) - && isset($tab['icon'])) { - // avoid generating an alt tag, because it only illustrates - // the text that follows and if browser does not display - // images, the text is duplicated - $image = '%2$s'; - $tab['text'] = sprintf($image, htmlentities($tab['icon']), $tab['text']); - } - // check to not display an empty link-text - elseif (empty($tab['text'])) { - $tab['text'] = '?'; - trigger_error('empty linktext in function ' . __FUNCTION__ . '()', - E_USER_NOTICE); - } - - $out = ''; - - if (!empty($tab['link'])) { - $out .= '' - . $tab['text'] . ''; - } else { - $out .= '' - . $tab['text'] . ''; - } - - $out .= ''; - return $out; -} // end of the 'PMA_getTab()' function - -/** - * returns html-code for a tab navigation - * - * @uses PMA_getTab() - * @uses htmlentities() - * @param array $tabs one element per tab - * @param string $tag_id id used for the html-tag - * @return string html-code for tab-navigation - */ -function PMA_getTabs($tabs, $tag_id = 'topmenu') -{ - $tab_navigation = - '
' . "\n" - .'
    ' . "\n"; - - foreach ($tabs as $tab) { - $tab_navigation .= PMA_getTab($tab) . "\n"; - } - - $tab_navigation .= - '
' . "\n" - .'
' - .'
' . "\n"; - - return $tab_navigation; -} - - -/** - * Displays a link, or a button if the link's URL is too large, to - * accommodate some browsers' limitations - * - * @param string the URL - * @param string the link message - * @param mixed $tag_params string: js confirmation - * array: additional tag params (f.e. style="") - * @param boolean $new_form we set this to false when we are already in - * a form, to avoid generating nested forms - * - * @return string the results to be echoed or saved in an array - */ -function PMA_linkOrButton($url, $message, $tag_params = array(), - $new_form = true, $strip_img = false, $target = '') -{ - if (! is_array($tag_params)) { - $tmp = $tag_params; - $tag_params = array(); - if (!empty($tmp)) { - $tag_params['onclick'] = 'return confirmLink(this, \'' . $tmp . '\')'; - } - unset($tmp); - } - if (! empty($target)) { - $tag_params['target'] = htmlentities($target); - } - - $tag_params_strings = array(); - foreach ($tag_params as $par_name => $par_value) { - // htmlspecialchars() only on non javascript - $par_value = substr($par_name, 0, 2) == 'on' - ? $par_value - : htmlspecialchars($par_value); - $tag_params_strings[] = $par_name . '="' . $par_value . '"'; - } - - // previously the limit was set to 2047, it seems 1000 is better - if (strlen($url) <= 1000) { - // no whitespace within an else Safari will make it part of the link - $ret = "\n" . '' - . $message . '' . "\n"; - } else { - // no spaces (linebreaks) at all - // or after the hidden fields - // IE will display them all - - // add class=link to submit button - if (empty($tag_params['class'])) { - $tag_params['class'] = 'link'; - } - - // decode encoded url separators - $separator = PMA_get_arg_separator(); - // on most places separator is still hard coded ... - if ($separator !== '&') { - // ... so always replace & with $separator - $url = str_replace(htmlentities('&'), $separator, $url); - $url = str_replace('&', $separator, $url); - } - $url = str_replace(htmlentities($separator), $separator, $url); - // end decode - - $url_parts = parse_url($url); - $query_parts = explode($separator, $url_parts['query']); - if ($new_form) { - $ret = '