Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress Auth Adapter #73

Closed
alcalbg opened this issue Apr 23, 2020 · 2 comments
Closed

WordPress Auth Adapter #73

alcalbg opened this issue Apr 23, 2020 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@alcalbg
Copy link
Member

alcalbg commented Apr 23, 2020

Can someone please try this new WordPress Auth adapter and send some feedback:

Thanks!

@alcalbg alcalbg added the help wanted Extra attention is needed label Apr 23, 2020
@denajjar
Copy link

denajjar commented May 4, 2020

The Auth Adapter is working. I have restricted access to predefined roles (administrator and editor).

public function user(): ?User
    {
        $wpuser = wp_get_current_user();
        $roles = ( array ) $wpuser->roles;
        $array=array("administrator", "editor");
        if ($wpuser->exists() && in_array($roles[0],$array)) {
            $user = new User();
            $user->setUsername($wpuser->data->user_login);
            $user->setName($wpuser->data->display_name);
            $user->setRole('user');
            $user->setHomedir('/');
            $user->setPermissions($this->permissions);
            return $user;
        }

@alcalbg
Copy link
Member Author

alcalbg commented May 9, 2020

WP adapter has been updated and included in the main repo with 15c386f

@alcalbg alcalbg added the good first issue Good for newcomers label May 17, 2020
@alcalbg alcalbg closed this as completed Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants