Skip to content

Commit

Permalink
Merge pull request #18014 from MauricioFauth/connection-dbal
Browse files Browse the repository at this point in the history
Create Dbal\Connection class
  • Loading branch information
MauricioFauth committed Jan 16, 2023
2 parents 591bc50 + a6bdf8a commit e2bda4f
Show file tree
Hide file tree
Showing 12 changed files with 288 additions and 491 deletions.
11 changes: 5 additions & 6 deletions libraries/classes/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,19 +609,18 @@ private static function connectToDatabaseServer(DatabaseInterface $dbi, Authenti
* Try to connect MySQL with the control user profile (will be used to get the privileges list for the current
* user but the true user link must be open after this one so it would be default one for all the scripts).
*/
$controlLink = false;
$controlConnection = null;
if ($GLOBALS['cfg']['Server']['controluser'] !== '') {
$controlLink = $dbi->connect(DatabaseInterface::CONNECT_CONTROL);
$controlConnection = $dbi->connect(DatabaseInterface::CONNECT_CONTROL);
}

// Connects to the server (validates user's login)
$userLink = $dbi->connect(DatabaseInterface::CONNECT_USER);

if ($userLink === false) {
$userConnection = $dbi->connect(DatabaseInterface::CONNECT_USER);
if ($userConnection === null) {
$auth->showFailure('mysql-denied');
}

if ($controlLink) {
if ($controlConnection !== null) {
return;
}

Expand Down
Loading

0 comments on commit e2bda4f

Please sign in to comment.