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
1bc65825
Verified
Commit
1bc65825
authored
1 month ago
by
dockx thibault
Browse files
Options
Download
Patches
Plain Diff
(Mangement) - adds some files to php 8.2
Adds file to php8.2
parent
04864c4e
core-php8
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/management/class_ListingEntry.inc
+4
-7
include/management/class_ListingEntry.inc
include/management/class_ManagementConfigurationDialog.inc
+8
-8
include/management/class_ManagementConfigurationDialog.inc
include/management/class_managementFilter.inc
+6
-6
include/management/class_managementFilter.inc
with
18 additions
and
21 deletions
+18
-21
include/management/class_ListingEntry.inc
+
4
−
7
View file @
1bc65825
...
...
@@ -40,20 +40,17 @@ class ListingEntry implements ArrayAccess
* \brief Object type
*/
public
$type
;
private
$attrs
;
protected
$listing
;
/* Cache where columns may store stuff */
public
$cache
=
[];
public
function
__construct
(
managementListing
$listing
,
string
$type
,
string
$dn
,
array
$attrs
,
int
$row
=
NULL
)
public
function
__construct
(
managementListing
$listing
,
string
$type
,
string
$dn
,
private
array
$attrs
,
int
$row
=
NULL
)
{
$this
->
listing
=
$listing
;
$this
->
type
=
$type
;
$this
->
dn
=
$dn
;
$this
->
aclBase
=
$dn
;
$this
->
attrs
=
$attrs
;
$this
->
row
=
$row
;
}
...
...
@@ -84,12 +81,12 @@ class ListingEntry implements ArrayAccess
public
function
isTemplate
():
bool
{
return
preg_match
(
'/^template_/'
,
$this
->
type
);
return
preg_match
(
'/^template_/'
,
(
string
)
$this
->
type
);
}
public
function
getTemplatedType
():
string
{
return
preg_replace
(
'/^template_/'
,
''
,
$this
->
type
);
return
preg_replace
(
'/^template_/'
,
''
,
(
string
)
$this
->
type
);
}
public
function
getTemplatedFields
():
array
...
...
@@ -104,7 +101,7 @@ class ListingEntry implements ArrayAccess
$infos
=
objects
::
infos
(
$this
->
getTemplatedType
());
$rights
=
$ui
->
get_permissions
(
$this
->
aclBase
,
$infos
[
'aclCategory'
]
.
'/'
.
(
$this
->
isTemplate
()
?
'template'
:
$infos
[
'mainTab'
]));
foreach
(
str_split
(
$acls
)
as
$acl
)
{
if
(
str
pos
(
$rights
,
$acl
)
===
FALSE
)
{
if
(
!
str
_contains
((
string
)
$rights
,
$acl
))
{
return
FALSE
;
}
}
...
...
This diff is collapsed.
Click to expand it.
include/management/class_ManagementConfigurationDialog.inc
+
8
−
8
View file @
1bc65825
...
...
@@ -128,10 +128,10 @@ class ManagementConfigurationDialog extends ManagementDialog
$this
->
attributesAccess
[
'resetInLdap'
]
->
setVisible
(
FALSE
);
}
if
(
!
$config
->
hasManagementConfig
(
get_class
(
$this
->
parent
)
,
TRUE
))
{
if
(
!
$config
->
hasManagementConfig
(
$this
->
parent
::
class
,
TRUE
))
{
$this
->
attributesAccess
[
'resetInLdapUser'
]
->
setVisible
(
FALSE
);
}
if
(
!
$config
->
hasManagementConfig
(
get_class
(
$this
->
parent
)
,
FALSE
))
{
if
(
!
$config
->
hasManagementConfig
(
$this
->
parent
::
class
,
FALSE
))
{
$this
->
attributesAccess
[
'resetInLdap'
]
->
setVisible
(
FALSE
);
}
...
...
@@ -169,7 +169,7 @@ class ManagementConfigurationDialog extends ManagementDialog
return
TRUE
;
}
elseif
((
is_object
(
$attr
)
&&
in_array
(
$attr
->
getLdapName
(),
$configAttrs
))
||
in_array
(
$attr
,
$configAttrs
))
{
$acl
=
$ui
->
get_permissions
(
CONFIGRDN
.
$config
->
current
[
'BASE'
],
'configuration/configInLdap'
,
'fdManagementConfig'
,
$this
->
readOnly
());
return
(
str
pos
(
$acl
,
'w'
)
!==
FALSE
);
return
(
str
_contains
((
string
)
$acl
,
'w'
)
);
}
else
{
return
parent
::
attrIsWriteable
(
$attr
);
}
...
...
@@ -178,7 +178,7 @@ class ManagementConfigurationDialog extends ManagementDialog
function
handle_resetInLdapUser
()
{
global
$config
;
$errors
=
$config
->
updateManagementConfig
(
get_class
(
$this
->
parent
)
,
NULL
,
TRUE
);
$errors
=
$config
->
updateManagementConfig
(
$this
->
parent
::
class
,
NULL
,
TRUE
);
msg_dialog
::
displayChecks
(
$errors
);
if
(
empty
(
$errors
))
{
$this
->
attributesAccess
[
'resetInLdapUser'
]
->
setVisible
(
FALSE
);
...
...
@@ -188,7 +188,7 @@ class ManagementConfigurationDialog extends ManagementDialog
function
handle_resetInLdap
()
{
global
$config
;
$errors
=
$config
->
updateManagementConfig
(
get_class
(
$this
->
parent
)
,
NULL
,
FALSE
);
$errors
=
$config
->
updateManagementConfig
(
$this
->
parent
::
class
,
NULL
,
FALSE
);
msg_dialog
::
displayChecks
(
$errors
);
if
(
empty
(
$errors
))
{
$this
->
attributesAccess
[
'resetInLdap'
]
->
setVisible
(
FALSE
);
...
...
@@ -213,7 +213,7 @@ class ManagementConfigurationDialog extends ManagementDialog
foreach
(
$values
as
$value
)
{
$column
=
[
$value
[
0
],
[]];
if
(
!
empty
(
$value
[
1
]))
{
$jsonDecoded
=
json_decode
(
$value
[
1
],
TRUE
);
$jsonDecoded
=
json_decode
(
(
string
)
$value
[
1
],
TRUE
);
if
(
$jsonDecoded
!==
NULL
)
{
$column
[
1
][
'attributes'
]
=
$jsonDecoded
;
}
else
{
...
...
@@ -228,11 +228,11 @@ class ManagementConfigurationDialog extends ManagementDialog
$this
->
parent
->
setColumnConfiguration
(
$columnInfos
);
if
(
$this
->
saveInLdapUser
)
{
return
$config
->
updateManagementConfig
(
get_class
(
$this
->
parent
)
,
$columnInfos
,
TRUE
);
return
$config
->
updateManagementConfig
(
$this
->
parent
::
class
,
$columnInfos
,
TRUE
);
}
if
(
$this
->
saveInLdap
)
{
return
$config
->
updateManagementConfig
(
get_class
(
$this
->
parent
)
,
$columnInfos
);
return
$config
->
updateManagementConfig
(
$this
->
parent
::
class
,
$columnInfos
);
}
return
[];
...
...
This diff is collapsed.
Click to expand it.
include/management/class_managementFilter.inc
+
6
−
6
View file @
1bc65825
...
...
@@ -120,7 +120,7 @@ class managementFilter
$this
->
parent
->
listing
->
fillSearchedAttributes
(
$type
,
$attrs
);
foreach
(
$attrs
as
$attr
=>
$acl
)
{
$rights
=
$ui
->
get_permissions
(
$base
,
$acl
,
$attr
);
if
(
str
pos
(
$rights
,
'r'
)
!==
FALSE
)
{
if
(
str
_contains
((
string
)
$rights
,
'r'
))
{
$this
->
searchAttributes
[
$type
][]
=
$attr
;
}
}
...
...
@@ -143,12 +143,12 @@ class managementFilter
$searchAttrs
=
[];
foreach
(
$this
->
searchAttributes
as
$type
=>
$attrs
)
{
foreach
(
$attrs
as
$attr
)
{
$searchAttrs
[]
=
strtolower
(
$type
)
.
'/'
.
$attr
;
$searchAttrs
[]
=
strtolower
(
(
string
)
$type
)
.
'/'
.
$attr
;
}
}
$smarty
->
assign
(
'SEARCHDESC'
,
sprintf
(
_
(
'Searches in %s'
),
implode
(
', '
,
$searchAttrs
)));
$parentClass
=
get_class
(
$this
->
parent
)
;
$parentClass
=
$this
->
parent
::
class
;
if
(
!
$parentClass
::
$skipTemplates
)
{
$smarty
->
assign
(
'TEMPLATES'
,
$this
->
showTemplates
);
}
...
...
@@ -201,7 +201,7 @@ class managementFilter
$elementFilters
=
[];
if
(
!
empty
(
$this
->
search
))
{
if
(
preg_match
(
'/^\(.+\)$/'
,
$this
->
search
))
{
if
(
preg_match
(
'/^\(.+\)$/'
,
(
string
)
$this
->
search
))
{
$elementFilters
[]
=
$this
->
search
;
}
else
{
$searchAttributesTmp
=
$this
->
searchAttributes
[
$type
];
...
...
@@ -224,7 +224,7 @@ class managementFilter
$filter
=
'(&'
.
implode
(
''
,
$typeElementFilters
)
.
')'
;
}
$parentClass
=
get_class
(
$this
->
parent
)
;
$parentClass
=
$this
->
parent
::
class
;
if
(
!
$parentClass
::
$skipTemplates
&&
$this
->
showTemplates
)
{
try
{
$ldapEntries
=
objects
::
ls
(
$type
,
$attrsAsked
,
((
$this
->
scope
==
'one'
)
?
'ou=templates,'
.
$searchBase
:
$searchBase
),
$filter
,
TRUE
,
$this
->
scope
,
TRUE
);
...
...
@@ -290,7 +290,7 @@ class managementFilter
continue
;
}
foreach
(
$this
->
parent
->
whiteList
[
'branches'
]
as
$branch
)
{
if
(
preg_match
(
'/'
.
preg_quote
(
$branch
,
'/'
)
.
'$/'
,
$dn
))
{
if
(
preg_match
(
'/'
.
preg_quote
(
(
string
)
$branch
,
'/'
)
.
'$/'
,
$dn
))
{
continue
2
;
}
}
...
...
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