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
57ec49e0
Verified
Commit
57ec49e0
authored
1 month ago
by
dockx thibault
Browse files
Options
Download
Patches
Plain Diff
Feat(ListingManagement) - adapted
Adaps class listing to php8.2
parent
ffe2cf2c
core-php8
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/management/class_ListingEntry.inc
+12
-8
include/management/class_ListingEntry.inc
with
12 additions
and
8 deletions
+12
-8
include/management/class_ListingEntry.inc
+
12
−
8
View file @
57ec49e0
...
@@ -40,36 +40,39 @@ class ListingEntry implements ArrayAccess
...
@@ -40,36 +40,39 @@ class ListingEntry implements ArrayAccess
* \brief Object type
* \brief Object type
*/
*/
public
$type
;
public
$type
;
private
$attrs
;
protected
$listing
;
protected
$listing
;
/* Cache where columns may store stuff */
/* Cache where columns may store stuff */
public
$cache
=
[];
public
$cache
=
[];
public
function
__construct
(
managementListing
$listing
,
string
$type
,
string
$dn
,
private
array
$attrs
,
int
$row
=
NULL
)
public
function
__construct
(
managementListing
$listing
,
string
$type
,
string
$dn
,
array
$attrs
,
int
$row
=
NULL
)
{
{
$this
->
listing
=
$listing
;
$this
->
listing
=
$listing
;
$this
->
type
=
$type
;
$this
->
type
=
$type
;
$this
->
dn
=
$dn
;
$this
->
dn
=
$dn
;
$this
->
aclBase
=
$dn
;
$this
->
aclBase
=
$dn
;
$this
->
attrs
=
$attrs
;
$this
->
row
=
$row
;
$this
->
row
=
$row
;
}
}
public
function
offsetSet
(
$offset
,
$value
)
:
void
public
function
offsetSet
(
$offset
,
$value
)
{
{
$this
->
attrs
[
$offset
]
=
$value
;
$this
->
attrs
[
$offset
]
=
$value
;
}
}
public
function
offsetExists
(
$offset
)
:
bool
public
function
offsetExists
(
$offset
)
{
{
return
isset
(
$this
->
attrs
[
$offset
]);
return
isset
(
$this
->
attrs
[
$offset
]);
}
}
public
function
offsetUnset
(
$offset
)
:
void
public
function
offsetUnset
(
$offset
)
{
{
unset
(
$this
->
attrs
[
$offset
]);
unset
(
$this
->
attrs
[
$offset
]);
}
}
public
function
offsetGet
(
$offset
)
:
mixed
public
function
offsetGet
(
$offset
)
{
{
return
(
isset
(
$this
->
attrs
[
$offset
])
?
$this
->
attrs
[
$offset
]
:
NULL
);
return
(
isset
(
$this
->
attrs
[
$offset
])
?
$this
->
attrs
[
$offset
]
:
NULL
);
}
}
...
@@ -81,12 +84,12 @@ class ListingEntry implements ArrayAccess
...
@@ -81,12 +84,12 @@ class ListingEntry implements ArrayAccess
public
function
isTemplate
():
bool
public
function
isTemplate
():
bool
{
{
return
preg_match
(
'/^template_/'
,
(
string
)
$this
->
type
);
return
preg_match
(
'/^template_/'
,
$this
->
type
);
}
}
public
function
getTemplatedType
():
string
public
function
getTemplatedType
():
string
{
{
return
preg_replace
(
'/^template_/'
,
''
,
(
string
)
$this
->
type
);
return
preg_replace
(
'/^template_/'
,
''
,
$this
->
type
);
}
}
public
function
getTemplatedFields
():
array
public
function
getTemplatedFields
():
array
...
@@ -101,7 +104,7 @@ class ListingEntry implements ArrayAccess
...
@@ -101,7 +104,7 @@ class ListingEntry implements ArrayAccess
$infos
=
objects
::
infos
(
$this
->
getTemplatedType
());
$infos
=
objects
::
infos
(
$this
->
getTemplatedType
());
$rights
=
$ui
->
get_permissions
(
$this
->
aclBase
,
$infos
[
'aclCategory'
]
.
'/'
.
(
$this
->
isTemplate
()
?
'template'
:
$infos
[
'mainTab'
]));
$rights
=
$ui
->
get_permissions
(
$this
->
aclBase
,
$infos
[
'aclCategory'
]
.
'/'
.
(
$this
->
isTemplate
()
?
'template'
:
$infos
[
'mainTab'
]));
foreach
(
str_split
(
$acls
)
as
$acl
)
{
foreach
(
str_split
(
$acls
)
as
$acl
)
{
if
(
!
str
_contains
((
string
)
$rights
,
$acl
))
{
if
(
str
pos
(
$rights
,
$acl
)
===
FALSE
)
{
return
FALSE
;
return
FALSE
;
}
}
}
}
...
@@ -125,3 +128,4 @@ class ListingEntry implements ArrayAccess
...
@@ -125,3 +128,4 @@ class ListingEntry implements ArrayAccess
return
$ui
->
allow_snapshot_restore
(
$this
->
aclBase
,
$infos
[
'aclCategory'
],
FALSE
);
return
$ui
->
allow_snapshot_restore
(
$this
->
aclBase
,
$infos
[
'aclCategory'
],
FALSE
);
}
}
}
}
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