-
Notifications
You must be signed in to change notification settings - Fork 114
LdapSource: Remove call to undefined fatal_error() function #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LdapSource: Remove call to undefined fatal_error() function #118
Conversation
|
@ctgraham We are very sorry for not replying to your 3 pull requests. I will take a look at all of them as soon as possible. |
| if (!ldap_start_tls($this->database)) { | ||
| $this->log("Ldap_start_tls failed", 'ldap.error'); | ||
| fatal_error("Ldap_start_tls failed"); | ||
| return $this->disconnect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer throwing Exception here over returning false. For example, if it were Mysql connection, it would throw PDOException if it failed to connect to the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but nowhere else in this project currently throws an Exception. There are various places in this class where we could:
datasources/Model/Datasource/LdapSource.php
Lines 548 to 549 in 84cc8d0
| $this->log("Error updating $dn: " . ldap_error($this->database) . "\nHere is what I sent: " . print_r($entry, true), 'ldap.error'); | |
| return false; |
datasources/Model/Datasource/LdapSource.php
Lines 597 to 598 in 84cc8d0
| $this->log("Failed Trying to delete: $dn \nLdap Erro:$errMsg", 'ldap.error'); | |
| return false; |
datasources/Model/Datasource/LdapSource.php
Lines 748 to 749 in 84cc8d0
| $this->log( "LDAP schema filter $schemaFilter is invalid!", 'ldap.error'); | |
| return array(); |
Shouldn't refactoring to use Exceptions be a different Issue/PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing the merge conflict for #115. Each of these PRs does have a failed test, but it looked to me like it is all the same failure, outside of the scope of this class:
- XmlrpcSourceTest::testRequest
Failed asserting that -32300 matches expected -32700.
Can you point me to any checks or conflicts that should be addressed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function
fatal_error()is not defined; Disconnecting and returning to the caller is probably preferred anyway.