Skip to content

Commit

Permalink
API Remove deprecated code (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabina-talipova committed Jan 25, 2023
1 parent 972af65 commit b9c070e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/en/tech_notes.md
Expand Up @@ -9,7 +9,7 @@ LDAP-only sequence:
1. `LDAPAuthenticator::authenticate` is called
1. Authentication against LDAP is performed by SilverStripe's backend.
1. If `Member` record is not found, stub is created with some basic fields (i.e. GUID), but no group mapping.
1. A login hook is triggered at `LDAPMemberExtension::memberLoggedIn`
1. A login hook is triggered at `LDAPMemberExtension::afterMemberLoggedIn`
1. LDAP synchronisation is performed by looking up the GUID. All `Member` fields are overwritten with the data obtained
from LDAP, and LDAP group mappings are added.
1. User is logged into SilverStripe as that member, considered authenticated and authorised (since the group mappings
Expand All @@ -21,7 +21,7 @@ are in place)
and SAML components.

* `LDAPAuthenticator::authenticate`: creates stub `Member` after authorisation (if non-existent).
* `LDAPMemberExtension::memberLoggedIn`: triggers LDAP synchronisation, rewriting all `Member` fields.
* `LDAPMemberExtension::afterMemberLoggedIn`: triggers LDAP synchronisation, rewriting all `Member` fields.
* `LDAPMemberSyncTask::run`: pulls all LDAP records and creates relevant `Members`.

## Password change synchronisation
Expand Down
2 changes: 1 addition & 1 deletion src/Authenticators/LDAPAuthenticator.php
Expand Up @@ -148,7 +148,7 @@ public function authenticate(array $data, HTTPRequest $request, ValidationResult
return null;
}

// LDAPMemberExtension::memberLoggedIn() will update any other AD attributes mapped to Member fields
// LDAPMemberExtension::afterMemberLoggedIn() will update any other AD attributes mapped to Member fields
$member = Member::get()->filter('GUID', $data['objectguid'])->limit(1)->first();
if (!($member && $member->exists())) {
$member = new Member();
Expand Down
10 changes: 0 additions & 10 deletions src/Extensions/LDAPMemberExtension.php
Expand Up @@ -2,7 +2,6 @@

namespace SilverStripe\LDAP\Extensions;

use SilverStripe\Dev\Deprecation;
use Exception;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Forms\FieldList;
Expand Down Expand Up @@ -289,15 +288,6 @@ public function sync()
$service->updateLDAPGroupsForMember($this->owner);
}

/**
* @deprecated 1.1.0 Will be removed without equivalent functionality to replace it
*/
public function memberLoggedIn()
{
Deprecation::notice('1.1.0', 'Will be removed without equivalent functionality to replace it');
return $this->afterMemberLoggedIn();
}

/**
* Triggered by {@link IdentityStore::logIn()}. When successfully logged in,
* this will update the Member record from LDAP data.
Expand Down

0 comments on commit b9c070e

Please sign in to comment.