Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
e9bb05d4
Commit
e9bb05d4
authored
Jun 25, 2014
by
Sergio
Browse files
change domain owner
parent
d3be5691
Changes
2
Hide whitespace changes
Inline
Side-by-side
interface/web/client/domain_edit.php
View file @
e9bb05d4
...
@@ -147,9 +147,10 @@ class page_action extends tform_actions {
...
@@ -147,9 +147,10 @@ class page_action extends tform_actions {
}
}
else
{
else
{
/*
/*
* We edit a existing one, but
there is nothing to edit
* We edit a existing one, but
domain name can't be changed
*/
*/
$this
->
dataRecord
=
$app
->
tform
->
getDataRecord
(
$this
->
id
);
$oldData
=
$app
->
tform
->
getDataRecord
(
$this
->
id
);
$this
->
dataRecord
[
"domain"
]
=
$oldData
[
"domain"
];
}
}
}
elseif
(
$_SESSION
[
"s"
][
"user"
][
"typ"
]
!=
'admin'
&&
$app
->
auth
->
has_clients
(
$_SESSION
[
's'
][
'user'
][
'userid'
]))
{
}
elseif
(
$_SESSION
[
"s"
][
"user"
][
"typ"
]
!=
'admin'
&&
$app
->
auth
->
has_clients
(
$_SESSION
[
's'
][
'user'
][
'userid'
]))
{
if
(
$this
->
id
==
0
)
{
if
(
$this
->
id
==
0
)
{
...
@@ -199,6 +200,17 @@ class page_action extends tform_actions {
...
@@ -199,6 +200,17 @@ class page_action extends tform_actions {
}
}
}
}
function
onAfterUpdate
()
{
global
$app
,
$conf
;
// make sure that the record belongs to the client group and not the admin group when admin inserts it
// also make sure that the user can not delete domain created by a admin
if
(
$_SESSION
[
"s"
][
"user"
][
"typ"
]
==
'admin'
&&
isset
(
$this
->
dataRecord
[
"client_group_id"
]))
{
$client_group_id
=
$app
->
functions
->
intval
(
$this
->
dataRecord
[
"client_group_id"
]);
$app
->
db
->
query
(
"UPDATE domain SET sys_groupid =
$client_group_id
, sys_perm_group = 'ru' WHERE domain_id = "
.
$this
->
id
);
}
}
}
}
$page
=
new
page_action
;
$page
=
new
page_action
;
...
...
interface/web/client/templates/domain_edit.htm
View file @
e9bb05d4
...
@@ -7,22 +7,16 @@
...
@@ -7,22 +7,16 @@
<div
class=
"ctrlHolder"
>
<div
class=
"ctrlHolder"
>
<label
for=
"domain"
>
{tmpl_var name='domain_txt'}
</label>
<label
for=
"domain"
>
{tmpl_var name='domain_txt'}
</label>
<tmpl_if
name=
"edit_disabled"
>
<tmpl_if
name=
"edit_disabled"
>
<input
name=
"domain"
id=
"domain"
value=
"{tmpl_var name='domain'}"
size=
"30"
maxlength=
"255"
type=
"text"
class=
"textInput"
disabled=
"disabled
"
/>
<input
name=
"domain"
id=
"domain"
value=
"{tmpl_var name='domain'}"
size=
"30"
maxlength=
"255"
type=
"text"
class=
"textInput"
readonly=
"readonly
"
/>
<tmpl_else>
<tmpl_else>
<input
name=
"domain"
id=
"domain"
value=
"{tmpl_var name='domain'}"
size=
"30"
maxlength=
"255"
type=
"text"
class=
"textInput"
/>
<input
name=
"domain"
id=
"domain"
value=
"{tmpl_var name='domain'}"
size=
"30"
maxlength=
"255"
type=
"text"
class=
"textInput"
/>
</tmpl_if>
</tmpl_if>
</div>
</div>
<div
class=
"ctrlHolder"
>
<div
class=
"ctrlHolder"
>
<label
for=
"client_group_id"
>
{tmpl_var name='client_txt'}
</label>
<label
for=
"client_group_id"
>
{tmpl_var name='client_txt'}
</label>
<tmpl_if
name=
"edit_disabled"
>
<select
name=
"client_group_id"
id=
"client_group_id"
class=
"selectInput"
disabled=
"disabled"
>
{tmpl_var name='client_group_id'}
</select>
<tmpl_else>
<select
name=
"client_group_id"
id=
"client_group_id"
class=
"selectInput"
>
<select
name=
"client_group_id"
id=
"client_group_id"
class=
"selectInput"
>
{tmpl_var name='client_group_id'}
{tmpl_var name='client_group_id'}
</select>
</select>
</tmpl_if>
</div>
</div>
</fieldset>
</fieldset>
...
...
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