php.de

Zurück   php.de > Webentwicklung > PHP-Fortgeschrittene

PHP-Fortgeschrittene Arbeiten mit PHP ohne Einschränkungen

Antwort
 
LinkBack Themen-Optionen Thema bewerten
Alt 13.10.2004, 10:55  
Gast
 
Beiträge: n/a
Standard Ldap :-(

Hallo also ich habe folgendes script zur überprüfung ob ein user in einer bestimmten ldap gruppe vorhanden ist:

************************************************** ***********

// verwenden von ldap bind
$ldaprdn = $user; // ldap rdn oder dn
$ldappass = $pass; // entsprechendes password
$NTdomain = "RBAMOUSER";
$queryuserdn = $NTdomain . "\\" . $ldaprdn;
$location = "emea";

// verbinden zum ldap server
$ldapconn = ldap_connect("rbamsroot01.roche.com")
or die("Keine Verbindung zum LDAP server möglich.");

if ($ldapconn) {

// binden zum ldap server
$ldapbind = ldap_bind($ldapconn, $queryuserdn, $ldappass);

// Bindung überpfrüfen
if ($ldapbind) {
echo "LDAP bind erfolgreich...";

$basedn = "DC=" . $location . ",DC=roche,DC=com";
$information=array("distinguishedName");
$adgroup = "cn=RBA MabThera_LyFE_Online_Booking_Tool,ou=Groups,dc=Roc he,dc=COM";


$sr = ldap_search($ldapconn, $basedn, "(&(objectCategory=user)(CN=$ldaprdn))",$informati on);
$info = ldap_get_entries($ldapconn, $sr);
$zahl= count($info);
print $zahl;
print "
";

if ($zahl > 0)
{

// Get the right values declared in the information array out of the temporary array
if(is_array($information)){
while (list ($key, $val) = each ($information)){
print $val;
print "
";

$userdn = $info[0]["$val"][0];
print $userdn;
// now check if user is member of $adgroup
$sr2=@ldap_search($ldapconn, $adgroup, "member=". $userdn, $information);
print $sr2;
// Get all the information into an array
$info2 = @ldap_get_entries($ldapconn, $sr2);
print $info2;
if (isset($info2)) {

$success= 1;


.... da kommt dann noch mehr .....

************************************************** ***********

auf jeden fall besteht folgendes problem, dass script läuft bis zur rot markierten stelle richtig ab, dort funzt dann irgend was nicht mehr und alles was danach kommt geht gar nicht mehr ich kann die variabel $userdn auch gar nicht ausgeben. Hat irgend jemand ne ahnung was da nicht stimmt ?
  Mit Zitat antworten
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 14.10.2004, 15:36  
Gast
 
Beiträge: n/a
Standard

Wo schließt du die geschweifte Blockanfangs-Klammer von
Code:
while (list ($key, $val) = each ($information)){
?
  Mit Zitat antworten
Antwort


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
LDAP + php, neue User anlegen und ändern bender.ac PHP-Fortgeschrittene 3 07.05.2008 20:36
LDAP + php, User anlegen bender.ac PHP Tipps 2008 1 29.04.2008 19:31
PHP5 und LDAP dauert lange PHP-Fortgeschrittene 2 07.12.2006 08:00
LDAP Namen in normale Namen umwandeln PHP Tipps 2005-2 6 01.08.2005 12:07
Novell eDirectory, LDAP und das ganze mit PHP PHP-Fortgeschrittene 4 28.07.2005 13:59
Values und Attributes im LDAP mittels php löschen. PHP Tipps 2005 4 24.02.2005 15:38
Kann keine Gruppe bei LDAP erstellen PHP Tipps 2005 0 28.01.2005 10:42
[Erledigt] LDAP Bind - unknown error PHP-Fortgeschrittene 0 27.01.2005 17:11
Active Directory Ldap Queries über 1000 Entries PHP Tipps 2005 0 27.01.2005 14:27
LDAP query auf ADS - Sizelimit exceed !? PHP-Fortgeschrittene 1 21.10.2004 22:38
LDAP nachinstallieren PHP Tipps 2004 6 12.10.2004 14:06
[Erledigt] LDAP Gruppe überprüfen PHP-Fortgeschrittene 4 29.09.2004 17:31
php Modul LDAP nachinstallieren PHP Tipps 2004 2 27.08.2004 18:20
[Erledigt] LDAP PHP-Fortgeschrittene 7 16.06.2004 07:49

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
rbamouser, php ldap memberof, ldap memberof php, php ldap rdn, ldap php memberof, ldap rdn, php ldap member of, ldap_search memberof, php ldap testen ob user in einer gruppe ist, php ldap member, ldap member of php, php ldap group members, php ldap anmeldung novell, php ldap_search, php ldap_search member, php ldap_search group member, rbamsroot01.roche.com, php ldap group memberships, ldap php \member of\, php ldap überprüfen, ob user in der gruppe ist

Alle Zeitangaben in WEZ +1. Es ist jetzt 01:55 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.