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
8cf70243
Unverified
Commit
8cf70243
authored
4 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
feat(core) Add archive ACL and action if plugin is installed
issue
#6119
parent
aaf5d6ed
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
6388-clear-the-tokens-storage-issues-into-the-fusiondirectory-configuration-backend
core-php8
master
fusiondirectory-1.5
fusiondirectory-1.4
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class_config.inc
+4
-0
include/class_config.inc
include/management/class_management.inc
+64
-0
include/management/class_management.inc
with
68 additions
and
0 deletions
+68
-0
include/class_config.inc
+
4
−
0
View file @
8cf70243
...
@@ -1141,6 +1141,10 @@ class config
...
@@ -1141,6 +1141,10 @@ class config
$this
->
data
[
'OBJECTS'
][
$obj
][
'snapshotActive'
]
=
TRUE
;
$this
->
data
[
'OBJECTS'
][
$obj
][
'snapshotActive'
]
=
TRUE
;
$this
->
data
[
'CATEGORIES'
][
$cat
][
'classes'
][]
=
'SnapshotHandler'
;
$this
->
data
[
'CATEGORIES'
][
$cat
][
'classes'
][]
=
'SnapshotHandler'
;
}
}
if
(
class_available
(
'archivedObject'
)
&&
archivedObject
::
isArchiveActive
(
$obj
))
{
$this
->
data
[
'OBJECTS'
][
$obj
][
'archiveActive'
]
=
TRUE
;
$this
->
data
[
'CATEGORIES'
][
$cat
][
'classes'
][]
=
'archive'
;
}
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
include/management/class_management.inc
+
64
−
0
View file @
8cf70243
...
@@ -280,6 +280,13 @@ class management implements FusionDirectoryDialog
...
@@ -280,6 +280,13 @@ class management implements FusionDirectoryDialog
);
);
}
}
if
(
class_available
(
'archivedObject'
))
{
$action
=
archivedObject
::
getManagementAction
(
$this
->
objectTypes
,
'archiveEntry'
);
if
(
$action
!==
NULL
)
{
$this
->
registerAction
(
$action
);
}
}
$this
->
registerAction
(
$this
->
registerAction
(
new
Action
(
new
Action
(
'remove'
,
_
(
'Remove'
),
'geticon.php?context=actions&icon=edit-delete&size=16'
,
'remove'
,
_
(
'Remove'
),
'geticon.php?context=actions&icon=edit-delete&size=16'
,
...
@@ -834,6 +841,63 @@ class management implements FusionDirectoryDialog
...
@@ -834,6 +841,63 @@ class management implements FusionDirectoryDialog
$this
->
dialogObject
=
new
templateDialog
(
$this
,
$type
,
NULL
,
$this
->
currentDn
);
$this
->
dialogObject
=
new
templateDialog
(
$this
,
$type
,
NULL
,
$this
->
currentDn
);
}
}
public
function
archiveEntry
(
array
$action
)
{
global
$ui
;
if
(
empty
(
$action
[
'targets'
]))
{
return
;
}
$this
->
currentDns
=
$action
[
'targets'
];
logging
::
debug
(
DEBUG_TRACE
,
__LINE__
,
__FUNCTION__
,
__FILE__
,
$this
->
currentDns
,
'Archiving'
);
// check locks
if
(
$locks
=
get_locks
(
$this
->
currentDns
))
{
return
gen_locked_message
(
$locks
,
$this
->
currentDns
);
}
// Add locks
add_lock
(
$this
->
currentDns
,
$ui
->
dn
);
$success
=
0
;
foreach
(
$this
->
currentDns
as
$dn
)
{
$entry
=
$this
->
listing
->
getEntry
(
$dn
);
if
(
$entry
===
NULL
)
{
trigger_error
(
'Could not find '
.
$dn
.
', action canceled'
);
$this
->
remove_lock
();
$this
->
currentDns
=
[];
return
;
}
if
(
$entry
->
isTemplate
())
{
$error
=
new
FusionDirectoryError
(
htmlescape
(
_
(
'Archiving a template is not possible'
)));
$error
->
display
();
$this
->
remove_lock
();
$this
->
currentDns
=
[];
return
;
}
$errors
=
archivedObject
::
archiveObject
(
$entry
->
type
,
$dn
);
if
(
empty
(
$errors
))
{
$success
++
;
}
else
{
msg_dialog
::
displayChecks
(
$errors
);
}
del_lock
(
$dn
);
}
if
(
$success
>
0
)
{
msg_dialog
::
display
(
_
(
'Archive success'
),
htmlescape
(
sprintf
(
_
(
'%d entries were successfully archived'
),
$success
)),
INFO_DIALOG
);
}
$this
->
currentDns
=
[];
}
/*!
/*!
* \brief This method opens an existing object to be edited.
* \brief This method opens an existing object to be edited.
...
...
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