Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Zvonimir
ISPConfig 3
Commits
3501f913
Commit
3501f913
authored
Aug 19, 2012
by
mcramer
Browse files
Implemented FS#2382 - automatically add alias domain when creating a domain
parent
8e0d3660
Changes
6
Hide whitespace changes
Inline
Side-by-side
interface/web/admin/form/server_config.tform.php
View file @
3501f913
...
...
@@ -390,6 +390,14 @@ $form["tabs"]['web'] = array(
'default'
=>
'n'
,
'value'
=>
array
(
0
=>
'n'
,
1
=>
'y'
)
),
'website_autoalias'
=>
array
(
'datatype'
=>
'VARCHAR'
,
'formtype'
=>
'TEXT'
,
'default'
=>
''
,
'value'
=>
''
,
'width'
=>
'40'
,
'maxlength'
=>
'255'
),
'vhost_conf_dir'
=>
array
(
'datatype'
=>
'VARCHAR'
,
'formtype'
=>
'TEXT'
,
...
...
interface/web/admin/lib/lang/de_server_config.lng
View file @
3501f913
...
...
@@ -35,6 +35,8 @@ $wb['hostname_txt'] = 'Hostname';
$wb
[
'nameservers_txt'
]
=
'Nameserver'
;
$wb
[
'auto_network_configuration_txt'
]
=
'Netzwerkkonfiguration'
;
$wb
[
'website_basedir_txt'
]
=
'Website basedir'
;
$wb
[
"website_autoalias_txt"
]
=
'Website Autoalias'
;
$wb
[
"website_autoalias_note_txt"
]
=
'Platzhalter: [client_id], [client_username], [website_id], [website_domain]'
;
$wb
[
'ip_address_error_wrong'
]
=
'Ungültiges IP-Adressen-Format.'
;
$wb
[
'netmask_error_wrong'
]
=
'Ungültiges Netzmasken-Format.'
;
$wb
[
'gateway_error_wrong'
]
=
'Ungültiges Gateway-Format.'
;
...
...
interface/web/admin/lib/lang/en_server_config.lng
View file @
3501f913
...
...
@@ -15,6 +15,8 @@ $wb["website_path_txt"] = 'Website path';
$wb
[
"website_symlinks_txt"
]
=
'Website symlinks'
;
$wb
[
'website_symlinks_rel_txt'
]
=
'Make relative symlinks'
;
$wb
[
"website_basedir_txt"
]
=
'Website basedir'
;
$wb
[
"website_autoalias_txt"
]
=
'Website auto alias'
;
$wb
[
"website_autoalias_note_txt"
]
=
'Placeholders: [client_id], [client_username], [website_id], [website_domain]'
;
$wb
[
"vhost_conf_dir_txt"
]
=
'Vhost config dir'
;
$wb
[
"vhost_conf_enabled_dir_txt"
]
=
'Vhost config enabled dir'
;
$wb
[
"getmail_config_dir_txt"
]
=
'Getmail config dir'
;
...
...
interface/web/admin/templates/server_config_web_edit.htm
View file @
3501f913
...
...
@@ -31,6 +31,10 @@
{tmpl_var name='website_symlinks_rel'}
</div>
</div>
<div
class=
"ctrlHolder"
>
<label
for=
"website_autoalias"
>
{tmpl_var name='website_autoalias_txt'}
</label>
<input
name=
"website_autoalias"
id=
"website_autoalias"
value=
"{tmpl_var name='website_autoalias'}"
size=
"40"
maxlength=
"255"
type=
"text"
class=
"textInput"
/>
{tmpl_var name='website_autoalias_note_txt'}
</div>
<div
class=
"ctrlHolder apache"
>
<label
for=
"vhost_conf_dir"
>
{tmpl_var name='vhost_conf_dir_txt'}
</label>
<input
name=
"vhost_conf_dir"
id=
"vhost_conf_dir"
value=
"{tmpl_var name='vhost_conf_dir'}"
size=
"40"
maxlength=
"255"
type=
"text"
class=
"textInput"
/>
...
...
server/plugins-available/apache2_plugin.inc.php
View file @
3501f913
...
...
@@ -871,10 +871,25 @@ class apache2_plugin {
'rewrite_target_ssl'
=>
$rewrite_target_ssl
);
}
}
$server_alias
=
array
();
// get autoalias
$auto_alias
=
$web_config
[
'website_autoalias'
];
if
(
$auto_alias
!=
''
)
{
// get the client username
$client
=
$app
->
db
->
queryOneRecord
(
"SELECT `username` FROM `client` WHERE `client_id` = '"
.
intval
(
$client_id
)
.
"'"
);
$aa_search
=
array
(
'[client_id]'
,
'[website_id]'
,
'[client_username]'
,
'[website_domain]'
);
$aa_replace
=
array
(
$client_id
,
$data
[
'new'
][
'domain_id'
],
$client
[
'username'
],
$data
[
'new'
][
'domain'
]);
$auto_alias
=
str_replace
(
$aa_search
,
$aa_replace
,
$auto_alias
);
unset
(
$client
);
unset
(
$aa_search
);
unset
(
$aa_replace
);
$server_alias
[]
.
=
$auto_alias
;
}
// get alias domains (co-domains and subdomains)
$aliases
=
$app
->
db
->
queryAllRecords
(
'SELECT * FROM web_domain WHERE parent_domain_id = '
.
$data
[
'new'
][
'domain_id'
]
.
" AND active = 'y'"
);
$server_alias
=
array
();
switch
(
$data
[
'new'
][
'subdomain'
])
{
case
'www'
:
$server_alias
[]
.
=
'www.'
.
$data
[
'new'
][
'domain'
]
.
' '
;
...
...
server/plugins-available/nginx_plugin.inc.php
View file @
3501f913
...
...
@@ -912,10 +912,25 @@ class nginx_plugin {
'rewrite_exclude'
=>
$rewrite_exclude
);
}
}
$server_alias
=
array
();
// get autoalias
$auto_alias
=
$web_config
[
'website_autoalias'
];
if
(
$auto_alias
!=
''
)
{
// get the client username
$client
=
$app
->
db
->
queryOneRecord
(
"SELECT `username` FROM `client` WHERE `client_id` = '"
.
intval
(
$client_id
)
.
"'"
);
$aa_search
=
array
(
'[client_id]'
,
'[website_id]'
,
'[client_username]'
,
'[website_domain]'
);
$aa_replace
=
array
(
$client_id
,
$data
[
'new'
][
'domain_id'
],
$client
[
'username'
],
$data
[
'new'
][
'domain'
]);
$auto_alias
=
str_replace
(
$aa_search
,
$aa_replace
,
$auto_alias
);
unset
(
$client
);
unset
(
$aa_search
);
unset
(
$aa_replace
);
$server_alias
[]
.
=
$auto_alias
;
}
// get alias domains (co-domains and subdomains)
$aliases
=
$app
->
db
->
queryAllRecords
(
'SELECT * FROM web_domain WHERE parent_domain_id = '
.
$data
[
'new'
][
'domain_id'
]
.
" AND active = 'y'"
);
$server_alias
=
array
();
switch
(
$data
[
'new'
][
'subdomain'
])
{
case
'www'
:
$server_alias
[]
=
'www.'
.
$data
[
'new'
][
'domain'
]
.
' '
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment