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
27aaa535
Commit
27aaa535
authored
8 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
Using custom exceptions in class_objects.inc as well
parent
8d32fd18
dev
6342-update-the-locales-for-1-5
6344-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen
6365-core-locking-mechanism-is-not-changing-the-mail-ressource-it-does-lock-the-mail-account
6365-core-when-lock-mechanism-is-trigger-the-user-should-not-be-editable-if-not-unlock
6378-orcid-test-method-is-wrong-and-break-orcid-saving
core-php8
master
fusiondirectory-1.5
fusiondirectory-1.4
fusiondirectory-1.3.1
fusiondirectory-1.3
fusiondirectory-1.2.3
fusiondirectory-1.2.2
fusiondirectory-1.2.1
fusiondirectory-1.2
fusiondirectory-1.1.1
fusiondirectory-1.1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class_objects.inc
+5
-3
include/class_objects.inc
with
5 additions
and
3 deletions
+5
-3
include/class_objects.inc
+
5
−
3
View file @
27aaa535
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
class
NonExistingObjectTypeException
extends
Exception
{};
class
NonExistingObjectTypeException
extends
Exception
{};
class
NonExistingBranchException
extends
Exception
{};
class
NonExistingBranchException
extends
Exception
{};
class
EmptyFilterException
extends
Exception
{};
class
EmptyFilterException
extends
Exception
{};
class
NoManagementClassException
extends
Exception
{};
class
LDAPFailureException
extends
Exception
{};
class
objects
class
objects
{
{
...
@@ -131,7 +133,7 @@ class objects
...
@@ -131,7 +133,7 @@ class objects
$ldap
->
cd
(
$ou
);
$ldap
->
cd
(
$ou
);
$ldap
->
search
(
$filter
,
$search_attrs
);
$ldap
->
search
(
$filter
,
$search_attrs
);
if
(
!
$ldap
->
success
())
{
if
(
!
$ldap
->
success
())
{
throw
new
Exception
(
$ldap
->
get_error
());
throw
new
LDAPFailure
Exception
(
$ldap
->
get_error
());
}
}
return
$ldap
;
return
$ldap
;
}
}
...
@@ -164,7 +166,7 @@ class objects
...
@@ -164,7 +166,7 @@ class objects
$infos
=
static
::
infos
(
$type
);
$infos
=
static
::
infos
(
$type
);
if
(
!
isset
(
$infos
[
'management'
]))
{
if
(
!
isset
(
$infos
[
'management'
]))
{
throw
new
Exception
(
'Asked for link for type "'
.
$type
.
'" but it does not have a management class'
);
throw
new
NoManagementClass
Exception
(
'Asked for link for type "'
.
$type
.
'" but it does not have a management class'
);
}
}
$pInfos
=
pluglist
::
pluginInfos
(
$infos
[
'management'
]);
$pInfos
=
pluglist
::
pluginInfos
(
$infos
[
'management'
]);
$index
=
$pInfos
[
'INDEX'
];
$index
=
$pInfos
[
'INDEX'
];
...
@@ -184,7 +186,7 @@ class objects
...
@@ -184,7 +186,7 @@ class objects
$text
=
$dn
;
$text
=
$dn
;
}
}
}
else
{
}
else
{
throw
new
Exception
(
'Dn '
.
$dn
.
' not found in LDAP'
);
throw
new
NonExistingLdapNode
Exception
(
'Dn '
.
$dn
.
' not found in LDAP'
);
}
}
}
elseif
(
is_array
(
$text
))
{
}
elseif
(
is_array
(
$text
))
{
$text
=
$text
[
$infos
[
'nameAttr'
]][
0
];
$text
=
$text
[
$infos
[
'nameAttr'
]][
0
];
...
...
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