Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
559fe83b
Commit
559fe83b
authored
Mar 30, 2015
by
Côme Bernigaud
Committed by
Benoit Mortier
Mar 30, 2015
Browse files
Fixes #3669 Removing services action when there is no argonaut client
parent
ef32f179
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/simpleplugin/class_simpleService.inc
View file @
559fe83b
...
...
@@ -46,7 +46,8 @@ class simpleService extends simplePlugin {
{
parent
::
__construct
(
$config
,
$dn
,
$object
,
$attributesInfo
);
$plInfos
=
pluglist
::
pluginInfos
(
get_class
(
$this
));
$this
->
DisplayName
=
$plInfos
[
'plShortName'
];
$this
->
DisplayName
=
$plInfos
[
'plShortName'
];
$this
->
parent
=
$object
;
/* $object is the instance of serverService in this case */
}
/*! \brief This function display the service and return the html code
...
...
@@ -84,11 +85,20 @@ class simpleService extends simplePlugin {
/* Name displayed in service overview */
$fields
[
'Message'
]
=
$this
->
DisplayName
;
/* Allow/disallow some functions */
$fields
[
'AllowStatus'
]
=
(
$this
->
status
==
""
)
&&
$this
->
showActions
&&
$this
->
acl_is_writeable
(
"start"
);
$fields
[
'AllowStart'
]
=
(
$this
->
status
==
"stopped"
)
&&
$this
->
showActions
&&
$this
->
acl_is_writeable
(
"start"
);
$fields
[
'AllowStop'
]
=
(
$this
->
status
==
"running"
)
&&
$this
->
showActions
&&
$this
->
acl_is_writeable
(
"stop"
);
$fields
[
'AllowRestart'
]
=
(
$this
->
status
==
"running"
)
&&
$this
->
showActions
&&
$this
->
acl_is_writeable
(
"restart"
);
if
(
$this
->
showActions
&&
is_object
(
$this
->
parent
->
parent
)
&&
$this
->
parent
->
parent
->
by_object
[
'argonautClient'
]
->
is_account
)
{
/* Allow/disallow some functions */
$fields
[
'AllowStatus'
]
=
(
$this
->
status
==
""
)
&&
$this
->
acl_is_writeable
(
"start"
);
$fields
[
'AllowStart'
]
=
(
$this
->
status
==
"stopped"
)
&&
$this
->
acl_is_writeable
(
"start"
);
$fields
[
'AllowStop'
]
=
(
$this
->
status
==
"running"
)
&&
$this
->
acl_is_writeable
(
"stop"
);
$fields
[
'AllowRestart'
]
=
(
$this
->
status
==
"running"
)
&&
$this
->
acl_is_writeable
(
"restart"
);
}
else
{
/* Disable some functions */
$fields
[
'AllowStatus'
]
=
FALSE
;
$fields
[
'AllowStart'
]
=
FALSE
;
$fields
[
'AllowStop'
]
=
FALSE
;
$fields
[
'AllowRestart'
]
=
FALSE
;
}
$fields
[
'AllowRemove'
]
=
$this
->
acl_is_removeable
();
$fields
[
'AllowEdit'
]
=
$this
->
acl_is_readable
(
""
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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