Error message when using simplesamlphp_auth and drupal 6.14

35 views
Skip to first unread message

Halvor Utby

unread,
Nov 30, 2009, 9:26:02 AM11/30/09
to Drupal SimpleSAMLphp integration
Hi all,

I'm tying the simplesamlphp_auth module (Rev: 14 from
http://drupalsimplesaml.googlecode.com/svn/trunk/simplesamlphp_auth/)
together with simplesamlphp 1.5.0 and drupal 6.14. We have are
currently connecting to a local SP which, to my knowledge, works as
expected.

However, the first time a user tries to log in the following error
message is displayed:

warning: array_fill() [function.array-fill]: Number of elements must
be positive in /path/to/drupal/htdocs/includes/database.inc on line
253.
warning: implode() [function.implode]: Invalid arguments passed in /
path/to/drupal/htdocs/includes/database.inc on line 253.
warning: array_keys() [function.array-keys]: The first argument should
be an array in /path/to/drupal/htdocs/modules/user/user.module on line
502.
warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax
error at or near ")" at character 84 in /path/to/drupal/htdocs/
includes/database.pgsql.inc on line 139.
user warning: query: SELECT p.perm FROM role r INNER JOIN permission p
ON p.rid = r.rid WHERE r.rid IN () in /path/to/drupal/htdocs/modules/
user/user.module on line 502.

The next time the same user tries to log in every thing will be fine
(since the user already has been created).
I'm not sure if this is a problem with the simplesamlphp_auth module
or with drupal 6.14.

If no one else has this problem I would guess we have a problem with
our SP.

--
Halvor Utby
USIT - UiO

Snorre Løvås

unread,
Dec 1, 2009, 11:36:43 AM12/1/09
to drupalsi...@googlegroups.com
On Mon, Nov 30, 2009 at 15:26, Halvor Utby <hal...@gmail.com> wrote:

> However, the first time a user tries to log in the following error
> message is displayed:

I can't seem to reproduce it in my Drupal 6.14. From the error
messages I can't pinpoint where it goes wrong...
The only difference I notice is postgres vs mysql.

My IdP sends givenName, sn, eduPersonPrincipalName, uid,
eduPersonAffiliation and mail. Which of these that are mandatory
depends on your configuration. Since my setup uses SmartName as part
of the users identifier I had to enable the smartname-module in
SimpleSAMLphp.

Regards,
Snorre
UNINETT ABC

Halvor Utby

unread,
Dec 14, 2009, 8:48:31 AM12/14/09
to Drupal SimpleSAMLphp integration
On Dec 1, 5:36 pm, Snorre Løvås <snorre.lo...@gmail.com> wrote:
Hi,

Sorry for the late reply, it's been quite busy around here and
debugging has taken me some time.

The error seem to start in module/user/user.module on line 502
(function user_access).
Line 50[1-2] says:
if (!isset($perm[$account->uid])) {
$result = db_query("SELECT p.perm FROM {role} r INNER JOIN
{permission} p ON p.rid = r.rid WHERE r.rid IN (". db_placeholders
($account->roles) .")", array_keys($account->roles));

The reason is that $account-roles has not been set yet.
My fix (which might break something else) is to replace the first line
above with:
if (!isset($perm[$account->uid]) && isset($account->roles)) {

I would appreciate if someone could check if this fix breaks something
else. I realize this might be an incomplete fix.
If someone has a better solution I would appreciate your suggestions.

Another idea could be to set "anonymous user" in the initial setup.

--
Halvor Utby
USIT
Reply all
Reply to author
Forward
0 new messages