Hi!

My Drupal environment is the following:
- Drupal 5.7
- PHP 5.2.3
- Database: Postgres 8.2.3

I have successfully managed to setup LDAP Auth against a Windows 2003 MS-AD, but I am having no luck setting up LDAP Data.

I´m trying to set it up but I can´t even get its configuration parameters to be saved.

In the "Drupal-LDAP fields mapping" section I am using the following choices:

- Same, but read-only mode.
- Filling the LDAP Attribute fields

In the "Attribute visibility & Access control" section, I´m checking all Attribute Names as Readable by User only

In the "Advanced configuration" section I´m filling the DN with the same account that I´m using for LDAP Auth.

After clicking on "Update" I am presented with the same configuration page again, with all fields left blank, with no error messages in this page.

In the Drupal log, however, I get this sequence of messages (from older to newer):

- pg_query() [function.pg-query]: Query failed: ERROR: column "ldapdata_mappings" does not exist LINE 1: SELECT ldapdata_mappings, ldapdata_roattrs, ldapdata_rwattrs... ^ em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 125.

- query: SELECT ldapdata_mappings, ldapdata_roattrs, ldapdata_rwattrs, ldapdata_binddn, ldapdata_bindpw, ldapdata_bindpw_clear FROM ldapauth WHERE name = 'MYCOMPANY.COM.BR' em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 144.

- pg_query() [function.pg-query]: Query failed: ERROR: column "ldapdata_mappings" does not exist LINE 1: SELECT ldapdata_mappings FROM ldapauth WHERE name = 'MYCOMPANY.COM... ^ em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 125.

- query: SELECT ldapdata_mappings FROM ldapauth WHERE name = 'MYCOMPANY.COM.BR' em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 144.

- pg_query() [function.pg-query]: Query failed: ERROR: column "ldapdata_mappings" of relation "ldapauth" does not exist LINE 1: UPDATE ldapauth SET ldapdata_mappings = 'a:6:{s:6:"access";s... ^ em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 125.

- query: UPDATE ldapauth SET ldapdata_mappings = 'a:6:{s:6:"access";s:1:"4";s:11:"ldap_amap-1";s:9:"givenName";s:11:"ldap_amap-2";s:2:"sn";s:14:"ldap_amap-mail";s:4:"mail";s:14:"ldap_amap-pass";s:4:"pass";s:19:"ldap_amap-signature";s:9:"signature";}', ldapdata_roattrs = 'a:4:{i:0;s:9:"givenName";i:1;s:2:"sn";i:2;s:2:"cn";i:3;s:4:"mail";}', ldapdata_rwattrs = '', ldapdata_binddn = 'cn=ldapuser,ou=Objetos,dc=mycompany,dc=com,dc=br', ldapdata_bindpw_clear = '0' WHERE name = 'MYCOMPANY.COM.BR' em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 144.

- pg_query() [function.pg-query]: Query failed: ERROR: column "ldapdata_mappings" does not exist LINE 1: SELECT ldapdata_mappings, ldapdata_roattrs, ldapdata_rwattrs... ^ em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 125.

- query: SELECT ldapdata_mappings, ldapdata_roattrs, ldapdata_rwattrs, ldapdata_binddn, ldapdata_bindpw, ldapdata_bindpw_clear FROM ldapauth WHERE name = 'MYCOMPANY.COM.BR' em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 144.

- pg_query() [function.pg-query]: Query failed: ERROR: column "ldapdata_mappings" does not exist LINE 1: SELECT ldapdata_mappings FROM ldapauth WHERE name = 'MYCOMPANY.COM... ^ em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 125.

- query: SELECT ldapdata_mappings FROM ldapauth WHERE name = 'MYCOMPANY.COM.BR' em /usr/local/apache-2.0.59/htdocs/bc/includes/database.pgsql.inc na linha 144.

I haven´t done any configurations in ldapdata.conf.php.

Can anybody help me on that?

Thanks in Advance,
Carlos.

Comments

zottmann’s picture

Hi!

Can anyone help me on this?

Thanks in advance,
Carlos.

asimmonds’s picture

It appears that ldapdata.install did not add the ldapdata_* columns to the ldapauth table. Try updating to a current 5.x-1.x-dev snapshot and reinstall the ldapdata module.

zottmann’s picture

Indeed, the ldapdata_* columns were not created. Should I use the HEAD version?

Regards,
Carlos.

zottmann’s picture

Hi!

There is a problem in the ldapdata.install module. The first three columns are being created as VARCHAR, and the Postgres syntax is "character varying".

I´ve created the columns by hand, and the module is saving its configurations right now. I didn´t manage to import data from ldap yet, but I guess its just a configuration issue.

Regards,
Carlos.

nodecommander’s picture

Version: 5.x-1.x-dev » 5.x-1.3

Good day,

I am having trouble setting up my ldap data.

for some reason the fields are blank when the user clicks on his account. When i check the logs nothing comes up the settings I use are the same as zottman.

Can someone please help.

Thanks,
Poova

fab971’s picture

I succeeded to insert the correct columns into ldapauth table by modifying the ldapdata.install file at line 9 :

  case 'mysqli':
    case 'mysql':
        - db_query("ALTER TABLE {ldapauth} ADD (
        - ldapdata_binddn VARCHAR(255) NOT NULL default ' ',
        - ldapdata_bindpw VARCHAR(255) NOT NULL default ' ',
        - ldapdata_bindpw_clear VARCHAR(2) NOT NULL default ' ',
        - ldapdata_rwattrs LONGTEXT NOT NULL default ' ', 
      	- ldapdata_roattrs LONGTEXT NOT NULL default ' ', 
        - ldapdata_mappings LONGTEXT NOT NULL default ' '
        - )");
			
       + db_query("ALTER TABLE ldapauth ADD (
       + ldapdata_binddn VARCHAR( 255 ) NOT NULL default ' ',
       + ldapdata_bindpw VARCHAR( 255 ) NOT NULL default ' ',
       + ldapdata_bindpw_clear VARCHAR( 2 ) NOT NULL default ' ',
       + ldapdata_rwattrs LONGTEXT NOT NULL ,
       + ldapdata_roattrs LONGTEXT NOT NULL ,
       + ldapdata_mappings LONGTEXT NOT NULL
       + )"); 

fab971’s picture

There is an error in my previous post : this is the good code

function ldapdata_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("ALTER TABLE ldapauth ADD (
        ldapdata_binddn VARCHAR( 255 ) NOT NULL default ' ',
        ldapdata_bindpw VARCHAR( 255 ) NOT NULL default ' ',
        ldapdata_bindpw_clear VARCHAR( 2 ) NOT NULL default ' ',
        ldapdata_rwattrs LONGTEXT NOT NULL ,
        ldapdata_roattrs LONGTEXT NOT NULL ,
        ldapdata_mappings LONGTEXT NOT NULL
        )"); 
			break;
    case 'pgsql':
      db_query("ALTER TABLE {ldapauth} ADD (
        ldapdata_binddn VARCHAR(255) NOT NULL default '',
        ldapdata_bindpw VARCHAR(255) NOT NULL default '',
        ldapdata_bindpw_clear VARCHAR(2) NOT NULL default '',
        ldapdata_rwattrs TEXT NOT NULL, 
        ldapdata_roattrs TEXT NOT NULL, 
        ldapdata_mappings TEXT NOT NULL
      )"); 
      break;
  }
}

Can you please report it into the last version of the module (5.x-1.5)

johnbarclay’s picture

Status: Active » Closed (won't fix)

Closing 5.x issues to clean out issue queue.