Skip to content

Conversation

@ctgraham
Copy link
Contributor

The function fatal_error() is not defined; Disconnecting and returning to the caller is probably preferred anyway.

@chinpei215
Copy link
Contributor

chinpei215 commented Oct 8, 2017

@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();
Copy link
Contributor

@chinpei215 chinpei215 Oct 8, 2017

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.

Copy link
Contributor Author

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:

$this->log("Error updating $dn: " . ldap_error($this->database) . "\nHere is what I sent: " . print_r($entry, true), 'ldap.error');
return false;

$this->log("Failed Trying to delete: $dn \nLdap Erro:$errMsg", 'ldap.error');
return false;

$this->log( "LDAP schema filter $schemaFilter is invalid!", 'ldap.error');
return array();

Shouldn't refactoring to use Exceptions be a different Issue/PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. Now I am working on test cases for LdapSource. After I finished the work, I will merge this PR and #114. But I am not sure if I can merge #115, as it contains some conflicts. If your are still interested in it, then please rebase it and make sure test cases pass.

Copy link
Contributor Author

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:

  1. XmlrpcSourceTest::testRequest
    Failed asserting that -32300 matches expected -32700.

Can you point me to any checks or conflicts that should be addressed?

Copy link
Contributor

@chinpei215 chinpei215 Oct 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already merged #114 on my local environment to write test cases. And next, I tried to merge #115, but then it reported several conflicts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. When you've merged #114 into GitHub, I will be able to rebase #115 to resolve the conflicts.

@chinpei215 chinpei215 merged commit f1425d3 into cakephp:master Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants