You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2009-01-16 11:35:43

dsi.operacoes
Member
Registered: 2008-12-23
Posts: 9

Problems importing users

Hello,

I´m having some problems importing new users...

I go to the "import new users"... sucessufully import the users but they do not appear on the User list...

the users exist in glpi_users...

Set GLPI in debug mode ( when listing users ) i noticed this query :

"SELECT count(DISTINCT glpi_users.ID)
FROM glpi_users
LEFT JOIN glpi_users_profiles ON (glpi_users.ID = glpi_users_profiles.FK_users)
WHERE ( glpi_users_profiles.FK_entities IN (0) ) AND glpi_users.deleted='0'"

this list the users i think... ( the imported users still do not appear...)

I change the query (on Mysql Query Browser ) to this :

" SELECT count(DISTINCT glpi_users.ID) FROM glpi_users
LEFT JOIN glpi_users_profiles ON (glpi_users.ID = glpi_users_profiles.FK_users)
WHERE glpi_users.deleted='0' "

well the problem i think is that when importing an user the user is not beeing assinged to a profile...

Can any one help ?

Thanks,
Duarte

Offline

#2 2009-01-16 11:39:43

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: Problems importing users

hello,
when you import a user, it goes throught the rulesengine, in order to try to determine entity and profile associated with him.
if the user matches no rules, then it's imported without a profile, and is only visible in the root entity

Offline

#3 2009-01-16 12:18:21

dsi.operacoes
Member
Registered: 2008-12-23
Posts: 9

Re: Problems importing users

OK...

got an error when importing a new user in debug mode:

PHP ERROR: ldap_search()[function.ldap-search]: bad search filter in e:\www.glpi\user.class.php at line 638
PHP ERROR_ ldap_get_entries(): supplied arguimento is not a valid ldap result resource in  e:\www.glpi\user.class.php at line 641

what can be the problem ?

Offline

#4 2009-01-16 12:19:09

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: Problems importing users

what's your connection filter in the LDAP configuration ?

Offline

#5 2009-01-16 12:31:25

dsi.operacoes
Member
Registered: 2008-12-23
Posts: 9

Re: Problems importing users

LDAP
Filter: (objectClass=user)

Offline

#6 2009-01-16 12:35:05

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: Problems importing users

1/ try this filter : (&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
2/ can you post you complete ldap configuration please ?

Offline

#7 2009-01-16 13:10:52

dsi.operacoes
Member
Registered: 2008-12-23
Posts: 9

Re: Problems importing users

tried the filter... got the same error...

the problem is here...

user.class.php
....
$sql_default_profile = "SELECT ID FROM glpi_profiles WHERE is_default=1";                   
....

this field does not exists on this table... maybe in an earlier version... ?

Offline

#8 2009-01-16 13:44:43

dsi.operacoes
Member
Registered: 2008-12-23
Posts: 9

Re: Problems importing users

I think the problem is with the Entity and rights assignment rules

When i test the root this is the result :

Criteria
uid:   
(AD)User ID:   
Login IMAP/POP:   

Result details
Root    Yes

Rule result
Validation : No
------------

the problem is that if there is no action on a rule ( for example.. the only one "root", by default...) them there is a query hardcoded (SELECT ID FROM glpi_profiles WHERE is_default=1), but that table on version 0.71.2, does not have the field "is_default", so que query is malformed...

i whish that this code is reviwed in the new version.

Offline

#9 2009-01-16 13:56:12

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: Problems importing users

There must be a "is_default" column in glpi_profiles table;

If not, you probably encounter a migration issue.

++

P.S. this field was add in GLPI 0.68.


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#10 2009-01-16 14:07:53

dsi.operacoes
Member
Registered: 2008-12-23
Posts: 9

Re: Problems importing users

ok u are right.. i was worng on the table name( the field is present)... them why an user does not appear on the user list(root entity(show all)) when imported. ?

if the  Entity and rights assignment rules default rule root, is not set to any action the user does not appear.

Thanks.

Offline

Board footer

Powered by FluxBB