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
533ee388
Verified
Commit
533ee388
authored
4 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
fix(plugins) Adapt code to create_missing_trees error handling
issue
#6061
parent
acb523a1
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
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
dhcp/admin/dhcp/class_dhcpConfiguration.inc
+5
-1
dhcp/admin/dhcp/class_dhcpConfiguration.inc
fai/admin/systems/services/repository/class_serviceRepository.inc
+8
-6
...n/systems/services/repository/class_serviceRepository.inc
fusioninventory/html/collect.php
+5
-1
fusioninventory/html/collect.php
gpg/addons/gpg/class_pgpServerInfo.inc
+4
-9
gpg/addons/gpg/class_pgpServerInfo.inc
user-reminder/config/user-reminder/class_userReminderConfig.inc
+5
-1
...eminder/config/user-reminder/class_userReminderConfig.inc
with
27 additions
and
18 deletions
+27
-18
dhcp/admin/dhcp/class_dhcpConfiguration.inc
+
5
−
1
View file @
533ee388
...
...
@@ -131,7 +131,11 @@ class dhcpConfiguration extends simplePlugin
/* Save dhcp settings */
$ldap
=
$config
->
get_ldap_link
();
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
create_missing_trees
(
preg_replace
(
'/^[^,]+,/'
,
''
,
$this
->
dn
));
try
{
$ldap
->
create_missing_trees
(
preg_replace
(
'/^[^,]+,/'
,
''
,
$this
->
dn
));
}
catch
(
FusionDirectoryError
$error
)
{
return
[
$error
];
}
$cache
=
$this
->
attributesAccess
[
'dhcpSections'
]
->
getCache
();
$errors
=
[];
$new
=
(
$this
->
orig_dn
==
'new'
);
...
...
This diff is collapsed.
Click to expand it.
fai/admin/systems/services/repository/class_serviceRepository.inc
+
8
−
6
View file @
533ee388
...
...
@@ -235,9 +235,10 @@ class serviceRepository extends simpleService
$ldap
->
cat
(
$fai
,
[
'dn'
]);
if
(
!
$ldap
->
count
())
{
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
create_missing_trees
(
$fai
);
if
(
!
$ldap
->
success
())
{
msg_dialog
::
display
(
_
(
'LDAP error'
),
msgPool
::
ldaperror
(
$ldap
->
get_error
(),
$fai
,
LDAP_ADD
,
get_class
()),
LDAP_ERROR
);
try
{
$ldap
->
create_missing_trees
(
$fai
);
}
catch
(
FusionDirectoryError
$error
)
{
$error
->
display
();
return
;
}
}
...
...
@@ -252,9 +253,10 @@ class serviceRepository extends simpleService
// Add classes OUs
foreach
([
'Script'
,
'Hook'
,
'Template'
,
'Variable'
,
'Profile'
,
'Package'
,
'Partition'
]
as
$type
)
{
$ldap
->
cd
(
$dn
);
$ldap
->
create_missing_trees
(
get_ou
(
'fai'
.
$type
.
'RDN'
)
.
$dn
);
if
(
!
$ldap
->
success
())
{
msg_dialog
::
display
(
_
(
'LDAP error'
),
msgPool
::
ldaperror
(
$ldap
->
get_error
(),
get_ou
(
'fai'
.
$type
.
'RDN'
)
.
$dn
,
LDAP_ADD
,
get_class
()),
LDAP_ERROR
);
try
{
$ldap
->
create_missing_trees
(
get_ou
(
'fai'
.
$type
.
'RDN'
)
.
$dn
);
}
catch
(
FusionDirectoryError
$error
)
{
$error
->
display
();
}
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
fusioninventory/html/collect.php
+
5
−
1
View file @
533ee388
...
...
@@ -114,7 +114,11 @@ if (preg_match('/QUERY>PROLOG<\/QUERY/', $xml)) {
}
else
{
/* Make sure branch is existing */
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
create_missing_trees
(
get_ou
(
'inventoryRDN'
)
.
$config
->
current
[
'BASE'
]);
try
{
$ldap
->
create_missing_trees
(
get_ou
(
'inventoryRDN'
)
.
$config
->
current
[
'BASE'
]);
}
catch
(
FusionDirectoryError
$error
)
{
returnError
(
$error
->
getMessage
());
}
}
/* Create root node */
$ldap
->
cd
(
$dn
);
...
...
This diff is collapsed.
Click to expand it.
gpg/addons/gpg/class_pgpServerInfo.inc
+
4
−
9
View file @
533ee388
...
...
@@ -95,15 +95,10 @@ class pgpServerInfo extends simplePlugin
if
(
!
$ldap
->
count
())
{
@
DEBUG
(
DEBUG_TRACE
,
__LINE__
,
__FUNCTION__
,
__FILE__
,
$this
->
pgpBaseKeySpaceDN
,
"Creating branch"
);
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
create_missing_trees
(
$this
->
pgpBaseKeySpaceDN
);
if
(
!
$ldap
->
success
())
{
$errors
[]
=
new
SimplePluginLdapError
(
$this
,
$this
->
pgpBaseKeySpaceDN
,
LDAP_ADD
,
$ldap
->
get_error
(),
$ldap
->
get_errno
()
);
try
{
$ldap
->
create_missing_trees
(
$this
->
pgpBaseKeySpaceDN
);
}
catch
(
FusionDirectoryError
$error
)
{
$errors
[]
=
SimplePluginError
::
relocate
(
$this
,
$error
);
}
}
/* Delete the old branch if empty */
...
...
This diff is collapsed.
Click to expand it.
user-reminder/config/user-reminder/class_userReminderConfig.inc
+
5
−
1
View file @
533ee388
...
...
@@ -203,7 +203,11 @@ class userReminderConfig extends simplePlugin
global
$config
;
$ldap
=
$config
->
get_ldap_link
();
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
create_missing_trees
(
get_ou
(
'reminderTokenRDN'
)
.
get_ou
(
'fusiondirectoryRDN'
)
.
$config
->
current
[
'BASE'
]);
try
{
$ldap
->
create_missing_trees
(
get_ou
(
'reminderTokenRDN'
)
.
get_ou
(
'fusiondirectoryRDN'
)
.
$config
->
current
[
'BASE'
]);
}
catch
(
FusionDirectoryError
$error
)
{
$error
->
display
();
}
parent
::
post_save
();
}
}
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