[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
RE : LDAP/PHP: Trying to add account -> text=attribute loginShell notallowed
Yes you are right the objectClass is probably being overwritten, to use
multiple values for an attribute you'd need to do it like this:
$info["objectClass"][0]="top";
$info["objectClass"][1]="posixAccount";
$info["objectClass"][2]="account";
$info["objectClass"][3]="shadowAccount";
$info["objectClass"][4]="inetOrgPerson";
Jean-Rene Cormier
-----Message d'origine-----
De : owner-openldap-software@OpenLDAP.org
[mailto:owner-openldap-software@OpenLDAP.org] De la part de John Dalbec
Envoyé : 9 avril, 2002 09:32
À : Dejan Muhamedagic
Cc : Holger Banko; LDAP Mailingliste
Objet : Re: LDAP/PHP: Trying to add account -> text=attribute loginShell
notallowed
Dejan Muhamedagic wrote:
>
> Hi,
>
> What do you mean by "not allowed"?
>
> In general, it could be that the schema doesn't support the attributes
for
> the objectclasses, or that you're binding with insufficient
credentials,
> or that there is no parent defined for the new record, or ... there
are
> probably a few that I can't recall now.
>
> Please include more info when posting.
>
> Dejan
> Please respond to Holger Banko <holger.banko@pgam.com>
> Sent by: owner-openldap-software@OpenLDAP.org
> To: LDAP Mailingliste <openldap-software@OpenLDAP.org>
> cc:
> Subject: LDAP/PHP: Trying to add account -> text=attribute
loginShell not allowed
>
> Hi,
>
> I am trying to add a User-Account to my LDAP-Tree with PHP. Everytime
I
> get an
> error in /var/log/message. Some attributes are not allowed (e.g.
> loginShell,
> gidNumber, uidNumber).
>
> Why ? Whats wrong ?
>
> // Daten vorbereiten
> $info["cn"]="$vorname $name";
> $info["sn"]="$name";
> $info["uid"]="$personr";
> $info["mail"]="$vorname.$name@pgam.com";
> $info["objectClass"]="top";
> $info["objectClass"]="posixAccount";
> $info["objectClass"]="account";
> $info["objectClass"]="shadowAccount";
> $info["objectClass"]="inetOrgPerson";
I expect that $info["objectClass"] is being overwritten each time. What
language are you writing this in? You need to read the documentation to
find out how to add multiple values for an attribute.
> $info["loginShell"]="/bin/bash";
> $info["userPassword"]="$name";
> $info["gecos"]="LDAP User";
> $info["homePhone"]="12345";
> $info["shadowMin"]="-1";
> $info["shadowInactive"]="-1";
> $info["gidNumber"]="100";
> $info["uidNumber"]="$uidnum";
> $info["homeDirectory"]="/home/$personr";
> $info["description"]="Via Intranet generiertes Benutzerkonto";
> $info["roomNumber"]="Empty";
> $info["givenName"]="Empty";
> $info["proxyauth"]="Empty";
>
> // hinzufügen der Daten zum Verzeichnis
> $r=ldap_add($ds,
"uid=$personr,ou=$standort,ou=People,dc=pgam,dc=com",
> $info);
>
> --Holger