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

Plugin admin page for role administration, etc. #4

Open
joshp23 opened this issue Jan 5, 2019 · 3 comments
Open

Plugin admin page for role administration, etc. #4

joshp23 opened this issue Jan 5, 2019 · 3 comments

Comments

@joshp23
Copy link
Owner

joshp23 commented Jan 5, 2019

In reference to @nicwaller's issue nicwaller#10, there should/could be an admin page to manage users/roles. Some work has been done on this here 1977912

@clmcavaney
Copy link

This would be handy to provide simpler management of user roles without having to edit the user/config.php file for each users role.
I would like to contribute to a solution here, but not 100% sure where to start. From what Nic (@nicwaller) first explored it looks like a form to display the current roles. Just not sure where the roles would be stored. It looks like updates might be ephemeral and not committed to a database.

Is anybody else keen?

@joshp23
Copy link
Owner Author

joshp23 commented Sep 7, 2019

I would start with moving users to the database, hashing passwords with password_hash(), and verifying users with something like

// intercept the login process
yourls_add_filter( 'is_valid_user', 'amp_is_valid_user' );
// returns true/false
function amp_is_valid_user( $value ) {
    $user = $_REQUEST['username'];
    if ( check_DB_for_user( $user ) == true ) {
        $pass = $_REQUEST['password'];
        $hash = get_user_hashed_pass_from_DB( $user );
        $value = password_verify( $pass , $hash );
    }
    return $value;
}

Making sure to extend this to address API calls, etc.

This would of course require the creation of a new user table, where roles are assigned. This would also invite a reconsideration of how the concept of ownership is currently managed in relation to URLs.

Then I would add or expand on Nick's simple admin page to deal with role assignment, etc.

@denics
Copy link

denics commented Aug 21, 2023

related to #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants