Merge commit 'origin/master' into local

Conflicts:
	server_status.php
This commit is contained in:
Martynas Mickevicius
2010-07-29 14:14:26 +03:00
342 changed files with 194811 additions and 179626 deletions

View File

@@ -83,9 +83,47 @@ $Id$
+ [core] Include Content Security Policy HTTP headers. + [core] Include Content Security Policy HTTP headers.
- bug #3004216 [CSS] Field attributes use inline CSS - bug #3004216 [CSS] Field attributes use inline CSS
- patch #2999595, rfe #2998130 [interface] Cleanup navigation frame. - patch #2999595, rfe #2998130 [interface] Cleanup navigation frame.
- [core] Update library PHPExcel to version 1.7.3c - patch #3025161 [core] Prevent sending of unnecessary cookies,
thanks to Piotr Przybylski - crackpl
- bug [password] Generate password only available if JS is enabled
(fixed for Privileges and Change password)
- [core] RecodingEngine now accepts none as valid option.
+ [core] Dropped AllowAnywhereRecoding configuration variable.
- rfe #3016457 [interface] Define tab order in SQL form to allow easier tab
navigation.
+ [core] Centralized format string expansion, @VARIABLES@ are recommended way
now, used by file name templates, default queries, export and title
generating.
+ [validator] SQL validator works also with SOAP PHP extension.
- [interface] Better formatting for SQL validator results.
- [doc] The linked-tables infrastructure is now called phpMyAdmin
configuration storage.
- [interface] Move drop/empty links from being tabs to Operations tab.
- [interface] Fixed rendering of error/notice/info titles background.
3.3.4.0 (not yet released) 3.3.6.0 (not yet released)
- bug #3033063 [core] Navi gets wrong db name
- bug #3031705 [core] Fix generating condition for real numbers by comparing
them to string.
3.3.5.0 (2010-07-26)
- patch #2932113 [information_schema] Slow export when having lots of
databases, thanks to Stéphane Pontier - shadow_walker
- bug #3022705 [import] Import button does not work in Catalan when there
is no progress bar possible
- bug [replication] Do not offer information_schema in the list of databases
- bug [js] Avoid loading twice a js file
- bug #3024344 [setup] Setup forces numeric MemoryLimit
- bug #3025975 [auth] Odd LoginCookieValidity default value
- bug #3026400 [PHP] ereg functions are deprecated
- bug #3027557 [PHP] split() deprecated in PHP 5.3 (backport fixes from master)
- bug #3023507 [core] No result set display from stored procedure SELECT
- bug [export] CSV for MS Excel (Windows) should have semi-colon as separator
- [core] Update library PHPExcel to version 1.7.3c
- bug #2994885, bug #3029168 [import] Convert Excel column name correctly
- bug [scripts] MySQL 5.5.5 does not accept TIMESTAMP(14) in create_tables.sql
3.3.4.0 (2010-06-28)
- bug #2996161 [import] properly escape import value - bug #2996161 [import] properly escape import value
- bug #2998889 [import] Import button does not work in Catalan - bug #2998889 [import] Import button does not work in Catalan
- [browse] Fix handling of sort order if only column is specified. - [browse] Fix handling of sort order if only column is specified.
@@ -96,6 +134,11 @@ $Id$
- bug [synchronize] Rows were deleted in target table regardless of the - bug [synchronize] Rows were deleted in target table regardless of the
"Would you like to delete..." option "Would you like to delete..." option
- bug [privileges] List of tables not shown when the db name has a wildcard - bug [privileges] List of tables not shown when the db name has a wildcard
- bug #3011126 [display] Edit link missing after long query
- patch #3013264 [doc] FAQ 1.40 uses a comma instead of a period,
thanks to Isaac Bennetch - ibennetch
- [engines] Fix getting InnoDB status.
- bug #2986422 [import] Results for query are not displayed
3.3.3.0 (2010-05-10) 3.3.3.0 (2010-05-10)
- patch #2982480 [navi] Do not group if there would be one table in group, - patch #2982480 [navi] Do not group if there would be one table in group,

View File

@@ -69,7 +69,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
</li> </li>
<li>To support uploading of ZIP files, you need the PHP <tt>zip</tt> extension.</li> <li>To support uploading of ZIP files, you need the PHP <tt>zip</tt> extension.</li>
<li>For proper support of multibyte strings (eg. UTF-8, which is <li>For proper support of multibyte strings (eg. UTF-8, which is
currently default), you should install mbstring and ctype currently the default), you should install the mbstring and ctype
extensions. extensions.
</li> </li>
<li>You need GD2 support in PHP to display inline <li>You need GD2 support in PHP to display inline
@@ -84,6 +84,9 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
</li> </li>
<li>To support upload progress bars, see <a href="#faq2_9"> <li>To support upload progress bars, see <a href="#faq2_9">
<abbr title="Frequently Asked Questions">FAQ</abbr> 2.9</a>.</li> <abbr title="Frequently Asked Questions">FAQ</abbr> 2.9</a>.</li>
<li>To support BLOB streaming, see PHP and MySQL requirements
in <a href="#faq6_25">
<abbr title="Frequently Asked Questions">FAQ</abbr> 6.25</a>.</li>
</ul> </ul>
</li> </li>
<li><b>MySQL</b> 5.0 or newer (<a href="#faq1_17">details</a>);</li> <li><b>MySQL</b> 5.0 or newer (<a href="#faq1_17">details</a>);</li>
@@ -167,7 +170,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
<ol><li><a href="#quick_install">Quick Install</a></li> <ol><li><a href="#quick_install">Quick Install</a></li>
<li><a href="#setup_script">Setup script usage</a></li> <li><a href="#setup_script">Setup script usage</a></li>
<li><a href="#linked-tables">Linked-tables infrastructure</a></li> <li><a href="#linked-tables">phpMyAdmin configuration storage</a></li>
<li><a href="#upgrading">Upgrading from an older version</a></li> <li><a href="#upgrading">Upgrading from an older version</a></li>
<li><a href="#authentication_modes">Using authentication modes</a></li> <li><a href="#authentication_modes">Using authentication modes</a></li>
</ol> </ol>
@@ -323,7 +326,7 @@ rm -rf config # remove not needed directory
</li> </li>
</ol> </ol>
<h3 id="linked-tables">Linked-tables infrastructure</h3> <h3 id="linked-tables">phpMyAdmin configuration storage</h3>
<p> For a whole set of new features (bookmarks, comments, <p> For a whole set of new features (bookmarks, comments,
<abbr title="structured query language">SQL</abbr>-history, <abbr title="structured query language">SQL</abbr>-history,
@@ -340,7 +343,8 @@ rm -rf config # remove not needed directory
<abbr title="Frequently Asked Questions">FAQ</abbr> 1.23</a>).</p> <abbr title="Frequently Asked Questions">FAQ</abbr> 1.23</a>).</p>
<p> If you already had this infrastructure and upgraded to MySQL 4.1.2 <p> If you already had this infrastructure and upgraded to MySQL 4.1.2
or newer, please use <i>./scripts/upgrade_tables_mysql_4_1_2+.sql</i>.</p> or newer, please use <i>./scripts/upgrade_tables_mysql_4_1_2+.sql</i>
and then create new tables by importing <i>./scripts/create_tables.sql</i>.</p>
<p> You can use your phpMyAdmin to create the tables for you. Please be aware <p> 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 that you may need special (administrator) privileges to create the database
@@ -369,7 +373,7 @@ rm -rf config # remove not needed directory
is version-specific.</p> is version-specific.</p>
<p> If you have upgraded your MySQL server from a version previous to 4.1.2 to <p> If you have upgraded your MySQL server from a version previous to 4.1.2 to
version 4.1.2 or newer and if you use the pmadb/linked table infrastructure, version 4.1.2 or newer and if you use the phpMyAdmin configuration storage,
you should run the SQL script found in you should run the SQL script found in
<tt>scripts/upgrade_tables_mysql_4_1_2+.sql</tt>.</p> <tt>scripts/upgrade_tables_mysql_4_1_2+.sql</tt>.</p>
@@ -396,7 +400,7 @@ rm -rf config # remove not needed directory
In cookie mode, the password is stored, encrypted with the blowfish In cookie mode, the password is stored, encrypted with the blowfish
algorithm, in a temporary cookie.</li> algorithm, in a temporary cookie.</li>
<li id="pmausr">Note: starting with phpMyAdmin 2.6.1, this section is only applicable if <li id="pmausr">Note: this section is only applicable if
your MySQL server is running with <tt>--skip-show-database</tt>.<br /><br /> your MySQL server is running with <tt>--skip-show-database</tt>.<br /><br />
For '<abbr title="HyperText Transfer Protocol">HTTP</abbr>' and 'cookie' For '<abbr title="HyperText Transfer Protocol">HTTP</abbr>' and 'cookie'
@@ -439,8 +443,9 @@ GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
GRANT SELECT, INSERT, UPDATE, DELETE ON &lt;pma_db&gt;.* TO 'pma'@'localhost'; GRANT SELECT, INSERT, UPDATE, DELETE ON &lt;pma_db&gt;.* TO 'pma'@'localhost';
</pre> </pre>
(this of course requires that your <a href="#linked-tables">linked-tables (this of course requires that your <a href="#linked-tables">phpMyAdmin
infrastructure</a> be set up).<br /></li> configuration storage</a> be set up).
<br /></li>
<li>Then each of the <i>true</i> users should be granted a set of privileges <li>Then each of the <i>true</i> users should be granted a set of privileges
on a set of particular databases. Normally you shouldn't give global on a set of particular databases. Normally you shouldn't give global
@@ -715,7 +720,7 @@ since this link provides funding for phpMyAdmin.
<dd>This special account is used for 2 distinct purposes: to make possible <dd>This special account is used for 2 distinct purposes: to make possible
all relational features (see all relational features (see
<a href="#pmadb" class="configrule">$cfg['Servers'][$i]['pmadb']</a>) <a href="#pmadb" class="configrule">$cfg['Servers'][$i]['pmadb']</a>)
and, for a MySQL server previous to 4.1.2 or running with and, for a MySQL server running with
<tt>--skip-show-database</tt>, to enable a multi-user installation <tt>--skip-show-database</tt>, to enable a multi-user installation
(<abbr title="HyperText Transfer Protocol">HTTP</abbr> or cookie (<abbr title="HyperText Transfer Protocol">HTTP</abbr> or cookie
authentication mode).<br /><br /> authentication mode).<br /><br />
@@ -861,11 +866,11 @@ since this link provides funding for phpMyAdmin.
<dt id="pmadb"> <dt id="pmadb">
<span id="cfg_Servers_pmadb">$cfg['Servers'][$i]['pmadb']</span> string <span id="cfg_Servers_pmadb">$cfg['Servers'][$i]['pmadb']</span> string
</dt> </dt>
<dd>The name of the database containing the linked-tables infrastructure. <dd>The name of the database containing the phpMyAdmin configuration storage.
<br /><br /> <br /><br />
See the <a href="#linked-tables">Linked-tables infrastructure</a> See the <a href="#linked-tables">phpMyAdmin configuration storage</a>
section in this document to see the benefits of this infrastructure, section in this document to see the benefits of this feature,
and for a quick way of creating this database and the needed tables. and for a quick way of creating this database and the needed tables.
<br /><br /> <br /><br />
@@ -874,7 +879,7 @@ since this link provides funding for phpMyAdmin.
case, just put your current database name in case, just put your current database name in
<tt>$cfg['Servers'][$i]['pmadb']</tt>. For a multi-user installation, <tt>$cfg['Servers'][$i]['pmadb']</tt>. For a multi-user installation,
set this parameter to the name of your central database containing set this parameter to the name of your central database containing
the linked-tables infrastructure.</dd> the phpMyAdmin configuration storage.</dd>
<dt id="bookmark"> <dt id="bookmark">
<span id="cfg_Servers_bookmarktable">$cfg['Servers'][$i]['bookmarktable']</span> string <span id="cfg_Servers_bookmarktable">$cfg['Servers'][$i]['bookmarktable']</span> string
@@ -883,7 +888,7 @@ since this link provides funding for phpMyAdmin.
useful for queries you often run.<br /><br /> useful for queries you often run.<br /><br />
To allow the usage of this functionality: To allow the usage of this functionality:
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables infrastructure</li> <ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
<li>enter the table name in <li>enter the table name in
<tt>$cfg['Servers'][$i]['bookmarktable']</tt></li> <tt>$cfg['Servers'][$i]['bookmarktable']</tt></li>
</ul> </ul>
@@ -919,8 +924,8 @@ since this link provides funding for phpMyAdmin.
To allow the usage of this functionality: To allow the usage of this functionality:
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables <ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin
infrastructure</li> configuration storage</li>
<li>put the relation table name in <li>put the relation table name in
<tt>$cfg['Servers'][$i]['relation']</tt></li> <tt>$cfg['Servers'][$i]['relation']</tt></li>
<li>now as normal user open phpMyAdmin and for each one of your <li>now as normal user open phpMyAdmin and for each one of your
@@ -944,9 +949,10 @@ since this link provides funding for phpMyAdmin.
cursor over the corresponding key.<br /> cursor over the corresponding key.<br />
This configuration variable will hold the name of this special This configuration variable will hold the name of this special
table. To allow the usage of this functionality: table. To allow the usage of this functionality:
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables infrastructure</li> <ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
<li>put the table name in <li>put the table name in
<tt>$cfg['Servers'][$i]['table_info']</tt></li> <tt>$cfg['Servers'][$i]['table_info']</tt> (e.g.
'pma_table_info')</li>
<li>then for each table where you want to use this feature, <li>then for each table where you want to use this feature,
click &quot;Structure/Relation view/Choose column to display&quot; click &quot;Structure/Relation view/Choose column to display&quot;
to choose the column.</li> to choose the column.</li>
@@ -970,8 +976,7 @@ since this link provides funding for phpMyAdmin.
To allow the usage of this functionality: To allow the usage of this functionality:
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables <ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
infrastructure</li>
<li>put the correct table names in <li>put the correct table names in
<tt>$cfg['Servers'][$i]['table_coords']</tt> and <tt>$cfg['Servers'][$i]['table_coords']</tt> and
<tt>$cfg['Servers'][$i]['pdf_pages']</tt></li> <tt>$cfg['Servers'][$i]['pdf_pages']</tt></li>
@@ -1002,10 +1007,10 @@ since this link provides funding for phpMyAdmin.
<br /><br /> <br /><br />
To allow the usage of this functionality: To allow the usage of this functionality:
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables <ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
infrastructure</li>
<li>put the table name in <li>put the table name in
<tt>$cfg['Servers'][$i]['column_info']</tt></li> <tt>$cfg['Servers'][$i]['column_info']</tt> (e.g.
'pma_column_info')</li>
<li>to update your PRE-2.5.0 Column_comments Table use this: <li>to update your PRE-2.5.0 Column_comments Table use this:
<pre> <pre>
@@ -1042,9 +1047,9 @@ ALTER TABLE `pma_column_comments`
To allow the usage of this functionality: To allow the usage of this functionality:
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables <ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
infrastructure</li>
<li>put the table name in <tt>$cfg['Servers'][$i]['history']</tt> <li>put the table name in <tt>$cfg['Servers'][$i]['history']</tt>
(e.g. 'pma_history')
</li> </li>
</ul> </ul>
</dd> </dd>
@@ -1074,8 +1079,8 @@ ALTER TABLE `pma_column_comments`
To allow the usage of this functionality: To allow the usage of this functionality:
<ul> <ul>
<li>set up <a href="#pmadb">pmadb</a> and the linked-tables infrastructure</li> <li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
<li>put the table name in <tt>$cfg['Servers'][$i]['tracking']</tt></li> <li>put the table name in <tt>$cfg['Servers'][$i]['tracking']</tt> (e.g. 'pma_tracking')</li>
</ul> </ul>
</dd> </dd>
@@ -1145,9 +1150,8 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
To allow the usage of this functionality: To allow the usage of this functionality:
<ul><li>set up <a href="#pmadb">pmadb</a> and the linked-tables <ul><li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
infrastructure</li> <li>put the table name in <tt>$cfg['Servers'][$i]['designer_coords']</tt> (e.g. 'pma_designer_coords')
<li>put the table name in <tt>$cfg['Servers'][$i]['designer_coords']</tt>
</li> </li>
</ul> </ul>
</dd> </dd>
@@ -1312,7 +1316,7 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
<dd>Path for storing session data (<a <dd>Path for storing session data (<a
href="http://php.net/session_save_path">session_save_path PHP parameter</a>).</dd> href="http://php.net/session_save_path">session_save_path PHP parameter</a>).</dd>
<dt id="cfg_MemoryLimit">$cfg['MemoryLimit'] integer [number of bytes]</dt> <dt id="cfg_MemoryLimit">$cfg['MemoryLimit'] string [number of bytes]</dt>
<dd>Set the number of bytes a script is allowed to allocate. If set <dd>Set the number of bytes a script is allowed to allocate. If set
to zero, no limit is imposed.<br /> to zero, no limit is imposed.<br />
This setting is used while importing/exporting dump files and at some This setting is used while importing/exporting dump files and at some
@@ -1358,8 +1362,8 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
<dd>Define how long is login cookie valid. Please note that php <dd>Define how long is login cookie valid. Please note that php
configuration option <a href="http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime">session.gc_maxlifetime</a> configuration option <a href="http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime">session.gc_maxlifetime</a>
might limit session validity and if session is lost, login cookie is might limit session validity and if session is lost, login cookie is
also invalidated. So it is good idea to set <code>session.gc_maxlifetime</code> also invalidated. So it is a good idea to set <code>session.gc_maxlifetime</code>
at least as high is $cfg['LoginCookieValidity'] is set.</dd> not lower than the value of $cfg['LoginCookieValidity'].</dd>
<dt id="cfg_LoginCookieStore">$cfg['LoginCookieStore'] integer [number of seconds]</dt> <dt id="cfg_LoginCookieStore">$cfg['LoginCookieStore'] integer [number of seconds]</dt>
<dd>Define how long is login cookie should be stored in browser. Default 0 <dd>Define how long is login cookie should be stored in browser. Default 0
@@ -1680,27 +1684,6 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
expression. For example if you want only Czech and English, you should expression. For example if you want only Czech and English, you should
set filter to <code>'^(cs|en)'</code>.</dd> set filter to <code>'^(cs|en)'</code>.</dd>
<dt id="cfg_DefaultCharset">$cfg['DefaultCharset'] string</dt>
<dd>Default character set to use for recoding of MySQL queries. This must be
enabled and it's described by
<a href="#cfg_AllowAnywhereRecoding" class="configrule">$cfg['AllowAnywhereRecoding']</a>
option.<br />
You can give here any character set which is in
<a href="#cfg_AvailableCharsets" class="configrule">$cfg['AvailableCharsets']</a>
array and this is just default choice, user can select any of them.</dd>
<dt id="cfg_AllowAnywhereRecoding">$cfg['AllowAnywhereRecoding'] boolean</dt>
<dd>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).<br /><br />
Setting this to <tt>TRUE</tt> also activates a pull-down menu
in the Export and Import pages, to choose the character set when
exporting a file. The default value in this menu comes from
<tt>$cfg['Export']['charset']</tt> and <tt>$cfg['Import']['charset']</tt>.
</dd>
<dt id="cfg_RecodingEngine">$cfg['RecodingEngine'] string</dt> <dt id="cfg_RecodingEngine">$cfg['RecodingEngine'] string</dt>
<dd>You can select here which functions will be used for character set <dd>You can select here which functions will be used for character set
conversion. Possible values are: conversion. Possible values are:
@@ -1708,8 +1691,15 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
iconv, then recode)</li> iconv, then recode)</li>
<li>iconv - use iconv or libiconv functions</li> <li>iconv - use iconv or libiconv functions</li>
<li>recode - use recode_string function</li> <li>recode - use recode_string function</li>
<li>none - disable encoding conversion</li>
</ul> </ul>
Default is auto.</dd> Default is auto.</dd>
<dd>
Enabled charset conversion activates a pull-down menu
in the Export and Import pages, to choose the character set when
exporting a file. The default value in this menu comes from
<tt>$cfg['Export']['charset']</tt> and <tt>$cfg['Import']['charset']</tt>.
</dd>
<dt id="cfg_IconvExtraParams">$cfg['IconvExtraParams'] string</dt> <dt id="cfg_IconvExtraParams">$cfg['IconvExtraParams'] string</dt>
<dd>Specify some parameters for iconv used in charset conversion. See <dd>Specify some parameters for iconv used in charset conversion. See
@@ -1864,7 +1854,7 @@ $cfg['TrustedProxies'] =
editing.</dd> editing.</dd>
<dt id="cfg_LimitChars">$cfg['LimitChars'] integer</dt> <dt id="cfg_LimitChars">$cfg['LimitChars'] integer</dt>
<dd>Maximum number of characters showen in any non-numeric column on browse view. <dd>Maximum number of characters shown in any non-numeric field on browse view.
Can be turned off by a toggle button on the browse page.</dd> Can be turned off by a toggle button on the browse page.</dd>
<dt><span id="cfg_ModifyDeleteAtLeft">$cfg['ModifyDeleteAtLeft'] </span>boolean <dt><span id="cfg_ModifyDeleteAtLeft">$cfg['ModifyDeleteAtLeft'] </span>boolean
@@ -2160,24 +2150,8 @@ setfacl -d -m "g:www-data:rwx" tmp
<dt id="cfg_TitleDatabase">$cfg['TitleDatabase'] string</dt> <dt id="cfg_TitleDatabase">$cfg['TitleDatabase'] string</dt>
<dt id="cfg_TitleServer">$cfg['TitleServer'] string</dt> <dt id="cfg_TitleServer">$cfg['TitleServer'] string</dt>
<dt id="cfg_TitleDefault">$cfg['TitleDefault'] string</dt> <dt id="cfg_TitleDefault">$cfg['TitleDefault'] string</dt>
<dd>Allows you to specify window's title bar. Following magic string can <dd>Allows you to specify window's title bar. You can use
be used to get special values: <a href="#faq6_27">format string expansion</a>.
<dl>
<dt><code>@HTTP_HOST@</code></dt>
<dd>HTTP host that runs phpMyAdmin</dd>
<dt><code>@SERVER@</code></dt>
<dd>MySQL server name</dd>
<dt><code>@VERBOSE@</code></dt>
<dd>Verbose MySQL server name as defined in <a href="#cfg_Servers_verbose">server configuration</a></dd>
<dt><code>@VSERVER@</code></dt>
<dd>Verbose MySQL server name if set, otherwise normal</dd>
<dt><code>@DATABASE@</code></dt>
<dd>Currently opened database</dd>
<dt><code>@TABLE@</code></dt>
<dd>Currently opened table</dd>
<dt><code>@PHPMYADMIN@</code></dt>
<dd>phpMyAdmin with version</dd>
</dl>
</dd> </dd>
<dt id="cfg_ErrorIconic">$cfg['ErrorIconic'] boolean</dt> <dt id="cfg_ErrorIconic">$cfg['ErrorIconic'] boolean</dt>
@@ -2208,9 +2182,9 @@ setfacl -d -m "g:www-data:rwx" tmp
<span id="cfg_DefaultQueryDatabase">$cfg['DefaultQueryDatabase']</span> string <span id="cfg_DefaultQueryDatabase">$cfg['DefaultQueryDatabase']</span> string
</dt> </dt>
<dd>Default queries that will be displayed in query boxes when user didn't <dd>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 specify any. You can use standard
comma separated list of column names. Note that %t and %f are only <a href="#faq6_27">format string expansion</a>.
applicable to <tt>$cfg['DefaultQueryTable']</tt>.</dd> </dd>
<dt id="cfg_SQP_fmtType">$cfg['SQP']['fmtType'] string [<tt>html</tt>|<tt>none</tt>]</dt> <dt id="cfg_SQP_fmtType">$cfg['SQP']['fmtType'] string [<tt>html</tt>|<tt>none</tt>]</dt>
<dd> <dd>
@@ -3141,7 +3115,7 @@ RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
in your Apache configuration. See <a href="http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#ssloptions">http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#ssloptions</a>.</p> in your Apache configuration. See <a href="http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#ssloptions">http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#ssloptions</a>.</p>
<h4 id="faq1_40"> <h4 id="faq1_40">
<a href="#faq1_40">1.40 When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work,</a></h4> <a href="#faq1_40">1.40 When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work.</a></h4>
<p>To be able to use cookie auth Apache must know that it has to rewrite the set-cookie headers.<br /> <p>To be able to use cookie auth Apache must know that it has to rewrite the set-cookie headers.<br />
Example from the Apache 2.2 documentation:</p> Example from the Apache 2.2 documentation:</p>
@@ -3365,7 +3339,7 @@ have either the <a href="http://pecl.php.net/package/APC">APC</a> extension
<h4 id="login_bug"> <h4 id="login_bug">
<a href="#login_bug">3.1 When using <a href="#login_bug">3.1 When using
<abbr title="HyperText Transfer Protocol">HTTP</abbr> authentication, an user <abbr title="HyperText Transfer Protocol">HTTP</abbr> authentication, a user
who logged out can not log in again in with the same nick.</a></h4> who logged out can not log in again in with the same nick.</a></h4>
<p> This is related to the authentication mechanism (protocol) used by <p> This is related to the authentication mechanism (protocol) used by
@@ -4134,25 +4108,34 @@ INSERT INTO REL_towns VALUES ('M', 'Montr&eacute;al');
<a href="#faqsqlvalidator">6.14 How do I set up the <a href="#faqsqlvalidator">6.14 How do I set up the
<abbr title="structured query language">SQL</abbr> Validator?</a></h4> <abbr title="structured query language">SQL</abbr> Validator?</a></h4>
<p> To use it, you need a very recent version of PHP, 4.3.0 recommended, with <p>
To use SQL Validator, you need PHP with
<abbr title="Extensible Markup Language">XML</abbr>, <abbr title="Extensible Markup Language">XML</abbr>,
<abbr title="Perl Compatible Regular Expressions">PCRE</abbr> and <abbr title="Perl Compatible Regular Expressions">PCRE</abbr> and
<abbr title="PHP Extension and Application Repository">PEAR</abbr> support. <abbr title="PHP Extension and Application Repository">PEAR</abbr> support.
On your system command line, run <tt>"pear install Net_Socket Net_URL In addition you need a <abbr title="Simple Object Access
HTTP_Request Mail_Mime Net_DIME SOAP"</tt> to get the necessary Protocol">SOAP</abbr> support, either as a PHP extension or as a PEAR SOAP
<abbr title="PHP Extension and Application Repository">PEAR</abbr> modules module.
for usage.<br /> </p>
On a more recent pear version, I had problems with the state of Net_DIME
being beta, so this single command <p>
<tt>"pear -d preferred_state=beta install -a SOAP"</tt> installed all the To install <abbr title="PHP Extension and Application
needed modules.<br /> Repository">PEAR</abbr> <abbr title="Simple Object Access
Protocol">SOAP</abbr> module, run <tt>"pear install Net_Socket Net_URL
HTTP_Request Mail_Mime Net_DIME SOAP"</tt> to get the necessary <abbr
title="PHP Extension and Application Repository">PEAR</abbr> modules for
usage.
</p>
<p>
If you use the Validator, you should be aware that any If you use the Validator, you should be aware that any
<abbr title="structured query language">SQL</abbr> statement you <abbr title="structured query language">SQL</abbr> statement you
submit will be stored anonymously (database/table/column names, submit will be stored anonymously (database/table/column names,
strings, numbers replaced with generic values). The Mimer strings, numbers replaced with generic values). The Mimer
<abbr title="structured query language">SQL</abbr> <abbr title="structured query language">SQL</abbr>
Validator itself, is &copy; 2001 Upright Database Technology. Validator itself, is &copy; 2001 Upright Database Technology.
We utilize it as free SOAP service.</p> We utilize it as free SOAP service.
</p>
<h4 id="faq6_15"> <h4 id="faq6_15">
<a href="#faq6_15">6.15 I want to add a BLOB column and put an index on <a href="#faq6_15">6.15 I want to add a BLOB column and put an index on
@@ -4323,17 +4306,59 @@ chmod o+rwx tmp
<h4 id="faq6_25"> <h4 id="faq6_25">
<a href="#faq6_25">6.25 How does BLOB streaming work in phpMyAdmin?</a></h4> <a href="#faq6_25">6.25 How does BLOB streaming work in phpMyAdmin?</a></h4>
<p> First, for general information about BLOB streaming on MySQL, visit <a href="http://blobstreaming.org">blobstreaming.org</a>. We currently support streaming if you are running MySQL 5.1 with the PBXT and PBMS storage engines.</p> <p> For general information about BLOB streaming on MySQL, visit <a href="http://blobstreaming.org">blobstreaming.org</a>. You need the following components:</p>
<ul>
<li>PBMS BLOB Streaming Daemon for MySQL (0.5.15 or later)</li>
<li>Streaming enabled PBXT Storage engine for MySQL (1.0.11-6 or
later)</li>
<li>PBMS Client Library for MySQL (0.5.15 or later)</li>
<li>PBMS PHP Extension for MySQL (0.1.1 or later)</li>
</ul>
<p>Here are details about configuration and operation:</p>
<ol> <ol>
<li>In <tt>config.inc.php</tt> your host should be defined with a FQDN (fully qualified domain name) instead of something like &quot;localhost&quot;.</li> <li>In <tt>config.inc.php</tt> your host should be defined with a FQDN (fully qualified domain name) instead of &quot;localhost&quot;.</li>
<li>A current limitation is that your first login via phpMyAdmin to a freshly-started server must be done with an account that has the SUPER privilege.</li> <li>Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column and a primary key.</li>
<li>On your target database, go to Operations and in the &quot;BLOB Repository&quot; section, click &quot;Enable&quot;. This creates the PBMS system tables inside your database.</li>
<li>Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column.</li>
<li>When you insert or update a row in this table, put a checkmark on the &quot;Upload to BLOB repository&quot; optional choice; otherwise, the upload will be done directly in your column instead of the repository.</li> <li>When you insert or update a row in this table, put a checkmark on the &quot;Upload to BLOB repository&quot; optional choice; otherwise, the upload will be done directly in your column instead of the repository.</li>
<li>Finally when you browse your table, you'll see in your column a link to stream your data, for example &quot;View image&quot;. A header containing the correct MIME-type will be sent to your browser; this MIME-type was stored at upload time but in case it's incorrect, it's possible to edit it by clicking on the displayed MIME-type.</li> <li>Finally when you browse your table, you'll see in your column a link to stream your data, for example &quot;View image&quot;. A header containing the correct MIME-type will be sent to your browser; this MIME-type was stored at upload time but in case it's incorrect, it's possible to edit it by clicking on the displayed MIME-type.</li>
</ol> </ol>
<h4 id="faq6_26">
<a href="#faq6_26">6.26 How can I select a range of rows?</a></h4>
<p> Click the first row of the range, hold the shift key and click the last row of the range. This works everywhere you see rows, for example in Browse mode or on the Structure page.</p>
<h4 id="faq6_27">
<a href="#faq6_27">6.27 What format strings can I use?</a></h4>
<p>
In all places where phpMyAdmin accepts format strings, you can use
<code>@VARIABLE@</code> expansion and
<a href="http://php.net/strftime">strftime</a> format strings. The
expanded variables depend on a context (eg. if you don't have chosen
table, you can not get table name), but following variables can be used:
</p>
<dl>
<dt><code>@HTTP_HOST@</code></dt>
<dd>HTTP host that runs phpMyAdmin</dd>
<dt><code>@SERVER@</code></dt>
<dd>MySQL server name</dd>
<dt><code>@VERBOSE@</code></dt>
<dd>Verbose MySQL server name as defined in <a href="#cfg_Servers_verbose">server configuration</a></dd>
<dt><code>@VSERVER@</code></dt>
<dd>Verbose MySQL server name if set, otherwise normal</dd>
<dt><code>@DATABASE@</code></dt>
<dd>Currently opened database</dd>
<dt><code>@TABLE@</code></dt>
<dd>Currently opened table</dd>
<dt><code>@FIELDS@</code></dt>
<dd>Fields of currently opened table</dd>
<dt><code>@PHPMYADMIN@</code></dt>
<dd>phpMyAdmin with version</dd>
</dl>
<h3 id="faqproject">phpMyAdmin project</h3> <h3 id="faqproject">phpMyAdmin project</h3>
<h4 id="faq7_1"> <h4 id="faq7_1">
@@ -4344,21 +4369,22 @@ chmod o+rwx tmp
under the Bugs section.<br /><br /> under the Bugs section.<br /><br />
But please first discuss your bug with other users:<br /> But please first discuss your bug with other users:<br />
<a href="http://sf.net/projects/phpmyadmin/"> <a href="https://sourceforge.net/projects/phpmyadmin/forums">
http://sf.net/projects/phpmyadmin/</a> (and choose Forums)</p> https://sourceforge.net/projects/phpmyadmin/forums</a>.
</p>
<h4 id="faq7_2"> <h4 id="faq7_2">
<a href="#faq7_2">7.2 I want to translate the messages to a new language or upgrade an <a href="#faq7_2">7.2 I want to translate the messages to a new language or upgrade an
existing language, where do I start?</a></h4> existing language, where do I start?</a></h4>
<p> Always use latest Git version of po file to translate. You can optionally <p> Always use latest Git version of the po file to translate. You can optionally
translate online at our <a href="http://l10n.cihar.com/">translation translate online at our <a href="http://l10n.cihar.com/">translation
server</a> where you can also get latest po files and merge them server</a> where you can also get the latest po files and merge them
with your translations. For creating new translation simply use with your translations. For creating a new translation simply use
<code>po/phpmyadmin.pot</code> and generate <code>po/phpmyadmin.pot</code> and generate
<code>po/LANG_CODE.po</code> for your language (you can use <code>po/LANG_CODE.po</code> for your language (you can use
<code>msginit -i po/phpmyadmin.pot -l LANG_CODE --no-translator -o po/LANG_CODE.po</code> <code>msginit -i po/phpmyadmin.pot -l LANG_CODE --no-translator -o po/LANG_CODE.po</code>
to do this) or ask on mailing list to add the translation to the web to do this) or ask on the mailing list to add the translation to the web
interface. More details are available on <a href="http://wiki.phpmyadmin.net/pma/Devel:Gettext_for_translators">our wiki</a>. interface. More details are available on <a href="http://wiki.phpmyadmin.net/pma/Devel:Gettext_for_translators">our wiki</a>.
</p> </p>
<p> <p>
@@ -4366,18 +4392,30 @@ chmod o+rwx tmp
the translations, since we define the right character set in the file. the translations, since we define the right character set in the file.
With HTML entities, the text on JavaScript messages would not With HTML entities, the text on JavaScript messages would not
display correctly. display correctly.
However there are some entities that need to be there, for quotes However there are some entities that need to be there: quotes,
,non-breakable spaces, ampersands, less than, greater than. non-breakable spaces, ampersands, less than, greater than.
</p> </p>
<p> <p>
You can then put your translations, as a zip file to avoid losing special You can then put your translations, as a zip file to avoid losing special
characters, on the sourceforge.net translation tracker. characters, on the sourceforge.net <a href="https://sourceforge.net/tracker/?group_id=23067&amp;atid=387645">translation tracker.</a>
</p> </p>
<p> <p>
It would be a good idea to subscribe to the phpmyadmin-translators mailing It would be a good idea to subscribe to the <a href="https://lists.sourceforge.net/lists/listinfo/phpmyadmin-translators">phpmyadmin-translators</a> mailing
list, because this is where we ask for translations of new messages. list, because this is where we ask for translations of new messages.
</p> </p>
<p>
Documentation is being translated using po4a and gettext (see
<a href="http://www.phpmyadmin.net/home_page/docs.php">documentation</a>
for existing translations). To start, checkout
<a href="http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/localized_docs;a=tree;f=po"><code>localized_docs/po</code></a>
from Git, or just go to the <a href="https://l10n.cihar.com/projects/pmadoc/">translation server</a>
and translate it online. If your language is missing, just contact
<a href="mailto:michal@cihar.com">Michal Čihař</a>; he will add it. If
you prefer to directly translate the po files, please put updated ones into our
<a href="https://sourceforge.net/tracker/?group_id=23067&amp;atid=387645">translation tracker</a>.
</p>
<h4 id="faq7_3"> <h4 id="faq7_3">
<a href="#faq7_3">7.3 I would like to help out with the development of <a href="#faq7_3">7.3 I would like to help out with the development of
phpMyAdmin. How should I proceed?</a></h4> phpMyAdmin. How should I proceed?</a></h4>
@@ -4417,7 +4455,7 @@ chmod o+rwx tmp
<a href="#faq8_2">8.2 How can I protect phpMyAdmin against brute force attacks?</a></h4> <a href="#faq8_2">8.2 How can I protect phpMyAdmin against brute force attacks?</a></h4>
<p> If you use Apache web server, phpMyAdmin exports information about <p> If you use Apache web server, phpMyAdmin exports information about
authentication to Apache environment and it can be used in Apache logs. authentication to the Apache environment and it can be used in Apache logs.
Currently there are two variables available: Currently there are two variables available:
</p> </p>
<dl> <dl>
@@ -4448,14 +4486,14 @@ LogFormat "%h %l %u %t \"%r\" %>s %b \
<a href="#faq9_1">9.1 How can I synchronize two databases/tables in phpMyAdmin?</a></h4> <a href="#faq9_1">9.1 How can I synchronize two databases/tables in phpMyAdmin?</a></h4>
<p> You can now synchronize databases/tables in phpMyAdmin using the Synchronize feature. <p> You can now synchronize databases/tables in phpMyAdmin using the Synchronize feature.
It allows you to connect to local as well as remote servers.This requires you to enter It allows you to connect to local as well as remote servers. This requires you to enter
server host name, username, password, port and the name of the database. Therefore you can server host name, username, password, port and the name of the database. Therefore you can
now synchronize your databases placed on the same server or some remote server. now synchronize your databases placed on the same server or some remote server.
</p> </p>
<p> <p>
This feature is helpful for developers who need to replicate their This feature is helpful for developers who need to replicate their
databases structure as well as data. Moreover, this feature not only database&#8217;s structure as well as data. Moreover, this feature not only
helps replication but also facilitates the user to keep his/her database helps replication but also facilitates the user to keep his/her database
in sync with another database. Other than the full database, certain in sync with another database. Other than the full database, certain
tables of the databases can also be synchronized. tables of the databases can also be synchronized.
@@ -4476,29 +4514,29 @@ representation.
</p> </p>
<p> <p>
On the left, are listed the source database table names.  Some of the On the left, are listed the source database table names. Some of the
names have a + plus sign preceding them. This shows that these tables names have a <code>+</code> plus sign preceding them. This shows that these tables
are only present in source database and they need to be added to the are only present in source database and they need to be added to the
target database in order to synchronize the target database. The tables target database in order to synchronize the target database. The tables
whose names are not preceded by a + sign are already present in the whose names are not preceded by a <code>+</code> sign are already present in the
target database. target database.
</p> </p>
<p> <p>
On the right, are listed the target database table names. There are few On the right, are listed the target database table names. There are few
table names that have “(not present)” appended after their names. This table names that have <code>(not present)</code> appended after their names. This
means that these tables are to be created in target database in order to means that these tables are to be created in target database in order to
synchronize target database with source database. Some tables names synchronize target database with source database. Some table names
have a - minus sign preceding them. This shows that these tables are have a <code>-</code> minus sign preceding them. This shows that these tables are
only present in target database and they will remain unchanged in the only present in target database and they will remain unchanged in the
target database. The column in the middle shows the difference between target database. The column in the middle shows the difference between
the source and target corresponding tables. the source and target corresponding tables.
</p> </p>
<p> <p>
The difference is depicted by the red and green buttons with S and D The difference is depicted by the red and green buttons with <tt>S</tt> and <tt>D</tt>
letters, indicating that either Structure or Data are not up to date. By letters, indicating that either Structure or Data are not up to date. By
clicking on them, they will turn grey, what means that they will be synchronised. clicking on them, they will turn grey, what means that they will be synchronized.
</p> </p>
<!-- DEVELOPERS --> <!-- DEVELOPERS -->
@@ -4816,6 +4854,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<li>Replication support</li> <li>Replication support</li>
</ul></li> </ul></li>
<li>Barrie Leslie
<ul>
<li>BLOBstreaming support with PBMS PHP extension</li>
</ul></li>
</ul> </ul>
<p> <p>

View File

@@ -3,7 +3,6 @@
/** /**
* display selection for relational field values * display selection for relational field values
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -23,7 +22,6 @@ require_once './libraries/header_http.inc.php';
* Displays the frame * Displays the frame
*/ */
$per_page = 200; $per_page = 200;
require_once './libraries/relation.lib.php'; // foreign keys
require_once './libraries/transformations.lib.php'; // Transformations require_once './libraries/transformations.lib.php'; // Transformations
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
$foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE); $foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE);

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version 1.0
* @package BLOBStreaming * @package BLOBStreaming
*/ */
@@ -31,70 +30,19 @@
$bsNewMIMEType = isset($_REQUEST['bs_new_mime_type']) ? urldecode($_REQUEST['bs_new_mime_type']) : NULL; $bsNewMIMEType = isset($_REQUEST['bs_new_mime_type']) ? urldecode($_REQUEST['bs_new_mime_type']) : NULL;
// necessary variables exist // necessary variables exist
if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType) if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType)
{ {
// load PMA configuration if (PMA_BS_SetContentType($bsDB, $bsTable, $bsReference, $bsNewMIMEType)) {
$PMA_Config = $GLOBALS['PMA_Config']; // determine redirector page
$newLoc = $cfg['PmaAbsoluteUri'] . 'sql.php?' . PMA_generate_common_url ('','', '&') . (isset($bsDB) ? '&db=' . urlencode($bsDB) : '') . (isset($bsTable) ? '&table=' . urlencode($bsTable) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . '&reload=1&purge=1';
// if PMA configuration exists // redirect to specified page
if (!empty($PMA_Config)) ?>
{ <script>
// if BS plugins exist window.location = "<?php echo $newLoc ?>";
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) </script>
{ <?php
$pbms_ref_tbl = $PMA_Config->get('PBMS_NAME') . '_reference'; } // end if ($result)
$pbms_cust_content_type_tbl = $PMA_Config->get('PBMS_NAME') . '_custom_content_type';
// if specified DB is selected
if (PMA_DBI_select_db($bsDB))
{
$query = "SELECT * FROM " . PMA_backquote($pbms_ref_tbl);
$query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'";
$result = PMA_DBI_query($query);
// if record exists
if ($data = PMA_DBI_fetch_assoc($result))
{
$query = "SELECT count(*) FROM " . PMA_backquote($pbms_cust_content_type_tbl);
$query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'";
$result = PMA_DBI_query($query);
// if record exists
if ($data = PMA_DBI_fetch_assoc($result))
{
if (1 == $data['count(*)'])
{
$query = "UPDATE " . PMA_backquote($pbms_cust_content_type_tbl) . " SET Content_type='";
$query .= PMA_sqlAddslashes($bsNewMIMEType) . "' WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'";
}
else
{
$query = "INSERT INTO " . PMA_backquote($pbms_cust_content_type_tbl) . " (Blob_url, Content_type)";
$query .= " VALUES('" . PMA_sqlAddslashes($bsReference) . "', '" . PMA_sqlAddslashes($bsNewMIMEType) . "')";
}
$result = PMA_DBI_query($query);
// if query execution succeeded
if ($result)
{
// determine redirector page
$newLoc = $cfg['PmaAbsoluteUri'] . 'sql.php?' . PMA_generate_common_url ('','', '&') . (isset($bsDB) ? '&db=' . urlencode($bsDB) : '') . (isset($bsTable) ? '&table=' . urlencode($bsTable) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . '&reload=1&purge=1';
// redirect to specified page
?>
<script>
window.location = "<?php echo $newLoc ?>";
</script>
<?php
} // end if ($result)
} // end if ($data = PMA_DBI_fetch_assoc($result))
} // end if ($data = PMA_DBI_fetch_assoc($result))
} // end if (PMA_DBI_select_db($bsDB))
} // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
} // end if (!empty($PMA_Config))
} // end if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType) } // end if ($bsDB && $bsTable && $bsReference && $bsNewMIMEType)
?> ?>

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version 1.0
* @package BLOBStreaming * @package BLOBStreaming
*/ */
@@ -10,13 +9,6 @@
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// retrieve BS server variables from PMA configuration
$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
if (empty($bs_server)) die('No blob streaming server configured!');
// Check URL parameters // Check URL parameters
PMA_checkParameters(array('reference', 'c_type')); PMA_checkParameters(array('reference', 'c_type'));
@@ -31,15 +23,23 @@ $reference = $_REQUEST['reference'];
*/ */
$c_type = preg_replace('/[^A-Za-z0-9/_-]/', '_', $_REQUEST['c_type']); $c_type = preg_replace('/[^A-Za-z0-9/_-]/', '_', $_REQUEST['c_type']);
$filename = 'http://' . $bs_server . '/' . $reference; // Get the blob streaming URL
$filename = PMA_BS_getURL($reference);
if (empty($filename)) {
die(__('No blob streaming server configured!'));
}
$hdrs = get_headers($filename, 1); $hdrs = get_headers($filename, 1);
if ($hdrs === FALSE) die('Failed to fetch headers'); if ($hdrs === FALSE) {
die(__('Failed to fetch headers'));
}
$fHnd = fopen($filename, "rb"); $fHnd = fopen($filename, "rb");
if ($fHnd === FALSE) die('Failed to open remote URL'); if ($fHnd === FALSE) {
die(__('Failed to open remote URL'));
}
$f_size = $hdrs['Content-Length']; $f_size = $hdrs['Content-Length'];
@@ -59,8 +59,9 @@ while (!feof($fHnd)) {
$content .= fread($fHnd, $f_size); $content .= fread($fHnd, $f_size);
$pos = strlen($content); $pos = strlen($content);
if ($pos >= $f_size) if ($pos >= $f_size) {
break; break;
}
} }
echo $content; echo $content;

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version 1.0
* @package BLOBStreaming * @package BLOBStreaming
*/ */
@@ -16,7 +15,7 @@
$mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL; $mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL;
/* /*
* @var string indicates whether media type is of custom type * @var string indicates whether media type is of custom type
*/ */
$customType = isset($_REQUEST['custom_type']) ? $_REQUEST['custom_type'] : false; $customType = isset($_REQUEST['custom_type']) ? $_REQUEST['custom_type'] : false;
@@ -26,24 +25,16 @@
$bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL; $bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL;
// if media type and BS reference are specified // if media type and BS reference are specified
if (isset($mediaType) && isset($bsReference)) if (isset($mediaType) && isset($bsReference)) {
{ if (isset($customType) && $customType) {
// load PMA configuration $bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType));
$PMA_Config = $GLOBALS['PMA_Config']; } else {
// Get the BLOB streaming URL
// if PMA configuration exists $bs_file_path = PMA_BS_getURL($bsReference);
if (!empty($PMA_Config)) if (empty($bs_file_path)) {
{ die(__('No blob streaming server configured!'));
// retrieve BS server variables from PMA configuration }
$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER'); }
if (empty($bs_server)) die('No blob streaming server configured!');
$bs_file_path = "http://" . $bs_server . '/' . $bsReference;
if (isset($customType) && $customType)
$bs_file_path = 'bs_disp_as_mime_type.php' . PMA_generate_common_url(array('reference' => $bsReference, 'c_type' => $mediaType));
?> ?>
<html> <html>
<head> <head>
@@ -70,7 +61,6 @@
</body> </body>
</html> </html>
<?php <?php
} // end if (!empty($PMA_Config))
} // end if (isset($mediaType) && isset($bsReference)) } // end if (isset($mediaType) && isset($bsReference))
?> ?>

View File

@@ -3,7 +3,6 @@
/** /**
* Simple script to set correct charset for changelog * Simple script to set correct charset for changelog
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -10,9 +9,7 @@
* Gets some core libraries * Gets some core libraries
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'functions.js';
require_once './libraries/header.inc.php'; require_once './libraries/header.inc.php';
require_once './libraries/relation.lib.php';
/** /**
@@ -24,5 +21,5 @@ $cfgRelation = PMA_getRelationsParam(TRUE);
/** /**
* Displays the footer * Displays the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -35,12 +35,6 @@ $cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false;
/* for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
/* User for advanced features */ /* User for advanced features */
// $cfg['Servers'][$i]['controluser'] = 'pma'; // $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; // $cfg['Servers'][$i]['controlpass'] = 'pmapass';
@@ -100,7 +94,7 @@ $cfg['SaveDir'] = '';
/** /**
* Default language to use, if not browser-defined or user-defined * Default language to use, if not browser-defined or user-defined
* (you find all languages in the file libraries/select_lang.lib.php) * (you find all languages in the locale folder)
* uncomment the desired line: * uncomment the desired line:
* default = 'en' * default = 'en'
*/ */

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -10,7 +9,6 @@
* Gets some core libraries * Gets some core libraries
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'functions.js';
require_once './libraries/mysql_charsets.lib.php'; require_once './libraries/mysql_charsets.lib.php';
PMA_checkParameters(array('new_db')); PMA_checkParameters(array('new_db'));

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -19,10 +18,10 @@ if (!isset($selected_tbl)) {
/** /**
* Gets the relations settings * Gets the relations settings
*/ */
require_once './libraries/relation.lib.php'; $cfgRelation = PMA_getRelationsParam();
require_once './libraries/transformations.lib.php'; require_once './libraries/transformations.lib.php';
$cfgRelation = PMA_getRelationsParam();
/** /**
* Check parameters * Check parameters
@@ -321,5 +320,5 @@ function printPage()
<?php <?php
echo '<br /><br /><input type="button" id="print" value="' . __('Print') . '" onclick="printPage()" />'; echo '<br /><br /><input type="button" id="print" value="' . __('Print') . '" onclick="printPage()" />';
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -3,7 +3,6 @@
/** /**
* dumps a database * dumps a database
* *
* @version $Id$
* @uses libraries/db_common.inc.php * @uses libraries/db_common.inc.php
* @uses libraries/db_info.inc.php * @uses libraries/db_info.inc.php
* @uses libraries/display_export.lib.php * @uses libraries/display_export.lib.php
@@ -73,5 +72,5 @@ require_once './libraries/display_export.lib.php';
/** /**
* Displays the footer * Displays the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -9,7 +9,6 @@
* - adding tables * - adding tables
* - viewing PDF schemas * - viewing PDF schemas
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -17,12 +16,8 @@
* requirements * requirements
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
require_once './libraries/Table.class.php';
require_once './libraries/mysql_charsets.lib.php'; require_once './libraries/mysql_charsets.lib.php';
// add blobstreaming library functions
require_once "./libraries/blobstreaming.lib.php";
/** /**
* Rename/move or copy database * Rename/move or copy database
*/ */
@@ -261,71 +256,11 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
} }
} }
/*
* Enable/Disable/Repair BLOB Repository Monitoring for current database
*/
if (strlen($db) > 0 && !empty($db_blob_streaming_op))
{
// load PMA_Config
$PMA_Config = $GLOBALS['PMA_Config'];
if (!empty($PMA_Config))
{
if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
{
// if Blobstreaming plugins exist, begin checking for Blobstreaming tables
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
{
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
$bs_tables = $bs_tables[$db];
$oneBSTableExists = FALSE;
// check if at least one blobstreaming table exists
foreach ($bs_tables as $table_key=>$tbl)
if ($bs_tables[$table_key]['Exists'])
{
$oneBSTableExists = TRUE;
break;
}
switch ($db_blob_streaming_op)
{
// enable BLOB repository monitoring
case "enable":
// if blobstreaming tables do not exist, create them
if (!$oneBSTableExists)
PMA_BS_CreateTables($db);
break;
// disable BLOB repository monitoring
case "disable":
// if at least one blobstreaming table exists, execute drop
if ($oneBSTableExists)
PMA_BS_DropTables($db);
break;
// repair BLOB repository
case "repair":
// check if a blobstreaming table is missing
foreach ($bs_tables as $table_key=>$tbl)
if (!$bs_tables[$table_key]['Exists'])
{
PMA_DBI_select_db($db);
PMA_DBI_query(PMA_BS_GetTableStruct($table_key));
}
}
// refresh side menu
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_operations.php?' . PMA_generate_common_url ('','', '&') . (isset($db) ? '&db=' . urlencode($db) : '') . (isset($token) ? '&token=' . urlencode($token) : '') . (isset($goto) ? '&goto=' . urlencode($goto) : '') . 'reload=1&purge=1');
} // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
} // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
}
}
/** /**
* Settings for relations stuff * Settings for relations stuff
*/ */
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
/** /**
@@ -429,7 +364,41 @@ if (!$is_information_schema) {
<input type="submit" value="<?php echo __('Go'); ?>" onclick="return confirmLink(this, 'CREATE DATABASE ... <?php echo __('and then'); ?> DROP DATABASE <?php echo PMA_jsFormat($db); ?>')" /> <input type="submit" value="<?php echo __('Go'); ?>" onclick="return confirmLink(this, 'CREATE DATABASE ... <?php echo __('and then'); ?> DROP DATABASE <?php echo PMA_jsFormat($db); ?>')" />
</fieldset> </fieldset>
</form> </form>
<?php
// Drop link if allowed
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
// Don't allow to easilly drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && ! $db_is_information_schema && ($db != 'mysql')) {
?>
<fieldset class="caution">
<legend><?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_deltbl.png"'
.' alt="" width="16" height="16" />';
}
echo __('Remove database');
?></legend>
<ul>
<?php
$this_sql_query = 'DROP DATABASE ' . PMA_backquote($GLOBALS['db']);
$this_url_params = array(
'sql_query' => $this_sql_query,
'back' => 'db_operations.php',
'goto' => 'main.php',
'reload' => '1',
'purge' => '1',
'zero_rows' => sprintf(__('Database %s has been dropped.'), htmlspecialchars(PMA_backquote($db))),
'db' => NULL,
);
?>
<li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" onclick="return confirmLinkDropDB(this, '<?php echo PMA_jsFormat($this_sql_query); ?>')">
<?php echo __('Drop the database (DROP)'); ?></a>
<?php echo PMA_showMySQLDocu('SQL-Syntax', 'DROP_DATABASE'); ?>
</li>
</ul>
</fieldset>
<?php } ?>
<?php <?php
/** /**
* Copy database * Copy database
@@ -501,92 +470,6 @@ if (!$is_information_schema) {
</form> </form>
<?php <?php
/*
* BLOB streaming support
*/
// load PMA_Config
$PMA_Config = $GLOBALS['PMA_Config'];
// if all blobstreaming plugins exist, begin checking for blobstreaming tables
if (!empty($PMA_Config))
{
if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
{
if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
{
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
$bs_tables = $bs_tables[$db];
$oneBSTableExists = FALSE;
$allBSTablesExist = TRUE;
// first check that all blobstreaming tables do not exist
foreach ($bs_tables as $table_key=>$tbl)
if ($bs_tables[$table_key]['Exists'])
$oneBSTableExists = TRUE;
else
$allBSTablesExist = FALSE;
?>
<form method="post" action="./db_operations.php">
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<fieldset>
<legend>
<?php echo PMA_getIcon('b_edit.png', __('BLOB Repository'), false, true); ?>
</legend>
<?php echo __('Status'); ?>:
<?php
// if the blobstreaming tables exist, provide option to disable the BLOB repository
if ($allBSTablesExist)
{
?>
<?php echo _pgettext('BLOB repository', 'Enabled'); ?>
</fieldset>
<fieldset class="tblFooters">
<input type="hidden" name="db_blob_streaming_op" value="disable" />
<input type="submit" onclick="return confirmDisableRepository('<?php echo $db; ?>');" value="<?php echo __('Disable'); ?>" />
</fieldset>
<?php
}
else
{
// if any of the blobstreaming tables are missing, provide option to repair the BLOB repository
if ($oneBSTableExists && !$allBSTablesExist)
{
?>
<?php echo __('Damaged'); ?>
</fieldset>
<fieldset class="tblFooters">
<input type="hidden" name="db_blob_streaming_op" value="repair" />
<input type="submit" value="<?php echo _pgettext('BLOB repository', 'Repair'); ?>" />
</fieldset>
<?php
}
// if none of the blobstreaming tables exist, provide option to enable BLOB repository
else
{
?>
<?php echo _pgettext('BLOB repository', 'Disabled'); ?>
</fieldset>
<fieldset class="tblFooters">
<input type="hidden" name="db_blob_streaming_op" value="enable" />
<input type="submit" value="<?php echo __('Enable'); ?>" />
</fieldset>
<?php
}
} // end if ($allBSTablesExist)
?>
</form>
<?php
} // end if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
} // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
}
/** /**
* Change database charset * Change database charset
@@ -612,7 +495,7 @@ if (!$is_information_schema) {
if ($num_tables > 0 if ($num_tables > 0
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
$message = PMA_Message::notice(__('The additional features for working with linked tables have been deactivated. To find out why click %shere%s.')); $message = PMA_Message::notice(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.'));
$message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false); $message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);
$message->addParam('</a>', false); $message->addParam('</a>', false);
/* Show error if user has configured something, notice elsewhere */ /* Show error if user has configured something, notice elsewhere */
@@ -651,5 +534,5 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
/** /**
* Displays the footer * Displays the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -27,7 +26,6 @@ $err_url = 'db_sql.php?' . PMA_generate_common_url($db);
/** /**
* Settings for relations stuff * Settings for relations stuff
*/ */
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
/** /**
@@ -266,5 +264,5 @@ function printPage()
id="print" value="<?php echo __('Print'); ?>" onclick="printPage()" /> id="print" value="<?php echo __('Print'); ?>" onclick="printPage()" />
<?php <?php
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -3,7 +3,6 @@
/** /**
* query by example the whole database * query by example the whole database
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -11,9 +10,6 @@
* requirements * requirements
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
require_once './libraries/Table.class.php';
require_once './libraries/relation.lib.php';
/** /**
* Gets the relation settings * Gets the relation settings
@@ -100,7 +96,7 @@ $tbl_result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';',
$tbl_result_cnt = PMA_DBI_num_rows($tbl_result); $tbl_result_cnt = PMA_DBI_num_rows($tbl_result);
if (0 == $tbl_result_cnt) { if (0 == $tbl_result_cnt) {
PMA_Message::error(__('No tables found in database.'))->display(); PMA_Message::error(__('No tables found in database.'))->display();
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
exit; exit;
} }
@@ -941,5 +937,5 @@ if (!empty($qry_orderby)) {
/** /**
* Displays the footer * Displays the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -7,23 +7,6 @@
* @todo display executed query, optional? * @todo display executed query, optional?
* @uses $cfg['UseDbSearch'] * @uses $cfg['UseDbSearch']
* @uses $GLOBALS['db'] * @uses $GLOBALS['db']
* @uses __('Access denied')
* @uses __('at least one of the words')
* @uses __('all words')
* @uses __('the exact phrase')
* @uses __('as regular expression')
* @uses __('Search results for "<i>%s</i>" %s:')
* @uses __('%s match(es) inside table <i>%s</i>')
* @uses __('Browse')
* @uses __('Delete')
* @uses __('<b>Total:</b> <i>%s</i> match(es)')
* @uses __('Search in database')
* @uses __('Word(s) or value(s) to search for (wildcard: "%"):')
* @uses __('Find:')
* @uses __('Words are separated by a space character (" ").')
* @uses __('Inside table(s):')
* @uses __('Unselect All')
* @uses __('Select All')
* @uses PMA_DBI_get_tables() * @uses PMA_DBI_get_tables()
* @uses PMA_sqlAddslashes() * @uses PMA_sqlAddslashes()
* @uses PMA_getSearchSqls() * @uses PMA_getSearchSqls()
@@ -46,7 +29,6 @@
* @uses array_intersect() * @uses array_intersect()
* @uses sprintf() * @uses sprintf()
* @uses in_array() * @uses in_array()
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -257,7 +239,7 @@ if (isset($_REQUEST['submit_search'])) {
$sql_query .= $newsearchsqls['select_count']; $sql_query .= $newsearchsqls['select_count'];
echo '<tr class="' . ($odd_row ? 'odd' : 'even') . '">' echo '<tr class="' . ($odd_row ? 'odd' : 'even') . '">'
.'<td>' . sprintf(__('%s match(es) inside table <i>%s</i>'), $res_cnt, .'<td>' . sprintf(_ngettext('%s match inside table <i>%s</i>', '%s matches inside table <i>%s</i>', $res_cnt), $res_cnt,
htmlspecialchars($each_table)) . "</td>\n"; htmlspecialchars($each_table)) . "</td>\n";
if ($res_cnt > 0) { if ($res_cnt > 0) {
@@ -282,7 +264,7 @@ if (isset($_REQUEST['submit_search'])) {
echo '</table>' . "\n"; echo '</table>' . "\n";
if (count($tables_selected) > 1) { if (count($tables_selected) > 1) {
echo '<p>' . sprintf(__('<b>Total:</b> <i>%s</i> match(es)'), echo '<p>' . sprintf(_ngettext('<b>Total:</b> <i>%s</i> match', '<b>Total:</b> <i>%s</i> matches', $num_search_result_total),
$num_search_result_total) . '</p>' . "\n"; $num_search_result_total) . '</p>' . "\n";
} }
} // end 1. } // end 1.
@@ -368,5 +350,5 @@ $alter_select =
/** /**
* Displays the footer * Displays the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -42,5 +41,5 @@ PMA_sqlQueryForm(true, false, isset($_REQUEST['delimiter']) ? $_REQUEST['delimit
/** /**
* Displays the footer * Displays the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -10,7 +9,6 @@
* *
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
require_once './libraries/Table.class.php';
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
@@ -57,7 +55,7 @@ if ($num_tables == 0) {
/** /**
* Displays the footer * Displays the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
exit; exit;
} }
@@ -151,25 +149,12 @@ $hidden_fields = array();
$odd_row = true; $odd_row = true;
$sum_row_count_pre = ''; $sum_row_count_pre = '';
// for blobstreaming
$PMA_Config = $GLOBALS['PMA_Config'];
if (!empty($PMA_Config))
$session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES'); // list of blobstreaming tables
$tableReductionCount = 0; // the amount to reduce the table count by $tableReductionCount = 0; // the amount to reduce the table count by
foreach ($tables as $keyname => $each_table) { foreach ($tables as $keyname => $each_table) {
if (isset($session_bs_tables)) if (PMA_BS_IsHiddenTable($keyname)) {
{ $tableReductionCount++;
// compare table name against blobstreaming tables continue;
foreach ($session_bs_tables as $table_key=>$table_val)
// if the table is a blobstreaming table, reduce table count and skip outer foreach loop
if ($table_key == $keyname)
{
$tableReductionCount++;
continue 2;
}
} }
// Get valid statistics whatever is the table type // Get valid statistics whatever is the table type
@@ -360,24 +345,24 @@ foreach ($tables as $keyname => $each_table) {
) { ) {
$do = true; $do = true;
} }
foreach ($server_slave_Wild_Do_Table as $table) { foreach ($server_slave_Wild_Do_Table as $db_table) {
if (($db == PMA_replication_strout($table)) && (ereg("^".substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true))-1), $truename))) $table_part = PMA_extract_db_or_table($db_table, 'table');
if (($db == PMA_extract_db_or_table($db_table, 'db')) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))) {
$do = true; $do = true;
}
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) { if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) {
$ignored = true; $ignored = true;
} }
foreach ($server_slave_Wild_Ignore_Table as $table) { foreach ($server_slave_Wild_Ignore_Table as $db_table) {
if (($db == PMA_replication_strout($table)) && (ereg("^".substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true))-1), $truename))) $table_part = PMA_extract_db_or_table($db_table, 'table');
if (($db == PMA_extract_db_or_table($db_table)) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))) {
$ignored = true; $ignored = true;
}
} }
}/* elseif ($server_master_status) { unset($table_part);
if ((strlen(array_search($db, $server_master_Do_DB))>0) || count($server_master_Do_DB)==1) }
$do = true;
elseif ((strlen(array_search($db, $server_master_Ignore_DB))>0) || count($server_master_Ignore_DB)==1)
$ignored = true;
}*/
?> ?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>"> <tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
<td align="center"> <td align="center">
@@ -613,5 +598,5 @@ if (empty($db_is_information_schema)) {
/** /**
* Displays the footer * Displays the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -9,7 +8,6 @@
* Run common work * Run common work
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
require_once './libraries/Table.class.php';
require './libraries/db_common.inc.php'; require './libraries/db_common.inc.php';
$url_query .= '&amp;goto=tbl_tracking.php&amp;back=db_tracking.php'; $url_query .= '&amp;goto=tbl_tracking.php&amp;back=db_tracking.php';
@@ -18,9 +16,6 @@ $url_query .= '&amp;goto=tbl_tracking.php&amp;back=db_tracking.php';
$sub_part = '_structure'; $sub_part = '_structure';
require './libraries/db_info.inc.php'; require './libraries/db_info.inc.php';
// Get relation settings
require_once './libraries/relation.lib.php';
// Work to do? // Work to do?
// (here, do not use $_REQUEST['db] as it can be crafted) // (here, do not use $_REQUEST['db] as it can be crafted)
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) { if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
@@ -39,7 +34,7 @@ if ($num_tables == 0 && count($data['ddlog']) == 0) {
} }
// Display the footer // Display the footer
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
exit; exit;
} }
@@ -203,5 +198,5 @@ if (count($data['ddlog']) > 0) {
/** /**
* Display the footer * Display the footer
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
?> ?>

View File

@@ -3,14 +3,13 @@
/** /**
* phpMyAdmin fatal error display page * phpMyAdmin fatal error display page
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
/** /**
* Input sanitizing. * Input sanitizing.
*/ */
require_once './libraries/sanitizing.lib.php'; require './libraries/sanitizing.lib.php';
/* Get variables */ /* Get variables */
if (! empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) { if (! empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) {

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @todo too much die here, or? * @todo too much die here, or?
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -60,7 +59,6 @@ if (empty($_REQUEST['asfile'])) {
// Does export require to be into file? // Does export require to be into file?
if (isset($export_list[$type]['force_file']) && ! $asfile) { if (isset($export_list[$type]['force_file']) && ! $asfile) {
$message = PMA_Message::error(__('Selected export type has to be saved in file!')); $message = PMA_Message::error(__('Selected export type has to be saved in file!'));
$GLOBALS['js_include'][] = 'functions.js';
require_once './libraries/header.inc.php'; require_once './libraries/header.inc.php';
if ($export_type == 'server') { if ($export_type == 'server') {
$active_page = 'server_export.php'; $active_page = 'server_export.php';
@@ -207,7 +205,7 @@ if ($what == 'sql') {
$output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xls'; $output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xls';
// Do we need to convert charset? // Do we need to convert charset?
$output_charset_conversion = $asfile && $cfg['AllowAnywhereRecoding'] $output_charset_conversion = $asfile && $GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE
&& isset($charset_of_file) && $charset_of_file != $charset && isset($charset_of_file) && $charset_of_file != $charset
&& $type != 'xls'; && $type != 'xls';
@@ -248,25 +246,19 @@ if ($asfile) {
if (isset($remember_template)) { if (isset($remember_template)) {
$GLOBALS['PMA_Config']->setCookie('pma_server_filename_template', $filename_template); $GLOBALS['PMA_Config']->setCookie('pma_server_filename_template', $filename_template);
} }
$filename = str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template));
} elseif ($export_type == 'database') { } elseif ($export_type == 'database') {
if (isset($remember_template)) { if (isset($remember_template)) {
$GLOBALS['PMA_Config']->setCookie('pma_db_filename_template', $filename_template); $GLOBALS['PMA_Config']->setCookie('pma_db_filename_template', $filename_template);
} }
$filename = str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template)));
} else { } else {
if (isset($remember_template)) { if (isset($remember_template)) {
$GLOBALS['PMA_Config']->setCookie('pma_table_filename_template', $filename_template); $GLOBALS['PMA_Config']->setCookie('pma_table_filename_template', $filename_template);
} }
$filename = str_replace('__TABLE__', $table, str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template))));
} }
$filename = PMA_expandUserString($filename_template);
// convert filename to iso-8859-1, it is safer // convert filename to iso-8859-1, it is safer
if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] )) { $filename = PMA_convert_string($charset, 'iso-8859-1', $filename);
$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 // Grab basic dump extension and mime type
$filename .= '.' . $export_list[$type]['extension']; $filename .= '.' . $export_list[$type]['extension'];
@@ -305,7 +297,6 @@ if ($save_on_server) {
} }
} }
if (isset($message)) { if (isset($message)) {
$GLOBALS['js_include'][] = 'functions.js';
require_once './libraries/header.inc.php'; require_once './libraries/header.inc.php';
if ($export_type == 'server') { if ($export_type == 'server') {
$active_page = 'server_export.php'; $active_page = 'server_export.php';
@@ -357,7 +348,6 @@ if (!$save_on_server) {
$num_tables = count($tables); $num_tables = count($tables);
if ($num_tables == 0) { if ($num_tables == 0) {
$message = PMA_Message::error(__('No tables found in database.')); $message = PMA_Message::error(__('No tables found in database.'));
$GLOBALS['js_include'][] = 'functions.js';
require_once './libraries/header.inc.php'; require_once './libraries/header.inc.php';
$active_page = 'db_export.php'; $active_page = 'db_export.php';
require './db_export.php'; require './db_export.php';
@@ -393,7 +383,6 @@ $do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_comments']); $do_comments = isset($GLOBALS[$what . '_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']); $do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) { if ($do_relation || $do_comments || $do_mime) {
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
} }
if ($do_mime) { if ($do_mime) {
@@ -572,7 +561,6 @@ if (!PMA_exportFooter()) {
// End of fake loop // End of fake loop
if ($save_on_server && isset($message)) { if ($save_on_server && isset($message)) {
$GLOBALS['js_include'][] = 'functions.js';
require_once './libraries/header.inc.php'; require_once './libraries/header.inc.php';
if ($export_type == 'server') { if ($export_type == 'server') {
$active_page = 'server_export.php'; $active_page = 'server_export.php';
@@ -629,7 +617,6 @@ if (!empty($asfile)) {
$message = new PMA_Message(__('Dump has been saved to file %s.'), PMA_Message::SUCCESS, $save_filename); $message = new PMA_Message(__('Dump has been saved to file %s.'), PMA_Message::SUCCESS, $save_filename);
} }
$GLOBALS['js_include'][] = 'functions.js';
require_once './libraries/header.inc.php'; require_once './libraries/header.inc.php';
if ($export_type == 'server') { if ($export_type == 'server') {
$active_page = 'server_export.php'; $active_page = 'server_export.php';
@@ -680,6 +667,6 @@ else {
//]]> //]]>
</script> </script>
<?php <?php
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
} // end if } // end if
?> ?>

View File

@@ -4,7 +4,6 @@
* Core script for import, this is just the glue around all other stuff * Core script for import, this is just the glue around all other stuff
* *
* @uses PMA_Bookmark_getList() * @uses PMA_Bookmark_getList()
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -13,7 +12,6 @@
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
//require_once './libraries/display_import_functions.lib.php'; //require_once './libraries/display_import_functions.lib.php';
$GLOBALS['js_include'][] = 'functions.js';
// reset import messages for ajax request // reset import messages for ajax request
$_SESSION['Import_message']['message'] = null; $_SESSION['Import_message']['message'] = null;
@@ -343,7 +341,7 @@ if ($import_file != 'none' && !$error) {
//$_SESSION['Import_message'] = $message->getDisplay(); //$_SESSION['Import_message'] = $message->getDisplay();
// Convert the file's charset if necessary // Convert the file's charset if necessary
if ($cfg['AllowAnywhereRecoding'] && isset($charset_of_file)) { if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE && isset($charset_of_file)) {
if ($charset_of_file != $charset) { if ($charset_of_file != $charset) {
$charset_conversion = TRUE; $charset_conversion = TRUE;
} }
@@ -447,6 +445,15 @@ if (isset($my_die)) {
} }
} }
// we want to see the results of the last query that returned at least a row
if (! empty($last_query_with_results)) {
// but we want to show intermediate results too
$disp_query = $sql_query;
$disp_message = __('Your SQL query has been executed successfully');
$sql_query = $last_query_with_results;
$go_sql = true;
}
if ($go_sql) { if ($go_sql) {
require './sql.php'; require './sql.php';
} else { } else {

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -3,8 +3,6 @@
/** /**
* forms frameset * forms frameset
* *
* @version $Id$
* @uses __('phpMyAdmin is more friendly with a <b>frames-capable</b> browser.')
* @uses $GLOBALS['cfg']['QueryHistoryDB'] * @uses $GLOBALS['cfg']['QueryHistoryDB']
* @uses $GLOBALS['cfg']['Server']['user'] * @uses $GLOBALS['cfg']['Server']['user']
* @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe * @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe
@@ -34,11 +32,6 @@
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
/**
* Includes the ThemeManager if it hasn't been included yet
*/
require_once './libraries/relation.lib.php';
// free the session file, for the other frames to be loaded // free the session file, for the other frames to be loaded
session_write_close(); session_write_close();
@@ -63,7 +56,7 @@ unset($cfgRelation);
/** /**
* pass variables to child pages * pass variables to child pages
*/ */
$drops = array('lang', 'server', 'convcharset', 'collation_connection', $drops = array('lang', 'server', 'collation_connection',
'db', 'table'); 'db', 'table');
foreach ($drops as $each_drop) { foreach ($drops as $each_drop) {

View File

@@ -101,10 +101,13 @@ function setDb(new_db) {
var old_db = db; var old_db = db;
db = new_db; db = new_db;
// the db name as an id exists only when LeftFrameLight is false
if (window.frame_navigation.document.getElementById(db) == null) { if (window.frame_navigation.document.getElementById(db) == null) {
// happens when LeftFrameLight is true
// db is unknown, reload complete left frame // db is unknown, reload complete left frame
refreshNavigation(); refreshNavigation();
} else { } else {
// happens when LeftFrameLight is false
unmarkDbTable(old_db); unmarkDbTable(old_db);
markDbTable(db); markDbTable(db);
} }

View File

@@ -194,7 +194,7 @@ function confirmQuery(theForm1, sqlQuery1)
* Displays a confirmation box before disabling the BLOB repository for a given database. * Displays a confirmation box before disabling the BLOB repository for a given database.
* This function is called while clicking links * This function is called while clicking links
* *
* @param object the database * @param object the database
* *
* @return boolean whether to disable the repository or not * @return boolean whether to disable the repository or not
*/ */
@@ -282,10 +282,10 @@ function checkSqlQuery(theForm)
// Global variable row_class is set to even // Global variable row_class is set to even
var row_class = 'even'; var row_class = 'even';
/** /**
* Generates a row dynamically in the differences table displaying * Generates a row dynamically in the differences table displaying
* the complete statistics of difference in table like number of * the complete statistics of difference in table like number of
* rows to be updated, number of rows to be inserted, number of * rows to be updated, number of rows to be inserted, number of
* columns to be added, number of columns to be removed, etc. * columns to be added, number of columns to be removed, etc.
* *
* @param index index of matching table * @param index index of matching table
@@ -294,17 +294,17 @@ var row_class = 'even';
* @param remove_size number of columns to be removed * @param remove_size number of columns to be removed
* @param insert_index number of indexes to be inserted * @param insert_index number of indexes to be inserted
* @param remove_index number of indexes to be removed * @param remove_index number of indexes to be removed
* @param img_obj image object * @param img_obj image object
* @param table_name name of the table * @param table_name name of the table
*/ */
function showDetails(i, update_size, insert_size, remove_size, insert_index, remove_index, img_obj, table_name) function showDetails(i, update_size, insert_size, remove_size, insert_index, remove_index, img_obj, table_name)
{ {
// The path of the image is split to facilitate comparison // The path of the image is split to facilitate comparison
var relative_path = (img_obj.src).split("themes/"); var relative_path = (img_obj.src).split("themes/");
// The image source is changed when the showDetails function is called. // The image source is changed when the showDetails function is called.
if (relative_path[1] == 'original/img/new_data_hovered.jpg') { if (relative_path[1] == 'original/img/new_data_hovered.jpg') {
img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg"; img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg";
img_obj.alt = PMA_messages['strClickToUnselect']; //only for IE browser img_obj.alt = PMA_messages['strClickToUnselect']; //only for IE browser
} else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') { } else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') {
@@ -313,76 +313,76 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
} else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') { } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') {
img_obj.src = "./themes/original/img/new_struct_hovered.jpg"; img_obj.src = "./themes/original/img/new_struct_hovered.jpg";
img_obj.alt = PMA_messages['strClickToSelect']; img_obj.alt = PMA_messages['strClickToSelect'];
} else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') {
img_obj.src = "./themes/original/img/new_data_hovered.jpg"; img_obj.src = "./themes/original/img/new_data_hovered.jpg";
img_obj.alt = PMA_messages['strClickToSelect']; img_obj.alt = PMA_messages['strClickToSelect'];
} }
var div = document.getElementById("list"); var div = document.getElementById("list");
var table = div.getElementsByTagName("table")[0]; var table = div.getElementsByTagName("table")[0];
var table_body = table.getElementsByTagName("tbody")[0]; var table_body = table.getElementsByTagName("tbody")[0];
//Global variable row_class is being used //Global variable row_class is being used
if (row_class == 'even') { if (row_class == 'even') {
row_class = 'odd'; row_class = 'odd';
} else { } else {
row_class = 'even'; row_class = 'even';
} }
// If the red or green button against a table name is pressed then append a new row to show the details of differences of this table. // If the red or green button against a table name is pressed then append a new row to show the details of differences of this table.
if ((relative_path[1] != 'original/img/new_struct_selected_hovered.jpg') && (relative_path[1] != 'original/img/new_data_selected_hovered.jpg')) { if ((relative_path[1] != 'original/img/new_struct_selected_hovered.jpg') && (relative_path[1] != 'original/img/new_data_selected_hovered.jpg')) {
var newRow = document.createElement("tr"); var newRow = document.createElement("tr");
newRow.setAttribute("class", row_class); newRow.setAttribute("class", row_class);
newRow.className = row_class; newRow.className = row_class;
// Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array // Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array
newRow.setAttribute("id" , i); newRow.setAttribute("id" , i);
var table_name_cell = document.createElement("td"); var table_name_cell = document.createElement("td");
table_name_cell.align = "center"; table_name_cell.align = "center";
table_name_cell.innerHTML = table_name ; table_name_cell.innerHTML = table_name ;
newRow.appendChild(table_name_cell); newRow.appendChild(table_name_cell);
var create_table = document.createElement("td"); var create_table = document.createElement("td");
create_table.align = "center"; create_table.align = "center";
var add_cols = document.createElement("td"); var add_cols = document.createElement("td");
add_cols.align = "center"; add_cols.align = "center";
var remove_cols = document.createElement("td"); var remove_cols = document.createElement("td");
remove_cols.align = "center"; remove_cols.align = "center";
var alter_cols = document.createElement("td"); var alter_cols = document.createElement("td");
alter_cols.align = "center"; alter_cols.align = "center";
var add_index = document.createElement("td"); var add_index = document.createElement("td");
add_index.align = "center"; add_index.align = "center";
var delete_index = document.createElement("td"); var delete_index = document.createElement("td");
delete_index.align = "center"; delete_index.align = "center";
var update_rows = document.createElement("td"); var update_rows = document.createElement("td");
update_rows.align = "center"; update_rows.align = "center";
var insert_rows = document.createElement("td"); var insert_rows = document.createElement("td");
insert_rows.align = "center"; insert_rows.align = "center";
var tick_image = document.createElement("img"); var tick_image = document.createElement("img");
tick_image.src = "./themes/original/img/s_success.png"; tick_image.src = "./themes/original/img/s_success.png";
if (update_size == '' && insert_size == '' && remove_size == '') { if (update_size == '' && insert_size == '' && remove_size == '') {
/** /**
This is the case when the table needs to be created in target database. This is the case when the table needs to be created in target database.
*/ */
create_table.appendChild(tick_image); create_table.appendChild(tick_image);
add_cols.innerHTML = "--"; add_cols.innerHTML = "--";
remove_cols.innerHTML = "--"; remove_cols.innerHTML = "--";
alter_cols.innerHTML = "--"; alter_cols.innerHTML = "--";
delete_index.innerHTML = "--"; delete_index.innerHTML = "--";
add_index.innerHTML = "--"; add_index.innerHTML = "--";
update_rows.innerHTML = "--"; update_rows.innerHTML = "--";
insert_rows.innerHTML = "--"; insert_rows.innerHTML = "--";
newRow.appendChild(create_table); newRow.appendChild(create_table);
newRow.appendChild(add_cols); newRow.appendChild(add_cols);
newRow.appendChild(remove_cols); newRow.appendChild(remove_cols);
@@ -391,43 +391,21 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
newRow.appendChild(add_index); newRow.appendChild(add_index);
newRow.appendChild(update_rows); newRow.appendChild(update_rows);
newRow.appendChild(insert_rows); newRow.appendChild(insert_rows);
} else if (update_size == '' && remove_size == '') { } else if (update_size == '' && remove_size == '') {
/** /**
This is the case when data difference is displayed in the This is the case when data difference is displayed in the
table which is present in source but absent from target database table which is present in source but absent from target database
*/ */
create_table.innerHTML = "--"; create_table.innerHTML = "--";
add_cols.innerHTML = "--"; add_cols.innerHTML = "--";
remove_cols.innerHTML = "--"; remove_cols.innerHTML = "--";
alter_cols.innerHTML = "--"; alter_cols.innerHTML = "--";
add_index.innerHTML = "--"; add_index.innerHTML = "--";
delete_index.innerHTML = "--"; delete_index.innerHTML = "--";
update_rows.innerHTML = "--"; update_rows.innerHTML = "--";
insert_rows.innerHTML = insert_size; insert_rows.innerHTML = insert_size;
newRow.appendChild(create_table);
newRow.appendChild(add_cols);
newRow.appendChild(remove_cols);
newRow.appendChild(alter_cols);
newRow.appendChild(delete_index);
newRow.appendChild(add_index);
newRow.appendChild(update_rows);
newRow.appendChild(insert_rows);
} else if (remove_size == '') {
/**
This is the case when data difference between matching_tables is displayed.
*/
create_table.innerHTML = "--";
add_cols.innerHTML = "--";
remove_cols.innerHTML = "--";
alter_cols.innerHTML = "--";
add_index.innerHTML = "--";
delete_index.innerHTML = "--";
update_rows.innerHTML = update_size;
insert_rows.innerHTML = insert_size;
newRow.appendChild(create_table); newRow.appendChild(create_table);
newRow.appendChild(add_cols); newRow.appendChild(add_cols);
newRow.appendChild(remove_cols); newRow.appendChild(remove_cols);
@@ -436,41 +414,63 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
newRow.appendChild(add_index); newRow.appendChild(add_index);
newRow.appendChild(update_rows); newRow.appendChild(update_rows);
newRow.appendChild(insert_rows); newRow.appendChild(insert_rows);
} else if (remove_size == '') {
/**
This is the case when data difference between matching_tables is displayed.
*/
create_table.innerHTML = "--";
add_cols.innerHTML = "--";
remove_cols.innerHTML = "--";
alter_cols.innerHTML = "--";
add_index.innerHTML = "--";
delete_index.innerHTML = "--";
update_rows.innerHTML = update_size;
insert_rows.innerHTML = insert_size;
newRow.appendChild(create_table);
newRow.appendChild(add_cols);
newRow.appendChild(remove_cols);
newRow.appendChild(alter_cols);
newRow.appendChild(delete_index);
newRow.appendChild(add_index);
newRow.appendChild(update_rows);
newRow.appendChild(insert_rows);
} else { } else {
/** /**
This is the case when structure difference between matching_tables id displayed This is the case when structure difference between matching_tables id displayed
*/ */
create_table.innerHTML = "--"; create_table.innerHTML = "--";
add_cols.innerHTML = insert_size; add_cols.innerHTML = insert_size;
remove_cols.innerHTML = remove_size; remove_cols.innerHTML = remove_size;
alter_cols.innerHTML = update_size; alter_cols.innerHTML = update_size;
delete_index.innerHTML = remove_index; delete_index.innerHTML = remove_index;
add_index.innerHTML = insert_index; add_index.innerHTML = insert_index;
update_rows.innerHTML = "--"; update_rows.innerHTML = "--";
insert_rows.innerHTML = "--"; insert_rows.innerHTML = "--";
newRow.appendChild(create_table); newRow.appendChild(create_table);
newRow.appendChild(add_cols); newRow.appendChild(add_cols);
newRow.appendChild(remove_cols); newRow.appendChild(remove_cols);
newRow.appendChild(alter_cols); newRow.appendChild(alter_cols);
newRow.appendChild(delete_index); newRow.appendChild(delete_index);
newRow.appendChild(add_index); newRow.appendChild(add_index);
newRow.appendChild(update_rows); newRow.appendChild(update_rows);
newRow.appendChild(insert_rows); newRow.appendChild(insert_rows);
} }
table_body.appendChild(newRow); table_body.appendChild(newRow);
} else if ((relative_path[1] != 'original/img/new_struct_hovered.jpg') && (relative_path[1] != 'original/img/new_data_hovered.jpg')) { } else if ((relative_path[1] != 'original/img/new_struct_hovered.jpg') && (relative_path[1] != 'original/img/new_data_hovered.jpg')) {
//The case when the row showing the details need to be removed from the table i.e. the difference button is deselected now. //The case when the row showing the details need to be removed from the table i.e. the difference button is deselected now.
var table_rows = table_body.getElementsByTagName("tr"); var table_rows = table_body.getElementsByTagName("tr");
var j; var j;
var index = 0; var index = 0;
for (j=0; j < table_rows.length; j++) for (j=0; j < table_rows.length; j++)
{ {
if (table_rows[j].id == i) { if (table_rows[j].id == i) {
index = j; index = j;
table_rows[j].parentNode.removeChild(table_rows[j]); table_rows[j].parentNode.removeChild(table_rows[j]);
} }
} }
//The table row css is being adjusted. Class "odd" for odd rows and "even" for even rows should be maintained. //The table row css is being adjusted. Class "odd" for odd rows and "even" for even rows should be maintained.
@@ -481,11 +481,11 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
table_rows[index].setAttribute("class","odd"); // for Mozilla firefox table_rows[index].setAttribute("class","odd"); // for Mozilla firefox
table_rows[index].className = "odd"; // for IE browser table_rows[index].className = "odd"; // for IE browser
} else { } else {
table_rows[index].setAttribute("class","even"); // for Mozilla firefox table_rows[index].setAttribute("class","even"); // for Mozilla firefox
table_rows[index].className = "even"; // for IE browser table_rows[index].className = "even"; // for IE browser
} }
} }
} }
} }
/** /**
@@ -494,35 +494,35 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
* @param img_obj the image object whose source needs to be changed * @param img_obj the image object whose source needs to be changed
* *
*/ */
function change_Image(img_obj) function change_Image(img_obj)
{ {
var relative_path = (img_obj.src).split("themes/"); var relative_path = (img_obj.src).split("themes/");
if (relative_path[1] == 'original/img/new_data.jpg') { if (relative_path[1] == 'original/img/new_data.jpg') {
img_obj.src = "./themes/original/img/new_data_hovered.jpg"; img_obj.src = "./themes/original/img/new_data_hovered.jpg";
} else if (relative_path[1] == 'original/img/new_struct.jpg') { } else if (relative_path[1] == 'original/img/new_struct.jpg') {
img_obj.src = "./themes/original/img/new_struct_hovered.jpg"; img_obj.src = "./themes/original/img/new_struct_hovered.jpg";
} else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') { } else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') {
img_obj.src = "./themes/original/img/new_struct.jpg"; img_obj.src = "./themes/original/img/new_struct.jpg";
} else if (relative_path[1] == 'original/img/new_data_hovered.jpg') { } else if (relative_path[1] == 'original/img/new_data_hovered.jpg') {
img_obj.src = "./themes/original/img/new_data.jpg"; img_obj.src = "./themes/original/img/new_data.jpg";
} else if (relative_path[1] == 'original/img/new_data_selected.jpg') { } else if (relative_path[1] == 'original/img/new_data_selected.jpg') {
img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg"; img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg";
} else if(relative_path[1] == 'original/img/new_struct_selected.jpg') { } else if(relative_path[1] == 'original/img/new_struct_selected.jpg') {
img_obj.src = "./themes/original/img/new_struct_selected_hovered.jpg"; img_obj.src = "./themes/original/img/new_struct_selected_hovered.jpg";
} else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') { } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') {
img_obj.src = "./themes/original/img/new_struct_selected.jpg"; img_obj.src = "./themes/original/img/new_struct_selected.jpg";
} else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') { } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') {
img_obj.src = "./themes/original/img/new_data_selected.jpg"; img_obj.src = "./themes/original/img/new_data_selected.jpg";
} }
} }
/** /**
* Generates the URL containing the list of selected table ids for synchronization and * Generates the URL containing the list of selected table ids for synchronization and
* a variable checked for confirmation of deleting previous rows from target tables * a variable checked for confirmation of deleting previous rows from target tables
* *
* @param token the token generated for each PMA form * @param token the token generated for each PMA form
* *
*/ */
@@ -536,15 +536,15 @@ function ApplySelectedChanges(token)
var x = table_rows.length; var x = table_rows.length;
var i; var i;
/** /**
Append the token at the beginning of the query string followed by Append the token at the beginning of the query string followed by
Table_ids that shows that "Apply Selected Changes" button is pressed Table_ids that shows that "Apply Selected Changes" button is pressed
*/ */
var append_string = "?token="+token+"&Table_ids="+1; var append_string = "?token="+token+"&Table_ids="+1;
for(i=0; i<x; i++){ for(i=0; i<x; i++){
append_string += "&"; append_string += "&";
append_string += i+"="+table_rows[i].id; append_string += i+"="+table_rows[i].id;
} }
// Getting the value of checkbox delete_rows // Getting the value of checkbox delete_rows
var checkbox = document.getElementById("delete_rows"); var checkbox = document.getElementById("delete_rows");
if (checkbox.checked){ if (checkbox.checked){
@@ -552,13 +552,13 @@ function ApplySelectedChanges(token)
} else { } else {
append_string += "&checked=false"; append_string += "&checked=false";
} }
//Appending the token and list of table ids in the URL //Appending the token and list of table ids in the URL
location.href += token; location.href += token;
location.href += append_string; location.href += append_string;
} }
/** /**
* Displays error message if any text field * Displays error message if any text field
* is left empty other than port field. * is left empty other than port field.
* *
* @param string the form name * @param string the form name
@@ -567,7 +567,7 @@ function ApplySelectedChanges(token)
* @return boolean whether the form field is empty or not * @return boolean whether the form field is empty or not
*/ */
function validateConnection(form_name, form_obj) function validateConnection(form_name, form_obj)
{ {
var check = true; var check = true;
var src_hostfilled = true; var src_hostfilled = true;
var trg_hostfilled = true; var trg_hostfilled = true;
@@ -602,7 +602,7 @@ function validateConnection(form_name, form_obj)
} }
return check; return check;
} }
/** /**
* Check if a form's element is empty * Check if a form's element is empty
* should be * should be
@@ -867,9 +867,9 @@ function PMA_markRowsInit() {
checkbox.checked = marked_row[unique_id]; checkbox.checked = marked_row[unique_id];
if (typeof(event) == 'object') { if (typeof(event) == 'object') {
table = this.parentNode; table = this.parentNode;
i = 0; parentTableLimit = 0;
while (table.tagName.toLowerCase() != 'table' && i < 20) { while (table.tagName.toLowerCase() != 'table' && parentTableLimit < 20) {
i++; parentTableLimit++;
table = table.parentNode; table = table.parentNode;
} }
@@ -884,7 +884,7 @@ function PMA_markRowsInit() {
} }
while (i != this.rowIndex) { while (i != this.rowIndex) {
table.rows[i].onmousedown(); $(table.rows[i]).mousedown();
if (i < this.rowIndex) { if (i < this.rowIndex) {
i++; i++;
} else { } else {
@@ -1637,8 +1637,8 @@ function pdfPaperSize(format, axis) {
/** /**
* for playing media from the BLOB repository * for playing media from the BLOB repository
* *
* @param var * @param var
* @param var url_params main purpose is to pass the token * @param var url_params main purpose is to pass the token
* @param var bs_ref BLOB repository reference * @param var bs_ref BLOB repository reference
* @param var m_type type of BLOB repository media * @param var m_type type of BLOB repository media
* @param var w_width width of popup window * @param var w_width width of popup window
@@ -1690,12 +1690,12 @@ function requestMIMETypeChange(db, table, reference, current_mime_type)
*/ */
function changeMIMEType(db, table, reference, mime_type) function changeMIMEType(db, table, reference, mime_type)
{ {
// specify url and parameters for jQuery POST // specify url and parameters for jQuery POST
var mime_chg_url = 'bs_change_mime_type.php'; var mime_chg_url = 'bs_change_mime_type.php';
var params = { bs_db: db, bs_table: table, bs_reference: reference, bs_new_mime_type: mime_type }; var params = { bs_db: db, bs_table: table, bs_reference: reference, bs_new_mime_type: mime_type };
// jQuery POST // jQuery POST
jQuery.post(mime_chg_url, params); jQuery.post(mime_chg_url, params);
} }
/** /**
@@ -1703,13 +1703,13 @@ function changeMIMEType(db, table, reference, mime_type)
*/ */
$(document).ready(function(){ $(document).ready(function(){
var $oldText,$db,$table,$token,$sql_query; var $oldText,$db,$table,$token,$sql_query;
$oldText=$(".syntax").html(); $oldText=$(".inner_sql").html();
$("#inline_edit").click(function(){ $("#inline_edit").click(function(){
$db=$("input[name='db']").val(); $db=$("input[name='db']").val();
$table=$("input[name='table']").val(); $table=$("input[name='table']").val();
$token=$("input[name='token']").val(); $token=$("input[name='token']").val();
$sql_query=$("input[name='sql_query']").val(); $sql_query=$("input[name='sql_query']").val();
$(".syntax").replaceWith("<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">"+ $sql_query +"</textarea><input type=\"button\" id=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\"><input type=\"button\" id=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">"); $(".inner_sql").replaceWith("<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">"+ $sql_query +"</textarea><input type=\"button\" id=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\"><input type=\"button\" id=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">");
return false; return false;
}); });
@@ -1718,12 +1718,20 @@ $(document).ready(function(){
}); });
$("#btnDiscard").live("click",function(){ $("#btnDiscard").live("click",function(){
$(".sql").html("<span class=\"syntax\">"+$oldText+"</span>"); $(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">"+$oldText+"</span></span>");
}); });
$('.sqlbutton').click(function(evt){ $('.sqlbutton').click(function(evt){
insertQuery(evt.target.id); insertQuery(evt.target.id);
return false; return false;
}); });
$('#sqlquery').focus();
if ($('#input_username')) {
if ($('#input_username').val() == '') {
$('#input_username').focus();
} else {
$('#input_password').focus();
}
}
}); });

View File

@@ -62,6 +62,10 @@ $js_messages['strSelectForeignKey'] = __('Select Foreign Key');
$js_messages['strPleaseSelectPrimaryOrUniqueKey'] = __('Please select the primary key or a unique key'); $js_messages['strPleaseSelectPrimaryOrUniqueKey'] = __('Please select the primary key or a unique key');
$js_messages['strChangeDisplay'] = __('Choose column to display'); $js_messages['strChangeDisplay'] = __('Choose column to display');
/* password generation */
$js_messages['strGeneratePassword'] = __('Generate password');
$js_messages['strGenerate'] = __('Generate');
echo "var PMA_messages = new Array();\n"; echo "var PMA_messages = new Array();\n";
foreach ($js_messages as $name => $js_message) { foreach ($js_messages as $name => $js_message) {
PMA_printJsValue("PMA_messages['" . $name . "']", $js_message); PMA_printJsValue("PMA_messages['" . $name . "']", $js_message);

10
js/password_generation.js Normal file
View File

@@ -0,0 +1,10 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* for libraries/display_change_password.lib.php
*
*/
$(document).ready(function() {
$('#tr_element_before_generate_password').parent().append('<tr><td>' + PMA_messages['strGeneratePassword'] + '</td><td><input type="button" id="button_generate_password" value="' + PMA_messages['strGenerate'] + '" onclick="suggestPassword(this.form)" /><input type="text" name="generated_pw" id="generated_pw" /></td></tr>');
$('#div_element_before_generate_password').parent().append('<div class="item"><label for="button_generate_password">' + PMA_messages['strGeneratePassword'] + ':</label><span class="options"><input type="button" id="button_generate_password" value="' + PMA_messages['strGenerate'] + '" onclick="suggestPassword(this.form)" /></span><input type="text" name="generated_pw" id="generated_pw" /></div>');
});

View File

@@ -3,14 +3,13 @@
/** /**
* *
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
/** /**
* Load vendor configuration. * Load vendor configuration.
*/ */
require_once('./libraries/vendor_config.php'); require('./libraries/vendor_config.php');
/** /**
* Configuration class * Configuration class
@@ -994,7 +993,6 @@ class PMA_Config
* @uses $GLOBALS['PMA_Config'] * @uses $GLOBALS['PMA_Config']
* @uses PMA_Config::get() * @uses PMA_Config::get()
* @uses PMA_Config::_getFontsizeOptions() * @uses PMA_Config::_getFontsizeOptions()
* @uses __('Font size')
* @static * @static
* @param string $current_size currently slected font size with unit * @param string $current_size currently slected font size with unit
* @return string html selectbox * @return string html selectbox
@@ -1031,7 +1029,6 @@ class PMA_Config
* *
* @uses PMA_generate_common_hidden_inputs() * @uses PMA_generate_common_hidden_inputs()
* @uses PMA_Config::_getFontsizeSelection() * @uses PMA_Config::_getFontsizeSelection()
* @uses __('Go')
* @static * @static
* @param string $current_size currently slected font size with unit * @param string $current_size currently slected font size with unit
* @return string html selectbox * @return string html selectbox
@@ -1086,10 +1083,13 @@ class PMA_Config
if ($validity == null) { if ($validity == null) {
$validity = 2592000; $validity = 2592000;
} }
if (strlen($value) && null !== $default && $value === $default if (strlen($value) && null !== $default && $value === $default) {
&& isset($_COOKIE[$cookie])) { // default value is used
// remove cookie, default value is used if (isset($_COOKIE[$cookie])) {
return $this->removeCookie($cookie); // remove cookie
return $this->removeCookie($cookie);
}
return false;
} }
if (! strlen($value) && isset($_COOKIE[$cookie])) { if (! strlen($value) && isset($_COOKIE[$cookie])) {

View File

@@ -3,7 +3,6 @@
/** /**
* Holds class PMA_Error * Holds class PMA_Error
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -3,7 +3,6 @@
/** /**
* Holds class PMA_Error_Handler * Holds class PMA_Error_Handler
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -3,7 +3,6 @@
/** /**
* file upload functions * file upload functions
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -259,13 +258,6 @@ class PMA_File
* @uses PMA_File::setRecentBLOBReference() * @uses PMA_File::setRecentBLOBReference()
* @uses curl_setopt_array() * @uses curl_setopt_array()
* @uses PMA_File::$_error_message * @uses PMA_File::$_error_message
* @uses __('The uploaded file exceeds the upload_max_filesize directive in php.ini.')
* @uses __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.')
* @uses __('The uploaded file was only partially uploaded.')
* @uses __('Missing a temporary folder.')
* @uses __('Failed to write file to disk.')
* @uses __('File upload stopped by extension.')
* @uses __('Unknown error in file upload.')
* @uses $_FILES * @uses $_FILES
* @param string $key a numeric key used to identify the different rows * @param string $key a numeric key used to identify the different rows
* @param string $primary_key * @param string $primary_key
@@ -287,118 +279,27 @@ class PMA_File
$is_bs_upload = FALSE; $is_bs_upload = FALSE;
// check if this field requires a repository upload // check if this field requires a repository upload
if (isset($_REQUEST['upload_blob_repo_' . $key])) if (isset($_REQUEST['upload_blob_repo_' . $key])) {
$is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE; $is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE;
}
// if request is an upload to the BLOB repository // if request is an upload to the BLOB repository
if ($is_bs_upload) if ($is_bs_upload) {
{ $bs_db = $_REQUEST['db'];
// load PMA configuration $bs_table = $_REQUEST['table'];
$PMA_Config = $GLOBALS['PMA_Config']; $tmp_filename = $file['tmp_name'];
$tmp_file_type = $file['type'];
// if PMA configuration is loaded if (! $tmp_file_type) {
if (!empty($PMA_Config)) $tmp_file_type = NULL;
{ }
// load BS variables from PMA configuration
$pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
$curlExists = $PMA_Config->get('CURL_EXISTS');
$bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
$bs_database = $bs_database[$_REQUEST['db']];
$allBSTablesExist = TRUE; if (! $bs_db || ! $bs_table) {
$this->_error_message = $GLOBALS['strUploadErrorUnknown'];
// determine if plugins and curl exist return FALSE;
if ($pluginsExist && $curlExists) }
{ $blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
foreach ($bs_database as $table_key=>$table) PMA_File::setRecentBLOBReference($blob_url);
{ } // end if ($is_bs_upload)
if (!$bs_database[$table_key]['Exists'])
{
$allBSTablesExist = FALSE;
break;
}
}
}
else
$allBSTablesExist = FALSE;
// if necessary BS tables exist
if ($allBSTablesExist)
{
// setup bs variables for uploading
$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
$bs_db = $_REQUEST['db'];
$bs_table = $_REQUEST['table'];
// setup file handle and related variables
$tmp_file = fopen($file['tmp_name'], 'r');
$tmp_file_type = $file['type'];
$tmp_file_size = $file['size'];
if (!$tmp_file_type)
$tmp_file_type = NULL;
// if none of the required variables contain data, return with an unknown error message
if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size)
{
$this->_error_message = __('Unknown error in file upload.');
return FALSE;
}
else
$bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table;
// init curl handle
$curlHnd = curl_init ($bs_server_path);
// if curl handle init successful
if ($curlHnd)
{
// specify custom header
$customHeader = array(
"Accept-Language: en-us;en;q=0;5",
"Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7",
"Content-type: $tmp_file_type"
);
// specify CURL options in array
$curlOptArr = array(
CURLOPT_PUT => TRUE,
CURLOPT_HEADER => TRUE,
CURLOPT_HTTPHEADER => $customHeader,
CURLOPT_INFILESIZE => $tmp_file_size,
CURLOPT_INFILE => $tmp_file,
CURLOPT_RETURNTRANSFER => TRUE
);
// pass array of options to curl handle setup function
curl_setopt_array($curlHnd, $curlOptArr);
// execute curl request and retrieve error message(s) (if any)
$ret = curl_exec($curlHnd);
$errRet = curl_error($curlHnd);
// close curl handle
curl_close($curlHnd);
// split entire string into array of lines
$retArr = explode("\r\n", $ret);
// check each line as a valid string of a BLOB reference
foreach ($retArr as $value)
if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4))
{
// is a valid reference, so set as current and break
PMA_File::setRecentBLOBReference($value);
break;
}
// close file handle
if ($tmp_file)
fclose($tmp_file);
} // end if ($curlHnd)
} // end if ($allBSTablesExist)
} // end if ($PMA_Config)
} // end if ($is_bs_upload)
// check for file upload errors // check for file upload errors
switch ($file['error']) { switch ($file['error']) {
@@ -495,135 +396,43 @@ class PMA_File
$is_bs_upload = FALSE; $is_bs_upload = FALSE;
// check if this field requires a repository upload // check if this field requires a repository upload
if (isset($_REQUEST['upload_blob_repo_' . $key])) if (isset($_REQUEST['upload_blob_repo_' . $key])) {
$is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE; $is_bs_upload = ($_REQUEST['upload_blob_repo_' . $key]['multi_edit'][0] == "on") ? TRUE : FALSE;
}
// is a request to upload file to BLOB repository using uploadDir mechanism // is a request to upload file to BLOB repository using uploadDir mechanism
if ($is_bs_upload) if ($is_bs_upload) {
{ $bs_db = $_REQUEST['db'];
// load PMA configuration $bs_table = $_REQUEST['table'];
$PMA_Config = $GLOBALS['PMA_Config']; $tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary];
// if the PMA configuration was loaded // check if fileinfo library exists
if (!empty($PMA_Config)) if ($PMA_Config->get('FILEINFO_EXISTS')) {
{ // attempt to init fileinfo
// load BS variables from PMA configuration $finfo = finfo_open(FILEINFO_MIME);
$pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
$curlExists = $PMA_Config->get('CURL_EXISTS');
$bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
$bs_database = $bs_database[$_REQUEST['db']];
$allBSTablesExist = TRUE; // fileinfo exists
if ($finfo) {
// if plugins and curl exist // pass in filename to fileinfo and close fileinfo handle after
if ($pluginsExist && $curlExists) $tmp_file_type = finfo_file($finfo, $tmp_filename);
{ finfo_close($finfo);
foreach ($bs_database as $table_key=>$table)
{
if (!$bs_database[$table_key]['Exists'])
{
$allBSTablesExist = FALSE;
break;
}
}
} }
else } else {
$allBSTablesExist = FALSE; // no fileinfo library exists, use file command
$tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
}
// if necessary BS tables exist if (! $tmp_file_type) {
if ($allBSTablesExist) $tmp_file_type = NULL;
{ }
// load BS variables
$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
$bs_db = $_REQUEST['db'];
$bs_table = $_REQUEST['table'];
// setup uploadDir mechanism and file variables if (! $bs_db || !$bs_table) {
$tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]; $this->_error_message = $GLOBALS['strUploadErrorUnknown'];
$tmp_file = fopen($tmp_filename, 'r'); return FALSE;
$tmp_file_size = filesize($tmp_filename); }
$blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
// check if fileinfo library exists PMA_File::setRecentBLOBReference($blob_url);
if ($PMA_Config->get('FILEINFO_EXISTS')) } // end if ($is_bs_upload)
{
// attempt to init fileinfo
$finfo = finfo_open(FILEINFO_MIME);
// fileinfo exists
if ($finfo)
{
// pass in filename to fileinfo and close fileinfo handle after
$tmp_file_type = finfo_file($finfo, $tmp_filename);
finfo_close($finfo);
}
}
else // no fileinfo library exists, use file command
$tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
if (!$tmp_file_type)
$tmp_file_type = NULL;
// necessary variables aren't loaded, return error message (unknown error)
if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size)
{
$this->_error_message = __('Unknown error in file upload.');
return FALSE;
}
else
$bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table;
// init curl handle
$curlHnd = curl_init ($bs_server_path);
// curl handle exists
if ($curlHnd)
{
// specify custom header
$customHeader = array(
"Accept-Language: en-us;en;q=0;5",
"Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7",
"Content-type: $tmp_file_type"
);
// specify custom curl options
$curlOptArr = array(
CURLOPT_PUT => TRUE,
CURLOPT_HEADER => TRUE,
CURLOPT_HTTPHEADER => $customHeader,
CURLOPT_INFILESIZE => $tmp_file_size,
CURLOPT_INFILE => $tmp_file,
CURLOPT_RETURNTRANSFER => TRUE
);
// setup custom curl options (as specified in above array)
curl_setopt_array($curlHnd, $curlOptArr);
// execute curl request and retrieve error message(s) (if any)
$ret = curl_exec($curlHnd);
$errRet = curl_error($curlHnd);
// close curl handle
curl_close($curlHnd);
// split return string into lines
$retArr = explode("\r\n", $ret);
// check subsequent lines for valid BLOB reference string
foreach ($retArr as $value)
if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4))
{
// is a valid reference, so set as current and break
PMA_File::setRecentBLOBReference($value);
break;
}
// close file handle
if ($tmp_file)
fclose($tmp_file);
} // end if ($curlHnd)
} // end if ($allBSTablesExist)
} // end if ($PMA_Config)
} // end if ($is_bs_upload)
return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]); return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary]);
} else { } else {
@@ -641,127 +450,36 @@ class PMA_File
// is a request to upload file to BLOB repository using uploadDir mechanism // is a request to upload file to BLOB repository using uploadDir mechanism
if ($is_bs_upload) if ($is_bs_upload)
{ {
// load PMA configuration // check if fileinfo library exists
$PMA_Config = $GLOBALS['PMA_Config']; if ($PMA_Config->get('FILEINFO_EXISTS'))
{
// attempt to init fileinfo
$finfo = finfo_open(FILEINFO_MIME);
// if the PMA configuration was loaded // if fileinfo exists
if (!empty($PMA_Config)) if ($finfo)
{ {
// load BS variables from PMA configuration // pass in filename to fileinfo and close fileinfo handle after
$pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'); $tmp_file_type = finfo_file($finfo, $tmp_filename);
$curlExists = $PMA_Config->get('CURL_EXISTS'); finfo_close($finfo);
$bs_database = $PMA_Config->get('BLOBSTREAMABLE_DATABASES'); }
$bs_database = $bs_database[$_REQUEST['db']]; }
else // no fileinfo library exists, use file command
$tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
$allBSTablesExist = TRUE; if (!$tmp_file_type)
$tmp_file_type = NULL;
// if plugins and curl exist $bs_db = $_REQUEST['db'];
if ($pluginsExist && $curlExists) $bs_table = $_REQUEST['table'];
{ if (!$bs_db || !$bs_table)
foreach ($bs_database as $table_key=>$table) {
{ $this->_error_message = $GLOBALS['strUploadErrorUnknown'];
if (!$bs_database[$table_key]['Exists']) return FALSE;
{ }
$allBSTablesExist = FALSE; $blob_url = PMA_BS_UpLoadFile($bs_db, $bs_table, $tmp_file_type, $tmp_filename);
break; PMA_File::setRecentBLOBReference($blob_url);
}
}
}
else
$allBSTablesExist = FALSE;
if ($allBSTablesExist)
{
// load BS variables
$bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
$bs_db = $_REQUEST['db'];
$bs_table = $_REQUEST['table'];
// setup uploadDir mechanism and file variables
$tmp_filename = $GLOBALS['cfg']['UploadDir'] . '/' . $_REQUEST['fields_uploadlocal_' . $key]['multi_edit'][$primary];
$tmp_file = fopen($tmp_filename, 'r');
$tmp_file_size = filesize($tmp_filename);
// check if fileinfo library exists
if ($PMA_Config->get('FILEINFO_EXISTS'))
{
// attempt to init fileinfo
$finfo = finfo_open(FILEINFO_MIME);
// if fileinfo exists
if ($finfo)
{
// pass in filename to fileinfo and close fileinfo handle after
$tmp_file_type = finfo_file($finfo, $tmp_filename);
finfo_close($finfo);
}
}
else // no fileinfo library exists, use file command
$tmp_file_type = exec("file -bi " . escapeshellarg($tmp_filename));
if (!$tmp_file_type)
$tmp_file_type = NULL;
// necessary variables aren't loaded, return error message (unknown error)
if (!$bs_server || !$bs_db || !$bs_table || !$tmp_file || !$tmp_file_size)
{
$this->_error_message = __('Unknown error in file upload.');
return FALSE;
}
else
$bs_server_path = 'http://' . $bs_server . '/' . $bs_db . '/' . $bs_table;
// init curl handle
$curlHnd = curl_init ($bs_server_path);
// if curl handle exists
if ($curlHnd)
{
// specify custom header
$customHeader = array(
"Accept-Language: en-us;en;q=0;5",
"Accept-Charset: ISO-8859-1;utf-8;q=0.7,*;q=0.7",
"Content-type: $tmp_file_type"
);
// specify custom curl options
$curlOptArr = array(
CURLOPT_PUT => TRUE,
CURLOPT_HEADER => TRUE,
CURLOPT_HTTPHEADER => $customHeader,
CURLOPT_INFILESIZE => $tmp_file_size,
CURLOPT_INFILE => $tmp_file,
CURLOPT_RETURNTRANSFER => TRUE
);
// setup custom curl options (as specified in above array)
curl_setopt_array($curlHnd, $curlOptArr);
// execute curl request and retrieve error message(s) (if any)
$ret = curl_exec($curlHnd);
$errRet = curl_error($curlHnd);
// close curl handle
curl_close($curlHnd);
// split return string into lines
$retArr = explode("\r\n", $ret);
// check subsequent lines for valid BLOB reference string
foreach ($retArr as $value)
if (strlen($value) > strlen("~*$bs_db/~") && "~*$bs_db/~" == substr($value, 0, strlen($bs_db) + 4))
{
// is a valid reference, so set as current and break
PMA_File::setRecentBLOBReference($value);
break;
}
// close file handle
if ($tmp_file)
fclose($tmp_file);
} // end if ($curlHnd)
} // end if ($allBSTablesExist)
} // end if ($PMA_Config)
} // end if ($is_bs_upload) } // end if ($is_bs_upload)
return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]); return $this->setLocalSelectedFile($_REQUEST['fields_uploadlocal_' . $key]);
@@ -832,7 +550,6 @@ class PMA_File
/** /**
* *
* @access public * @access public
* @uses __('File could not be read')
* @uses PMA_File::setName() * @uses PMA_File::setName()
* @uses PMA_securePath() * @uses PMA_securePath()
* @uses PMA_userDir() * @uses PMA_userDir()
@@ -881,7 +598,6 @@ class PMA_File
* @todo move check of $cfg['TempDir'] into PMA_Config? * @todo move check of $cfg['TempDir'] into PMA_Config?
* @access public * @access public
* @uses $cfg['TempDir'] * @uses $cfg['TempDir']
* @uses __('Error moving the uploaded file, see [a@./Documentation.html#faq1_11@Documentation]FAQ 1.11[/a]')
* @uses PMA_File::isReadable() * @uses PMA_File::isReadable()
* @uses PMA_File::getName() * @uses PMA_File::getName()
* @uses PMA_File::setName() * @uses PMA_File::setName()
@@ -937,7 +653,6 @@ class PMA_File
* *
* @todo move file read part into readChunk() or getChunk() * @todo move file read part into readChunk() or getChunk()
* @todo add support for compression plugins * @todo add support for compression plugins
* @uses __('File could not be read')
* @uses PMA_File::$_compression to set it * @uses PMA_File::$_compression to set it
* @uses PMA_File::getName() * @uses PMA_File::getName()
* @uses fopen() * @uses fopen()

View File

@@ -3,7 +3,6 @@
/** /**
* holds the database index class * holds the database index class
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -539,7 +538,6 @@ class PMA_Index
/** /**
* Function to check over array of indexes and look for common problems * Function to check over array of indexes and look for common problems
* *
* @uses __('The indexes %1 and %2 seem to be equal and one of them could possibly be removed.')
* @uses is_string() * @uses is_string()
* @uses is_array() * @uses is_array()
* @uses count() * @uses count()

View File

@@ -3,7 +3,6 @@
/** /**
* hold the PMA_List base class * hold the PMA_List base class
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -3,7 +3,6 @@
/** /**
* holds the PMA_List_Database class * holds the PMA_List_Database class
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -3,7 +3,6 @@
/** /**
* Holds class PMA_Message * Holds class PMA_Message
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -3,7 +3,6 @@
/** /**
* Library for extracting information about the partitions * Library for extracting information about the partitions
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -3,7 +3,6 @@
/** /**
* Library for extracting information about the available storage engines * Library for extracting information about the available storage engines
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -92,12 +91,7 @@ class PMA_StorageEngine
&& ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED')) { && ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED')) {
continue; continue;
} }
// currently (MySQL 5.1.26) there is no way we can be informed
// that PBMS does not support normal table creation so
// we use an exception here
if ('PBMS' == $details['Engine']) {
continue;
}
$output .= ' <option value="' . htmlspecialchars($key). '"' $output .= ' <option value="' . htmlspecialchars($key). '"'
. (empty($details['Comment']) . (empty($details['Comment'])
? '' : ' title="' . htmlspecialchars($details['Comment']) . '"') ? '' : ' title="' . htmlspecialchars($details['Comment']) . '"')
@@ -145,6 +139,9 @@ class PMA_StorageEngine
*/ */
static public function isValid($engine) static public function isValid($engine)
{ {
if ($engine == "PBMS") {
return TRUE;
}
$storage_engines = PMA_StorageEngine::getStorageEngines(); $storage_engines = PMA_StorageEngine::getStorageEngines();
return isset($storage_engines[$engine]); return isset($storage_engines[$engine]);
} }
@@ -155,7 +152,6 @@ class PMA_StorageEngine
* @uses PMA_ENGINE_DETAILS_TYPE_SIZE * @uses PMA_ENGINE_DETAILS_TYPE_SIZE
* @uses PMA_ENGINE_DETAILS_TYPE_NUMERIC * @uses PMA_ENGINE_DETAILS_TYPE_NUMERIC
* @uses PMA_StorageEngine::getVariablesStatus() * @uses PMA_StorageEngine::getVariablesStatus()
* @uses __('There is no detailed status information available for this storage engine.')
* @uses PMA_showHint() * @uses PMA_showHint()
* @uses PMA_formatByteDown() * @uses PMA_formatByteDown()
* @uses PMA_formatNumber() * @uses PMA_formatNumber()
@@ -267,6 +263,8 @@ class PMA_StorageEngine
return $mysql_vars; return $mysql_vars;
} }
function engine_init() {}
/** /**
* Constructor * Constructor
* *
@@ -305,7 +303,9 @@ class PMA_StorageEngine
default: default:
$this->support = PMA_ENGINE_SUPPORT_NO; $this->support = PMA_ENGINE_SUPPORT_NO;
} }
} } else {
$this->engine_init();
}
} }
/** /**
@@ -335,11 +335,6 @@ class PMA_StorageEngine
/** /**
* public String getSupportInformationMessage() * public String getSupportInformationMessage()
* *
* @uses __('%s is the default storage engine on this MySQL server.')
* @uses __('%s is available on this MySQL server.')
* @uses __('%s has been disabled for this MySQL server.')
* @uses __('This MySQL server does not support the %s storage engine.')
* @uses __('This MySQL server does not support the %s storage engine.')
* @uses PMA_ENGINE_SUPPORT_DEFAULT * @uses PMA_ENGINE_SUPPORT_DEFAULT
* @uses PMA_ENGINE_SUPPORT_YES * @uses PMA_ENGINE_SUPPORT_YES
* @uses PMA_ENGINE_SUPPORT_DISABLED * @uses PMA_ENGINE_SUPPORT_DISABLED

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -782,7 +781,6 @@ class PMA_Table
$GLOBALS['sql_query'] .= "\n\n" . $sql_insert_data . ';'; $GLOBALS['sql_query'] .= "\n\n" . $sql_insert_data . ';';
} }
require_once './libraries/relation.lib.php';
$GLOBALS['cfgRelation'] = PMA_getRelationsParam(); $GLOBALS['cfgRelation'] = PMA_getRelationsParam();
// Drops old table if the user has requested to move it // Drops old table if the user has requested to move it
@@ -1058,7 +1056,6 @@ class PMA_Table
* @todo move into extra function PMA_Relation::renameTable($new_name, $old_name, $new_db, $old_db) * @todo move into extra function PMA_Relation::renameTable($new_name, $old_name, $new_db, $old_db)
*/ */
// Move old entries from comments to new table // Move old entries from comments to new table
require_once './libraries/relation.lib.php';
$GLOBALS['cfgRelation'] = PMA_getRelationsParam(); $GLOBALS['cfgRelation'] = PMA_getRelationsParam();
if ($GLOBALS['cfgRelation']['commwork']) { if ($GLOBALS['cfgRelation']['commwork']) {
$remove_query = ' $remove_query = '

View File

@@ -3,7 +3,6 @@
/** /**
* hold PMA_Theme class * hold PMA_Theme class
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -145,7 +144,6 @@ class PMA_Theme {
* @uses PMA_Theme::setImgPath() * @uses PMA_Theme::setImgPath()
* @uses PMA_Theme::getName() * @uses PMA_Theme::getName()
* @uses $GLOBALS['cfg']['ThemePath'] * @uses $GLOBALS['cfg']['ThemePath']
* @uses __('No valid image path for theme %s found!')
* @uses is_dir() * @uses is_dir()
* @uses sprintf() * @uses sprintf()
*/ */
@@ -357,8 +355,6 @@ class PMA_Theme {
* @uses PMA_Theme::getVersion() * @uses PMA_Theme::getVersion()
* @uses PMA_Theme::getId() * @uses PMA_Theme::getId()
* @uses PMA_Theme::getPath() * @uses PMA_Theme::getPath()
* @uses __('No preview available.')
* @uses __('take it')
* @uses PMA_generate_common_url() * @uses PMA_generate_common_url()
* @uses addslashes() * @uses addslashes()
* @uses file_exists() * @uses file_exists()

View File

@@ -2,15 +2,9 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
/**
*
*/
require_once './libraries/Theme.class.php';
/** /**
* *
* @package phpMyAdmin * @package phpMyAdmin

View File

@@ -2,15 +2,9 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
/**
* Gets relation settings
*/
require_once './libraries/relation.lib.php';
/** /**
* This class tracks changes on databases, tables and views. * This class tracks changes on databases, tables and views.
* For more information please see phpMyAdmin/Documentation.html * For more information please see phpMyAdmin/Documentation.html

View File

@@ -4,7 +4,6 @@
* Set of functions used to run config authentication (ie no authentication). * Set of functions used to run config authentication (ie no authentication).
* *
* @package phpMyAdmin-Auth-Config * @package phpMyAdmin-Auth-Config
* @version $Id$
*/ */
@@ -132,7 +131,7 @@ function PMA_auth_fails()
echo '</tr>' . "\n"; echo '</tr>' . "\n";
} }
echo '</table>' . "\n"; echo '</table>' . "\n";
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
return TRUE; return TRUE;
} // end of the 'PMA_auth_fails()' function } // end of the 'PMA_auth_fails()' function

View File

@@ -2,11 +2,8 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* Set of functions used to run cookie based authentication. * Set of functions used to run cookie based authentication.
* Thanks to Piotr Roszatycki <d3xter at users.sourceforge.net> and
* Dan Wilson who built this patch for the Debian package.
* *
* @package phpMyAdmin-Auth-Cookie * @package phpMyAdmin-Auth-Cookie
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -117,17 +114,6 @@ function PMA_get_blowfish_secret() {
* @uses $GLOBALS['target'] * @uses $GLOBALS['target']
* @uses $GLOBALS['db'] * @uses $GLOBALS['db']
* @uses $GLOBALS['table'] * @uses $GLOBALS['table']
* @uses __('Welcome to %s')
* @uses __('The configuration file now needs a secret passphrase (blowfish_secret).')
* @uses __('Error')
* @uses __('Log in')
* @uses __('Server:')
* @uses __('Username:')
* @uses __('Password:')
* @uses __('Server Choice')
* @uses __('Go')
* @uses __('Cookies must be enabled past this point.')
* @uses __('phpMyAdmin documentation')
* @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['pmaThemeImage']
* @uses $cfg['Servers'] * @uses $cfg['Servers']
* @uses $cfg['LoginCookieRecall'] * @uses $cfg['LoginCookieRecall']
@@ -194,6 +180,7 @@ if (top != self) {
} }
//]]> //]]>
</script> </script>
<script src="./js/functions.js" type="text/javascript"></script>
</head> </head>
<body class="loginform"> <body class="loginform">
@@ -326,22 +313,6 @@ if (top != self) {
} }
?> ?>
</div> </div>
<script type="text/javascript">
// <![CDATA[
function PMA_focusInput()
{
var input_username = document.getElementById('input_username');
var input_password = document.getElementById('input_password');
if (input_username.value == '') {
input_username.focus();
} else {
input_password.focus();
}
}
window.setTimeout('PMA_focusInput()', 500);
// ]]>
</script>
<?php <?php
if (file_exists(CUSTOM_FOOTER_FILE)) { if (file_exists(CUSTOM_FOOTER_FILE)) {
require CUSTOM_FOOTER_FILE; require CUSTOM_FOOTER_FILE;
@@ -646,9 +617,6 @@ function PMA_auth_set_user()
* *
* @uses $GLOBALS['server'] * @uses $GLOBALS['server']
* @uses $GLOBALS['allowDeny_forbidden'] * @uses $GLOBALS['allowDeny_forbidden']
* @uses __('Access denied')
* @uses __('No activity within %s seconds; please log in again')
* @uses __('Cannot log in to the MySQL server')
* @uses $GLOBALS['no_activity'] * @uses $GLOBALS['no_activity']
* @uses $cfg['LoginCookieValidity'] * @uses $cfg['LoginCookieValidity']
* @uses $GLOBALS['PMA_Config']->removeCookie() * @uses $GLOBALS['PMA_Config']->removeCookie()

View File

@@ -5,7 +5,6 @@
* NOTE: Requires PHP loaded as a Apache module. * NOTE: Requires PHP loaded as a Apache module.
* *
* @package phpMyAdmin-Auth-HTTP * @package phpMyAdmin-Auth-HTTP
* @version $Id$
*/ */

View File

@@ -4,7 +4,6 @@
* Set of functions used to run single signon authentication. * Set of functions used to run single signon authentication.
* *
* @package phpMyAdmin-Auth-Signon * @package phpMyAdmin-Auth-Signon
* @version $Id$
*/ */

View File

@@ -390,7 +390,7 @@ function Swekey_GetFastHalfRndToken()
$_SESSION['rnd-token-date'] = time(); $_SESSION['rnd-token-date'] = time();
if (! empty($cachefile)) if (! empty($cachefile))
{ {
// we unlink the file so no possible tempfile race attack (thanks Thijs) // we unlink the file so no possible tempfile race attack
unlink($cachefile); unlink($cachefile);
$file = fopen($cachefile , "x"); $file = fopen($cachefile , "x");
if ($file != FALSE) if ($file != FALSE)

View File

@@ -4,6 +4,41 @@
* @package BLOBStreaming * @package BLOBStreaming
*/ */
function initPBMSDatabase()
{
$query = "create database IF NOT EXISTS pbms;"; // If no other choice then try this.
/*
* The user may not have privileges to create the 'pbms' database
* so if it doesn't exist then we perform a select on a pbms system
* table in an already existing database which will cause the PBMS
* daemon to create the 'pbms' database.
*/
$db_array = PMA_DBI_fetch_result('SHOW DATABASES;');
if (! empty($db_array)) {
$target = "";
foreach ($db_array as $current_db) {
if ($current_db == 'pbms') {
return TRUE;
}
if ($target == "") {
if (($current_db != 'pbxt') && ($current_db != 'mysql') && ($current_db != 'information_schema')) {
$target = $current_db;
}
}
}
if ($target != "") {
$query = "select * from $target.pbms_metadata_header"; // If it exists this table will not contain much
}
}
$result = PMA_DBI_query($query );
if (! $result) {
return FALSE;
}
return TRUE;
}
/** /**
* checks whether the necessary plugins for BLOBStreaming exist * checks whether the necessary plugins for BLOBStreaming exist
* *
@@ -13,7 +48,6 @@
* @uses PMA_Config::set() * @uses PMA_Config::set()
* @uses PMA_BS_SetVariables() * @uses PMA_BS_SetVariables()
* @uses PMA_BS_GetVariables() * @uses PMA_BS_GetVariables()
* @uses PMA_BS_SetFieldReferences()
* @uses PMA_cacheSet() * @uses PMA_cacheSet()
* @uses PMA_cacheGet() * @uses PMA_cacheGet()
* @return boolean * @return boolean
@@ -28,12 +62,6 @@ function checkBLOBStreamingPlugins()
return FALSE; return FALSE;
} }
// At this point we might already know that plugins do not exist
// because this was recorded in the session (cache).
if (PMA_cacheGet('skip_blobstreaming', true)) {
return false;
}
// If we don't know that we can skip blobstreaming, we continue // If we don't know that we can skip blobstreaming, we continue
// verifications; anyway, in case we won't skip blobstreaming, // verifications; anyway, in case we won't skip blobstreaming,
// we still need to set some variables in non-persistent settings, // we still need to set some variables in non-persistent settings,
@@ -63,96 +91,67 @@ function checkBLOBStreamingPlugins()
$serverCfg['socket'] = ""; $serverCfg['socket'] = "";
} }
$allPluginsExist = false; $has_blobstreaming = false;
if (PMA_MYSQL_INT_VERSION >= 50109) { if (PMA_MYSQL_INT_VERSION >= 50109) {
$PMA_Config->set('PBXT_NAME', 'pbxt');
$PMA_Config->set('PBMS_NAME', 'pbms');
$required_plugins[$PMA_Config->get('PBXT_NAME')]['Library'] = 'libpbxt.so';
$required_plugins[$PMA_Config->get('PBMS_NAME')]['Library'] = 'libpbms.so';
$number_of_required_plugins_found = 0;
// Retrieve MySQL plugins // Retrieve MySQL plugins
$existing_plugins = PMA_DBI_fetch_result('SHOW PLUGINS'); $existing_plugins = PMA_DBI_fetch_result('SHOW PLUGINS');
foreach ($existing_plugins as $one_existing_plugin) { foreach ($existing_plugins as $one_existing_plugin) {
// check if required plugins exist // check if required plugins exist
foreach ($required_plugins as $one_required_plugin) { if ( strtolower($one_existing_plugin['Library']) == 'libpbms.so'
if ( strtolower($one_existing_plugin['Library']) == strtolower($one_required_plugin['Library']) && $one_existing_plugin['Status'] == "ACTIVE") {
&& $one_existing_plugin['Status'] == "ACTIVE") { $has_blobstreaming = true;
$number_of_required_plugins_found++;
}
}
if (2 == $number_of_required_plugins_found) {
$allPluginsExist = true;
break; break;
} }
} }
unset($required_plugins, $existing_plugins, $one_required_plugin, $one_existing_plugin, $number_of_required_plugins_found); unset($existing_plugins, $one_existing_plugin);
} }
// set variable indicating BS plugin existence // set variable indicating BS plugin existence
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', $allPluginsExist); $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', $has_blobstreaming);
if ($allPluginsExist) { if ($has_blobstreaming) {
// retrieve BS variables from PMA configuration
$bs_set_variables = array();
$bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_garbage_threshold'] = (isset($serverCfg['bs_garbage_threshold'])) ? $serverCfg['bs_garbage_threshold'] : NULL;
$bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_repository_threshold'] = (isset($serverCfg['bs_repository_threshold'])) ? $serverCfg['bs_repository_threshold'] : NULL;
$bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_temp_blob_timeout'] = (isset($serverCfg['bs_temp_blob_timeout'])) ? $serverCfg['bs_temp_blob_timeout'] : NULL;
$bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_temp_log_threshold'] = (isset($serverCfg['bs_temp_log_threshold'])) ? $serverCfg['bs_temp_log_threshold'] : NULL;
// set BS variables to PMA configuration defaults
PMA_BS_SetVariables($bs_set_variables);
// retrieve updated BS variables (configurable and unconfigurable)
$bs_variables = PMA_BS_GetVariables(); $bs_variables = PMA_BS_GetVariables();
// if no BS variables exist, set plugin existence to false and return // if no BS variables exist, set plugin existence to false and return
if (count($bs_variables) <= 0) { if (count($bs_variables) <= 0) {
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE); $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
PMA_cacheSet('skip_blobstreaming', true, true); PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE; return FALSE;
} // end if (count($bs_variables) <= 0) } // end if (count($bs_variables) <= 0)
// switch on BS field references // get BS server port
if (strtolower($bs_variables[$PMA_Config->get('PBMS_NAME') . '_field_references']) == "off") { $BS_PORT = $bs_variables['pbms_port'];
if (! PMA_BS_SetFieldReferences('ON')) {
PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE;
}
}
// get BS server port // if no BS server port or 'pbms' database exists, set plugin existance to false and return
$BS_PORT = $bs_variables[$PMA_Config->get('PBMS_NAME') . '_port']; if ((! $BS_PORT) || (! initPBMSDatabase())) {
// if no BS server port exists, set plugin existance to false and return
if (! $BS_PORT) {
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE); $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
PMA_cacheSet('skip_blobstreaming', true, true); PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE; return FALSE;
} // end if (!$BS_PORT) } // end if (!$BS_PORT)
// Ping PBMS: the database doesn't need to exist for this to work.
if (pbms_connect($serverCfg['host'], $BS_PORT, "anydb") == FALSE) {
$PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE;
}
pbms_close();
if (function_exists("pbms_pconnect")) {
$PMA_Config->set('PBMS_PCONNECT_EXISTS', TRUE);
} else {
$PMA_Config->set('PBMS_PCONNECT_EXISTS', FALSE);
}
// add selected BS, CURL and fileinfo library variables to PMA configuration // add selected BS, CURL and fileinfo library variables to PMA configuration
$PMA_Config->set('BLOBSTREAMING_PORT', $BS_PORT); $PMA_Config->set('BLOBSTREAMING_PORT', $BS_PORT);
$PMA_Config->set('BLOBSTREAMING_HOST', $serverCfg['host']); $PMA_Config->set('BLOBSTREAMING_HOST', $serverCfg['host']);
$PMA_Config->set('BLOBSTREAMING_SERVER', $serverCfg['host'] . ':' . $BS_PORT); $PMA_Config->set('BLOBSTREAMING_SERVER', $serverCfg['host'] . ':' . $BS_PORT);
$PMA_Config->set('CURL_EXISTS', FALSE); $PMA_Config->set('PHP_PBMS_EXISTS', FALSE);
$PMA_Config->set('FILEINFO_EXISTS', FALSE); $PMA_Config->set('FILEINFO_EXISTS', FALSE);
// check if CURL exists
if (function_exists("curl_init")) {
// initialize curl handler
$curlHnd = curl_init();
// CURL exists, set necessary variable and close resource
if (! empty($curlHnd)) {
$PMA_Config->set('CURL_EXISTS', TRUE);
curl_close($curlHnd);
} // end if (!empty($curlHnd))
} // end if (function_exists("curl_init"))
// check if PECL's fileinfo library exist // check if PECL's fileinfo library exist
$finfo = NULL; $finfo = NULL;
@@ -165,180 +164,15 @@ function checkBLOBStreamingPlugins()
$PMA_Config->set('FILEINFO_EXISTS', TRUE); $PMA_Config->set('FILEINFO_EXISTS', TRUE);
finfo_close($finfo); finfo_close($finfo);
} // end if (!empty($finfo)) } // end if (!empty($finfo))
} else { } else {
PMA_cacheSet('skip_blobstreaming', true, true); PMA_cacheSet('skip_blobstreaming', true, true);
return FALSE; return FALSE;
} // end if ($allPluginsExist) } // end if ($has_blobstreaming)
$bs_tables = array();
// specify table structure for BS reference table
$bs_tables[$PMA_Config->get('PBMS_NAME') . '_reference'] = array();
$bs_tables[$PMA_Config->get('PBMS_NAME') . '_reference']['struct'] = <<<EOD
CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_reference
(
Table_name CHAR(64) COMMENT 'The name of the referencing table',
Blob_id BIGINT COMMENT 'The BLOB reference number - part of the BLOB URL',
Column_name CHAR(64) COMMENT 'The column name of the referencing field',
Row_condition VARCHAR(255) COMMENT 'This condition identifies the row in the table',
Blob_url VARCHAR(200) COMMENT 'The BLOB URL for HTTP GET access',
Repository_id INT COMMENT 'The repository file number of the BLOB',
Repo_blob_offset BIGINT COMMENT 'The offset in the repository file',
Blob_size BIGINT COMMENT 'The size of the BLOB in bytes',
Deletion_time TIMESTAMP COMMENT 'The time the BLOB was deleted',
Remove_in INT COMMENT 'The number of seconds before the reference/BLOB is removed perminently',
Temp_log_id INT COMMENT 'Temporary log number of the referencing deletion entry',
Temp_log_offset BIGINT COMMENT 'Temporary log offset of the referencing deletion entry'
) ENGINE=PBMS;
EOD;
// specify table structure for BS repository table
$bs_tables[$PMA_Config->get('PBMS_NAME') . '_repository'] = array();
$bs_tables[$PMA_Config->get('PBMS_NAME') . '_repository']['struct'] = <<<EOD
CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_repository
(
Repository_id INT COMMENT 'The repository file number',
Repo_blob_offset BIGINT COMMENT 'The offset of the BLOB in the repository file',
Blob_size BIGINT COMMENT 'The size of the BLOB in bytes',
Head_size SMALLINT UNSIGNED COMMENT 'The size of the BLOB header - proceeds the BLOB data',
Access_code INT COMMENT 'The 4-byte authorisation code required to access the BLOB - part of the BLOB URL',
Creation_time TIMESTAMP COMMENT 'The time the BLOB was created',
Last_ref_time TIMESTAMP COMMENT 'The last time the BLOB was referenced',
Last_access_time TIMESTAMP COMMENT 'The last time the BLOB was accessed (read)',
Content_type CHAR(128) COMMENT 'The content type of the BLOB - returned by HTTP GET calls',
Blob_data LONGBLOB COMMENT 'The data of this BLOB'
) ENGINE=PBMS;
EOD;
// specify table structure for BS custom content type table
$bs_tables[$PMA_Config->get('PBMS_NAME') . '_custom_content_type'] = array();
$bs_tables[$PMA_Config->get('PBMS_NAME') . '_custom_content_type']['struct'] = <<<EOD
CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_custom_content_type
(
Blob_url VARCHAR(200) COMMENT 'The BLOB URL for HTTP GET access',
Content_type VARCHAR(255) COMMENT 'The custom MIME type for a given BLOB reference as specified by the user',
PRIMARY KEY(Blob_url)
);
EOD;
// add BS tables to PMA configuration
$PMA_Config->set('BLOBSTREAMING_TABLES', $bs_tables);
return TRUE; return TRUE;
} }
/**
* checks for databases that support BLOBStreaming
*
* @access public
* @uses PMA_GetDatabases()
* @uses PMA_TablesExist()
* @uses PMA_Config::set()
*/
function checkBLOBStreamableDatabases()
{
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
$serverCfg = $GLOBALS['cfg']['Server'];
// retrieve BS tables from PMA configuration
$session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES');
$bs_databases = array();
$bs_tables = array();
// return if BS tables do not exist
if (!$session_bs_tables)
return;
foreach ($session_bs_tables as $table_key=>$table)
{
$bs_tables[$table_key] = array();
$bs_tables[$table_key]['Exists'] = FALSE;
}
// retrieve MySQL databases
$databases = PMA_GetDatabases();
// check if BS tables exist for each database
foreach ($databases as $db_key=>$db_name)
{
$bs_databases[$db_name] = $bs_tables;
PMA_TablesExist($bs_databases[$db_name], $db_name);
}
// set BS databases in PMA configuration
$PMA_Config->set('BLOBSTREAMABLE_DATABASES', $bs_databases);
}
/**
* checks whether a given set of tables exist in a given database
*
* @access public
* @param array - list of tables to look for
* @param string - name of database
* @uses PMA_DBI_select_db()
* @uses PMA_DBI_query()
* @uses PMA_DBI_fetch_assoc()
*/
function PMA_TablesExist(&$tables, $db_name)
{
// select specified database
PMA_DBI_select_db($db_name);
// run query to retrieve tables in specified database
$query = "SHOW TABLES";
$result = PMA_DBI_query($query);
// while there are records to parse
while ($data = @PMA_DBI_fetch_assoc($result))
{
$state = TRUE;
// check if necessary tables exist
foreach ($tables as $table_key=>$table)
if (!$table['Exists'])
if ($data['Tables_in_' . $db_name] == $table_key)
$tables[$table_key]['Exists'] = TRUE;
else
if ($state)
$state = FALSE;
// break if necessary tables are found before all records are parsed
if ($state)
break;
} // end while ($data = @PMA_DBI_fetch_assoc($result))
}
/**
* returns a list of databases
*
* @access public
* @uses PMA_DBI_query()
* @uses PMA_DBI_fetch_assoc()
* @return array - list of databases acquired via MySQL
*/
function PMA_GetDatabases()
{
// run query to retrieve databases
$query = "SHOW DATABASES";
$result = PMA_DBI_query($query);
$databases = array();
// while there are records to parse
while ($data = @PMA_DBI_fetch_assoc($result))
$databases[] = $data['Database'];
// return list of databases
return $databases;
}
/** /**
* sets BLOBStreaming variables to a list of specified arguments * sets BLOBStreaming variables to a list of specified arguments
* @access public * @access public
@@ -388,7 +222,7 @@ function PMA_BS_GetVariables()
return NULL; return NULL;
// run query to retrieve BS variables // run query to retrieve BS variables
$query = "SHOW VARIABLES LIKE '%" . $PMA_Config->get('PBMS_NAME') . "%'"; $query = "SHOW VARIABLES LIKE '%pbms%'";
$result = PMA_DBI_query($query); $result = PMA_DBI_query($query);
$BS_Variables = array(); $BS_Variables = array();
@@ -401,136 +235,263 @@ function PMA_BS_GetVariables()
return $BS_Variables; return $BS_Variables;
} }
/** //========================
* sets the BLOBStreaming global field references to ON/OFF //========================
* function PMA_BS_ReportPBMSError($msg)
* @access public {
* @param string - ON or OFF $tmp_err = pbms_error();
* @uses PMA_Config::get() PMA_showMessage("PBMS error, $msg $tmp_err");
* @uses PMA_sqlAddslashes() }
* @uses PMA_DBI_query()
* @return boolean - success/failure of query execution //------------
*/ function PMA_do_connect($db_name, $quiet)
function PMA_BS_SetFieldReferences($val)
{ {
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config']; $PMA_Config = $GLOBALS['PMA_Config'];
// return if unable to load PMA configuration // return if unable to load PMA configuration
if (empty($PMA_Config)) if (empty($PMA_Config))
return FALSE; return FALSE;
// set field references to value specified // generate bs reference link
$query = "SET GLOBAL " . $PMA_Config->get('PBMS_NAME') . "_field_references=" . PMA_sqlAddslashes($val); $pbms_host = $PMA_Config->get('BLOBSTREAMING_HOST');
$result = PMA_DBI_try_query($query, null, 0); $pbms_port = $PMA_Config->get('BLOBSTREAMING_PORT');
// get last known error (if applicable) if ($PMA_Config->get('PBMS_PCONNECT_EXISTS')) {
PMA_DBI_getError(); // Open a persistent connection.
$ok = pbms_pconnect($pbms_host, $pbms_port, $db_name);
// return success of query execution } else {
if ($result && 0 == $GLOBALS['errno']) $ok = pbms_connect($pbms_host, $pbms_port, $db_name);
return TRUE;
else
return FALSE;
}
/**
* gets the SQL table definition for a given BLOBStreaming table
*
* @access public
* @param string - table name
* @uses PMA_Config::get()
* @return string - SQL table definition
*/
function PMA_BS_GetTableStruct($tbl_name)
{
// retrieve table structures for BS tables
$bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
// return if tables don't exist
if (!$bs_tables)
return;
// return if specified table doesn't exist in collection of BS tables
if (!isset($bs_tables[$tbl_name]))
return;
// return specified table's structure
return $bs_tables[$tbl_name]['struct'];
}
/**
* creates the BLOBStreaming tables for a given database
*
* @access public
* @param string - database name
* @uses PMA_Config::get()
* @uses PMA_DBI_select_db()
* @uses PMA_DBI_query()
* @uses PMA_BS_GetTableStruct()
* @return boolean - success/failure of transactional query execution
*/
function PMA_BS_CreateTables($db_name)
{
// retrieve BS tables
$bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
// select specified database
PMA_DBI_select_db($db_name);
// create necessary BS tables for specified database
foreach ($bs_tables as $table_key=>$table)
{
$result = PMA_DBI_query(PMA_BS_GetTableStruct($table_key));
// return false if query execution fails
if (!$result)
return FALSE;
} }
// return true on success if ($ok == FALSE) {
if ($quiet == FALSE) {
PMA_BS_ReportPBMSError("PBMS Connection failed: pbms_connect($pbms_host, $pbms_port, $db_name)");
}
return FALSE;
}
return TRUE; return TRUE;
} }
/** //------------
* drops BLOBStreaming tables for a given database function PMA_do_disconnect()
*
* @access public
* @param string - database name
* @uses PMA_Config::get()
* @uses PMA_DBI_select_db()
* @uses PMA_backquote()
* @uses PMA_DBI_query()
* @return boolean - success/failure of transactional query execution
*/
function PMA_BS_DropTables($db_name)
{ {
pbms_close();
}
//------------
/**
* checks whether the BLOB reference looks valid
*
*/
function PMA_BS_IsPBMSReference($bs_reference, $db_name)
{
if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE;
}
// You do not really need a connection to the PBMS Daemon
// to check if a reference looks valid.
$ok = pbms_is_blob_reference($bs_reference);
return $ok ;
}
//------------
function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
{
if (PMA_do_connect($db_name, FALSE) == FALSE) {
return 'Error';
}
if (pbms_get_info(trim($bs_reference)) == FALSE) {
PMA_BS_ReportPBMSError("PBMS get BLOB info failed: pbms_get_info($bs_reference)");
PMA_do_disconnect();
return 'Error';
}
$content_type = pbms_get_metadata_value("Content-Type");
if ($content_type == FALSE) {
$br = trim($bs_reference);
PMA_BS_ReportPBMSError("'$content_type' PMA_BS_CreateReferenceLink('$br', '$db_name'): get BLOB Content-Type failed: ");
}
PMA_do_disconnect();
if (! $content_type) {
$content_type = "image/jpeg";
}
$bs_url = PMA_BS_getURL($bs_reference);
if (empty($bs_url)) {
PMA_BS_ReportPBMSError("No blob streaming server configured!");
return 'Error';
}
$output = "<a href=\"#\" onclick=\"requestMIMETypeChange('" . urlencode($db_name) . "', '" . urlencode($GLOBALS['table']) . "', '" . urlencode($bs_reference) . "', '" . urlencode($content_type) . "')\">$content_type</a>";
// specify custom HTML for various content types
switch ($content_type) {
// no content specified
case NULL:
$output = "NULL";
break;
// image content
case 'image/jpeg':
case 'image/png':
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('View image') . '</a>)';
break;
// audio content
case 'audio/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 120)">' . __('Play audio'). '</a>)';
break;
// video content
case 'application/x-flash-video':
case 'video/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 480)">' . __('View video') . '</a>)';
break;
// unsupported content. specify download
default:
$output .= ' (<a href="' . $bs_url . '" target="new">' . __('Download file'). '</a>)';
}
return $output;
}
//------------
// In the future there may be server variables to turn on/off PBMS
// BLOB streaming on a per table or database basis. So in anticipation of this
// PMA_BS_IsTablePBMSEnabled() passes in the table and database name even though
// they are not currently needed.
function PMA_BS_IsTablePBMSEnabled($db_name, $tbl_name, $tbl_type)
{
if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE;
}
if ((isset($tbl_type) == FALSE) || (strlen($tbl_type) == 0)) {
return FALSE;
}
// load PMA configuration // load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config']; $PMA_Config = $GLOBALS['PMA_Config'];
// return if unable to load PMA configuration // return if unable to load PMA configuration
if (empty($PMA_Config)) if (empty($PMA_Config)) {
return FALSE; return FALSE;
}
// retrieve BS tables if (! $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST')) {
$bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES'); return FALSE;
}
// select specified database // This information should be cached rather than selecting it each time.
PMA_DBI_select_db($db_name); //$query = "SELECT count(*) FROM information_schema.TABLES T, pbms.pbms_enabled E where T.table_schema = ". PMA_backquote($db_name) . " and T.table_name = ". PMA_backquote($tbl_name) . " and T.engine = E.name";
$query = "SELECT count(*) FROM pbms.pbms_enabled E where E.name = '" . PMA_sqlAddslashes($tbl_type) . "'";
$result = PMA_DBI_query($query);
// drop BS tables $data = PMA_DBI_fetch_row($result);
foreach ($bs_tables as $table_key=>$table) if ($data[0] == 1) {
{ return TRUE;
$query = "DROP TABLE IF EXISTS " . PMA_backquote($table_key); }
return FALSE;
}
//------------
function PMA_BS_UpLoadFile($db_name, $tbl_name, $file_type, $file_name)
{
if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE;
}
if (PMA_do_connect($db_name, FALSE) == FALSE) {
return FALSE;
}
$fh = fopen($file_name, 'r');
if (! $fh) {
PMA_do_disconnect();
PMA_showMessage("Could not open file: $file_name");
return FALSE;
}
pbms_add_metadata("Content-Type", $file_type);
$pbms_blob_url = pbms_read_stream($fh, filesize($file_name), $tbl_name);
if (! $pbms_blob_url) {
PMA_BS_ReportPBMSError("pbms_read_stream() Failed");
}
fclose($fh);
PMA_do_disconnect();
return $pbms_blob_url;
}
//------------
function PMA_BS_SetContentType($db_name, $bsTable, $blobReference, $contentType)
{
if (PMA_cacheGet('skip_blobstreaming', true)) {
return FALSE;
}
// This is a really ugly way to do this but currently there is nothing better.
// In a future version of PBMS the system tables will be redesigned to make this
// more eficient.
$query = "SELECT Repository_id, Repo_blob_offset FROM pbms_reference WHERE Blob_url='" . PMA_sqlAddslashes($blobReference) . "'";
//error_log(" PMA_BS_SetContentType: $query\n", 3, "/tmp/mylog");
$result = PMA_DBI_query($query);
//error_log(" $query\n", 3, "/tmp/mylog");
// if record exists
if ($data = PMA_DBI_fetch_assoc($result)) {
$where = "WHERE Repository_id=" . $data['Repository_id'] . " AND Repo_blob_offset=" . $data['Repo_blob_offset'] ;
$query = "SELECT name from pbms_metadata $where";
$result = PMA_DBI_query($query); $result = PMA_DBI_query($query);
// return false if query execution fails if (PMA_DBI_num_rows($result) == 0) {
if (!$result) $query = "INSERT into pbms_metadata Values( ". $data['Repository_id'] . ", " . $data['Repo_blob_offset'] . ", 'Content_type', '" . PMA_sqlAddslashes($contentType) . "')";
return FALSE; } else {
$query = "UPDATE pbms_metadata SET name = 'Content_type', Value = '" . PMA_sqlAddslashes($contentType) . "' $where";
}
//error_log("$query\n", 3, "/tmp/mylog");
PMA_DBI_query($query);
} else {
return FALSE;
}
return TRUE;
}
//------------
function PMA_BS_IsHiddenTable($table)
{
switch ($table) {
case 'pbms_repository' :
case 'pbms_reference' :
case 'pbms_metadata' :
case 'pbms_metadata_header' :
case 'pbms_dump' :
return TRUE;
}
return FALSE;
}
//------------
function PMA_BS_getURL($reference)
{
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
if (empty($PMA_Config)) {
return FALSE;
} }
// return true on success // retrieve BS server variables from PMA configuration
return TRUE; $bs_server = $PMA_Config->get('BLOBSTREAMING_SERVER');
if (empty($bs_server)) {
return FALSE;
}
$bs_url = 'http://' . $bs_server . '/' . rtrim($reference);
return $bs_url;
} }
/** /**
@@ -547,13 +508,6 @@ function PMA_BS_DropTables($db_name)
*/ */
function PMA_BS_GetPrimaryField($db_name, $tbl_name) function PMA_BS_GetPrimaryField($db_name, $tbl_name)
{ {
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// return if unable to load PMA configuration
if (empty($PMA_Config))
return FALSE;
// select specified database // select specified database
PMA_DBI_select_db($db_name); PMA_DBI_select_db($db_name);
@@ -562,152 +516,12 @@ function PMA_BS_GetPrimaryField($db_name, $tbl_name)
$result = PMA_DBI_query($query); $result = PMA_DBI_query($query);
// while there are records to parse // while there are records to parse
while ($data = PMA_DBI_fetch_assoc($result)) while ($data = PMA_DBI_fetch_assoc($result)) {
if ("PRI" == $data['Key']) if ("PRI" == $data['Key']) {
return $data['Field']; return $data['Field'];
}
}
// return NULL on no primary key // return NULL on no primary key
return NULL; return NULL;
} }
/**
* checks whether a BLOB reference exists in the BLOB repository
*
* @access public
* @param string - BLOB reference
* @param string - database name
* @uses PMA_DBI_select_db()
* @uses PMA_backquote()
* @uses PMA_Config::get()
* @uses PMA_sqlAddslashes()
* @uses PMA_DBI_query()
* @return boolean - existence of BLOB reference
*/
function PMA_BS_ReferenceExists($bs_reference, $db_name)
{
$referenceExists = FALSE;
// return false on invalid BS reference
if (strlen ($bs_reference) < strlen ("~*$db_name/~") || "~*$db_name/~" != substr ($bs_reference, 0, strlen ($db_name) + 4))
return $referenceExists;
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// return if unable to load PMA configuration
if (empty($PMA_Config))
return $referenceExists;
// select specified database
PMA_DBI_select_db($db_name);
// run query on BS reference retrieval
$query = "SELECT * FROM " . PMA_backquote($PMA_Config->get('PBMS_NAME') . "_reference") . " WHERE Blob_url='" . PMA_sqlAddslashes($bs_reference) . "'";
$result = PMA_DBI_query($query);
// if record exists
if ($data = @PMA_DBI_fetch_assoc($result))
$referenceExists = TRUE;
// return reference existance
return $referenceExists;
}
/**
* creates a HTTP link to a given blob reference for a given database
*
* @access public
* @param string - BLOB reference
* @param string - database name
* @uses PMA_Config::get()
* @uses PMA_DBI_select_db()
* @uses PMA_backquote()
* @uses PMA_sqlAddslashes()
* @uses PMA_DBI_query()
* @uses PMA_DBI_fetch_assoc()
* @return string - HTTP link or Error
*/
function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
{
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// return if unable to load PMA configuration
if (empty($PMA_Config))
return '';
// generate bs reference link
$bs_ref_link = 'http://' . $PMA_Config->get('BLOBSTREAMING_SERVER') . '/' . $bs_reference;
// select specified database
PMA_DBI_select_db($db_name);
$pbms_repo_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_repository");
$pbms_ref_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_reference");
$pbms_cust_content_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_custom_content_type");
// run query on determining specified BS reference
$query = "SELECT $pbms_repo_bq.Content_type, $pbms_cust_content_bq.Content_type AS Custom_type";
$query .= " FROM $pbms_repo_bq LEFT JOIN $pbms_ref_bq ON";
$query .= "$pbms_repo_bq.Repository_id=$pbms_ref_bq.Repository_id";
$query .= " AND $pbms_repo_bq.Blob_size=$pbms_ref_bq.Blob_size";
$query .= " AND $pbms_repo_bq.Repo_blob_offset=$pbms_ref_bq.Repo_blob_offset";
$query .= " LEFT JOIN $pbms_cust_content_bq ON $pbms_cust_content_bq.Blob_url=$pbms_ref_bq.Blob_url";
$query .= " WHERE $pbms_ref_bq.Blob_url='" . PMA_sqlAddslashes($bs_reference) . "'";
$result = PMA_DBI_query($query);
// if record exists
if ($data = @PMA_DBI_fetch_assoc($result))
{
// determine content-type for BS repository file (original or custom)
$is_custom_type = false;
if (isset($data['Custom_type']))
{
$content_type = $data['Custom_type'];
$is_custom_type = true;
}
else
$content_type = $data['Content_type'];
if (!$content_type)
$content_type = NULL;
$output = "<a href=\"#\" onclick=\"requestMIMETypeChange('" . urlencode($db_name) . "', '" . urlencode($GLOBALS['table']) . "', '" . urlencode($bs_reference) . "', '" . urlencode($content_type) . "')\">$content_type</a>";
// specify custom HTML for various content types
switch ($content_type)
{
// no content specified
case NULL:
$output = "NULL";
break;
// image content
case 'image/jpeg':
case 'image/png':
$output .= ' (<a href="' . $bs_ref_link . '" target="new">' . __('View image') . '</a>)';
break;
// audio content
case 'audio/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 120)">' . __('Play audio'). '</a>)';
break;
// video content
case 'application/x-flash-video':
case 'video/mpeg':
$output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 480)">' . __('View video') . '</a>)';
break;
// unsupported content. specify download
default:
$output .= ' (<a href="' . $bs_ref_link . '" target="new">' . __('Download file'). '</a>)';
}
// return HTML
return $output;
} // end if ($data = @PMA_DBI_fetch_assoc($result))
// return on error
return 'Error';
}
?> ?>

View File

@@ -11,7 +11,6 @@
* See the enclosed file COPYING for license information (LGPL). If you * See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
* *
* @version $Id$
* @since Horde 2.2 * @since Horde 2.2
* @package horde.cipher * @package horde.cipher
*/ */

View File

@@ -3,15 +3,9 @@
/** /**
* Set of functions used with the bookmark feature * Set of functions used with the bookmark feature
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
/**
*
*/
require_once './libraries/relation.lib.php';
/** /**
* Defines the bookmark parameters for the current user * Defines the bookmark parameters for the current user
* *

View File

@@ -3,116 +3,50 @@
/** /**
* Charset conversion functions. * Charset conversion functions.
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
} }
/**
* Failure on loading recode/iconv extensions.
*/
function PMA_failRecoding() {
PMA_fatalError(__('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.'));
}
/**
* Loads the recode or iconv extensions if any of it is not loaded yet
*/
if (isset($cfg['AllowAnywhereRecoding'])
&& $cfg['AllowAnywhereRecoding']) {
if ($cfg['RecodingEngine'] == 'recode') {
if (!@extension_loaded('recode')) {
PMA_failRecoding();
}
$PMA_recoding_engine = 'recode';
} elseif ($cfg['RecodingEngine'] == 'iconv') {
if (!@extension_loaded('iconv')) {
PMA_failRecoding();
}
$PMA_recoding_engine = 'iconv';
} else {
if (@extension_loaded('iconv')) {
$PMA_recoding_engine = 'iconv';
} elseif (@extension_loaded('recode')) {
$PMA_recoding_engine = 'recode';
} else {
PMA_failRecoding();
}
}
} // end load recode/iconv extension
define('PMA_CHARSET_NONE', 0); define('PMA_CHARSET_NONE', 0);
define('PMA_CHARSET_ICONV', 1); define('PMA_CHARSET_ICONV', 1);
define('PMA_CHARSET_LIBICONV', 2); define('PMA_CHARSET_RECODE', 2);
define('PMA_CHARSET_RECODE', 3); define('PMA_CHARSET_ICONV_AIX', 3);
define('PMA_CHARSET_ICONV_AIX', 4);
if (!isset($cfg['IconvExtraParams'])) {
$cfg['IconvExtraParams'] = '';
}
// Finally detect which function we will use: // Finally detect which function we will use:
if (isset($cfg['AllowAnywhereRecoding']) if ($cfg['RecodingEngine'] == 'iconv') {
&& $cfg['AllowAnywhereRecoding']) { if (@function_exists('iconv')) {
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
if (!isset($PMA_recoding_engine)) { $PMA_recoding_engine = PMA_CHARSET_ICONV_AIX;
$PMA_recoding_engine = $cfg['RecodingEngine'];
}
if ($PMA_recoding_engine == 'iconv') {
if (@function_exists('iconv')) {
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
$PMA_recoding_engine = PMA_CHARSET_ICONV_AIX;
} else {
$PMA_recoding_engine = PMA_CHARSET_ICONV;
}
} elseif (@function_exists('libiconv')) {
$PMA_recoding_engine = PMA_CHARSET_LIBICONV;
} else { } else {
$PMA_recoding_engine = PMA_CHARSET_NONE; $PMA_recoding_engine = PMA_CHARSET_ICONV;
if (!isset($GLOBALS['is_header_sent'])) {
include './libraries/header.inc.php';
}
echo __('Couldn\'t use the iconv, libiconv, or recode_string functions, although the necessary extensions appear to be loaded. Check your PHP configuration.');
require_once './libraries/footer.inc.php';
exit();
}
} elseif ($PMA_recoding_engine == 'recode') {
if (@function_exists('recode_string')) {
$PMA_recoding_engine = PMA_CHARSET_RECODE;
} else {
$PMA_recoding_engine = PMA_CHARSET_NONE;
require_once './libraries/header.inc.php';
echo __('Couldn\'t use the iconv, libiconv, or recode_string functions, although the necessary extensions appear to be loaded. Check your PHP configuration.');
require_once './libraries/footer.inc.php';
exit;
} }
} else { } else {
if (@function_exists('iconv')) { $PMA_recoding_engine = PMA_CHARSET_NONE;
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) { PMA_warnMissingExtension('iconv');
$PMA_recoding_engine = PMA_CHARSET_ICONV_AIX; }
} else { } elseif ($cfg['RecodingEngine'] == 'recode') {
$PMA_recoding_engine = PMA_CHARSET_ICONV; if (@function_exists('recode_string')) {
} $PMA_recoding_engine = PMA_CHARSET_RECODE;
} elseif (@function_exists('libiconv')) { } else {
$PMA_recoding_engine = PMA_CHARSET_LIBICONV; $PMA_recoding_engine = PMA_CHARSET_NONE;
} elseif (@function_exists('recode_string')) { PMA_warnMissingExtension('recode');
$PMA_recoding_engine = PMA_CHARSET_RECODE; }
} elseif ($cfg['RecodingEngine'] == 'auto') {
if (@function_exists('iconv')) {
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
$PMA_recoding_engine = PMA_CHARSET_ICONV_AIX;
} else { } else {
$PMA_recoding_engine = PMA_CHARSET_NONE; $PMA_recoding_engine = PMA_CHARSET_ICONV;
require_once './libraries/header.inc.php';
echo __('Couldn\'t use the iconv, libiconv, or recode_string functions, although the necessary extensions appear to be loaded. Check your PHP configuration.');
require_once './libraries/footer.inc.php';
exit;
} }
} elseif (@function_exists('recode_string')) {
$PMA_recoding_engine = PMA_CHARSET_RECODE;
} else {
$PMA_recoding_engine = PMA_CHARSET_NONE;
} }
} else { } else {
$PMA_recoding_engine = PMA_CHARSET_NONE; $PMA_recoding_engine = PMA_CHARSET_NONE;
} }
/* Load AIX iconv wrapper if needed */ /* Load AIX iconv wrapper if needed */
@@ -120,43 +54,6 @@ if ($PMA_recoding_engine == PMA_CHARSET_ICONV_AIX) {
require_once './libraries/iconv_wrapper.lib.php'; require_once './libraries/iconv_wrapper.lib.php';
} }
/**
* 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
*
*/
function PMA_convert_charset($what) {
global $cfg, $charset, $convcharset;
if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] )
|| $convcharset == $charset) { // 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 * Converts encoding of text according to parameters with detected
* conversion function. * conversion function.
@@ -181,59 +78,9 @@ function PMA_convert_string($src_charset, $dest_charset, $what) {
return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what); return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what);
case PMA_CHARSET_ICONV_AIX: case PMA_CHARSET_ICONV_AIX:
return PMA_aix_iconv_wrapper($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what); 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: default:
return $what; return $what;
} }
} // end of the "PMA_convert_string()" function } // 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
*
*/
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
?> ?>

View File

@@ -3,7 +3,6 @@
/** /**
* Get user's global privileges and some db-specific privileges * Get user's global privileges and some db-specific privileges
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {

View File

@@ -3,7 +3,6 @@
/** /**
* Functions for cleanup of user input. * Functions for cleanup of user input.
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -28,7 +28,6 @@
* - db connection * - db connection
* - authentication work * - authentication work
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -50,7 +49,7 @@ if (!defined('E_DEPRECATED')) {
/** /**
* the error handler * the error handler
*/ */
require_once './libraries/Error_Handler.class.php'; require './libraries/Error_Handler.class.php';
/** /**
* initialize the error handler * initialize the error handler
@@ -79,42 +78,42 @@ define('PHPMYADMIN', true);
/** /**
* core functions * core functions
*/ */
require_once './libraries/core.lib.php'; require './libraries/core.lib.php';
/** /**
* Input sanitizing * Input sanitizing
*/ */
require_once './libraries/sanitizing.lib.php'; require './libraries/sanitizing.lib.php';
/** /**
* the PMA_Theme class * the PMA_Theme class
*/ */
require_once './libraries/Theme.class.php'; require './libraries/Theme.class.php';
/** /**
* the PMA_Theme_Manager class * the PMA_Theme_Manager class
*/ */
require_once './libraries/Theme_Manager.class.php'; require './libraries/Theme_Manager.class.php';
/** /**
* the PMA_Config class * the PMA_Config class
*/ */
require_once './libraries/Config.class.php'; require './libraries/Config.class.php';
/** /**
* the relation lib, tracker needs it * the relation lib, tracker needs it
*/ */
require_once './libraries/relation.lib.php'; require './libraries/relation.lib.php';
/** /**
* the PMA_Tracker class * the PMA_Tracker class
*/ */
require_once './libraries/Tracker.class.php'; require './libraries/Tracker.class.php';
/** /**
* the PMA_Table class * the PMA_Table class
*/ */
require_once './libraries/Table.class.php'; require './libraries/Table.class.php';
if (!defined('PMA_MINIMUM_COMMON')) { if (!defined('PMA_MINIMUM_COMMON')) {
/** /**
@@ -335,7 +334,7 @@ if ($GLOBALS['PMA_Config']->get('ForceSSL')
/** /**
* include session handling after the globals, to prevent overwriting * include session handling after the globals, to prevent overwriting
*/ */
require_once './libraries/session.inc.php'; require './libraries/session.inc.php';
/** /**
* init some variables LABEL_variables_init * init some variables LABEL_variables_init
@@ -454,7 +453,7 @@ if (PMA_checkPageValidity($_REQUEST['back'], $goto_whitelist)) {
* f.e. PMA_Config: fontsize * f.e. PMA_Config: fontsize
* *
* @todo variables should be handled by their respective owners (objects) * @todo variables should be handled by their respective owners (objects)
* f.e. lang, server, convcharset, collation_connection in PMA_Config * f.e. lang, server, collation_connection in PMA_Config
*/ */
if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['token']) { if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['token']) {
/** /**
@@ -468,7 +467,7 @@ if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['
/* Session ID */ /* Session ID */
'phpMyAdmin', 'phpMyAdmin',
/* Cookie preferences */ /* Cookie preferences */
'pma_lang', 'pma_charset', 'pma_collation_connection', 'pma_lang', 'pma_collation_connection',
/* Possible login form */ /* Possible login form */
'pma_servername', 'pma_username', 'pma_password', 'pma_servername', 'pma_username', 'pma_password',
/* for playing blobstreamable media */ /* for playing blobstreamable media */
@@ -479,7 +478,7 @@ if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['
/** /**
* Require cleanup functions * Require cleanup functions
*/ */
require_once './libraries/cleanup.lib.php'; require './libraries/cleanup.lib.php';
/** /**
* Do actual cleanup * Do actual cleanup
*/ */
@@ -488,14 +487,6 @@ if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['
} }
/**
* @global string $GLOBALS['convcharset']
* @see select_lang.lib.php
*/
if (isset($_REQUEST['convcharset'])) {
$GLOBALS['convcharset'] = strip_tags($_REQUEST['convcharset']);
}
/** /**
* current selected database * current selected database
* @global string $GLOBALS['db'] * @global string $GLOBALS['db']
@@ -563,17 +554,10 @@ $GLOBALS['footnotes'] = array();
/******************************************************************************/ /******************************************************************************/
/* loading language file LABEL_loading_language_file */ /* loading language file LABEL_loading_language_file */
/**
* Added messages while developing:
*/
if (file_exists('./lang/added_messages.php')) {
include './lang/added_messages.php';
}
/** /**
* lang detection is done here * lang detection is done here
*/ */
require_once './libraries/select_lang.lib.php'; require './libraries/select_lang.lib.php';
/** /**
* check for errors occurred while loading configuration * check for errors occurred while loading configuration
@@ -800,7 +784,6 @@ if (! defined('PMA_MINIMUM_COMMON')) {
* @todo should be done in PMA_Config * @todo should be done in PMA_Config
*/ */
$GLOBALS['PMA_Config']->setCookie('pma_lang', $GLOBALS['lang']); $GLOBALS['PMA_Config']->setCookie('pma_lang', $GLOBALS['lang']);
$GLOBALS['PMA_Config']->setCookie('pma_charset', $GLOBALS['convcharset']);
$GLOBALS['PMA_Config']->setCookie('pma_collation_connection', $GLOBALS['collation_connection']); $GLOBALS['PMA_Config']->setCookie('pma_collation_connection', $GLOBALS['collation_connection']);
$_SESSION['PMA_Theme_Manager']->setThemeCookie(); $_SESSION['PMA_Theme_Manager']->setThemeCookie();
@@ -814,7 +797,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
require_once './libraries/logging.lib.php'; require_once './libraries/logging.lib.php';
// Gets the authentication library that fits the $cfg['Server'] settings // Gets the authentication library that fits the $cfg['Server'] settings
// and run authentication // and run authentication
// to allow HTTP or http // to allow HTTP or http
@@ -826,14 +809,13 @@ if (! defined('PMA_MINIMUM_COMMON')) {
* the required auth type plugin * the required auth type plugin
*/ */
require_once './libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php'; require_once './libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php';
if (!PMA_auth_check()) { if (!PMA_auth_check()) {
PMA_auth(); PMA_auth();
} else { } else {
PMA_auth_set_user(); PMA_auth_set_user();
} }
// Check IP-based Allow/Deny rules as soon as possible to reject the // Check IP-based Allow/Deny rules as soon as possible to reject the
// user // user
// Based on mod_access in Apache: // 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 // http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/aaa/mod_access.c?rev=1.37&content-type=text/vnd.viewcvs-markup
@@ -970,9 +952,8 @@ if (! defined('PMA_MINIMUM_COMMON')) {
// checks for blobstreaming plugins and databases that support // checks for blobstreaming plugins and databases that support
// blobstreaming (by having the necessary tables for blobstreaming) // blobstreaming (by having the necessary tables for blobstreaming)
if (checkBLOBStreamingPlugins()) { checkBLOBStreamingPlugins();
checkBLOBStreamableDatabases();
}
} // end if !defined('PMA_MINIMUM_COMMON') } // end if !defined('PMA_MINIMUM_COMMON')
// remove sensitive values from session // remove sensitive values from session

View File

@@ -3,7 +3,6 @@
/** /**
* Misc functions used all over the scripts. * Misc functions used all over the scripts.
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -130,7 +129,6 @@ function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = f
/** /**
* Displays the maximum size for an upload * Displays the maximum size for an upload
* *
* @uses __('Max: %s%s')
* @uses PMA_formatByteDown() * @uses PMA_formatByteDown()
* @uses sprintf() * @uses sprintf()
* @param integer the size * @param integer the size
@@ -320,7 +318,7 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '')
switch ($cfg['SQP']['fmtType']) { switch ($cfg['SQP']['fmtType']) {
case 'none': case 'none':
if ($unparsed_sql != '') { if ($unparsed_sql != '') {
$formatted_sql = "<pre>\n" . PMA_SQP_formatNone(array('raw' => $unparsed_sql)) . "\n</pre>"; $formatted_sql = '<span class="inner_sql"><pre>' . "\n" . PMA_SQP_formatNone(array('raw' => $unparsed_sql)) . "\n" . '</pre></span>';
} else { } else {
$formatted_sql = PMA_SQP_formatNone($parsed_sql); $formatted_sql = PMA_SQP_formatNone($parsed_sql);
} }
@@ -346,7 +344,6 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '')
* @uses $cfg['MySQLManualType'] * @uses $cfg['MySQLManualType']
* @uses $cfg['MySQLManualBase'] * @uses $cfg['MySQLManualBase']
* @uses $cfg['ReplaceHelpImg'] * @uses $cfg['ReplaceHelpImg']
* @uses __('Documentation')
* @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['pmaThemeImage']
* @uses PMA_MYSQL_INT_VERSION * @uses PMA_MYSQL_INT_VERSION
* @uses strtolower() * @uses strtolower()
@@ -501,11 +498,7 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
* @uses footer.inc.php * @uses footer.inc.php
* @uses header.inc.php * @uses header.inc.php
* @uses $GLOBALS['sql_query'] * @uses $GLOBALS['sql_query']
* @uses __('Error')
* @uses __('SQL query')
* @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['pmaThemeImage']
* @uses __('Edit')
* @uses __('MySQL said: ')
* @uses $GLOBALS['cfg']['PropertiesIconic'] * @uses $GLOBALS['cfg']['PropertiesIconic']
* @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] * @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']
* @uses PMA_backquote() * @uses PMA_backquote()
@@ -661,19 +654,19 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
$back_url .= '?no_history=true'; $back_url .= '?no_history=true';
} }
$_SESSION['Import_message']['go_back_url'] = $back_url; $_SESSION['Import_message']['go_back_url'] = $back_url;
$error_msg_output .= '<fieldset class="tblFooters">'; $error_msg_output .= '<fieldset class="tblFooters">';
$error_msg_output .= '[ <a href="' . $back_url . '">' . __('Back') . '</a> ]'; $error_msg_output .= '[ <a href="' . $back_url . '">' . __('Back') . '</a> ]';
$error_msg_output .= '</fieldset>' . "\n\n"; $error_msg_output .= '</fieldset>' . "\n\n";
} }
echo $error_msg_output; echo $error_msg_output;
/** /**
* display footer and exit * display footer and exit
*/ */
require_once './libraries/footer.inc.php'; require './libraries/footer.inc.php';
} else { } else {
echo $error_msg_output; echo $error_msg_output;
} }
@@ -798,18 +791,11 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
// load PMA configuration // load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config']; $PMA_Config = $GLOBALS['PMA_Config'];
// if PMA configuration exists
if (!empty($PMA_Config))
$session_bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
foreach ($tables as $table_name => $table) { foreach ($tables as $table_name => $table) {
// if BS tables exist // if BS tables exist
if (isset($session_bs_tables)) if (PMA_BS_IsHiddenTable($table_name)) {
// compare table name to tables in list of blobstreaming tables continue;
foreach ($session_bs_tables as $table_key=>$table_val) }
// if table is in list, skip outer foreach loop
if ($table_name == $table_key)
continue 2;
// check for correct row count // check for correct row count
if (null === $table['Rows']) { if (null === $table['Rows']) {
@@ -1137,7 +1123,11 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
if (! empty($GLOBALS['show_as_php'])) { if (! empty($GLOBALS['show_as_php'])) {
$query_base = '$sql = "' . $query_base; $query_base = '$sql = "' . $query_base;
} elseif (! empty($GLOBALS['validatequery'])) { } elseif (! empty($GLOBALS['validatequery'])) {
$query_base = PMA_validateSQL($query_base); try {
$query_base = PMA_validateSQL($query_base);
} catch (Exception $e) {
PMA_Message::error(__('Failed to connect to SQL validator!'))->display();
}
} elseif (isset($parsed_sql)) { } elseif (isset($parsed_sql)) {
$query_base = PMA_formatSql($parsed_sql, $query_base); $query_base = PMA_formatSql($parsed_sql, $query_base);
} }
@@ -1188,7 +1178,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
$url_params['sql_query'] = $sql_query; $url_params['sql_query'] = $sql_query;
$url_params['show_query'] = 1; $url_params['show_query'] = 1;
if (! empty($cfg['SQLQuery']['Edit']) && ! $query_too_big) { // even if the query is big and was truncated, offer the chance
// to edit it (unless it's enormous, see PMA_linkOrButton() )
if (! empty($cfg['SQLQuery']['Edit'])) {
if ($cfg['EditInWindow'] == true) { if ($cfg['EditInWindow'] == true) {
$onclick = 'window.parent.focus_querywindow(\'' . PMA_jsFormat($sql_query, false) . '\'); return false;'; $onclick = 'window.parent.focus_querywindow(\'' . PMA_jsFormat($sql_query, false) . '\'); return false;';
} else { } else {
@@ -1251,7 +1243,11 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
$validate_link = ''; $validate_link = '';
} //validator } //validator
echo '<code class="sql">'; if (!empty($GLOBALS['validatequery'])) {
echo '<div class="sqlvalidate">';
} else {
echo '<code class="sql">';
}
if ($query_too_big) { if ($query_too_big) {
echo $shortened_query_base; echo $shortened_query_base;
} else { } else {
@@ -1262,7 +1258,11 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
if (! empty($GLOBALS['show_as_php'])) { if (! empty($GLOBALS['show_as_php'])) {
echo '";'; echo '";';
} }
echo '</code>'; if (!empty($GLOBALS['validatequery'])) {
echo '</div>';
} else {
echo '</code>';
}
echo '<div class="tools">'; echo '<div class="tools">';
// avoid displaying a Profiling checkbox that could // avoid displaying a Profiling checkbox that could
@@ -1270,6 +1270,17 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
if (! empty($refresh_link)) { if (! empty($refresh_link)) {
PMA_profilingCheckbox($sql_query); PMA_profilingCheckbox($sql_query);
} }
// if needed, generate an invisible form that contains controls for the
// Inline link; this way, the behavior of the Inline link does not
// depend on the profiling support or on the refresh link
if (empty($refresh_link) || ! PMA_profilingSupported()) {
echo '<form action="sql.php" method="post">';
echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']);
echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />';
echo '</form>';
}
// see in js/functions.js the jQuery code attached to id inline_edit
$inline_edit = "<script type=\"text/javascript\">\n" . $inline_edit = "<script type=\"text/javascript\">\n" .
"//<![CDATA[\n" . "//<![CDATA[\n" .
"document.write('[<a href=\"#\" title=\"" . "document.write('[<a href=\"#\" title=\"" .
@@ -1624,8 +1635,6 @@ function PMA_localisedDate($timestamp = -1, $format = '')
* If the variables $link and $args ar left empty, an inactive tab is created * If the variables $link and $args ar left empty, an inactive tab is created
* *
* @uses $GLOBALS['PMA_PHP_SELF'] * @uses $GLOBALS['PMA_PHP_SELF']
* @uses __('Empty')
* @uses __('Drop')
* @uses $GLOBALS['active_page'] * @uses $GLOBALS['active_page']
* @uses $GLOBALS['url_query'] * @uses $GLOBALS['url_query']
* @uses $cfg['MainPageIconic'] * @uses $cfg['MainPageIconic']
@@ -1778,6 +1787,13 @@ function PMA_generate_html_tabs($tabs, $url_params)
function PMA_linkOrButton($url, $message, $tag_params = array(), function PMA_linkOrButton($url, $message, $tag_params = array(),
$new_form = true, $strip_img = false, $target = '') $new_form = true, $strip_img = false, $target = '')
{ {
$url_length = strlen($url);
// with this we should be able to catch case of image upload
// into a (MEDIUM) BLOB; not worth generating even a form for these
if ($url_length > $GLOBALS['cfg']['LinkLengthLimit'] * 100) {
return '';
}
if (! is_array($tag_params)) { if (! is_array($tag_params)) {
$tmp = $tag_params; $tmp = $tag_params;
$tag_params = array(); $tag_params = array();
@@ -1799,7 +1815,7 @@ function PMA_linkOrButton($url, $message, $tag_params = array(),
$tag_params_strings[] = $par_name . '="' . $par_value . '"'; $tag_params_strings[] = $par_name . '="' . $par_value . '"';
} }
if (strlen($url) <= $GLOBALS['cfg']['LinkLengthLimit']) { if ($url_length <= $GLOBALS['cfg']['LinkLengthLimit']) {
// no whitespace within an <a> else Safari will make it part of the link // no whitespace within an <a> else Safari will make it part of the link
$ret = "\n" . '<a href="' . $url . '" ' $ret = "\n" . '<a href="' . $url . '" '
. implode(' ', $tag_params_strings) . '>' . implode(' ', $tag_params_strings) . '>'
@@ -1885,7 +1901,6 @@ function PMA_linkOrButton($url, $message, $tag_params = array(),
/** /**
* Returns a given timespan value in a readable format. * Returns a given timespan value in a readable format.
* *
* @uses __('%s days, %s hours, %s minutes and %s seconds')
* @uses sprintf() * @uses sprintf()
* @uses floor() * @uses floor()
* @param int the timespan * @param int the timespan
@@ -2102,7 +2117,8 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
$condition .= 'IS NULL AND'; $condition .= 'IS NULL AND';
} else { } else {
// timestamp is numeric on some MySQL 4.1 // timestamp is numeric on some MySQL 4.1
if ($meta->numeric && $meta->type != 'timestamp') { // for real we use CONCAT above and it should compare to string
if ($meta->numeric && $meta->type != 'timestamp' && $meta->type != 'real') {
$condition .= '= ' . $row[$i] . ' AND'; $condition .= '= ' . $row[$i] . ' AND';
} elseif (($meta->type == 'blob' || $meta->type == 'string') } elseif (($meta->type == 'blob' || $meta->type == 'string')
// hexify only if this is a true not empty BLOB or a BINARY // hexify only if this is a true not empty BLOB or a BINARY
@@ -2194,7 +2210,6 @@ function PMA_buttonOrImage($button_name, $button_class, $image_name, $text,
* Generate a pagination selector for browsing resultsets * Generate a pagination selector for browsing resultsets
* *
* @todo $url is not javascript escaped!? * @todo $url is not javascript escaped!?
* @uses __('Page number:')
* @uses range() * @uses range()
* @param string URL for the JavaScript * @param string URL for the JavaScript
* @param string Number of rows in the pagination set * @param string Number of rows in the pagination set
@@ -2298,7 +2313,6 @@ function PMA_pageselector($url, $rows, $pageNow = 1, $nbTotalPage = 1,
* Generate navigation for a list * Generate navigation for a list
* *
* @todo use $pos from $_url_params * @todo use $pos from $_url_params
* @uses __('Page number:')
* @uses range() * @uses range()
* @param integer number of elements in the list * @param integer number of elements in the list
* @param integer current position in the list * @param integer current position in the list
@@ -2409,7 +2423,6 @@ function PMA_userDir($dir)
* *
* @uses $cfg['DefaultTabDatabase'] * @uses $cfg['DefaultTabDatabase']
* @uses $GLOBALS['db'] * @uses $GLOBALS['db']
* @uses __('Jump to database &quot;%s&quot;.')
* @uses PMA_generate_common_url() * @uses PMA_generate_common_url()
* @uses PMA_unescape_mysql_wildcards() * @uses PMA_unescape_mysql_wildcards()
* @uses strlen() * @uses strlen()
@@ -2439,7 +2452,6 @@ function PMA_getDbLink($database = null)
* that affects a functionality * that affects a functionality
* *
* @uses PMA_MYSQL_INT_VERSION * @uses PMA_MYSQL_INT_VERSION
* @uses __('The %s functionality is affected by a known bug, see %s')
* @uses PMA_showHint() * @uses PMA_showHint()
* @uses sprintf() * @uses sprintf()
* @param string $functionality localized message explaining the func. * @param string $functionality localized message explaining the func.
@@ -2829,7 +2841,7 @@ function PMA_getTitleForTarget($target) {
$mapping = array( $mapping = array(
// Values for $cfg['DefaultTabTable'] // Values for $cfg['DefaultTabTable']
'tbl_structure.php' => __('Structure'), 'tbl_structure.php' => __('Structure'),
'tbl_sql.php' => __('SQL'), 'tbl_sql.php' => __('SQL'),
'tbl_select.php' =>__('Search'), 'tbl_select.php' =>__('Search'),
'tbl_change.php' =>__('Insert'), 'tbl_change.php' =>__('Insert'),
@@ -2844,19 +2856,72 @@ $mapping = array(
return $mapping[$target]; return $mapping[$target];
} }
function PMA_js($code, $print=true) /**
{ * Formats user string, expading @VARIABLES@, accepting strftime format string.
// these generated newlines are needed *
$out = ''; * @param string Text where to do expansion.
$out .= '<script type="text/javascript">'."\n"; * @param function Function to call for escaping variable values.
$out .= "\n" . '// <![CDATA[' . "\n"; * @param array Array with overrides for default parameters (obtained from GLOBALS).
$out .= $code; */
$out .= "\n" . '// ]]>' . "\n"; function PMA_expandUserString($string, $escape = NULL, $updates = array()) {
$out .= '</script>'."\n"; /* Content */
$vars['http_host'] = PMA_getenv('HTTP_HOST') ? PMA_getenv('HTTP_HOST') : '';
$vars['server_name'] = $GLOBALS['cfg']['Server']['host'];
$vars['server_verbose'] = $GLOBALS['cfg']['Server']['verbose'];
$vars['server_verbose_or_name'] = !empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host'];
$vars['database'] = $GLOBALS['db'];
$vars['table'] = $GLOBALS['table'];
$vars['phpmyadmin_version'] = 'phpMyAdmin ' . PMA_VERSION;
if ($print) /* Update forced variables */
echo $out; foreach($updates as $key => $val) {
$vars[$key] = $val;
}
return $out; /* Replacement mapping */
/*
* The __VAR__ ones are for backward compatibility, because user
* might still have it in cookies.
*/
$replace = array(
'@HTTP_HOST@' => $vars['http_host'],
'@SERVER@' => $vars['server_name'],
'__SERVER__' => $vars['server_name'],
'@VERBOSE@' => $vars['server_verbose'],
'@VSERVER@' => $vars['server_verbose_or_name'],
'@DATABASE@' => $vars['database'],
'__DB__' => $vars['database'],
'@TABLE@' => $vars['table'],
'__TABLE__' => $vars['table'],
'@PHPMYADMIN@' => $vars['phpmyadmin_version'],
);
/* Optional escaping */
if (!is_null($escape)) {
foreach($replace as $key => $val) {
$replace[$key] = $escape($val);
}
}
/* Fetch fields list if required */
if (strpos($string, '@FIELDS@') !== FALSE) {
$fields_list = PMA_DBI_fetch_result(
'SHOW COLUMNS FROM ' . PMA_backquote($GLOBALS['db'])
. '.' . PMA_backquote($GLOBALS['table']));
$field_names = array();
foreach ($fields_list as $field) {
if (!is_null($escape)) {
$field_names[] = $escape($field['Field']);
} else {
$field_names[] = $field['Field'];
}
}
$replace['@FIELDS@'] = implode(',', $field_names);
}
/* Do the replacement */
return str_replace(array_keys($replace), array_values($replace), strftime($string));
} }
?> ?>

View File

@@ -16,7 +16,6 @@
* *
* All directives are explained in Documentation.html * All directives are explained in Documentation.html
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -138,12 +137,6 @@ $cfg['Servers'][$i]['connect_type'] = 'tcp';
*/ */
$cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['extension'] = 'mysql';
/* added for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = '';
$cfg['Servers'][$i]['bs_repository_threshold'] = '';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = '';
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '';
/** /**
* Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0) * Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)
* *
@@ -542,11 +535,13 @@ $cfg['ExecTimeLimit'] = 300;
$cfg['SessionSavePath'] = ''; $cfg['SessionSavePath'] = '';
/** /**
* maximum allocated bytes (0 for no limit) * maximum allocated bytes ('0' for no limit)
* this is a string because '16M' is a valid value; we must put here
* a string as the default value so that /setup accepts strings
* *
* @global integer $cfg['MemoryLimit'] * @global string $cfg['MemoryLimit']
*/ */
$cfg['MemoryLimit'] = 0; $cfg['MemoryLimit'] = '0';
/** /**
* mark used tables, make possible to show locked tables (since MySQL 3.23.30) * mark used tables, make possible to show locked tables (since MySQL 3.23.30)
@@ -585,7 +580,8 @@ $cfg['Confirm'] = true;
$cfg['LoginCookieRecall'] = true; $cfg['LoginCookieRecall'] = true;
/** /**
* validity of cookie login (in seconds) * validity of cookie login (in seconds; 1440 matches php.ini's
* session.gc_maxlifetime)
* *
* @global integer $cfg['LoginCookieValidity'] * @global integer $cfg['LoginCookieValidity']
*/ */
@@ -1114,21 +1110,21 @@ $cfg['Export']['remember_file_template'] = true;
* *
* @global string $cfg['Export']['file_template_table'] * @global string $cfg['Export']['file_template_table']
*/ */
$cfg['Export']['file_template_table'] = '__TABLE__'; $cfg['Export']['file_template_table'] = '@TABLE@';
/** /**
* *
* *
* @global string $cfg['Export']['file_template_database'] * @global string $cfg['Export']['file_template_database']
*/ */
$cfg['Export']['file_template_database'] = '__DB__'; $cfg['Export']['file_template_database'] = '@DATABASE@';
/** /**
* *
* *
* @global string $cfg['Export']['file_template_server'] * @global string $cfg['Export']['file_template_server']
*/ */
$cfg['Export']['file_template_server'] = '__SERVER__'; $cfg['Export']['file_template_server'] = '@SERVER@';
/** /**
* *
@@ -1429,14 +1425,14 @@ $cfg['Export']['latex_data_continued_caption'] = 'strLatexContent strLatexContin
* *
* @global string $cfg['Export']['latex_data_label'] * @global string $cfg['Export']['latex_data_label']
*/ */
$cfg['Export']['latex_data_label'] = 'tab:__TABLE__-data'; $cfg['Export']['latex_data_label'] = 'tab:@TABLE@-data';
/** /**
* *
* *
* @global string $cfg['Export']['latex_structure_label'] * @global string $cfg['Export']['latex_structure_label']
*/ */
$cfg['Export']['latex_structure_label'] = 'tab:__TABLE__-structure'; $cfg['Export']['latex_structure_label'] = 'tab:@TABLE@-structure';
/** /**
* *
@@ -1936,8 +1932,7 @@ $cfg['DefaultLang'] = 'en';
$cfg['DefaultConnectionCollation'] = 'utf8_general_ci'; $cfg['DefaultConnectionCollation'] = 'utf8_general_ci';
/** /**
* Force: always use this language - must be defined in * Force: always use this language
* libraries/select_lang.lib.php
* $cfg['Lang'] = 'en'; * $cfg['Lang'] = 'en';
* *
* Regular expression to limit listed languages, e.g. '^(cs|en)' for Czech and * Regular expression to limit listed languages, e.g. '^(cs|en)' for Czech and
@@ -1947,26 +1942,6 @@ $cfg['DefaultConnectionCollation'] = 'utf8_general_ci';
*/ */
$cfg['FilterLanguages'] = ''; $cfg['FilterLanguages'] = '';
/**
* Default character set to use for recoding of MySQL queries, does not take
* any effect when character sets recoding is switched off by
* $cfg['AllowAnywhereRecoding'] or in language file
* (see $cfg['AvailableCharsets'] to possible choices, you can add your own)
*
* @global string $cfg['DefaultCharset']
*/
$cfg['DefaultCharset'] = 'utf-8';
/**
* Allow character set recoding of MySQL queries, must be also enabled in language
* file to make harder using other language files than Unicode.
* Default value is false to avoid problems on servers without the iconv
* extension
*
* @global boolean $cfg['AllowAnywhereRecoding']
*/
$cfg['AllowAnywhereRecoding'] = false;
/** /**
* You can select here which functions will be used for character set conversion. * You can select here which functions will be used for character set conversion.
* Possible values are: * Possible values are:
@@ -1974,6 +1949,7 @@ $cfg['AllowAnywhereRecoding'] = false;
* recode) * recode)
* iconv - use iconv or libiconv functions * iconv - use iconv or libiconv functions
* recode - use recode_string function * recode - use recode_string function
* none - disable encoding conversion
* *
* @global string $cfg['RecodingEngine'] * @global string $cfg['RecodingEngine']
*/ */
@@ -2275,14 +2251,6 @@ $cfg['InitialSlidersState'] = 'closed';
//-----------------------------------------------------------------------------
// custom-setup by mkkeck: 2004-05-04
// some specials for new icons and scrolling
/**
* @todo We need to rearrange these variables.
*/
/******************************************************************************* /*******************************************************************************
* Window title settings * Window title settings
*/ */
@@ -2376,22 +2344,14 @@ $cfg['ThemePerServer'] = false;
*/ */
/** /**
* Default queries * Default query for table
* %d will be replaced by the database name.
* %t will be replaced by the table name.
* %f will be replaced by a list of field names.
* (%t and %f only applies to DefaultQueryTable)
* *
* @global string $cfg['DefaultQueryTable'] * @global string $cfg['DefaultQueryTable']
*/ */
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1'; $cfg['DefaultQueryTable'] = 'SELECT * FROM @TABLE@ WHERE 1';
/** /**
* Default queries * Default query for database
* %d will be replaced by the database name.
* %t will be replaced by the table name.
* %f will be replaced by a list of field names.
* (%t and %f only applies to DefaultQueryTable)
* *
* @global string $cfg['DefaultQueryDatabase'] * @global string $cfg['DefaultQueryDatabase']
*/ */

View File

@@ -5,7 +5,6 @@
* This script is distinct from libraries/common.inc.php because this * This script is distinct from libraries/common.inc.php because this
* script is called from /test. * script is called from /test.
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
@@ -202,7 +201,6 @@ function PMA_securePath($path)
* @todo use detected argument separator (PMA_Config) * @todo use detected argument separator (PMA_Config)
* @uses $GLOBALS['session_name'] * @uses $GLOBALS['session_name']
* @uses $GLOBALS['text_dir'] * @uses $GLOBALS['text_dir']
* @uses __('Error')
* @uses $GLOBALS['available_languages'] * @uses $GLOBALS['available_languages']
* @uses $GLOBALS['lang'] * @uses $GLOBALS['lang']
* @uses $GLOBALS['PMA_Config']->removeCookie() * @uses $GLOBALS['PMA_Config']->removeCookie()
@@ -222,30 +220,7 @@ function PMA_securePath($path)
*/ */
function PMA_fatalError($error_message, $message_args = null) function PMA_fatalError($error_message, $message_args = null)
{ {
// it could happen PMA_fatalError() is called before language file is loaded /* Use format string if applicable */
if (! isset($GLOBALS['available_languages'])) {
$GLOBALS['cfg'] = array(
'DefaultLang' => 'en',
'AllowAnywhereRecoding' => false);
// Loads the language file
require_once './libraries/select_lang.lib.php';
// $text_dir is set in po file
if (isset($text_dir)) {
$GLOBALS['text_dir'] = $text_dir;
}
}
// $error_message could be a language string identifier: strString
if (substr($error_message, 0, 3) === 'str') {
if (isset($$error_message)) {
$error_message = $$error_message;
} elseif (isset($GLOBALS[$error_message])) {
$error_message = $GLOBALS[$error_message];
}
}
if (is_string($message_args)) { if (is_string($message_args)) {
$error_message = sprintf($error_message, $message_args); $error_message = sprintf($error_message, $message_args);
} elseif (is_array($message_args)) { } elseif (is_array($message_args)) {
@@ -253,12 +228,18 @@ function PMA_fatalError($error_message, $message_args = null)
} }
$error_message = strtr($error_message, array('<br />' => '[br]')); $error_message = strtr($error_message, array('<br />' => '[br]'));
if (function_exists('__')) {
$error_header = __('Error');
} else {
$error_header = 'Error';
}
// Displays the error message // Displays the error message
// (do not use &amp; for parameters sent by header) // (do not use &amp; for parameters sent by header)
$query_params = array( $query_params = array(
'lang' => $GLOBALS['available_languages'][$GLOBALS['lang']][1], 'lang' => $GLOBALS['available_languages'][$GLOBALS['lang']][1],
'dir' => $GLOBALS['text_dir'], 'dir' => $GLOBALS['text_dir'],
'type' => __('Error'), 'type' => $error_header,
'error' => $error_message, 'error' => $error_message,
); );
header('Location: ' . (defined('PMA_SETUP') ? '../' : '') . 'error.php?' header('Location: ' . (defined('PMA_SETUP') ? '../' : '') . 'error.php?'
@@ -281,7 +262,8 @@ function PMA_fatalError($error_message, $message_args = null)
*/ */
function PMA_warnMissingExtension($extension, $fatal = false, $extra = '') function PMA_warnMissingExtension($extension, $fatal = false, $extra = '')
{ {
$message = sprintf(__('Cannot load [a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a] extension. Please check your PHP configuration.'), $extension); $message = sprintf(__('The %s extension is missing. Please check your PHP configuration.'),
sprintf('[a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a]', $extension));
if ($extra != '') { if ($extra != '') {
$message .= ' ' . $extra; $message .= ' ' . $extra;
} }
@@ -311,31 +293,12 @@ function PMA_getTableCount($db)
if ($tables) { if ($tables) {
$num_tables = PMA_DBI_num_rows($tables); $num_tables = PMA_DBI_num_rows($tables);
// for blobstreaming - get blobstreaming tables // do not count hidden blobstreaming tables
// for use in determining if a table here is a blobstreaming table while ((($num_tables > 0)) && $data = PMA_DBI_fetch_assoc($tables)) {
if (PMA_BS_IsHiddenTable($data['Tables_in_' . $db])) {
// load PMA configuration $num_tables--;
$PMA_Config = $GLOBALS['PMA_Config']; }
}
// if PMA configuration exists
if (!empty($PMA_Config))
{
// load BS tables
$session_bs_tables = $GLOBALS['PMA_Config']->get('BLOBSTREAMING_TABLES');
// if BS tables exist
if (isset ($session_bs_tables))
while ($data = PMA_DBI_fetch_assoc($tables))
foreach ($session_bs_tables as $table_key=>$table_val)
// if the table is a blobstreaming table, reduce the table count
if ($data['Tables_in_' . $db] == $table_key)
{
if ($num_tables > 0)
$num_tables--;
break;
}
} // end if PMA configuration exists
PMA_DBI_free_result($tables); PMA_DBI_free_result($tables);
} else { } else {

View File

@@ -3,7 +3,6 @@
/** /**
* Common Option Constants For DBI Functions * Common Option Constants For DBI Functions
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -238,8 +237,6 @@ function PMA_usort_comparison_callback($a, $b)
function PMA_DBI_get_tables_full($database, $table = false, $tbl_is_group = false, $link = null, function PMA_DBI_get_tables_full($database, $table = false, $tbl_is_group = false, $link = null,
$limit_offset = 0, $limit_count = false, $sort_by = 'Name', $sort_order = 'ASC') $limit_offset = 0, $limit_count = false, $sort_by = 'Name', $sort_order = 'ASC')
{ {
require_once './libraries/Table.class.php';
if (true === $limit_count) { if (true === $limit_count) {
$limit_count = $GLOBALS['cfg']['MaxTableList']; $limit_count = $GLOBALS['cfg']['MaxTableList'];
} }

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -37,12 +36,19 @@ $err_url = $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db);
* Ensures the database exists (else move to the "parent" script) and displays * Ensures the database exists (else move to the "parent" script) and displays
* headers * headers
*/ */
if (!isset($is_db) || !$is_db) { if (! isset($is_db) || ! $is_db) {
// Not a valid db name -> back to the welcome page
if (strlen($db)) { if (strlen($db)) {
$is_db = PMA_DBI_select_db($db); $is_db = PMA_DBI_select_db($db);
// This "Command out of sync" 2014 error may happen, for example
// after calling a MySQL procedure; at this point we can't select
// the db but it's not necessarily wrong
if (PMA_DBI_getError() && $GLOBALS['errno'] == 2014) {
$is_db = true;
unset($GLOBALS['errno']);
}
} }
if (! strlen($db) || !$is_db) { // Not a valid db name -> back to the welcome page
if (! strlen($db) || ! $is_db) {
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit; exit;
} }
@@ -59,7 +65,6 @@ if (isset($submitcollation) && !empty($db_collation)) {
unset($db_charset, $db_collation); unset($db_charset, $db_collation);
} }
$GLOBALS['js_include'][] = 'functions.js';
require_once './libraries/header.inc.php'; require_once './libraries/header.inc.php';
/** /**

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {

View File

@@ -31,7 +31,6 @@
* @uses strnatcasecmp() * @uses strnatcasecmp()
* @uses count() * @uses count()
* @uses addslashes() * @uses addslashes()
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -59,7 +58,6 @@ $pos = $_SESSION['tmp_user_values']['table_limit_offset'];
* fills given tooltip arrays * fills given tooltip arrays
* *
* @uses $cfg['ShowTooltipAliasTB'] * @uses $cfg['ShowTooltipAliasTB']
* @uses __('Creation')
* @uses PMA_localisedDate() * @uses PMA_localisedDate()
* @uses strtotime() * @uses strtotime()
* @param array $tooltip_truename tooltip data * @param array $tooltip_truename tooltip data

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -14,7 +13,6 @@ if (! defined('PHPMYADMIN')) {
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
require_once './libraries/relation.lib.php';
/** /**
* Gets the relation settings * Gets the relation settings
*/ */
@@ -36,19 +34,6 @@ $is_superuser = PMA_isSuperuser();
/** /**
* Prepares links * Prepares links
*/ */
// Drop link if allowed
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
// Don't allow to easilly drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && ! $db_is_information_schema && ($db != 'mysql')) {
$tab_drop['link'] = 'sql.php';
$tab_drop['args']['sql_query'] = 'DROP DATABASE ' . PMA_backquote($db);
$tab_drop['args']['zero_rows'] = sprintf(__('Database %s has been dropped.'), htmlspecialchars(PMA_backquote($db)));
$tab_drop['args']['goto'] = 'main.php';
$tab_drop['args']['back'] = 'db' . $sub_part . '.php';
$tab_drop['args']['reload'] = 1;
$tab_drop['args']['purge'] = 1;
$tab_drop['attr'] = 'onclick="return confirmLinkDropDB(this, \'DROP DATABASE ' . PMA_jsFormat($db) . '\')"';
}
/** /**
* export, search and qbe links if there is at least one table * export, search and qbe links if there is at least one table
@@ -97,9 +82,6 @@ if (! $db_is_information_schema) {
$tab_import['link'] = 'db_import.php'; $tab_import['link'] = 'db_import.php';
$tab_import['text'] = __('Import'); $tab_import['text'] = __('Import');
$tab_import['icon'] = 'b_import.png'; $tab_import['icon'] = 'b_import.png';
$tab_drop['text'] = __('Drop');
$tab_drop['icon'] = 'b_deltbl.png';
$tab_drop['class'] = 'caution';
$tab_operation['link'] = 'db_operations.php'; $tab_operation['link'] = 'db_operations.php';
$tab_operation['text'] = __('Operations'); $tab_operation['text'] = __('Operations');
$tab_operation['icon'] = 'b_tblops.png'; $tab_operation['icon'] = 'b_tblops.png';
@@ -134,9 +116,6 @@ if (! $db_is_information_schema) {
if ($is_superuser) { if ($is_superuser) {
$tabs[] =& $tab_privileges; $tabs[] =& $tab_privileges;
} }
if ($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) {
$tabs[] =& $tab_drop;
}
} }
$url_params['db'] = $db; $url_params['db'] = $db;

View File

@@ -12,7 +12,6 @@
* our current sql.php. * our current sql.php.
* Of course the interface would need a way to pass calling parameters. * Of course the interface would need a way to pass calling parameters.
* Also, support DEFINER (like we do in export). * Also, support DEFINER (like we do in export).
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -17,14 +16,6 @@ if (! defined('PHPMYADMIN')) {
* @uses PMA_showHint() * @uses PMA_showHint()
* @uses $GLOBALS['cfg']['PropertiesNumColumns'] * @uses $GLOBALS['cfg']['PropertiesNumColumns']
* @uses $GLOBALS['is_show_stats'] * @uses $GLOBALS['is_show_stats']
* @uses __('Table')
* @uses __('Action')
* @uses __('Rows')
* @uses __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')
* @uses __('Type')
* @uses __('Collation')
* @uses __('Size')
* @uses __('Overhead')
* @uses $GLOBALS['colspan_for_structure'] * @uses $GLOBALS['colspan_for_structure']
* @uses PMA_SortableTableHeader() * @uses PMA_SortableTableHeader()
* @param boolean $db_is_information_schema * @param boolean $db_is_information_schema

View File

@@ -4,18 +4,12 @@
* Ensure the database and the table exist (else move to the "parent" script) * Ensure the database and the table exist (else move to the "parent" script)
* and display headers * and display headers
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
} }
/**
*
*/
require_once './libraries/Table.class.php';
if (empty($is_db)) { if (empty($is_db)) {
if (strlen($db)) { if (strlen($db)) {
$is_db = @PMA_DBI_select_db($db); $is_db = @PMA_DBI_select_db($db);

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-DBG * @package phpMyAdmin-DBG
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -19,8 +18,8 @@ if ($GLOBALS['cfg']['DBG']['php']) {
* Loads the DBG extension if needed * Loads the DBG extension if needed
*/ */
if (! @extension_loaded('dbg') ) { if (! @extension_loaded('dbg') ) {
$message = PMA_Message::error(__('Cannot load [a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a] extension. Please check your PHP configuration.')); $message = PMA_Message::error(__('The %s extension is missing. Please check your PHP configuration.'),
$message->addParam('DBG'); $message->addParam(sprintf('[a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a]', 'dbg'));
$message->addMessage('<a href="./Documentation.html#faqdbg" target="documentation">', false); $message->addMessage('<a href="./Documentation.html#faqdbg" target="documentation">', false);
$message->addString(__('Documentation')); $message->addString(__('Documentation'));
$message->addMessage('</a>', false); $message->addMessage('</a>', false);

View File

@@ -4,7 +4,6 @@
* Interface to the classic MySQL extension * Interface to the classic MySQL extension
* *
* @package phpMyAdmin-DBI-MySQL * @package phpMyAdmin-DBI-MySQL
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -308,9 +307,6 @@ function PMA_DBI_get_client_info()
* @uses PMA_DBI_convert_message() * @uses PMA_DBI_convert_message()
* @uses $GLOBALS['errno'] * @uses $GLOBALS['errno']
* @uses $GLOBALS['userlink'] * @uses $GLOBALS['userlink']
* @uses __('The server is not responding')
* @uses __('(or the local MySQL server's socket is not correctly configured)')
* @uses __('Details...')
* @uses mysql_errno() * @uses mysql_errno()
* @uses mysql_error() * @uses mysql_error()
* @uses defined() * @uses defined()

View File

@@ -4,7 +4,6 @@
* Interface to the improved MySQL extension (MySQLi) * Interface to the improved MySQL extension (MySQLi)
* *
* @package phpMyAdmin-DBI-MySQLi * @package phpMyAdmin-DBI-MySQLi
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -144,7 +143,6 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $server = nu
* selects given database * selects given database
* *
* @uses $GLOBALS['userlink'] * @uses $GLOBALS['userlink']
* @uses PMA_convert_charset()
* @uses mysqli_select_db() * @uses mysqli_select_db()
* @param string $dbname database name to select * @param string $dbname database name to select
* @param object mysqli $link the mysqli object * @param object mysqli $link the mysqli object
@@ -168,7 +166,6 @@ function PMA_DBI_select_db($dbname, $link = null)
* @uses PMA_DBI_QUERY_STORE * @uses PMA_DBI_QUERY_STORE
* @uses PMA_DBI_QUERY_UNBUFFERED * @uses PMA_DBI_QUERY_UNBUFFERED
* @uses $GLOBALS['userlink'] * @uses $GLOBALS['userlink']
* @uses PMA_convert_charset()
* @uses MYSQLI_STORE_RESULT * @uses MYSQLI_STORE_RESULT
* @uses MYSQLI_USE_RESULT * @uses MYSQLI_USE_RESULT
* @uses mysqli_query() * @uses mysqli_query()
@@ -366,8 +363,6 @@ function PMA_DBI_get_client_info()
* @uses PMA_DBI_convert_message() * @uses PMA_DBI_convert_message()
* @uses $GLOBALS['errno'] * @uses $GLOBALS['errno']
* @uses $GLOBALS['userlink'] * @uses $GLOBALS['userlink']
* @uses __('The server is not responding')
* @uses __('(or the local MySQL server's socket is not correctly configured)')
* @uses mysqli_errno() * @uses mysqli_errno()
* @uses mysqli_error() * @uses mysqli_error()
* @uses mysqli_connect_errno() * @uses mysqli_connect_errno()

View File

@@ -3,7 +3,6 @@
/** /**
* Displays form for password change * Displays form for password change
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -58,7 +57,7 @@ $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5)
</label> </label>
</td> </td>
</tr> </tr>
<tr> <tr id="tr_element_before_generate_password">
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<input type="radio" name="pw_hash" id="radio_pw_hash_old" value="old" /> <input type="radio" name="pw_hash" id="radio_pw_hash_old" value="old" />
@@ -67,15 +66,6 @@ $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5)
</label> </label>
</td> </td>
</tr> </tr>
<tr>
<td>
<?php echo __('Generate Password'); ?>
</td>
<td>
<input type="button" id="button_generate_password" value="<?php echo __('Generate'); ?>" onclick="suggestPassword(this.form)" />
<input type="text" name="generated_pw" id="generated_pw" />
</td>
</tr>
</table> </table>
</fieldset> </fieldset>
<fieldset id="fieldset_change_password_footer" class="tblFooters"> <fieldset id="fieldset_change_password_footer" class="tblFooters">

View File

@@ -3,7 +3,6 @@
/** /**
* Displays form for creating database (if user has privileges for that) * Displays form for creating database (if user has privileges for that)
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {

View File

@@ -22,7 +22,6 @@
* warnings about the lack of privileges for CREATE TABLE. Tested * warnings about the lack of privileges for CREATE TABLE. Tested
* on MySQL 5.0.18. * on MySQL 5.0.18.
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {

View File

@@ -2,20 +2,13 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
} }
/**
*
*/
require_once './libraries/Table.class.php';
// Get relations & co. status // Get relations & co. status
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
@@ -148,13 +141,13 @@ echo PMA_pluginGetJavascript($export_list);
echo __('File name template'); echo __('File name template');
$trans = new PMA_Message; $trans = new PMA_Message;
$trans->addMessage('__SERVER__/'); $trans->addMessage('@SERVER@/');
$trans->addString(__('server name')); $trans->addString(__('server name'));
if ($export_type == 'database' || $export_type == 'table') { if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage('__DB__/'); $trans->addMessage('@DATABASE@/');
$trans->addString(__('database name')); $trans->addString(__('database name'));
if ($export_type == 'table') { if ($export_type == 'table') {
$trans->addMessage('__TABLE__/'); $trans->addMessage('@TABLE@/');
$trans->addString(__('table name')); $trans->addString(__('table name'));
} }
} }
@@ -194,6 +187,7 @@ echo PMA_pluginGetJavascript($export_list);
?> ?>
/> />
<?php echo PMA_showDocu('faq6_27'); ?>
( (
<input type="checkbox" name="remember_template" <input type="checkbox" name="remember_template"
id="checkbox_remember_template" id="checkbox_remember_template"
@@ -205,7 +199,7 @@ echo PMA_pluginGetJavascript($export_list);
<div class="formelementrow"> <div class="formelementrow">
<?php <?php
// charset of file // charset of file
if ($cfg['AllowAnywhereRecoding']) { if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
echo ' <label for="select_charset_of_file">' echo ' <label for="select_charset_of_file">'
. __('Character set of the file:') . '</label>' . "\n"; . __('Character set of the file:') . '</label>' . "\n";

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
@@ -94,9 +93,9 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
window.setTimeout(perform_upload, 1000); window.setTimeout(perform_upload, 1000);
<?php <?php
} else { // no plugin avaliable } else { // no plugin available
?> ?>
$('#upload_form_status_info').html('<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo __('Please be patient, the file is being uploaded. Details about the upload are not available.') . PMA_showDocu('faq2_9'); ?>'); $('#upload_form_status_info').html('<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo PMA_jsFormat(__('Please be patient, the file is being uploaded. Details about the upload are not available.')) . PMA_showDocu('faq2_9'); ?>');
$('#upload_form_status').css("display", "none"); $('#upload_form_status').css("display", "none");
<?php <?php
} // else } // else
@@ -174,7 +173,7 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
// charset of file // charset of file
echo '<div class="formelementrow">' . "\n"; echo '<div class="formelementrow">' . "\n";
if ($cfg['AllowAnywhereRecoding']) { if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>'; echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>';
reset($cfg['AvailableCharsets']); reset($cfg['AvailableCharsets']);
echo '<select id="charset_of_file" name="charset_of_file" size="1">'; echo '<select id="charset_of_file" name="charset_of_file" size="1">';

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */

View File

@@ -3,7 +3,6 @@
/** /**
* Code for displaying language selection * Code for displaying language selection
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {

View File

@@ -3,14 +3,12 @@
/** /**
* library for displaying table with results from all sort of select queries * library for displaying table with results from all sort of select queries
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
/** /**
* *
*/ */
require_once './libraries/Table.class.php';
require_once './libraries/Index.class.php'; require_once './libraries/Index.class.php';
/** /**
@@ -1286,47 +1284,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$vertical_display['data'][$row_no][$i] = ' <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n"; $vertical_display['data'][$row_no][$i] = ' <td align="right"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} else { } else {
// for blobstreaming // for blobstreaming
$bs_reference_exists = $allBSTablesExist = FALSE;
// load PMA configuration
$PMA_Config = $GLOBALS['PMA_Config'];
// if PMA configuration exists
if ($PMA_Config) {
// load BS variables
$pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
// if BS plugins exist
if ($pluginsExist) {
// load BS databases
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
// if BS db array and specified db string not empty and valid
if (!empty($bs_tables) && strlen($db) > 0) {
$bs_tables = $bs_tables[$db];
if (isset($bs_tables)) {
$allBSTablesExist = TRUE;
// check if BS tables exist for given database
foreach ($bs_tables as $table_key=>$bs_tbl)
if (!$bs_tables[$table_key]['Exists']) {
$allBSTablesExist = FALSE;
break;
}
}
}
}
}
// if necessary BS tables exist
if ($allBSTablesExist) {
$bs_reference_exists = PMA_BS_ReferenceExists($row[$i], $db);
}
// if valid BS reference exists // if valid BS reference exists
if ($bs_reference_exists) { if (PMA_BS_IsPBMSReference($row[$i], $db)) {
$blobtext = PMA_BS_CreateReferenceLink($row[$i], $db); $blobtext = PMA_BS_CreateReferenceLink($row[$i], $db);
} else { } else {
$blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta, $_url_params); $blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta, $_url_params);
@@ -1379,9 +1338,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// user asked to see the real contents of BINARY // user asked to see the real contents of BINARY
// fields // fields
if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && PMA_contains_nonprintable_ascii($row[$i])) { if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && PMA_contains_nonprintable_ascii($row[$i])) {
$row[$i] = bin2hex($row[$i]); $row[$i] = bin2hex($row[$i]);
} } else {
else {
$row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i])); $row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i]));
} }
} else { } else {
@@ -1735,7 +1693,7 @@ function PMA_displayTable_checkConfigParams()
} else { } else {
// display_binary_as_hex config option // display_binary_as_hex config option
if (isset($GLOBALS['cfg']['DisplayBinaryAsHex']) && true === $GLOBALS['cfg']['DisplayBinaryAsHex']) { if (isset($GLOBALS['cfg']['DisplayBinaryAsHex']) && true === $GLOBALS['cfg']['DisplayBinaryAsHex']) {
$_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary_as_hex'] = true; $_SESSION['tmp_user_values']['query'][$sql_md5]['display_binary_as_hex'] = true;
} }
} }
@@ -2315,7 +2273,6 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
* @uses PMA_DBI_try_query() * @uses PMA_DBI_try_query()
* @uses PMA_DBI_num_rows() * @uses PMA_DBI_num_rows()
* @uses PMA_DBI_fetch_row() * @uses PMA_DBI_fetch_row()
* @uses __('Link not found')
* @uses PMA_DBI_free_result() * @uses PMA_DBI_free_result()
* @uses $GLOBALS['printview'] * @uses $GLOBALS['printview']
* @uses htmlspecialchars() * @uses htmlspecialchars()

View File

@@ -7,7 +7,6 @@
* - reversed the right modify links: 1. drop, 2. edit, 3. checkbox * - reversed the right modify links: 1. drop, 2. edit, 3. checkbox
* - also changes made in js/functions.js * - also changes made in js/functions.js
* *
* @version $Id$
* @package phpMyAdmin * @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* *
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */
@@ -12,13 +11,6 @@
class PMA_StorageEngine_innodb extends PMA_StorageEngine class PMA_StorageEngine_innodb extends PMA_StorageEngine
{ {
/** /**
* @uses __('Data home directory')
* @uses __('The common part of the directory path for all InnoDB data files.')
* @uses __('Data files')
* @uses __('Autoextend increment')
* @uses __(' The increment size for extending the size of an autoextending tablespace when it becomes full.')
* @uses __('Buffer pool size')
* @uses __('The size of the memory buffer InnoDB uses to cache data and indexes of its tables.')
* @uses PMA_ENGINE_DETAILS_TYPE_NUMERIC * @uses PMA_ENGINE_DETAILS_TYPE_NUMERIC
* @uses PMA_ENGINE_DETAILS_TYPE_SIZE * @uses PMA_ENGINE_DETAILS_TYPE_SIZE
* @return array * @return array
@@ -131,8 +123,6 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine
/** /**
* @uses $this->support * @uses $this->support
* @uses PMA_ENGINE_SUPPORT_YES * @uses PMA_ENGINE_SUPPORT_YES
* @uses __('Buffer Pool')
* @uses __('InnoDB Status')
* @return array detail pages * @return array detail pages
*/ */
function getInfoPages() function getInfoPages()
@@ -152,22 +142,6 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine
* @uses PMA_DBI_fetch_result() * @uses PMA_DBI_fetch_result()
* @uses PMA_formatNumber() * @uses PMA_formatNumber()
* @uses PMA_formatByteDown() * @uses PMA_formatByteDown()
* @uses __('Buffer Pool Usage')
* @uses __('Total')
* @uses __('pages')
* @uses __('Free pages')
* @uses __('Dirty pages')
* @uses __('Pages containing data')
* @uses __('Pages to be flushed')
* @uses __('Busy pages')
* @uses __('Latched pages')
* @uses __('Buffer Pool Activity')
* @uses __('Read requests')
* @uses __('Write requests')
* @uses __('Read misses')
* @uses __('Write waits')
* @uses __('Read misses in %')
* @uses __('Write waits in %')
* @uses join() * @uses join()
* @uses htmlspecialchars() * @uses htmlspecialchars()
* @uses PMA_formatNumber() * @uses PMA_formatNumber()
@@ -305,7 +279,7 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine
function getPageStatus() function getPageStatus()
{ {
return '<pre id="pre_innodb_status">' . "\n" return '<pre id="pre_innodb_status">' . "\n"
. htmlspecialchars(PMA_DBI_fetch_value('SHOW INNODB STATUS;')) . "\n" . htmlspecialchars(PMA_DBI_fetch_value('SHOW INNODB STATUS;', 0, 'Status')) . "\n"
. '</pre>' . "\n"; . '</pre>' . "\n";
} }

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */

View File

@@ -0,0 +1,113 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @version $Id$
* @package phpMyAdmin-Engines
*/
/**
* the PBMS daemon
* @package phpMyAdmin-Engines
*/
class PMA_StorageEngine_pbms extends PMA_StorageEngine
{
/**
* returns array with variable names dedicated to PBMS daemon
*
* @return array variable names
*/
function engine_init()
{
$this->engine = "PBMS";
$this->title = "PrimeBase Media Streaming Daemon";
$this->comment = "Provides BLOB streaming service for storage engines,";
$this->support = PMA_ENGINE_SUPPORT_YES;
}
function getVariables()
{
return array(
'pbms_garbage_threshold' => array(
'title' => __('Garbage Threshold'),
'desc' => __('The percentage of garbage in a repository file before it is compacted.'),
'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
),
'pbms_port' => array(
'title' => __('Port'),
'desc' => __('The port for the PBMS stream-based communications. Setting this value to 0 will disable HTTP communication with the daemon.'),
'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
),
'pbms_repository_threshold' => array(
'title' => __('Repository Threshold'),
'desc' => __('The maximum size of a BLOB repository file. You may use Kb, MB or GB to indicate the unit of the value. A value in bytes is assumed when no unit is specified.'),
'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
),
'pbms_temp_blob_timeout' => array(
'title' => __('Temp Blob Timeout'),
'desc' => __('The timeout, in seconds, for temporary BLOBs. Uploaded BLOB data is removed after this time, unless they are referenced by a record in the database.'),
'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
),
'pbms_temp_log_threshold' => array(
'title' => __('Temp Log Threshold'),
'desc' => __('The maximum size of a temporary BLOB log file. You may use Kb, MB or GB to indicate the unit of the value. A value in bytes is assumed when no unit is specified.'),
'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
),
'pbms_max_keep_alive' => array(
'title' => __('Max Keep Alive'),
'desc' => __('The timeout for inactive connection with the keep-alive flag set. After this time the connection will be closed. The time-out is in milliseconds (1/1000).'),
'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
),
'pbms_http_metadata_headers' => array(
'title' => __('Metadata Headers'),
'desc' => __('A ":" delimited list of metadata headers to be used to initialize the pbms_metadata_header table when a database is created.'),
'type' => PMA_ENGINE_DETAILS_TYPE_PLAINTEXT
),
);
}
//--------------------
function getInfoPages()
{
$pages = array();
$pages['Documentation'] = __('Documentation');
return $pages;
}
//--------------------
function getPage($id)
{
if (! array_key_exists($id, $this->getInfoPages())) {
return false;
}
$id = 'getPage' . $id;
return $this->$id();
}
function getPageConfigure()
{
}
function getPageDocumentation()
{
$output = '<p> Documentation and further information about PBMS can be found on ' . "\n"
. '<a href="http://www.blobstreaming.org/" target="_blank">The PrimeBase Media Streaming home page</a>.<br><br>' . "\n"
. '<table id="PBMS_Related_Links" >' . "\n"
. '<tr>' . "\n"
. '<td>' . "\n"
. '<p>' . "\n"
. '<strong><font size="2"><b>Related Links</b></font></strong>' . "\n"
. '<br>' . "\n"
. '<a href="http://bpbdev.blogspot.com/" target="_blank">The PrimeBase Media Streaming Blog by Barry Leslie</a><br><br>' . "\n"
. '<a href="http://www.primebase.com/xt" target="_blank">PrimeBase XT Home Page</a><br><br>' . "\n"
. '</font>' . "\n"
. '</td>' . "\n"
. '</tr>' . "\n"
. '</table>' . "\n";
return $output;
}
}
?>

View File

@@ -1,7 +1,6 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$
* @package phpMyAdmin-Engines * @package phpMyAdmin-Engines
*/ */
@@ -99,6 +98,46 @@ class PMA_StorageEngine_pbxt extends PMA_StorageEngine
} }
return PMA_formatByteDown($value); return PMA_formatByteDown($value);
} }
//--------------------
function getInfoPages()
{
$pages = array();
$pages['Documentation'] = __('Documentation');
return $pages;
}
//--------------------
function getPage($id)
{
if (! array_key_exists($id, $this->getInfoPages())) {
return false;
}
$id = 'getPage' . $id;
return $this->$id();
}
function getPageDocumentation()
{
$output = '<p> Documentation and further information about PBXT can be found on the ' . "\n"
. '<a href="http://www.primebase.com/xt/" target="_blank">PrimeBase XT Home Page</a>.<br><br>' . "\n"
. '<table id="PBMS_Related_Links" >' . "\n"
. '<tr>' . "\n"
. '<td>' . "\n"
. '<p>' . "\n"
. '<strong><font size="2"><b>Related Links</b></font></strong>' . "\n"
. '<br>' . "\n"
. '<a href="http://pbxt.blogspot.com/" target="_blank">The PrimeBase XT Blog by Paul McCullagh</a><br><br>' . "\n"
. '<a href="http://www.blobstreaming.org/" target="_blank">The PrimeBase Media Streaming (PBMS) home page</a>.<br><br>' . "\n"
. '</font>' . "\n"
. '</td>' . "\n"
. '</tr>' . "\n"
. '</table>' . "\n";
return $output;
}
} }
?> ?>

View File

@@ -4,7 +4,6 @@
* Set of functions used to build NHibernate dumps of tables * Set of functions used to build NHibernate dumps of tables
* *
* @package phpMyAdmin-Export-Codegen * @package phpMyAdmin-Export-Codegen
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -2,7 +2,6 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @package phpMyAdmin-Export-CSV * @package phpMyAdmin-Export-CSV
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -70,7 +69,18 @@ function PMA_exportHeader() {
// Here we just prepare some values for export // Here we just prepare some values for export
if ($what == 'excel') { if ($what == 'excel') {
$csv_terminated = "\015\012"; $csv_terminated = "\015\012";
$csv_separator = isset($GLOBALS['excel_edition']) && $GLOBALS['excel_edition'] == 'mac_excel2003' ? ';' : ','; switch($GLOBALS['excel_edition']) {
case 'win':
// as tested on Windows with Excel 2002 and Excel 2007
$csv_separator = ';';
break;
case 'mac_excel2003':
$csv_separator = ';';
break;
case 'mac_excel2008':
$csv_separator = ',';
break;
}
$csv_enclosed = '"'; $csv_enclosed = '"';
$csv_escaped = '"'; $csv_escaped = '"';
if (isset($GLOBALS['excel_columns'])) { if (isset($GLOBALS['excel_columns'])) {

View File

@@ -4,7 +4,6 @@
* Set of functions used to build CSV dumps of tables * Set of functions used to build CSV dumps of tables
* *
* @package phpMyAdmin-Export-CSV * @package phpMyAdmin-Export-CSV
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build CSV dumps of tables * Set of functions used to build CSV dumps of tables
* *
* @package phpMyAdmin-Export-HTMLWord * @package phpMyAdmin-Export-HTMLWord
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,12 +4,16 @@
* Set of functions used to build dumps of tables * Set of functions used to build dumps of tables
* *
* @package phpMyAdmin-Export-Latex * @package phpMyAdmin-Export-Latex
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
} }
/* Messages used in default captions */
$GLOBALS['strLatexContent'] = __('Content of table @TABLE@');
$GLOBALS['strLatexContinued'] = __('(continued)');
$GLOBALS['strLatexStructure'] = __('Structure of table @TABLE@');
/** /**
* *
*/ */
@@ -32,11 +36,11 @@ if (isset($plugin_list)) {
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data'); array('type' => 'bgroup', 'name' => 'structure', 'text' => __('Structure'), 'force' => 'data');
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption')); array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption')); array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key')); array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'), 'doc' => 'faq6_27');
if (!empty($GLOBALS['cfgRelation']['relation'])) { if (!empty($GLOBALS['cfgRelation']['relation'])) {
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations')); array('type' => 'bool', 'name' => 'relation', 'text' => __('Relations'));
@@ -56,11 +60,11 @@ if (isset($plugin_list)) {
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')); array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row'));
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption')); array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption')); array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Continued table caption'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key')); array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'), 'doc' => 'faq6_27');
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')); array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by'));
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
@@ -77,12 +81,12 @@ if (isset($plugin_list)) {
* @access private * @access private
*/ */
function PMA_texEscape($string) { function PMA_texEscape($string) {
$escape = array('$', '%', '{', '}', '&', '#', '_', '^'); $escape = array('$', '%', '{', '}', '&', '#', '_', '^');
$cnt_escape = count($escape); $cnt_escape = count($escape);
for ($k=0; $k < $cnt_escape; $k++) { for ($k=0; $k < $cnt_escape; $k++) {
$string = str_replace($escape[$k], '\\' . $escape[$k], $string); $string = str_replace($escape[$k], '\\' . $escape[$k], $string);
} }
return $string; return $string;
} }
/** /**
@@ -208,8 +212,8 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
$buffer .= ' \\hline \\endhead \\hline \\endfoot \\hline ' . $crlf; $buffer .= ' \\hline \\endhead \\hline \\endfoot \\hline ' . $crlf;
if (isset($GLOBALS['latex_caption'])) { if (isset($GLOBALS['latex_caption'])) {
$buffer .= ' \\caption{' . str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_data_caption']) $buffer .= ' \\caption{' . PMA_expandUserString($GLOBALS['latex_data_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db))
. '} \\label{' . str_replace('__TABLE__', $table, $GLOBALS['latex_data_label']) . '} \\\\'; . '} \\label{' . PMA_expandUserString($GLOBALS['latex_data_label'], NULL, array('table' => $table, 'database' => $db)) . '} \\\\';
} }
if (!PMA_exportOutputHandler($buffer)) { if (!PMA_exportOutputHandler($buffer)) {
return FALSE; return FALSE;
@@ -227,7 +231,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
return FALSE; return FALSE;
} }
if (isset($GLOBALS['latex_caption'])) { if (isset($GLOBALS['latex_caption'])) {
if (!PMA_exportOutputHandler('\\caption{' . str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_data_continued_caption']) . '} \\\\ ')) return FALSE; if (!PMA_exportOutputHandler('\\caption{' . PMA_expandUserString($GLOBALS['latex_data_continued_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db)) . '} \\\\ ')) return FALSE;
} }
if (!PMA_exportOutputHandler($buffer . '\\endhead \\endfoot' . $crlf)) { if (!PMA_exportOutputHandler($buffer . '\\endhead \\endfoot' . $crlf)) {
return FALSE; return FALSE;
@@ -290,7 +294,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
* *
* @access public * @access public
*/ */
// @@@ Table structure // @@@ Table structure
function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = false, $do_comments = false, $do_mime = false, $dates = false, $dummy) function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = false, $do_comments = false, $do_mime = false, $dates = false, $dummy)
{ {
global $cfgRelation; global $cfgRelation;
@@ -374,14 +378,14 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
// Table caption for first page and label // Table caption for first page and label
if (isset($GLOBALS['latex_caption'])) { if (isset($GLOBALS['latex_caption'])) {
$buffer .= ' \\caption{'. str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_structure_caption']) $buffer .= ' \\caption{'. PMA_expandUserString($GLOBALS['latex_structure_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db))
. '} \\label{' . str_replace('__TABLE__', $table, $GLOBALS['latex_structure_label']) . '} \\label{' . PMA_expandUserString($GLOBALS['latex_structure_label'], NULL, array('table' => $table, 'database' => $db))
. '} \\\\' . $crlf; . '} \\\\' . $crlf;
} }
$buffer .= $header . ' \\\\ \\hline \\hline' . $crlf . '\\endfirsthead' . $crlf; $buffer .= $header . ' \\\\ \\hline \\hline' . $crlf . '\\endfirsthead' . $crlf;
// Table caption on next pages // Table caption on next pages
if (isset($GLOBALS['latex_caption'])) { if (isset($GLOBALS['latex_caption'])) {
$buffer .= ' \\caption{'. str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_structure_continued_caption']) $buffer .= ' \\caption{'. PMA_expandUserString($GLOBALS['latex_structure_continued_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db))
. '} \\\\ ' . $crlf; . '} \\\\ ' . $crlf;
} }
$buffer .= $header . ' \\\\ \\hline \\hline \\endhead \\endfoot ' . $crlf; $buffer .= $header . ' \\\\ \\hline \\hline \\endhead \\endfoot ' . $crlf;
@@ -426,8 +430,8 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
$field_name = $row['Field']; $field_name = $row['Field'];
$local_buffer = $field_name . "\000" . $type . "\000" $local_buffer = $field_name . "\000" . $type . "\000"
. (($row['Null'] == '' || $row['Null'] == 'NO') ? __('No') : __('Yes')) . (($row['Null'] == '' || $row['Null'] == 'NO') ? __('No') : __('Yes'))
. "\000" . (isset($row['Default']) ? $row['Default'] : ''); . "\000" . (isset($row['Default']) ? $row['Default'] : '');
if ($do_relation && $have_rel) { if ($do_relation && $have_rel) {

View File

@@ -4,7 +4,6 @@
* Set of functions used to build OpenDocument Spreadsheet dumps of tables * Set of functions used to build OpenDocument Spreadsheet dumps of tables
* *
* @package phpMyAdmin-Export-ODS * @package phpMyAdmin-Export-ODS
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build OpenDocument Text dumps of tables * Set of functions used to build OpenDocument Text dumps of tables
* *
* @package phpMyAdmin-Export-ODT * @package phpMyAdmin-Export-ODT
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,7 +4,6 @@
* Produce a PDF report (export) from a query * Produce a PDF report (export) from a query
* *
* @package phpMyAdmin-Export-PDF * @package phpMyAdmin-Export-PDF
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,7 +4,6 @@
* Set of functions used to build SQL dumps of tables * Set of functions used to build SQL dumps of tables
* *
* @package phpMyAdmin-Export-SQL * @package phpMyAdmin-Export-SQL
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -187,7 +186,6 @@ function PMA_exportFooter()
} }
// restore connection settings // restore connection settings
// (not set if $cfg['AllowAnywhereRecoding'] is false)
$charset_of_file = isset($GLOBALS['charset_of_file']) ? $GLOBALS['charset_of_file'] : ''; $charset_of_file = isset($GLOBALS['charset_of_file']) ? $GLOBALS['charset_of_file'] : '';
if (!empty($GLOBALS['asfile']) && isset($mysql_charset_map[$charset_of_file])) { if (!empty($GLOBALS['asfile']) && isset($mysql_charset_map[$charset_of_file])) {
$foot .= $crlf $foot .= $crlf
@@ -276,8 +274,7 @@ function PMA_exportHeader()
// so that a utility like the mysql client can interpret // so that a utility like the mysql client can interpret
// the file correctly // the file correctly
if (isset($GLOBALS['charset_of_file']) && isset($mysql_charset_map[$GLOBALS['charset_of_file']])) { if (isset($GLOBALS['charset_of_file']) && isset($mysql_charset_map[$GLOBALS['charset_of_file']])) {
// $cfg['AllowAnywhereRecoding'] was true so we got a charset from // we got a charset from the export dialog
// the export dialog
$set_names = $mysql_charset_map[$GLOBALS['charset_of_file']]; $set_names = $mysql_charset_map[$GLOBALS['charset_of_file']];
} else { } else {
// by default we use the connection charset // by default we use the connection charset
@@ -535,7 +532,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false, $a
$schema_create .= 'DROP TABLE IF EXISTS ' . PMA_backquote($table, $sql_backquotes) . ';' . $crlf; $schema_create .= 'DROP TABLE IF EXISTS ' . PMA_backquote($table, $sql_backquotes) . ';' . $crlf;
} }
// Steve Alberty's patch for complete table dump, // Complete table dump,
// Whether to quote table and fields names or not // Whether to quote table and fields names or not
if ($sql_backquotes) { if ($sql_backquotes) {
PMA_DBI_query('SET SQL_QUOTE_SHOW_CREATE = 1'); PMA_DBI_query('SET SQL_QUOTE_SHOW_CREATE = 1');

View File

@@ -4,7 +4,6 @@
* *
* *
* @package phpMyAdmin-Export-XLS * @package phpMyAdmin-Export-XLS
* @version $Id$
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

Some files were not shown because too many files have changed in this diff Show More