Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory
Commits
474e72ee
Commit
474e72ee
authored
7 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
fix(simpleService): Cleanup service ACLs
issue
#5742
parent
d141961e
dev
6342-update-the-locales-for-1-5
6344-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen
6365-core-locking-mechanism-is-not-changing-the-mail-ressource-it-does-lock-the-mail-account
6365-core-when-lock-mechanism-is-trigger-the-user-should-not-be-editable-if-not-unlock
6378-orcid-test-method-is-wrong-and-break-orcid-saving
core-php8
master
fusiondirectory-1.5
fusiondirectory-1.4
fusiondirectory-1.3.1
fusiondirectory-1.3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/simpleplugin/class_simpleService.inc
+26
-21
include/simpleplugin/class_simpleService.inc
with
26 additions
and
21 deletions
+26
-21
include/simpleplugin/class_simpleService.inc
+
26
−
21
View file @
474e72ee
<?php
<?php
/*
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2011-201
6
FusionDirectory
Copyright (C) 2011-201
7
FusionDirectory
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
@@ -22,16 +21,14 @@
...
@@ -22,16 +21,14 @@
/*! \brief This class is made for easy service creation for editing LDAP attributes
/*! \brief This class is made for easy service creation for editing LDAP attributes
*
*
*/
*/
class
simpleService
extends
simplePlugin
{
class
simpleService
extends
simplePlugin
{
protected
static
$showActions
=
TRUE
;
var
$status
=
""
;
protected
$status
=
''
;
var
$conflicts
=
array
();
public
$conflicts
=
array
();
var
$dn
=
NULL
;
public
$DisplayName
=
''
;
var
$cn
=
""
;
var
$DisplayName
=
""
;
var
$view_logged
=
FALSE
;
var
$showActions
=
TRUE
;
/*! \brief constructor
/*! \brief constructor
*
*
...
@@ -52,11 +49,6 @@ class simpleService extends simplePlugin {
...
@@ -52,11 +49,6 @@ class simpleService extends simplePlugin {
*/
*/
function
execute
()
function
execute
()
{
{
if
(
$this
->
is_account
&&
!
$this
->
view_logged
)
{
$this
->
view_logged
=
TRUE
;
logging
::
log
(
'view'
,
'server/'
.
get_class
(
$this
),
$this
->
dn
);
}
$str
=
parent
::
execute
();
$str
=
parent
::
execute
();
if
(
!
$this
->
dialog
)
{
if
(
!
$this
->
dialog
)
{
...
@@ -83,12 +75,12 @@ class simpleService extends simplePlugin {
...
@@ -83,12 +75,12 @@ class simpleService extends simplePlugin {
/* Name displayed in service overview */
/* Name displayed in service overview */
$fields
[
'Message'
]
=
$this
->
DisplayName
;
$fields
[
'Message'
]
=
$this
->
DisplayName
;
if
(
$this
->
showActions
&&
is_object
(
$this
->
parent
->
parent
)
&&
isset
(
$this
->
parent
->
parent
->
by_object
[
'argonautClient'
])
&&
$this
->
parent
->
parent
->
by_object
[
'argonautClient'
]
->
is_account
)
{
if
(
static
::
$
showActions
&&
is_object
(
$this
->
parent
->
parent
)
&&
isset
(
$this
->
parent
->
parent
->
by_object
[
'argonautClient'
])
&&
$this
->
parent
->
parent
->
by_object
[
'argonautClient'
]
->
is_account
)
{
/* Allow/disallow some functions */
/* Allow/disallow some functions */
$fields
[
'AllowStatus'
]
=
(
$this
->
status
==
""
)
&&
$this
->
acl_is_writeable
(
"start"
);
$fields
[
'AllowStatus'
]
=
(
$this
->
status
==
''
)
&&
$this
->
acl_is_writeable
(
'simpleServiceStatus'
);
$fields
[
'AllowStart'
]
=
(
$this
->
status
==
"
stopped
"
)
&&
$this
->
acl_is_writeable
(
"s
tart
"
);
$fields
[
'AllowStart'
]
=
(
$this
->
status
==
'
stopped
'
)
&&
$this
->
acl_is_writeable
(
'simpleServiceS
tart
'
);
$fields
[
'AllowStop'
]
=
(
$this
->
status
==
"
running
"
)
&&
$this
->
acl_is_writeable
(
"s
top
"
);
$fields
[
'AllowStop'
]
=
(
$this
->
status
==
'
running
'
)
&&
$this
->
acl_is_writeable
(
'simpleServiceS
top
'
);
$fields
[
'AllowRestart'
]
=
(
$this
->
status
==
"
running
"
)
&&
$this
->
acl_is_writeable
(
"r
estart
"
);
$fields
[
'AllowRestart'
]
=
(
$this
->
status
==
'
running
'
)
&&
$this
->
acl_is_writeable
(
'simpleServiceR
estart
'
);
}
else
{
}
else
{
/* Disable some functions */
/* Disable some functions */
$fields
[
'AllowStatus'
]
=
FALSE
;
$fields
[
'AllowStatus'
]
=
FALSE
;
...
@@ -98,7 +90,7 @@ class simpleService extends simplePlugin {
...
@@ -98,7 +90,7 @@ class simpleService extends simplePlugin {
}
}
$fields
[
'AllowRemove'
]
=
$this
->
acl_is_removeable
();
$fields
[
'AllowRemove'
]
=
$this
->
acl_is_removeable
();
$fields
[
'AllowEdit'
]
=
$this
->
acl_is_readable
(
""
);
$fields
[
'AllowEdit'
]
=
$this
->
acl_is_readable
(
''
);
return
$fields
;
return
$fields
;
}
}
...
@@ -113,5 +105,18 @@ class simpleService extends simplePlugin {
...
@@ -113,5 +105,18 @@ class simpleService extends simplePlugin {
$this
->
status
=
$value
;
$this
->
status
=
$value
;
}
}
static
function
generatePlProvidedAcls
(
$attributesInfo
)
{
$acls
=
parent
::
generatePlProvidedAcls
(
$attributesInfo
);
if
(
static
::
$showActions
)
{
$acls
[
'simpleServiceStatus'
]
=
_
(
'Get service status'
);
$acls
[
'simpleServiceStart'
]
=
_
(
'Start service'
);
$acls
[
'simpleServiceStop'
]
=
_
(
'Stop service'
);
$acls
[
'simpleServiceRestart'
]
=
_
(
'Restart service'
);
}
return
$acls
;
}
}
}
?>
?>
This diff is collapsed.
Click to expand it.
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets