Commit Graph

261 Commits

Author SHA1 Message Date
Kamil Tekiela
51f4017b32
Refactor destroy controller (#17194)
* Remove redundant conditions

They were always true. First, the variable is set to -1.
If the variable is -1, then set it to Message.
If the variable is Message then set the JSON array. All of this is
redundant.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* $sqlQuery is not used anywhere

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Enforce $selected to be an array

I can't remove it as it is a global. Previously, it was set to a POST
variable. Since we validate that the variable is set and is not null,
we can use the value from $params. If we validate that it's also an
array we can replace for loop with foreach.
There is no passing by reference, so this change should be safe.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Replace $rebuildDatabaseList with input validation

The validation message says 'No databases selected.' so I assume that
we should check that we actually got at least one entry in the list.
If that is true, then the $rebuildDatabaseList is not needed and the
condition redundant.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* drop_selected_dbs is always set and is redundant

I am not sure if this is necessary. The AJAX request sends a value of "1"
but the code doesn't really do anything with it other than checking if
it is actually set. Is there some other path possible?

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Flatten the array with a single element

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant isset

The variable is set, so !isset === is_null. Why check for null if we can
check just for !is_array.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Update psalm-baseline.xml

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Adhere to the coding standard

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-19 14:26:04 -03:00
Maurício Meneghini Fauth
b2a51c4d84
Create the RelationParameters value object
Replaces the $cfgRelation array with the RelationParameters value
object.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-14 18:22:36 -03:00
Maurício Meneghini Fauth
3e0856c77b
Remove useless string concatenations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-27 21:40:22 -03:00
Maurício Meneghini Fauth
7955f7d96d
Replace pow function with the ** operator
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-27 19:12:11 -03:00
Maurício Meneghini Fauth
f00d70cccb
Remove useless whitespaces
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-15 17:05:40 -03:00
Maurício Meneghini Fauth
3531775b7c
Add type declarations to the controllers contructors
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-11 17:32:22 -03:00
Maurício Meneghini Fauth
83091680cc
Extract actions from controllers to new controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-10 17:55:05 -03:00
Maurício Meneghini Fauth
38fda677bd
Extract Processes class from ProcessesController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-10 15:52:48 -03:00
Maurício Meneghini Fauth
94e714a49b
Extract the Server\ShowEngineController class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-09 17:58:00 -03:00
Maurício Meneghini Fauth
e3554879ef
Extract actions from controllers to new controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-07 21:19:43 -03:00
Maurício Meneghini Fauth
8f2f3eff40
Remove the Core::isValid method
This improves the type checking and simplifies the code.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-02 13:20:50 -03:00
Maurício Meneghini Fauth
a2ed4dfe68
Make controllers callable
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-30 13:16:29 -03:00
Maurício Meneghini Fauth
86798ec45e
Refactor PhpMyAdmin\Plugins::getChoice method
Extracts the getDefault method from the getChoice method and adds a
getName method to the Plugin interface.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-27 13:38:01 -03:00
Maurício Meneghini Fauth
84d175b282
Extract HTML from Plugins::getChoice method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-25 15:29:43 -03:00
Maurício Meneghini Fauth
7a4536d4d6
Remove PhpMyAdmin\Twig\PluginsExtension class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-25 11:00:21 -03:00
Maurício Meneghini Fauth
f7fc4177af
Add support for account locking
- https://dev.mysql.com/doc/refman/en/account-locking.html
- https://mariadb.com/kb/en/account-locking/

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-21 00:55:33 -03:00
Maurício Meneghini Fauth
04d3c83559
Fix some errors found by PHPStan/Psalm
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-05 16:09:08 -03:00
William Desportes
8aa4e30512
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-29 03:16:09 +02:00
William Desportes
4b9a9628f3
Merge #17045 - Fix #11834 - Fixing the issues regarding granting/showing priv from priv tab
Pull-request: #17045
Fixes: #11834

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-29 02:52:09 +02:00
Fawzi E. Abdulfattah
3f985e2124 Fixing the issues regarding granting and showing the privileges from the privileges tab
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
2021-07-28 17:26:01 +02:00
Fawzi E. Abdulfattah
84e9b611a6 fixing the links when granting privileges on tables or routines
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
2021-07-28 03:42:02 +02:00
William Desportes
c5a1dd2ec7
Merge #16925 - Replace Export privileges group dialog with a modal
Pull-request: #16925

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-27 03:26:32 +02:00
William Desportes
9373c8ec70
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-22 14:51:35 +02:00
William Desportes
d281dcc0bd
Fix #17026 - Handle possible invalid boolean values injected in SaveDir or UploadDir
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-22 12:59:54 +02:00
William Desportes
ab2e5358f7
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-21 18:49:19 +02:00
Fawzi E. Abdulfattah
68981b78d7 Fixing all the issues related to assigning privileges
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
2021-07-17 02:49:07 +02:00
William Desportes
c830c1e93a
Merge branch 'origin/QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-15 02:34:29 +02:00
William Desportes
f490ee8867
Fix a coding standard mistake
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-15 00:49:21 +02:00
William Desportes
8500a6c5a1
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-13 22:43:26 +02:00
William Desportes
7c17889d78
Ref #17010 - Fix #16994 - Be sure to always pass a string value
Pull-request: #17010
Ref: #16994

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-13 22:29:47 +02:00
Fawzi E. Abdulfattah
5005c38d9d Fixing the issue when assigning database to user with '_'
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
2021-07-13 21:25:15 +02:00
Maurício Meneghini Fauth
1835ebb4fc
Replace mb_strpos !== false with str_contains
See: https://wiki.php.net/rfc/str_contains#case-insensitivity_and_multibyte_strings

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-10 13:43:40 -03:00
Maurício Meneghini Fauth
6ae07c96fb
Replace strpos !== false with str_contains
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-09 22:30:42 -03:00
Maurício Meneghini Fauth
e8c28d1883
Remove some globals from Config::enableBc method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-08 19:49:26 -03:00
Maurício Meneghini Fauth
1a2d7804d2
Add ServerRequest::getParsedBodyParam method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-06 12:24:02 -03:00
Maurício Meneghini Fauth
d2eeebef34
Add getParam and isPost methods to ServerRequest
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-05 13:38:17 -03:00
Maurício Meneghini Fauth
27a5792976
Add PhpMyAdmin\Http\ServerRequest class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-04 15:48:23 -03:00
Maurício Meneghini Fauth
6f894e7ea7
Add support for PSR-7 request objects in controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-03 18:54:42 -03:00
Maurício Meneghini Fauth
9adaa912e1
Rename Response class to ResponseRenderer
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-06-30 12:35:22 -03:00
Guileas
135b116f2f
Replace zxcvbn by zxcvbn-ts
Signed-off-by: Gwénola ETHEVE <git@etheve.eu>

Update package.json

Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-06-23 23:49:24 +02:00
Maurício Meneghini Fauth
1c084de30b
Fix coding standard errors
Related to 62f142c9fa.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-06-03 16:50:33 -03:00
Saksham Gupta
25005d30e8 Replace Export privileges group dialog with a modal
Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Add functionality for table and database

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Add line

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Code fix

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Code fix 2

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Convert export priviliege user specific

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Cleanup reused code

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix lint

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Add parameter types

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Remove $ from $msgbox variable

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Comment fix

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Remove redundant functions

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Remove else condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix race condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix race condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
2021-06-01 19:52:13 +05:30
Maurício Meneghini Fauth
674bf8f97c
Remove db, table and dbi globals from Tracking class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-05-26 16:40:05 -03:00
Maurício Meneghini Fauth
cd1b8a9b77
Fix some errors found by PHPStan and Psalm
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-05-22 15:14:24 -03:00
Maurício Meneghini Fauth
5750dfb1bb
Extract method to get edit user group modal form
Creates a new route: /server/user-groups/edit-form

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-04-26 22:59:09 -03:00
Maurício Meneghini Fauth
8d0c2a339c
Move both operands of an assignment to the same line
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-04-20 22:35:21 -03:00
William Desportes
b92476b0cd
Extract some logic out of ProcessesController::getList() into a function
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-04-20 22:37:00 +02:00
William Desportes
8fbb01a684
Merge branch 'origin/QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-04-19 21:51:45 +02:00
William Desportes
f741d7b6c1
Merge #16809 - Fix #16404 - Password generation fix after new user creation failure
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-04-19 21:11:55 +02:00
Maurício Meneghini Fauth
90778eecf7
Upgrade phpmyadmin/coding-standard to 3.0.0
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-04-19 02:20:46 -03:00