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

Restrict alias domains to subdom MU sites #335

Merged
merged 1 commit into from
Jun 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/helper/class-ee-site.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ protected function delete_site( $level, $site_url, $site_fs_path, $db_data = []
* : Size of proxy cache key zone.
*
* [--add-alias-domains=<comma-seprated-domains-to-add>]
* : Comma seprated list of domains to add to site's alias domains.
* : Comma seprated list of domains to add to site's alias domains. These can be configured only on WordPress subdom MU.
*
* [--delete-alias-domains=<comma-seprated-domains-to-delete>]
* : Comma seprated list of domains to delete from site's alias domains.
* : Comma seprated list of domains to delete from site's alias domains. These can be configured only on WordPress subdom MU.
*
* ## EXAMPLES
*
Expand All @@ -367,6 +367,12 @@ protected function delete_site( $level, $site_url, $site_fs_path, $db_data = []
*
* # Update proxy cache of site.
* $ ee site update example.com --proxy-cache=on --proxy-cache-max-size=1g --proxy-cache-max-time=30s
*
* # Add alias domains to a WordPress subdom site.
* $ ee site update example.com --add-alias-domains='a.com,b.com,c.com'
*
* # Delete alias domains from a WordPress subdom site.
* $ ee site update example.com --delete-alias-domains='a.com,b.com'
*/
public function update( $args, $assoc_args ) {

Expand Down Expand Up @@ -412,8 +418,8 @@ protected function update_alias_domains( $args, $assoc_args ) {
$this->site_data = reset( $array_data );

// Check if it is a WP site.
if ( 'wp' !== $this->site_data['site_type'] ) {
EE::error( 'Currently alias domains are only supported in WordPress site type.' );
if ( 'wp' !== $this->site_data['site_type'] || 'subdom' !== $this->site_data['app_sub_type'] ) {
EE::error( 'Currently alias domains are only supported in WordPress subdom MU sites.' );
}

// Validate data.
Expand Down