No login page with phpLdapAdmin

Hello @stephdl,

i installed nethserver-ldapadmin, but when I try to login I get this:

Notice: Undefined variable: _SESSION in /usr/share/phpldapadmin/lib/page.php on line 379

Fatal error: Call to a member function getValue() on a non-object in /usr/share/phpldapadmin/lib/page.php on line 379

Could not find anything on the net to solve this issue.
Any idea?

does your ns7 is uptodate

which login name did you try ?

I have just installed it on a new updated NS7, I used the ‘admin’ user, think to set a password

Yes my server is uptodate. I now logged in with user admin into NS. User admin does have a password.

This error is coming before the login page of ldapadmin is shown!
(I think you are talking about the user I have to use to login into ldapadmin, but this would be the next step)

ll /etc/phpldapadmin/

ll /etc/phpldapadmin/
what do you wan’t to tell me?

i guess that /etc/phpldapadmin/config.php has not been expanded, so issue in a terminal

ll /etc/phpldapadmin/config.php

then if nothing, go to /var/log/messages an find the error message why the event nethserver-phpldapadmin-update failed

it is baby time, i might not be available

the file exists and variables set inside seems to be useful, too:

[root@dc2 phpldapadmin]# ll /etc/phpldapadmin/config.php
-rw-r----- 1 root apache 26197 Feb  6 16:32 /etc/phpldapadmin/config.php

the relevant settings inside (I can find my server in this vars):

<?php
$config->custom->session['blowfish'] = 'alongsecretstring....';
$config->custom->appearance['hide_template_warning'] = true;
$config->custom->appearance['friendly_attrs'] = array(
        'facsimileTelephoneNumber' => 'Fax',
        'gid'                      => 'Group',
        'mail'                     => 'Email',
        'telephoneNumber'          => 'Telephone',
        'uid'                      => 'User Name',
        'userPassword'             => 'Password'
);
$servers = new Datastore();
$servers->newServer('ldap_pla');
$servers->setValue('server','name','Samba4AD Server');
$servers->setValue('server','host',"ldaps://intern.org");
$servers->setValue('login','auth_type','cookie');
$servers->setValue('login','bind_id',"INTERN\DC2$");
$servers->setValue('login','bind_pass',"secret..");
$servers->setValue('login','attr','sAMAccountName');
$servers->setValue('server','base',array("dc=intern,dc=org"));
$servers->setValue('server','read_only',true);
$servers->setValue('appearance','password_hash','');
?>

Then something useful in /var/log/messages ?

Try to find the messages of the installation and post here please

here is the relevant part of /var/log/messages logged during the installation:

Feb  6 12:06:24 dc2 yum[21043]: Installed: nethserver-stephdl-1.0.2-1.ns7.sdl.noarch
Feb  6 12:07:22 dc2 yum[21045]: Installed: phpldapadmin-1.2.3-5.el7.noarch
Feb  6 12:07:22 dc2 yum[21045]: Installed: nethserver-phpldapadmin-0.0.1-1.ns7.sdl.noarch
Feb  6 12:07:24 dc2 esmith::event[21164]: Event: nethserver-phpldapadmin-update
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database configuration
Feb  6 12:07:24 dc2 dbus[627]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Feb  6 12:07:24 dc2 systemd: Cannot add dependency job for unit microcode.service, ignoring: Unit is not loaded properly: Invalid argument.
Feb  6 12:07:24 dc2 dbus-daemon: dbus[627]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Feb  6 12:07:24 dc2 systemd: Starting Time & Date Service...
Feb  6 12:07:24 dc2 dbus[627]: [system] Successfully activated service 'org.freedesktop.timedate1'
Feb  6 12:07:24 dc2 dbus-daemon: dbus[627]: [system] Successfully activated service 'org.freedesktop.timedate1'
Feb  6 12:07:24 dc2 systemd: Started Time & Date Service.
Feb  6 12:07:24 dc2 /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases[21165]: /var/lib/nethserver/db/configuration: OLD phpldapadmin=(undefined)
Feb  6 12:07:24 dc2 /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases[21165]: /var/lib/nethserver/db/configuration: NEW phpldapadmin=configuration|access|private|kamikaze|disabled|status|enabled
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database certificates
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database networks
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database routes
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database accounts
Feb  6 12:07:24 dc2 /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases[21165]: /var/lib/nethserver/db/accounts: OLD phpldapadmin=(undefined)
Feb  6 12:07:24 dc2 /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases[21165]: /var/lib/nethserver/db/accounts: NEW phpldapadmin=reserved
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database hosts
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database proxypass
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database fwrules
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database fwservices
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database portforward
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database tc
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database dhcp
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database domains
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database getmail
Feb  6 12:07:24 dc2 esmith::event[21164]: Action: /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases SUCCESS [0.214839]
Feb  6 12:07:24 dc2 esmith::event[21164]: expanding /etc/httpd/conf.d/default-virtualhost.inc
Feb  6 12:07:24 dc2 esmith::event[21164]: expanding /etc/httpd/conf.d/phpldapadmin.conf
Feb  6 12:07:24 dc2 esmith::event[21164]: expanding /etc/phpldapadmin/config.php
Feb  6 12:07:24 dc2 esmith::event[21164]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.225056]
Feb  6 12:07:24 dc2 systemd: Reloading.
Feb  6 12:07:24 dc2 systemd: [/usr/lib/systemd/system/microcode.service:10] Trailing garbage, ignoring.
Feb  6 12:07:24 dc2 systemd: microcode.service lacks both ExecStart= and ExecStop= setting. Refusing.
Feb  6 12:07:24 dc2 esmith::event[21164]: [INFO] service httpd reloadFeb  6 12:06:24 dc2 yum[21043]: Installed: nethserver-stephdl-1.0.2-1.ns7.sdl.noarch
Feb  6 12:07:22 dc2 yum[21045]: Installed: phpldapadmin-1.2.3-5.el7.noarch
Feb  6 12:07:22 dc2 yum[21045]: Installed: nethserver-phpldapadmin-0.0.1-1.ns7.sdl.noarch
Feb  6 12:07:24 dc2 esmith::event[21164]: Event: nethserver-phpldapadmin-update
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database configuration
Feb  6 12:07:24 dc2 dbus[627]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Feb  6 12:07:24 dc2 systemd: Cannot add dependency job for unit microcode.service, ignoring: Unit is not loaded properly: Invalid argument.
Feb  6 12:07:24 dc2 dbus-daemon: dbus[627]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Feb  6 12:07:24 dc2 systemd: Starting Time & Date Service...
Feb  6 12:07:24 dc2 dbus[627]: [system] Successfully activated service 'org.freedesktop.timedate1'
Feb  6 12:07:24 dc2 dbus-daemon: dbus[627]: [system] Successfully activated service 'org.freedesktop.timedate1'
Feb  6 12:07:24 dc2 systemd: Started Time & Date Service.
Feb  6 12:07:24 dc2 /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases[21165]: /var/lib/nethserver/db/configuration: OLD phpldapadmin=(undefined)
Feb  6 12:07:24 dc2 /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases[21165]: /var/lib/nethserver/db/configuration: NEW phpldapadmin=configuration|access|private|kamikaze|disabled|status|enabled
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database certificates
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database networks
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database routes
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database accounts
Feb  6 12:07:24 dc2 /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases[21165]: /var/lib/nethserver/db/accounts: OLD phpldapadmin=(undefined)
Feb  6 12:07:24 dc2 /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases[21165]: /var/lib/nethserver/db/accounts: NEW phpldapadmin=reserved
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database hosts
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database proxypass
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database fwrules
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database fwservices
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database portforward
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database tc
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database dhcp
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database domains
Feb  6 12:07:24 dc2 esmith::event[21164]: Migrating existing database getmail
Feb  6 12:07:24 dc2 esmith::event[21164]: Action: /etc/e-smith/events/nethserver-phpldapadmin-update/S00initialize-default-databases SUCCESS [0.214839]
Feb  6 12:07:24 dc2 esmith::event[21164]: expanding /etc/httpd/conf.d/default-virtualhost.inc
Feb  6 12:07:24 dc2 esmith::event[21164]: expanding /etc/httpd/conf.d/phpldapadmin.conf
Feb  6 12:07:24 dc2 esmith::event[21164]: expanding /etc/phpldapadmin/config.php
Feb  6 12:07:24 dc2 esmith::event[21164]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.225056]
Feb  6 12:07:24 dc2 systemd: Reloading.
Feb  6 12:07:24 dc2 systemd: [/usr/lib/systemd/system/microcode.service:10] Trailing garbage, ignoring.
Feb  6 12:07:24 dc2 systemd: microcode.service lacks both ExecStart= and ExecStop= setting. Refusing.
Feb  6 12:07:24 dc2 esmith::event[21164]: [INFO] service httpd reload
Feb  6 12:07:24 dc2 systemd: Reloaded The Apache HTTP Server.
Feb  6 12:07:24 dc2 esmith::event[21164]: [INFO] httpd reload
Feb  6 12:07:24 dc2 esmith::event[21164]: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [0.192205]
Feb  6 12:07:24 dc2 esmith::event[21164]: Event: nethserver-phpldapadmin-update SUCCESS
Feb  6 12:07:24 dc2 esmith::event[21194]: Event: runlevel-adjust
Feb  6 12:07:24 dc2 systemd: Reloaded The Apache HTTP Server.
Feb  6 12:07:24 dc2 esmith::event[21164]: [INFO] httpd reload
Feb  6 12:07:24 dc2 esmith::event[21164]: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [0.192205]
Feb  6 12:07:24 dc2 esmith::event[21164]: Event: nethserver-phpldapadmin-update SUCCESS
Feb  6 12:07:24 dc2 esmith::event[21194]: Event: runlevel-adjust
1 Like

Fun, nothing wrong.

Well what about to restart apache

systemctl restart httpd

or to expand/restart again the templates/services

signal-event nethserver-phpldapadmin-save

Feb 6 18:39:39 dc2 systemd: Stopping The Apache HTTP Server... 
Feb 6 18:39:43 dc2 systemd: Starting The Apache HTTP Server... 
Feb 6 18:39:43 dc2 systemd: Started The Apache HTTP Server.

signal-event nethserver-phpldapadmin-save

Feb 6 18:41:33 dc2 esmith::event[6562]: Event: nethserver-phpldapadmin-save 
Feb 6 18:41:33 dc2 esmith::event[6562]: expanding /etc/httpd/conf.d/default-virtualhost.inc 
Feb 6 18:41:33 dc2 dbus[637]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' 
Feb 6 18:41:33 dc2 dbus-daemon: dbus[637]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' 
Feb 6 18:41:33 dc2 systemd: Cannot add dependency job for unit microcode.service, ignoring: Unit is not loaded properly: Invalid argument. 
Feb 6 18:41:33 dc2 systemd: Starting Time & Date Service... 
Feb 6 18:41:33 dc2 dbus[637]: [system] Successfully activated service 'org.freedesktop.timedate1' 
Feb 6 18:41:33 dc2 dbus-daemon: dbus[637]: [system] Successfully activated service 'org.freedesktop.timedate1' 
Feb 6 18:41:33 dc2 systemd: Started Time & Date Service. 
Feb 6 18:41:33 dc2 esmith::event[6562]: expanding /etc/httpd/conf.d/phpldapadmin.conf 
Feb 6 18:41:33 dc2 esmith::event[6562]: expanding /etc/phpldapadmin/config.php 
Feb 6 18:41:33 dc2 esmith::event[6562]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.222282] 
Feb 6 18:41:33 dc2 systemd: Reloading. 
Feb 6 18:41:33 dc2 systemd: [/usr/lib/systemd/system/microcode.service:10] Trailing garbage, ignoring. 
Feb 6 18:41:33 dc2 systemd: microcode.service lacks both ExecStart= and ExecStop= setting. Refusing. 
Feb 6 18:41:33 dc2 esmith::event[6562]: [INFO] service httpd reload 
Feb 6 18:41:34 dc2 systemd: Reloaded The Apache HTTP Server. 
Feb 6 18:41:34 dc2 esmith::event[6562]: [INFO] httpd reload 
Feb 6 18:41:34 dc2 esmith::event[6562]: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [0.183784] Feb 6 18:41:34 dc2 esmith::event[6562]: Event: nethserver-phpldapadmin-save SUCCESS
Feb 6 18:42:00 dc2 clamd: SelfCheck: Database status OK.

for mee this looks normal, too. Doesn’t change anything.

go to /var/log/httpd/ssl_error_log and /var/log/httpd/error_log, try to catch more errors

workable here :slight_smile:

what is the url you used ?

Found it:
/var/log/httpd/ssl_error_log:

[Mon Feb 06 19:24:20.081635 2017] [:error] [pid 6595] [client 10.140.1.84:40627] PHP Notice: Undefined variable: kq in /etc/phpldapadmin/config.php on line 307 
[Mon Feb 06 19:24:20.081999 2017] [:error] [pid 6595] [client 10.140.1.84:40627] PHP Notice: Undefined variable: _SESSION in /usr/share/phpldapadmin/lib/page.php on line 379 
[Mon Feb 06 19:24:20.082009 2017] [:error] [pid 6595] [client 10.140.1.84:40627] PHP Fatal error: Call to a member function getValue() on a non-object in /usr/share/phpldapadmin/lib/page.php on line 379

Undefined variable: kq in /etc/phpldapadmin/config.php on line 307:
In this line I can find a crypted string including $kg which might be interpreted wrong!

$servers->setValue(‘login’,‘bind_pass’,"
eJSEo$kq");

If I change $ sign to e.g. “x” then the error is gone and the login screen is visible! The logind doesn’t work then anymore, because this seems to be my crypted PW what I changed.

So I changed my root and admin Password to see what happens: But this string on line 307 did not change (also run signal-event nethserver-phpldapadmin-save to create a new config.php).

Do you know where this string in ‘bind_pass’ is created from? Is this a new bug I found now?

2 Likes

I think so, and I’m the guilty :slight_smile:

edit in /etc/e-smith/templates/etc/phpldapadmin/config.php/08Settings_of_Ldap_server the line 38

- \$servers->setValue('login','bind_pass',"$bindPassword");
by
+\$servers->setValue('login','bind_pass','$bindPassword');

then
signal-event nethserver-phpldapadmin-save

OK, what can I do to login into phpldapadmin now?

I could wait for your update - :sunglasses:
But then I can’t answer the very first question about which field in LDAP database makes us stopping to set sogos default mail addr


please

yum install http://mirror.de-labrusse.fr/NethDev/nethserver-phpldapadmin-0.0.2/nethserver-phpldapadmin-0.0.2-1.ns7.sdl.noarch.rpm

and report if you can login please with the admin user.

2 Likes

Well done, that’s working! That was super fast now! Thanks.