Login warnings

ttosttos - April 8, 2008 - 05:50
Project:No request new password
Version:5.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

* warning: array_keys() [function.array-keys]: The first argument should be an array in /opt/lampp/htdocs/main/modules/user/user.module on line 378.
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /opt/lampp/htdocs/main/modules/user/user.module on line 379.
* warning: implode() [function.implode]: Invalid arguments passed in /opt/lampp/htdocs/main/modules/user/user.module on line 379.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /opt/lampp/htdocs/main/includes/database.mysql.inc on line 172.

#1

pedrofaria - April 9, 2008 - 12:37

Strange....

What are your drupal version???

#2

ttosttos - April 9, 2008 - 18:04

Seen with 5.7 when using LDAP Integration module and logging as a new user (which implies ldap authentication and automatic user registration on drupal dbase). Warnings pop up as soon as this module is enabled. I acknowledge that there's a chance that this module isn't the culprit and just acts as a catalyst. I'm unable to diagnose more precisely.

#3

pedrofaria - April 10, 2008 - 14:31

Its very strange because the error are a role access verifications... nothing with my module...

Try disable my module and login with a new user on your site...

if this error persists... probably my module are causing it...

thanks

#4

ttosttos - April 11, 2008 - 00:45

That was the first thing I tried. Hence, my posting here. The problem follows the activation of this module.

#5

gregsumi - May 9, 2008 - 05:09
Version:5.x-1.x-dev» 5.x-1.2

I too have experienced this problem. I'm using 5.7 and LDAP Integration & Roles. Uninstalling the module eliminated the warnings.

#6

pedrofaria - May 14, 2008 - 17:40

i cant see any problem with my module... but talking with a friend he check at ldat_integration page module and paste this hint for me...

If you are using 5x-1-3 and are experiencing problems with inital logins or ldapgroups, upgrade to the latest 5x-dev snapshot from April 17, 2008 or newer until the 5x-1-4 release is available.

i can't reproduce this environment for test and debug... it's is de biggest problem...

Please... make this test:
- enable my module
- make a login with a not logged user (probably will display the warnings)
- logout
- Log in again

check if the warnings persist!

Some time ago, building a authentication module for drupal i got this problems end just with first time logins...

cya

#7

gregsumi - May 24, 2008 - 08:48

The warning only appears on the first-time login, however, LDAP Groups are not mapped while No Request New Password is enabled.

I've attempted installing the .dev version but the problems persisted :(

#8

eboyd16 - June 23, 2008 - 13:59
Priority:normal» critical

I need major help. This module has destroyed my entire log in system. I can not get rid of it. If it is active I get errors and no ldap mapping and if it is off no one can log in at all if they are validated though the ldap, the site crashes. This site was set to go live this weekend and taking off the "request new password" links was just a minor issue. Now I might have to reinstall the entire system to fix this.

I may not be the module but it happened right after I installed it.

#9

pedrofaria - June 23, 2008 - 13:58

i still thinking that the problem is not my module...

i will try call LDAP developers to check soon...

#10

pedrofaria - June 23, 2008 - 14:07
Assigned to:Anonymous» pedrofaria
Status:active» closed

this is a Drupal problem....

i take a quickly search at ldap projects issues and found this:

http://drupal.org/node/239628

please, take a look...

#11

eboyd16 - June 23, 2008 - 14:25
Assigned to:pedrofaria» Anonymous
Status:closed» active

errors are still happening for me after I put in the patch.

#12

kotoponus - August 4, 2009 - 17:06

The same problem here - after applying the patch as suggested below, I do not get the warning messages but still the LDAP groups do not get picked up.

http://drupal.org/node/243942#comment-892515

I had to deselect the choice for "Disable Request new password link" in order to return to the functional point in order for Drupal to start picking the Groups again.

I would be grateful if you can have a chat with LDAP folks.

#13

pedrofaria - August 4, 2009 - 19:13

Please, make a test for me.

Go to your drupal mysql system table, search for noreqnewpass row and change the weight value to 100

Let me know if this will fix the problem...

thanks.

#14

kotoponus - August 5, 2009 - 11:07

Thanks for the quick response -

It is Postgres and I have updated the weights to 100. And re-checked the 2 boxes for the noreqnewpass. It let you login, but it does not pull the roles, which is what it supposed to do per LDAP Group functionality. It definitely does it without the first choice selected.

drupal5=> update system set weight = 100 where name ='noreqnewpass';
UPDATE 1
drupal5=> select * from system where name = 'noreqnewpass';
filename | name | type | description | status | throttle | bootstrap | schema_version | weight
----------------------------------------------------+--------------+--------+----------------------------------------+--------+----------+-----------+----------------+--------
sites/all/modules/noreqnewpass/noreqnewpass.module | noreqnewpass | module | Disable link to request a new password | 1 | 0 | 0 | 0 | 100
(1 row)

Anything else I can test for you?

#15

kotoponus - November 3, 2009 - 12:34

OK, I have more time to look into this - modules user, ldapauth and your noreqnewpass have a hook (?) with login_validate().

I placed debug echo in every one of this function, as this seems to dictate if users can login so that I can find out which one gets called. If I disactivate the noreqnewpass by de-selecting "Disable Request new password link" in admin/settings/noreqnewpass, it uses ldapauth's login_validate(). But if I re-activate, it uses the one from noreqnewpass.

The only thing I am not sure is why it still seems to be authorised by LDAP, even when "Disable Request new password link" is ticked if ldapauth's login_validate() is not called.

To me, given lack of clear understanding of the general hook(?) process, it seems like a precedent issue over whose login_validate() gets called first (therefore, others do not get called).

And, I guess it might have been the reason why you asked me to perform the update earlier? Does the weight determine which comes first?

I have the following:

drupal5=> select * from system where name IN ('noreqnewpass','user','ldapauth');
                      filename                      |     name     |  type  |                   description                   | status | throttle | bootstrap | schema_version | weight
----------------------------------------------------+--------------+--------+-------------------------------------------------+--------+----------+-----------+----------------+--------
sites/all/modules/ldap_integration/ldapauth.module | ldapauth     | module | Implements LDAP Authentication                  |      1 |        0 |         1 |              2 |      0
sites/all/modules/noreqnewpass/noreqnewpass.module | noreqnewpass | module | Disable link to request a new password          |      1 |        0 |         0 |              0 |      0
modules/user/user.module                           | user         | module | Manages the user registration and login system. |      1 |        0 |         0 |              0 |      0
(3 rows)

Or is there any other way to determine the precedence?

#16

pedrofaria - November 5, 2009 - 12:52

Hello kotoponus,

Thanks for your time... :)

Ok, now i can understand all problem... let me try explain...

The No request new password module need overwrite user_login_validate function just to change form error messages and i can't replace form_set_error messages... Ldap auth only run your own validation if user_login_validation are setted.

if (isset($form['#validate']['user_login_validate'])) {
  $form['#validate'] = array('ldapauth_login_validate' => array());
}

The problem is that both modules made same hack and now i have to change my logic...

i will think what i can do and make some tests...

I saw on ldapauth code that he do the same think as no request new module do!

switch($form_id) {
case 'user_login_block':
  // Since form only available when not logged in, no need to check for admin?
  if (variable_get('ldap_disable_request_new_password', FALSE)) {
    unset($form['links']);
  }
  break;
  ...

So i guess that i don't need use both modules together...

Thanks again...

#17

kotoponus - November 5, 2009 - 16:32

Hi, pedrofaria,

Huurah! It looks like this may be going somewhere! Yay.

Your explanation makes sense. Please let me know if you need me to test or to do whatever else. Also, I guess, this can be informed to LDAPauth peeps as well you think?

Looking forward to hearing from you again! :D

 
 

Drupal is a registered trademark of Dries Buytaert.