Remove logic code in declaration files.
Move declaration out of logic file. Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
This commit is contained in:
parent
560b321d0c
commit
dffc8c34e9
@ -3,12 +3,7 @@
|
||||
<!-- http://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php -->
|
||||
<description>phpMyAdmin custom coding standard</description>
|
||||
|
||||
<rule ref="PEAR">
|
||||
<exclude name="PEAR.Commenting.FileComment" />
|
||||
<exclude name="PEAR.Commenting.ClassComment" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment" />
|
||||
<exclude name="Generic.Commenting.DocComment" />
|
||||
</rule>
|
||||
<rule ref="PSR1" />
|
||||
<rule ref="Generic.Metrics.NestingLevel" />
|
||||
<!-- There MUST NOT be trailing whitespace at the end of lines. -->
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
|
||||
|
||||
@ -7,10 +7,6 @@
|
||||
*/
|
||||
namespace PMA\libraries;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to handle database QBE search
|
||||
*
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats interval like 10 per hour
|
||||
|
||||
@ -6,10 +6,6 @@
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the bookmark parameters for the current user
|
||||
*
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get html for one relational key
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* HTML generator for database listing
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the $column_order array
|
||||
|
||||
@ -8,10 +8,6 @@
|
||||
use PMA\libraries\Message;
|
||||
use PMA\libraries\Util;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the central_columns parameters for the current user
|
||||
*
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all variables from request except whitelisted ones.
|
||||
|
||||
@ -5,13 +5,8 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
use PMA\libraries\Table;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the radio button field_key into 4 arrays
|
||||
*
|
||||
|
||||
@ -7,10 +7,6 @@
|
||||
*/
|
||||
use PMA\libraries\Message;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML for the Change password dialog
|
||||
*
|
||||
|
||||
@ -10,10 +10,6 @@ use PMA\libraries\Message;
|
||||
use PMA\libraries\plugins\ExportPlugin;
|
||||
use PMA\libraries\Table;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs appropriate checked statement for checkbox.
|
||||
*
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints details about the current Git commit revision
|
||||
|
||||
@ -8,14 +8,9 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
use PMA\libraries\Message;
|
||||
use PMA\libraries\plugins\ImportPlugin;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints Html For Display Import Hidden Input
|
||||
*
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares the names of two languages.
|
||||
|
||||
@ -6,16 +6,11 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
use PMA\libraries\Message;
|
||||
use PMA\libraries\plugins\ExportPlugin;
|
||||
use PMA\libraries\Table;
|
||||
use PMA\libraries\ZipFile;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a session variable upon a possible fatal error during export
|
||||
*
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array of filtered file names
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* set of functions for structure section in pma
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (!defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML for display indexes
|
||||
|
||||
@ -5,14 +5,9 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
use PMA\libraries\Message;
|
||||
use PMA\libraries\plugins\TransformationsPlugin;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve form parameters for insert/edit form
|
||||
*
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the "true" IP address of the current user
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
* @package PhpMyAdmin
|
||||
*
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a string so it can be a string inside JavaScript code inside an
|
||||
|
||||
@ -7,9 +7,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user information to webserver logs.
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
* @package PhpMyAdmin
|
||||
* @todo Maybe we could try to use fileinfo module if loaded
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to detect MIME type of content.
|
||||
|
||||
@ -7,9 +7,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets url params
|
||||
|
||||
@ -7,10 +7,6 @@
|
||||
*/
|
||||
use PMA\libraries\Util;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate charset dropdown box
|
||||
*
|
||||
|
||||
@ -1,19 +1,13 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* set of functions used for normalization
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
use PMA\libraries\Message;
|
||||
use PMA\libraries\Util;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* build the html for columns of $colTypeCategory category
|
||||
* in form of given $listType in a table
|
||||
|
||||
@ -16,10 +16,6 @@ use PMA\libraries\StorageEngine;
|
||||
use PMA\libraries\Table;
|
||||
use PMA\libraries\Util;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML output for database comment
|
||||
*
|
||||
|
||||
@ -10,10 +10,6 @@ use PMA\libraries\Table;
|
||||
use PMA\libraries\RecentFavoriteTable;
|
||||
use SqlParser\Statements\CreateStatement;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a query as controluser if possible, otherwise as normal user
|
||||
*
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup column related relation stuff
|
||||
|
||||
@ -7,10 +7,6 @@
|
||||
*/
|
||||
use PMA\libraries\Message;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns HTML for error message
|
||||
*
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether given link is valid
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns language name
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the server selection in list or selectbox form, or option tags only
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* functions for displaying server binary log
|
||||
*
|
||||
@ -11,10 +10,6 @@
|
||||
use PMA\libraries\Message;
|
||||
use PMA\libraries\Util;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the html for log selector.
|
||||
*
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the html for server Character Sets and Collations.
|
||||
|
||||
@ -5,9 +5,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the html for the sub-page heading
|
||||
|
||||
@ -10,10 +10,6 @@
|
||||
*/
|
||||
use PMA\libraries\Message;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the html for Database List
|
||||
*
|
||||
|
||||
@ -10,10 +10,6 @@
|
||||
*/
|
||||
use PMA\libraries\StorageEngine;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* setup HTML for server Engines information
|
||||
*
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the common SQL used to retrieve plugin data
|
||||
|
||||
@ -5,16 +5,11 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
use PMA\libraries\DatabaseInterface;
|
||||
use PMA\libraries\Message;
|
||||
use PMA\libraries\Template;
|
||||
use PMA\libraries\Util;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Html for User Group Dialog
|
||||
*
|
||||
|
||||
@ -10,10 +10,6 @@
|
||||
*/
|
||||
use PMA\libraries\ServerStatusData;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints server status information: processes, connections and traffic
|
||||
*
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns html with PMA\libraries\Advisor
|
||||
|
||||
@ -11,10 +11,6 @@
|
||||
use PMA\libraries\ServerStatusData;
|
||||
use PMA\libraries\Util;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints html with monitor
|
||||
*
|
||||
|
||||
@ -12,10 +12,6 @@ use PMA\libraries\Message;
|
||||
use PMA\libraries\ServerStatusData;
|
||||
use PMA\libraries\Util;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints html for auto refreshing processes list
|
||||
*
|
||||
|
||||
@ -10,10 +10,6 @@
|
||||
*/
|
||||
use PMA\libraries\ServerStatusData;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the html content for the query statistics
|
||||
*
|
||||
|
||||
@ -10,10 +10,6 @@
|
||||
*/
|
||||
use PMA\libraries\ServerStatusData;
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the html for the list filter
|
||||
*
|
||||
|
||||
@ -6,10 +6,6 @@
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return HTML to list the users belonging to a given user group
|
||||
*
|
||||
|
||||
@ -6,10 +6,6 @@
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML for secondary level menu tabs on 'Users' page
|
||||
*
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Ajax return when $_REQUEST['type'] === 'getval'
|
||||
|
||||
@ -114,21 +114,4 @@ if (! isset($_SESSION[' PMA_token '])) {
|
||||
$_SESSION[' PMA_token '] = md5(uniqid(rand(), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* tries to secure session from hijacking and fixation
|
||||
* should be called before login and after successful login
|
||||
* (only required if sensitive information stored in session)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function PMA_secureSession()
|
||||
{
|
||||
// prevent session fixation and XSS
|
||||
// (better to use session_status() if available)
|
||||
if ((PMA_PHP_INT_VERSION >= 50400 && session_status() === PHP_SESSION_ACTIVE)
|
||||
|| (PMA_PHP_INT_VERSION < 50400 && session_id() !== '')
|
||||
) {
|
||||
session_regenerate_id(true);
|
||||
}
|
||||
$_SESSION[' PMA_token '] = md5(uniqid(rand(), true));
|
||||
}
|
||||
require_once 'libraries/session.lib.php';
|
||||
26
libraries/session.lib.php
Normal file
26
libraries/session.lib.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* session library
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
/**
|
||||
* tries to secure session from hijacking and fixation
|
||||
* should be called before login and after successful login
|
||||
* (only required if sensitive information stored in session)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function PMA_secureSession()
|
||||
{
|
||||
// prevent session fixation and XSS
|
||||
// (better to use session_status() if available)
|
||||
if ((PMA_PHP_INT_VERSION >= 50400 && session_status() === PHP_SESSION_ACTIVE)
|
||||
|| (PMA_PHP_INT_VERSION < 50400 && session_id() !== '')
|
||||
) {
|
||||
session_regenerate_id(true);
|
||||
}
|
||||
$_SESSION[' PMA_token '] = md5(uniqid(rand(), true));
|
||||
}
|
||||
@ -10,10 +10,6 @@ use PMA\libraries\Message;
|
||||
use PMA\libraries\Table;
|
||||
use PMA\libraries\Response;
|
||||
|
||||
if (!defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses and analyzes the given SQL query.
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user