Skip to content

Commit

Permalink
2.8.40: Changed Apache config for Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
webpwnized committed May 4, 2021
1 parent 354c4e5 commit d76ef6b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions classes/MySQLHandler.php
Expand Up @@ -149,25 +149,26 @@ private function doConnectToDatabase($pHOSTNAME, $pUSERNAME, $pPASSWORD){
private function doOpenDatabaseConnection(){
$USERNAME = self::$mMySQLDatabaseUsername;
$HOSTNAME = self::$mMySQLDatabaseHost;
$PASSWORD = self::$mMySQLDatabasePassword;

try{
# Try password from configuration file, then blank, then mutillidae, then samurai
$lResult = $this->doConnectToDatabase($HOSTNAME, $USERNAME, self::$mMySQLDatabasePassword);
$lResult = $this->doConnectToDatabase($HOSTNAME, $USERNAME, $PASSWORD);
if ($lResult <> 1){
$lResult = $this->doConnectToDatabase($HOSTNAME, $USERNAME, self::$MUTILLIDAE_DBV1_PASSWORD);
if ($lResult <> 1){
$lResult = $this->doConnectToDatabase($HOSTNAME, $USERNAME, self::$MUTILLIDAE_DBV2_PASSWORD);
if ($lResult <> 1){
$lResult = $this->doConnectToDatabase($HOSTNAME, $USERNAME, self::$SAMURAI_WTF_PASSWORD);
if ($lResult <> 1){
$lResult = $this->doConnectToDatabase(self::$MUTILLIDAE_DOCKER_HOSTNAME, $USERNAME, self::$mMySQLDatabasePassword);
}//end if
if ($lResult <> 1){
$lResult = $this->doConnectToDatabase(self::$MUTILLIDAE_DOCKER_HOSTNAME, $USERNAME, $PASSWORD);
}//end if
}//end if
}//end if
}//end if

} catch (Exception $e) {
throw(new Exception("CRITICAL. Error attempting to open MySQL connection. Try checking the connection settings in includes/database-config.php. If there is a problem connecting, usually one of these settings is incorrect (i.e. - username, password, database name). It is also a good idea to make sure the database is running and that the web site (Mutillidae) is allowed to connect. This error was generated by function doOpenDatabaseConnection(). Tried to connect with username " . self::$mMySQLDatabaseUsername . " and hostname " . self::$mMySQLDatabaseHost . ". " . $this->mCustomErrorHandler->getExceptionMessage($e)));
throw(new Exception("CRITICAL. Error attempting to open MySQL connection. Try checking the connection settings in includes/database-config.php. If there is a problem connecting, usually one of the settings is incorrect (i.e. - username, password, database name). It is also a good idea to make sure the database is running and that the web site (Mutillidae) is allowed to connect. This error was generated by function doOpenDatabaseConnection() - " . $this->mCustomErrorHandler->getExceptionMessage($e)));
}// end try

}// end function doOpenDatabaseConnection
Expand Down

0 comments on commit d76ef6b

Please sign in to comment.