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-plugins
Commits
5d55120b
Verified
Commit
5d55120b
authored
5 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
feat(ipam) Sync System fields with interfaces IP and Macs
issue
#6039
parent
a12f0708
dev
6104-mail-methods-refactor
6231-give-the-ability-to-the-webservice-to-notice-if-an-attribute-is-monovalued-or-multivalued
6237-add-requiredattrs-array-to-the-webservice-informations
6245-adapt-the-ci-to-the-reorganisation-of-the-dev-tools-and-fixing-the-trigger-downstream-pipelines
6250-supann-configuration-backend-requires-account-life-cycle-section
6280-plugins-update-plugins-to-take-into-consideration-the-new-directory-of-core-structure
6310-tasks-reminder-error-in-the-schema-duplicate-attribute-id
6311-put-the-version-1-5-in-all-yaml-for-fusiondirectory-1-5
6322-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen-2
6332-zimbra-allows-update-of-data-for-unknown-domain-name-for-specific-individual-aliases
6337-webservice-issue-with-archiving-post-request-not-responding-but-successfully-archiving-user
6341-supann-extract-resources-states-sub-states-from-backend-configuration-to-their-own-objects
6346-lifecycle-adaptation-to-select-supann-resources-and-related-states-via-regex-mechanism
master
fusiondirectory-1.5
fusiondirectory-1.4
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ipam/admin/systems/ipam/class_interfacesManagement.inc
+20
-5
ipam/admin/systems/ipam/class_interfacesManagement.inc
ipam/admin/systems/ipam/class_networkInterface.inc
+2
-1
ipam/admin/systems/ipam/class_networkInterface.inc
systems/admin/systems/class_ipHostPlugin.inc
+19
-0
systems/admin/systems/class_ipHostPlugin.inc
with
41 additions
and
6 deletions
+41
-6
ipam/admin/systems/ipam/class_interfacesManagement.inc
+
20
−
5
View file @
5d55120b
...
...
@@ -46,7 +46,6 @@ class interfacesManagement extends management implements SimpleTab
var
$cn
;
public
static
$columns
=
[
[
'ObjectTypeColumn'
,
[]],
[
'LinkColumn'
,
[
'attributes'
=>
'nameAttr'
,
'label'
=>
'Name'
]],
[
'Column'
,
[
'attributes'
=>
'macAddress'
,
'label'
=>
'Mac'
]],
[
'Column'
,
[
'attributes'
=>
'fdNetworkInterfaceVlanId'
,
'label'
=>
'VLAN id'
]],
...
...
@@ -81,6 +80,8 @@ class interfacesManagement extends management implements SimpleTab
$this
->
parent
=
$parent
;
parent
::
__construct
([
'networkInterface'
],
[]);
$this
->
parent
->
getBaseObject
()
->
setNetworkAttributesReadOnly
(
TRUE
);
}
protected
function
setUpListing
()
...
...
@@ -108,18 +109,32 @@ class interfacesManagement extends management implements SimpleTab
function
save_object
()
{
// save_object of the dialog is called in management::execute
/* Sync base tab fields with interfaces */
$entryIterator
=
$this
->
listing
->
getIterator
();
$macAddress
=
[];
$ipHostNumber
=
[];
foreach
(
$entryIterator
as
$entry
)
{
if
(
!
empty
(
$entry
[
'macAddress'
]))
{
array_push
(
$macAddress
,
...
$entry
[
'macAddress'
]);
}
if
(
!
empty
(
$entry
[
'ipHostNumber'
]))
{
array_push
(
$ipHostNumber
,
...
$entry
[
'ipHostNumber'
]);
}
}
$this
->
parent
->
getBaseObject
()
->
macAddress
=
array_values
(
array_unique
(
$macAddress
));
$this
->
parent
->
getBaseObject
()
->
ipHostNumber
=
array_values
(
array_unique
(
$ipHostNumber
));
}
public
function
remove
(
bool
$fulldelete
=
FALSE
):
array
{
$errors
=
[];
return
$errors
;
return
[];
}
public
function
save
():
array
{
$errors
=
[];
return
$errors
;
return
[];
}
/*! \brief Prepare active services to be copied.
...
...
This diff is collapsed.
Click to expand it.
ipam/admin/systems/ipam/class_
system
Interface.inc
→
ipam/admin/systems/ipam/class_
network
Interface.inc
+
2
−
1
View file @
5d55120b
...
...
@@ -32,7 +32,8 @@ class networkInterface extends simplePlugin
'plObjectType'
=>
[
'networkInterface'
=>
[
'name'
=>
_
(
'Network interface'
),
'ou'
=>
''
,
'icon'
=>
'geticon.php?context=category&icon=network&size=16'
,
'icon'
=>
'images/empty.png'
,
'tabClass'
=>
'simpleTabs_noSpecial'
,
]],
'plProvidedAcls'
=>
parent
::
generatePlProvidedAcls
(
static
::
getAttributesInfo
())
...
...
This diff is collapsed.
Click to expand it.
systems/admin/systems/class_ipHostPlugin.inc
+
19
−
0
View file @
5d55120b
...
...
@@ -25,6 +25,8 @@
*/
class
ipHostPlugin
extends
simplePlugin
{
protected
$networkAttributesReadOnly
=
FALSE
;
function
__construct
(
$dn
=
NULL
,
$object
=
NULL
,
$parent
=
NULL
,
$mainTab
=
FALSE
)
{
global
$config
;
...
...
@@ -51,4 +53,21 @@ class ipHostPlugin extends simplePlugin
}
return
parent
::
mergeObjectClasses
(
$objectclasses
);
}
public
function
setNetworkAttributesReadOnly
(
bool
$networkAttributesReadOnly
)
{
$this
->
networkAttributesReadOnly
=
$networkAttributesReadOnly
;
}
public
function
attrIsWriteable
(
$attr
):
bool
{
if
(
!
is_object
(
$attr
))
{
$attr
=
$this
->
attributesAccess
[
$attr
];
}
if
(
$this
->
networkAttributesReadOnly
&&
in_array
(
$attr
->
getLdapName
(),
[
'ipHostNumber'
,
'macAddress'
]))
{
return
FALSE
;
}
else
{
return
parent
::
attrIsWriteable
(
$attr
);
}
}
}
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