-
Notifications
You must be signed in to change notification settings - Fork 9
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
GH-50 Update ee auth list
command by adding support for listing all auths across all sites
#51
base: develop
Are you sure you want to change the base?
GH-50 Update ee auth list
command by adding support for listing all auths across all sites
#51
Conversation
Add support for listing all auths across all sites using a hashmap approach
@kirtangajjar
|
@PiyushKhurana Do one thing, handle it in your code. If the user is in the site directory, then show site's info else global info. Hint: try to find out how Easyengine does this. We have made a function for it. So if the user is within an site directory, you don't need to show global auth, just let he program continue, and it will do it's job. If not, then invoke your logic of global auth. |
- Add condition to check whether command is run from inside site directory or not - Use usort function to sort the array - Use array_map to add new field 'sitename' to each array element
ee auth list
command by adding support for listing all auths across all sites
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirtangajjar You can check the code. It is complete from my end.
if ( empty( $sites ) ) { | ||
EE::error( 'No auths exits on any sites' ); | ||
} | ||
$formatter = new EE\Formatter( $assoc_args, array( 'sitename', 'username', 'password' ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirtangajjar While working on other issue , I came across a condition where there was not auth on any sites , so I have added the condition to check if there are no auths at all on any sites in that case it will simply show a error message instead of showing empty table
Added support for listing all auths across all sites
What's changed
ee auth list
command from outside of site directory will display all the auths across all the sites.What's remain same
ee auth list
command from within the site directory will display all the auths of that particular site only.Files to check out
src/Auth_Command.php
closes #50