Skip to content
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

LDAPAutheticate warnings in log #3911

Closed
halest opened this issue Jul 19, 2017 · 6 comments
Closed

LDAPAutheticate warnings in log #3911

halest opened this issue Jul 19, 2017 · 6 comments
Labels
Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Type: Bug Bugs within the core SuiteCRM codebase

Comments

@halest
Copy link

halest commented Jul 19, 2017

Issue

Updated to latest release yesterday evening, now have 15k lines of warnings in Log:
PHP Warning: Declaration of LDAPAuthenticateUser::loadUserOnLogin($name, $password) should be compatible with SugarAuthenticateUser::loadUserOnLogin($name, $password, $fallback = false, $PARAMS = Array) in C:\inetpub\suitecrm\modules\Users\authentication\LDAPAuthenticate\LDAPAuthenticateUser.php on line 52
Declaration of LDAPAuthenticateUser::authenticateUser($name, $password) should be compatible with SugarAuthenticateUser::authenticateUser($name, $password, $fallback = false) in C:\inetpub\suitecrm\modules\Users\authentication\LDAPAuthenticate\LDAPAuthenticateUser.php on line 52

Anyone know how to fix this?

Context

Your Environment

  • SuiteCRM Version used: 7.9.3
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): FF 52
  • Environment name and version (e.g. MySQL, PHP 7): MSSQL PHP7
  • Operating System and version (e.g Ubuntu 16.04): Win 2008R2
@Dillon-Brown Dillon-Brown added Type: Bug Bugs within the core SuiteCRM codebase Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds labels Jul 19, 2017
@pgorod
Copy link
Contributor

pgorod commented Jul 19, 2017

@halest can you please try this change and see if it solves the issue for you?

pgorod@9e132f3

(now updated with the missing parenthesis)

Dillon-Brown added a commit to Dillon-Brown/SuiteCRM that referenced this issue Jul 19, 2017
Dillon-Brown added a commit to Dillon-Brown/SuiteCRM that referenced this issue Jul 19, 2017
@Dillon-Brown
Copy link
Contributor

Make sure you also include () after PARAMS = Array

@Dillon-Brown Dillon-Brown added the Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution label Jul 19, 2017
@halest
Copy link
Author

halest commented Jul 19, 2017

@pgorod Thank you for the effort. I have been playing around with the commits and it seems the least-amount-of-change-solution to get rid of the warnings while keeping it functional would be to change the function declarations like so:
function authenticateUser($name, $password) {
to
function authenticateUser($name, $password, $fallback = false) {
and
function loadUserOnLogin($name, $password) {
to
function loadUserOnLogin($name, $password, $fallback = false, $PARAMS = Array()) {

So good on my end

@pgorod
Copy link
Contributor

pgorod commented Jul 19, 2017

@Dillon-Brown can you please add a commit to your PR with

function authenticateUser($name, $password, $fallback = false) {

@erikschwalbe
Copy link

After change:
function loadUserOnLogin($name, $password) {
to
function loadUserOnLogin($name, $password, $fallback = false, $PARAMS = Array()) {
there is a new warning in logfile:
PHP Warning: in_array() expects parameter 2 to be array, string given in /var/www/suitecrm/modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php on line 124

@pgorod
Copy link
Contributor

pgorod commented Nov 7, 2017

@erikschwalbe actually I think that warning is a sign of a bug: the order of the parameters in that in_array seems to be inverted. Not only it's getting a string where it expects an array, it's also getting an array where it expects a string.

I believe probably what was intended in that line was this:

if (!in_array($GLOBALS['ldap_config']->settings['ldap_group_user_attr']), $attrs) {
     $attrs[] = $GLOBALS['ldap_config']->settings['ldap_group_user_attr'];
}

Click to check out in_array syntax.

@Dillon-Brown what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

4 participants