Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Find disabled/enabled user on FreeIPA #820

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nerdalertdk
Copy link
Contributor

Now, whereDisabled and whereEnabled works with FreeIPA

Now, whereDisabled and whereEnabled works with FreeIPA
@nerdalertdk nerdalertdk changed the title Update FreeIPA.php Find disabled/enabled user on FreeIPA May 2, 2023
@nerdalertdk
Copy link
Contributor Author

nerdalertdk commented May 2, 2023

Found this bug, since old users was not delete in our web app, Still have problem with the import it self, since nsaccountlock is a operational attributes so it return null with getUserAccountControl()

@nerdalertdk
Copy link
Contributor Author

Okay, next problem is the isDisabled on HasUserAccountControl trait

AD is returning a integra and FreeIPA is returning a bool (true/false) as a string

@nerdalertdk
Copy link
Contributor Author

nerdalertdk commented May 2, 2023

Any suggestions on a better way ?

public function getUserAccountControl()
    {
        if ( is_a($this->getSchema(), "Adldap\Schemas\FreeIPA") ) {
            return filter_var( $this->getFirstAttribute($this->schema->userAccountControl()),FILTER_VALIDATE_BOOLEAN ) ? AccountControl::ACCOUNTDISABLE : false;
        }

        return $this->getFirstAttribute($this->schema->userAccountControl());
    }

When importing from a FreeIPA system users are now deleted and restored correct
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant