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
0e365a65
Verified
Commit
0e365a65
authored
1 month ago
by
dockx thibault
Browse files
Options
Download
Patches
Plain Diff
(snapshot) - php82
adapt snapshot to php82
parent
26cf0fbd
core-php8
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/management/snapshot/class_SnapshotAttribute.inc
+3
-3
include/management/snapshot/class_SnapshotAttribute.inc
include/management/snapshot/class_SnapshotHandler.inc
+6
-6
include/management/snapshot/class_SnapshotHandler.inc
with
9 additions
and
9 deletions
+9
-9
include/management/snapshot/class_SnapshotAttribute.inc
+
3
−
3
View file @
0e365a65
...
@@ -87,7 +87,7 @@ class SnapshotsAttribute extends OrderedArrayAttribute
...
@@ -87,7 +87,7 @@ class SnapshotsAttribute extends OrderedArrayAttribute
protected
function
getAttributeArrayValue
(
$key
,
$value
)
protected
function
getAttributeArrayValue
(
$key
,
$value
)
{
{
$values
=
[
$values
=
[
date
(
_
(
'Y-m-d, H:i:s'
),
preg_replace
(
'/\-.*$/'
,
''
,
$value
[
'gosaSnapshotTimestamp'
][
0
])),
date
(
_
(
'Y-m-d, H:i:s'
),
preg_replace
(
'/\-.*$/'
,
''
,
(
string
)
$value
[
'gosaSnapshotTimestamp'
][
0
])),
$value
[
'description'
][
0
]
$value
[
'description'
][
0
]
];
];
if
(
$this
->
plugin
->
global
)
{
if
(
$this
->
plugin
->
global
)
{
...
@@ -120,8 +120,8 @@ class SnapshotsAttribute extends OrderedArrayAttribute
...
@@ -120,8 +120,8 @@ class SnapshotsAttribute extends OrderedArrayAttribute
if
(
parent
::
handlePostValueActions
(
$id
,
$postValue
))
{
if
(
parent
::
handlePostValueActions
(
$id
,
$postValue
))
{
return
TRUE
;
return
TRUE
;
}
}
if
(
preg_match
(
'/^'
.
$id
.
'_restore_/'
,
$postValue
))
{
if
(
preg_match
(
'/^'
.
$id
.
'_restore_/'
,
(
string
)
$postValue
))
{
$key
=
preg_replace
(
'/^'
.
$id
.
'_restore_/'
,
''
,
$postValue
);
$key
=
preg_replace
(
'/^'
.
$id
.
'_restore_/'
,
''
,
(
string
)
$postValue
);
$key
=
preg_replace
(
'/_[xy]$/'
,
''
,
$key
);
$key
=
preg_replace
(
'/_[xy]$/'
,
''
,
$key
);
$this
->
plugin
->
triggerRestore
(
$this
->
value
[
$key
][
'dn'
]);
$this
->
plugin
->
triggerRestore
(
$this
->
value
[
$key
][
'dn'
]);
...
...
This diff is collapsed.
Click to expand it.
include/management/snapshot/class_SnapshotHandler.inc
+
6
−
6
View file @
0e365a65
...
@@ -85,7 +85,7 @@ class SnapshotHandler
...
@@ -85,7 +85,7 @@ class SnapshotHandler
protected
function
snapshot_dn
(
$dn
)
protected
function
snapshot_dn
(
$dn
)
{
{
global
$config
;
global
$config
;
return
preg_replace
(
"/"
.
preg_quote
(
$config
->
current
[
'BASE'
],
'/'
)
.
"$/"
,
""
,
$dn
)
return
preg_replace
(
"/"
.
preg_quote
(
(
string
)
$config
->
current
[
'BASE'
],
'/'
)
.
"$/"
,
""
,
(
string
)
$dn
)
.
$this
->
snapshotRDN
;
.
$this
->
snapshotRDN
;
}
}
...
@@ -154,7 +154,7 @@ class SnapshotHandler
...
@@ -154,7 +154,7 @@ class SnapshotHandler
$ldap
=
$config
->
get_ldap_link
();
$ldap
=
$config
->
get_ldap_link
();
$objectBase
=
preg_replace
(
"/^[^,]*./"
,
""
,
$dn
);
$objectBase
=
preg_replace
(
"/^[^,]*./"
,
""
,
(
string
)
$dn
);
// Initialize base
// Initialize base
$base
=
$this
->
snapshot_dn
(
$objectBase
);
$base
=
$this
->
snapshot_dn
(
$objectBase
);
...
@@ -182,7 +182,7 @@ class SnapshotHandler
...
@@ -182,7 +182,7 @@ class SnapshotHandler
}
else
{
}
else
{
$tmp
=
[];
$tmp
=
[];
foreach
(
$objects
as
$entry
)
{
foreach
(
$objects
as
$entry
)
{
$tmp
[
base64_encode
(
$entry
[
'dn'
])]
=
$entry
[
'description'
][
0
];
$tmp
[
base64_encode
(
(
string
)
$entry
[
'dn'
])]
=
$entry
[
'description'
][
0
];
}
}
}
}
return
$tmp
;
return
$tmp
;
...
@@ -227,7 +227,7 @@ class SnapshotHandler
...
@@ -227,7 +227,7 @@ class SnapshotHandler
list
(
$usec
,
$sec
)
=
explode
(
" "
,
microtime
());
list
(
$usec
,
$sec
)
=
explode
(
" "
,
microtime
());
/* Collect some infos */
/* Collect some infos */
$base_of_object
=
preg_replace
(
'/^[^,]+,/i'
,
''
,
$dn
);
$base_of_object
=
preg_replace
(
'/^[^,]+,/i'
,
''
,
(
string
)
$dn
);
$new_base
=
$this
->
snapshot_dn
(
$base_of_object
);
$new_base
=
$this
->
snapshot_dn
(
$base_of_object
);
/* Create object */
/* Create object */
$data
=
''
;
$data
=
''
;
...
@@ -318,7 +318,7 @@ class SnapshotHandler
...
@@ -318,7 +318,7 @@ class SnapshotHandler
foreach
(
$dnSnapshotsList
as
$snap
)
{
foreach
(
$dnSnapshotsList
as
$snap
)
{
$snapCount
+=
1
;
$snapCount
+=
1
;
// let's keep seconds instead of nanosecs
// let's keep seconds instead of nanosecs
$snapEpoch
=
preg_split
(
'/-/'
,
$snap
[
'gosaSnapshotTimestamp'
][
0
]);
$snapEpoch
=
preg_split
(
'/-/'
,
(
string
)
$snap
[
'gosaSnapshotTimestamp'
][
0
]);
if
(
$snapEpoch
[
0
]
<
$snapDateToDelete
)
{
if
(
$snapEpoch
[
0
]
<
$snapDateToDelete
)
{
$snapToDelete
[]
=
$snap
[
'dn'
];
$snapToDelete
[]
=
$snap
[
'dn'
];
}
}
...
@@ -373,7 +373,7 @@ class SnapshotHandler
...
@@ -373,7 +373,7 @@ class SnapshotHandler
$ldap
=
$config
->
get_ldap_link
();
$ldap
=
$config
->
get_ldap_link
();
/* Prepare bases and some other infos */
/* Prepare bases and some other infos */
$base_of_object
=
preg_replace
(
'/^[^,]+,/i'
,
''
,
$dn
);
$base_of_object
=
preg_replace
(
'/^[^,]+,/i'
,
''
,
(
string
)
$dn
);
$new_base
=
$this
->
snapshot_dn
(
$base_of_object
);
$new_base
=
$this
->
snapshot_dn
(
$base_of_object
);
$tmp
=
[];
$tmp
=
[];
...
...
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