Skip to content

Commit

Permalink
Merge pull request #110 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 4.1.0
  • Loading branch information
briskt authored Feb 10, 2021
2 parents 5db838b + fbb6d97 commit 72a9c46
Show file tree
Hide file tree
Showing 10 changed files with 1,387 additions and 649 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [4.1.0] - 2021-02-10
### Added
- Added `queryConditions` config variable on Sage People component
### Fixed
- Minor dependency updates

## [4.0.5] - 2020-10-07
### Fixed
- Update Docker credentials
Expand Down Expand Up @@ -189,7 +195,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- First release.

[Unreleased]: https://github.com/silinternational/idp-id-sync/compare/4.0.5...develop
[Unreleased]: https://github.com/silinternational/idp-id-sync/compare/4.1.0...develop
[4.1.0]: https://github.com/silinternational/idp-id-sync/compare/4.0.5...4.1.0
[4.0.5]: https://github.com/silinternational/idp-id-sync/compare/4.0.2...4.0.5
[4.0.2]: https://github.com/silinternational/idp-id-sync/compare/4.0.1...4.0.2
[4.0.1]: https://github.com/silinternational/idp-id-sync/compare/4.0.0...4.0.1
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ deps:
docker-compose run --rm cli composer install --no-scripts

depsupdate:
docker-compose run --rm cli composer update --no-scripts
docker-compose run --rm cli bash -c "composer update --no-scripts && composer show -Df json > versions.json"

phpmyadmin:
docker-compose up -d phpmyadmin
Expand Down
14 changes: 9 additions & 5 deletions application/common/components/adapters/SagePeopleIdStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ class SagePeopleIdStore extends IdStoreBase
const PROP_LOCKED = 'fHCM2__User__r.jaars_Locked_From_IdP__c';
const PROP_REQUIRE_MFA = 'fHCM2__User__r.jaars_Require_2sv_with_IdP__c';

const DEFAULT_QUERY_CONDITIONS = "fHCM2__Employment_Status__c='Active' AND fHCM2__User__c!=null AND fHCM2__Department__c!='a0H1U000001NKk4UAG'";

public $authUrl = null;
public $queryUrl = null;
public $clientId = null;
public $clientSecret = null;
public $username = null;
public $password = null;
public $queryConditions = null;

public $timeout = 45; // Timeout in seconds (per call to ID Store API).

Expand All @@ -52,6 +55,10 @@ public function init()
}
}

if ($this->queryConditions === null) {
$this->queryConditions = self::DEFAULT_QUERY_CONDITIONS;
}

parent::init();
}

Expand Down Expand Up @@ -93,7 +100,7 @@ public function getActiveUser(string $employeeId)
throw new \Exception('employee_id contains invalid characters');
}
$activeUsers = $this->getFromIdStore(sprintf(
"WHERE %s='%s' AND fHCM2__Employment_Status__c='Active'",
"WHERE %s='%s' AND " . $this->queryConditions,
self::PROP_EMPLOYEE_ID,
$safeEmployeeId
));
Expand Down Expand Up @@ -259,10 +266,7 @@ protected function getFromIdStore($whereClause): array
*/
public function getAllActiveUsers()
{
$allActiveUsers = $this->getFromIdStore(
"WHERE fHCM2__Employment_Status__c='Active' AND fHCM2__User__c!=null AND "
. "fHCM2__Department__c!='a0H1U000001NKk4UAG'"
);
$allActiveUsers = $this->getFromIdStore('WHERE ' . $this->queryConditions);

return self::getAsUsers($allActiveUsers);
}
Expand Down
Loading

0 comments on commit 72a9c46

Please sign in to comment.