changing name for clarity
This commit is contained in:
@@ -64,8 +64,8 @@ class WOSiteCreateController(CementBaseController):
|
||||
(['--alias'],
|
||||
dict(help="domain name to redirect to",
|
||||
action='store', nargs='?')),
|
||||
(['--subsite'],
|
||||
dict(help="parent multi-site name",
|
||||
(['--subsiteof'],
|
||||
dict(help="create a subsite of a multisite install",
|
||||
action='store', nargs='?')),
|
||||
(['-le', '--letsencrypt'],
|
||||
dict(help="configure letsencrypt ssl for the site",
|
||||
@@ -127,24 +127,24 @@ class WOSiteCreateController(CementBaseController):
|
||||
proxyinfo = proxyinfo.split(':')
|
||||
host = proxyinfo[0].strip()
|
||||
port = '80' if len(proxyinfo) < 2 else proxyinfo[1].strip()
|
||||
elif stype is None and not pargs.proxy and not pargs.alias and not pargs.subsite:
|
||||
elif stype is None and not pargs.proxy and not pargs.alias and not pargs.subsiteofof:
|
||||
stype, cache = 'html', 'basic'
|
||||
elif stype is None and pargs.alias:
|
||||
stype, cache = 'alias', ''
|
||||
alias_name = pargs.alias.strip()
|
||||
if not alias_name:
|
||||
Log.error(self, "Please provide alias name")
|
||||
elif stype is None and pargs.subsite:
|
||||
elif stype is None and pargs.subsiteof:
|
||||
stype, cache = 'subsite', ''
|
||||
subsite_name = pargs.subsite.strip()
|
||||
if not subsite_name:
|
||||
subsiteof_name = pargs.subsiteof.strip()
|
||||
if not subsiteof_name:
|
||||
Log.error(self, "Please provide multisite parent name")
|
||||
elif stype and pargs.proxy:
|
||||
Log.error(self, "proxy should not be used with other site types")
|
||||
elif stype and pargs.alias:
|
||||
Log.error(self, "alias should not be used with other site types")
|
||||
elif stype and pargs.subsite:
|
||||
Log.error(self, "subsite should not be used with other site types")
|
||||
elif stype and pargs.subsiteof:
|
||||
Log.error(self, "subsiteof should not be used with other site types")
|
||||
|
||||
if not pargs.site_name:
|
||||
try:
|
||||
@@ -197,16 +197,16 @@ class WOSiteCreateController(CementBaseController):
|
||||
|
||||
if stype == 'subsite':
|
||||
# Get parent site data
|
||||
parent_site_info = getSiteInfo(self, subsite_name)
|
||||
parent_site_info = getSiteInfo(self, subsiteof_name)
|
||||
if not parent_site_info:
|
||||
Log.error(self, "Parent site {0} does not exist"
|
||||
.format(subsite_name))
|
||||
.format(subsiteof_name))
|
||||
if not parent_site_info.is_enabled:
|
||||
Log.error(self, "Parent site {0} is not enabled"
|
||||
.format(subsite_name))
|
||||
if 'wp' not in parent_site_info.site_type:
|
||||
Log.error(self, "Parent site {0} is not WordPress site"
|
||||
.format(subsite_name))
|
||||
.format(subsiteof_name))
|
||||
if parent_site_info.site_type not in ['wpsubdomain', 'wpsubdir']:
|
||||
Log.error(self, "Parent site {0} is not WordPress multisite"
|
||||
.format(subsiteof_name))
|
||||
|
||||
data = dict(
|
||||
site_name=wo_domain, www_domain=wo_www_domain,
|
||||
@@ -221,8 +221,8 @@ class WOSiteCreateController(CementBaseController):
|
||||
data["wpsubdir"] = parent_site_info.site_type == 'wpsubdir'
|
||||
data["wo_php"] = ("php" + parent_site_info.php_version).replace(".", "")
|
||||
data['subsite'] = True
|
||||
data['subsite_name'] = subsite_name
|
||||
data['subsite_webroot'] = parent_site_info.site_path
|
||||
data['subsiteof_name'] = subsiteof_name
|
||||
data['subsiteof_webroot'] = parent_site_info.site_path
|
||||
|
||||
|
||||
if (pargs.php72 or pargs.php73 or pargs.php74 or
|
||||
@@ -296,7 +296,7 @@ class WOSiteCreateController(CementBaseController):
|
||||
(not pargs.wprocket) and
|
||||
(not pargs.wpce) and
|
||||
(not pargs.wpredis) and
|
||||
(not pargs.subsite)):
|
||||
(not pargs.subsiteof)):
|
||||
data['basic'] = True
|
||||
|
||||
if (cache == 'wpredis'):
|
||||
|
||||
@@ -68,7 +68,7 @@ def setupdomain(self, data):
|
||||
wo_site_webroot = data['webroot']
|
||||
|
||||
if 'subsite' in data.keys() and data['subsite']:
|
||||
wo_parent_site = data["subsite_name"]
|
||||
wo_parent_site = data["subsiteof_name"]
|
||||
wo_parent_info = getSiteInfo(wo_parent_site)
|
||||
data["webroot"] = wo_parent_info["webroot"]
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ server {
|
||||
{{/subsite}}
|
||||
|
||||
{{#subsite}}
|
||||
root {{subsite_webroot}}/htdocs;
|
||||
root {{subsiteof_webroot}}/htdocs;
|
||||
{{/subsite}}
|
||||
|
||||
index {{^static}}index.php{{/static}} index.html index.htm;
|
||||
|
||||
Reference in New Issue
Block a user