Skip to content

Commit

Permalink
handle undefined variable
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
lionick committed Nov 26, 2021
1 parent 50ddc81 commit 9b82416
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed

- Provision certificates from OrgIdentity (LDAP Provisioner)
- Handle undefined variables (LDAP Provisioner)
- Log errors when LDAP Provisioner fails to write at LDAP

## [3.3.7-rciam] - 2021-11-16

Expand Down
2 changes: 1 addition & 1 deletion app/Plugin/LdapProvisioner/Lib/LdapSyncEntitlements.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function groupEntitlementAssemble($memberships_groups){
. ":role=" . $role // role
. "#" . $this->config['urn_authority']; // AA FQDN
// Enable legacy URN syntax for compatibility reasons?
if($this->config['urn_legacy']) {
if(!empty($this->config['urn_legacy']) && $this->config['urn_legacy']) {
$this->state['Attributes']['eduPersonEntitlement'][] =
$this->config['urn_namespace'] // URN namespace
. ':' . $this->config['urn_authority'] // AA FQDN
Expand Down
5 changes: 4 additions & 1 deletion app/Plugin/LdapProvisioner/Model/CoLdapProvisionerTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ public function provision($coProvisioningTargetData, $op, $provisioningData) {
$provisioningData);
} else {
if(!empty($attributes)) {
$this->log(get_class($this) . "::{" . var_export($attributes, true) . "}::@", LOG_ERROR);
$this->log(__METHOD__ . "::replace::{" . var_export($attributes, true) . "}::@", LOG_ERROR);
}
throw new RuntimeException(ldap_error($cxn), ldap_errno($cxn));
}
Expand All @@ -1492,6 +1492,9 @@ public function provision($coProvisioningTargetData, $op, $provisioningData) {
}

if(!@ldap_add($cxn, $dns['newdn'], $attributes)) {
if(!empty($attributes)) {
$this->log(__METHOD__ . "::add::{" . var_export($attributes, true) . "}::@", LOG_ERROR);
}
throw new RuntimeException(ldap_error($cxn), ldap_errno($cxn));
}
}
Expand Down

0 comments on commit 9b82416

Please sign in to comment.