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

Call to a member function user() on null #1551

Closed
ghost opened this issue Oct 13, 2016 · 11 comments
Closed

Call to a member function user() on null #1551

ghost opened this issue Oct 13, 2016 · 11 comments
Labels

Comments

@ghost
Copy link

ghost commented Oct 13, 2016

Steps to reproduce

  1. clean install
  2. configure ldap
  3. try to login with a wrong user leads to no login (works fine)
  4. try to login with valid ldap user/pass leads to error 500 -> identify.php:395

Expected behaviour

Let the user log in

Actual behaviour

apache error logs produce this at every login attemps:
[Thu Oct 13 16:20:46.650533 2016] [fcgid:warn] [pid 63232] [client 1.1.1.1:60844] mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to a member function user() on null in /home/teampamtmhyeb9zazvti/public_html/sources/identify.php:395, referer: http://teampass.readycomputing.com/index.php?page=items
[Thu Oct 13 16:20:46.650565 2016] [fcgid:warn] [pid 63232] [client 1.1.1.1:60844] mod_fcgid: stderr: Stack trace:, referer: http://teampass.readycomputing.com/index.php?page=items
[Thu Oct 13 16:20:46.650569 2016] [fcgid:warn] [pid 63232] [client 1.1.1.1:60844] mod_fcgid: stderr: #0 /home/teampamtmhyeb9zazvti/public_html/sources/identify.php(87): identifyUser('nuz/VxcXFxc/d/z...'), referer: http://teampass.readycomputing.com/index.php?page=items
[Thu Oct 13 16:20:46.650573 2016] [fcgid:warn] [pid 63232] [client 1.1.1.1:60844] mod_fcgid: stderr: #1 {main}, referer: http://teampass.readycomputing.com/index.php?page=items
[Thu Oct 13 16:20:46.650577 2016] [fcgid:warn] [pid 63232] [client 1.1.1.1:60844] mod_fcgid: stderr: thrown in /home/teampamtmhyeb9zazvti/public_html/sources/identify.php on line 395, referer: http://teampass.readycomputing.com/index.php?page=items

while ldap logs produce valid searches:
[13/Oct/2016:16:20:46 -0400] conn=34 fd=65 slot=65 connection from 127.0.0.1 to 127.0.0.1
[13/Oct/2016:16:20:46 -0400] conn=34 op=0 BIND dn="cn=directory manager" method=128 version=3
[13/Oct/2016:16:20:46 -0400] conn=34 op=0 RESULT err=0 tag=97 nentries=0 etime=0 dn="cn=directory manager"
[13/Oct/2016:16:20:46 -0400] conn=34 op=1 SRCH base="ou=People,dc=readycomputing,dc=com" scope=2 filter="(&(uid=test1)(objectClass=person))" attrs="distinguishedName"
[13/Oct/2016:16:20:46 -0400] conn=34 op=1 RESULT err=0 tag=101 nentries=1 etime=0
[13/Oct/2016:16:20:46 -0400] conn=34 op=2 SRCH base="ou=People,dc=readycomputing,dc=com" scope=2 filter="(memberUid=test1)" attrs="distinguishedName"
[13/Oct/2016:16:20:46 -0400] conn=34 op=2 RESULT err=0 tag=101 nentries=0 etime=0 notes=U
[13/Oct/2016:16:20:46 -0400] conn=34 op=3 BIND dn="uid=test1,ou=People,dc=readycomputing,dc=com" method=128 version=3
[13/Oct/2016:16:20:46 -0400] conn=34 op=3 RESULT err=0 tag=97 nentries=0 etime=0 dn="uid=test1,ou=people,dc=readycomputing,dc=com"
[13/Oct/2016:16:20:46 -0400] conn=34 op=4 UNBIND
[13/Oct/2016:16:20:46 -0400] conn=34 op=4 fd=65 closed - U1

Server configuration

Operating system:
RHEL 7.2 fully updated

Web server:
[root@appserver public_html]# apachectl -V
Server version: Apache/2.4.6 (CentOS)
Server built: Jul 19 2016 13:15:57
Server's Module Magic Number: 20120211:24
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

Database:
mysql Ver 15.1 Distrib 5.5.50-MariaDB, for Linux (x86_64) using readline

PHP version:
PHP 7.0.11 (cli) (built: Sep 14 2016 08:28:52) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

Teampass version:
TeamPass-2.1.26-final-2

Updated from an older Teampass or fresh install:
both, but latest test on fresh install

Client configuration

Browser:
multiple, firefox, chrome, midori, all the same result

Operating system:
multiple, linux different flavors, windows, all the same result

Logs

Web server error log

Insert your webserver log here
[Thu Oct 13 16:20:46.650533 2016] [fcgid:warn] [pid 63232] [client 104.163.129.90:60844] mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to a member function user() on null in /home/teampamtmhyeb9zazvti/public_html/sources/identify.php:395, referer: http://teampass.readycomputing.com/index.php?page=items
[Thu Oct 13 16:20:46.650565 2016] [fcgid:warn] [pid 63232] [client 104.163.129.90:60844] mod_fcgid: stderr: Stack trace:, referer: http://teampass.readycomputing.com/index.php?page=items
[Thu Oct 13 16:20:46.650569 2016] [fcgid:warn] [pid 63232] [client 104.163.129.90:60844] mod_fcgid: stderr: #0 /home/teampamtmhyeb9zazvti/public_html/sources/identify.php(87): identifyUser('nuz/VxcXFxc/d/z...'), referer: http://teampass.readycomputing.com/index.php?page=items
[Thu Oct 13 16:20:46.650573 2016] [fcgid:warn] [pid 63232] [client 104.163.129.90:60844] mod_fcgid: stderr: #1 {main}, referer: http://teampass.readycomputing.com/index.php?page=items
[Thu Oct 13 16:20:46.650577 2016] [fcgid:warn] [pid 63232] [client 104.163.129.90:60844] mod_fcgid: stderr: thrown in /home/teampamtmhyeb9zazvti/public_html/sources/identify.php on line 395, referer: http://teampass.readycomputing.com/index.php?page=items

Firebug log (How to?)

there is no response tab in firebug. There is a response header in headers tab:
Cache-Control
no-store, no-cache, must-revalidate
Connection
close
Content-Length
0
Content-Type
text/html; charset=utf-8
Date
Thu, 13 Oct 2016 20:20:46 GMT
Expires
Thu, 19 Nov 1981 08:52:00 GMT
Pragma
no-cache
Server
Apache/2.4.6
X-Powered-By
PHP/7.0.11

Parametersapplication/x-www-form-urlencodedDo not sort
6c120efbca80b0ca96f850919...
a02326dca60b8dbdcd6bec52a0843a80607480bf9c3a3bb28e
data
nuz/VxcXFxc/d/z9m+/p4bDTDkCjwIHnj1/n5un1WxevunB1esy+te91FPQ5vUMde+K6CxaFSHFvOCaSWAA6+QjnPX43Bv3SUtAiM1
+h30nXkW9Pnt4OHsRxNtYuf2MS5cHLNUIlNMHs1soQgwebPSIcG/4BSVs5fNBURCiP/5BYoyqgYa+amH8sfTzgwUc=
type
identify_user
Source
type=identify_user&data=nuz%2FVxcXFxc%2Fd%2Fz9m%2B%2Fp4bDTDkCjwIHnj1%2Fn5un1WxevunB1esy%2Bte91FPQ5vUMde
%2BK6CxaFSHFvOCaSWAA6%2BQjnPX43Bv3SUtAiM1%2Bh30nXkW9Pnt4OHsRxNtYuf2MS5cHLNUIlNMHs1soQgwebPSIcG%2F4BSVs5fNBURCiP
%2F5BYoyqgYa%2BamH8sfTzgwUc%3D&6c120efbca80b0ca96f850919b36e72ea54c0b378a66b8840a=a02326dca60b8dbdcd
6bec52a0843a80607480bf9c3a3bb28e

selection_440
selection_441
selection_442
selection_443

@nilsteampassnet
Copy link
Owner

In your ldap, are your users defined with "mail", "givenname" and "sn"?

@ghost
Copy link
Author

ghost commented Oct 14, 2016

Hi.

Yes they are. In fact, the error shown above happens after ldap return with success match of user-pass. The problem is the function user() not existing in php's eyes

Thanks in advance for your help.

@nilsteampassnet
Copy link
Owner

This function is defined in ldap library.
Are you sure that all LDAP files have been copied on your server?

@ghost
Copy link
Author

ghost commented Oct 14, 2016

Good suggestion, Prior to opening this ticket, I've uploaded the files twice and made a diff of webserver folder and uploaded unzipped copy. All identical.

@nilsteampassnet
Copy link
Owner

I don't understand.

In adLDAP.php, declaration is public function user() {
And adLDAPUsers.php, we have public function info(

And other users made it work.

Perhaps is there something wrong in ldap configuration?

I'm very bad in ldap so it is not easy to help here.

@ghost
Copy link
Author

ghost commented Oct 17, 2016

Hi.

Sorry to say that "PHP Fatal error: Uncaught Error: Call to a member function user() on null in " is PHP server and code related. LDAP query was done before reaching this point.

As you said, the function is public, but the object may not be global. I'll have to look into that. It's probably an object scope problem. Well... It HAS to be.

Regards.

Marc.

@radioactiv
Copy link

The issue was that adLDAP wasn't being used at all because it's only used when authenticating with Active Directory, not with "posix-search".

@nilsteampassnet
Copy link
Owner

Absolutely correct!

Thank you @radioactiv .

nilsteampassnet added a commit that referenced this issue Oct 22, 2016
Fix for #1551
Starting implementation of change of strategy for "Read-Only" users. They should be able to use personal folders is enabled.
nilsteampassnet added a commit that referenced this issue Oct 22, 2016
Fix for #1551
@ghost
Copy link
Author

ghost commented Oct 25, 2016

why the error message then?
why is it referencing function user with null?
if AD is not involved, why then php get into the adLDAP new object creation
and fails in the loop on line 395?

These are, I think, legitimate questions that need answer. I'll have to
find time and get to the bottom of this by myself if you can't provide
answers to the above.

Please advise.

Marc.

Marc.
Sent from my mobile.

On Oct 22, 2016 2:41 AM, "Nils Laumaillé" notifications@github.com wrote:

Absolutely correct!

Thank you @radioactiv https://github.com/radioactiv .


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1551 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVxG7YhwaBwwGb3nuopp7JQo088-jQ_gks5q2bAhgaJpZM4KWV6a
.

@ghost
Copy link
Author

ghost commented Oct 25, 2016

Ok. I don't have time to check and report back?
No answer to my questions either?
What if I find an issue with the code?

Marc.
Sent from my mobile.

On Oct 23, 2016 11:19 AM, "Nils Laumaillé" notifications@github.com wrote:

Closed #1551 #1551.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1551 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVxG7f0NMQVz7pKXA3qaSAv1Tb1GvT4bks5q23r3gaJpZM4KWV6a
.

@DIALOGFitzroyDev
Copy link

Here is my config that worked for me. I use Microsoft AD.

Teampass_MS_AD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants