-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix authentication when connecting to MongoDB (#2)
* Fix authentication when connecting to MongoDB * Add back travis CI for correct repository * Fix reference to configuration file
- Loading branch information
1 parent
66def0d
commit f3f54b7
Showing
5 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?php | ||
/** | ||
* This file is part of the simplesamlphp-module-mongo. | ||
* This file is part of the simplesamlphp-module-mongodb. | ||
* | ||
* For the full copyright and license information, please view the LICENSE file that was distributed with this source | ||
* code. | ||
* | ||
* @author Chris Beaton <[email protected]> | ||
* @package prolificinteractive/simplesamlphp-module-mongo | ||
* @package prolificinteractive/simplesamlphp-module-mongodb | ||
*/ | ||
|
||
use \SimpleSAML\Store; | ||
|
@@ -31,7 +31,7 @@ class sspmod_mongo_Store_Store extends Store | |
public function __construct($connectionDetails = array()) | ||
{ | ||
$options = []; | ||
$config = SimpleSAML_Configuration::getConfig('module_mongo.php'); | ||
$config = SimpleSAML_Configuration::getConfig('module_mongodb.php'); | ||
$connectionDetails = array_merge($config->toArray(), $connectionDetails); | ||
if (!empty($connectionDetails['replicaSet'])) { | ||
$options['replicaSet'] = $connectionDetails['replicaSet']; | ||
|
@@ -61,6 +61,9 @@ static function createConnectionURI($connectionDetails = array()) { | |
? "${connectionDetails['username']}:${connectionDetails['password']}@" | ||
: '') | ||
."${seedList}"; | ||
if(!empty($connectionDetails['database'])) { | ||
$connectionURI .= '/' . $connectionDetails['database']; | ||
} | ||
|
||
return $connectionURI; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* code. | ||
* | ||
* @author Chris Beaton <[email protected]> | ||
* @package prolificinteractive/simplesamlphp-module-mongo | ||
* @package prolificinteractive/simplesamlphp-module-mongodb | ||
*/ | ||
|
||
namespace SimpleSAML\Test\Module\mongo\Store; | ||
|
File renamed without changes.