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

Feature: admin-tools-specific subcommands (Ref: #40) #52

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

danish17
Copy link

βž• Added admin-tools specific support for ee auth command.
πŸ”ƒ Change generate_global_auth_files() logic
πŸ”ƒ Fix some PHPCS issues

Subcommands πŸ”§

1. Creating admin-tools auth user

Creates a new user to be used on <site_name>/ee-admin

Syntax:
ee auth create admin-tools

Parameters:
--user username
--pass password (optional)

Example:
ee auth create admin-tools --user=test --pass=test

2. Deleting admin-tools auth user

Deletes an user from admin-tools

Syntax:
ee auth delete admin-tools

Parameters:
--user username

Example:
ee auth create admin-tools --user=test

3. Updating admin-tools auth user

Updates an existing user on admin-tools

Syntax:
ee auth update admin-tools

Parameters:
--user username to update
--pass new password (optional)

Example:
ee auth update admin-tools --user=test --pass=updatedtest

4. Listing admin-tools auth

Lists existing users on admin-tools

Syntax:
ee auth list admin-tools

Example:
ee auth list admin-tools


Functions to watch out for πŸ‘€

  • admin_tools_create_auth()
  • admin_tools_update_auth()
  • admin_tools_delete_auth()
  • admin_tools_list_auth()
  • generate_global_auth_files()

Footnotes:

Reference: #40

@danish17 danish17 added the enhancement New feature or request label Sep 20, 2021
@danish17 danish17 self-assigned this Sep 20, 2021
src/Auth_Command.php Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/Auth_Command.php Outdated Show resolved Hide resolved
src/Auth_Command.php Outdated Show resolved Hide resolved
src/Auth_Command.php Outdated Show resolved Hide resolved
src/Auth_Command.php Outdated Show resolved Hide resolved
src/Auth_Command.php Outdated Show resolved Hide resolved
Earlier, we used admin_tools_create_auth() to create auth specifically for default_admin_tools
it created a lot of redundant code. We are able to replicate the same by adding an else if {}
in populate_info() method.
Remove all admin_tools_ prefixed functions. Functionality was replaced by modifying populate_info() method.
src/Auth_Command.php Outdated Show resolved Hide resolved
@kirtangajjar
Copy link
Contributor

@danish17 Please also checkout requested changes

`ee auth delete global` had unexpected behaviour, it works expectedly now. `ee auth list global` showed admin-tools auth, it will exclusively show default auths now.
Changelog:
- separated logic for generate_global_auth_files() for default and default_admin_tools
- add generate_default_auth_files() to handle generation of default (global) auths
Fix: global auths not working
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants