LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesLDAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 13th, 2008, 02:44 PM
adel.87 adel.87 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 5 adel.87 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 50 sec
Reputation Power: 0
Add user

hi at every body I've active Directory i try to add user with ldap request but i failed ,can you give sample for adding user with the protocol LDAP?

thank for helping !!!!!

Reply With Quote
  #2  
Old March 14th, 2008, 12:06 PM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 8,257 pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Months 2 Days 12 h 49 m 42 sec
Reputation Power: 524
Standard comment: show us what you got so far and what the error message/strange behaviour is

Reply With Quote
  #3  
Old March 25th, 2008, 07:32 PM
adel.87 adel.87 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 5 adel.87 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 50 sec
Reputation Power: 0
hi at every body this is my code

Code:
	
 
 
 
  <table>


<?php

}
}


//function modobjectclass($domain,$ds,)
function getdes ($domain,$ds,$user)
{$dc=explode('.',$domain);
$user=explode("@",$user);
$dn="DC=".$dc[0].","."DC=".$dc[1];
$filtre="sAMAccountName=".$user[0];
$result=ldap_search($ds,$dn,$filtre);
$val=ldap_get_entries($ds, $result);
$nom=($val[0]["description"][0]);
return ($nom);
}
}

class admin extends user 
{
 function admin($domain ,$ds,$user)
{$dc=explode('.',$domain);
$user=explode("@",$user);
$dn="DC=".$dc[0].","."DC=".$dc[1];
$filtre="sAMAccountName=".$user[0];
$result=ldap_search($ds,$dn,$filtre);

$val=ldap_get_entries($ds, $result);

$this->nom=($val[0]["name"][0]);
$a=($val[0]["name"][0]);
$this->log=($val[0]["samaccountname"][0]);
$this->prenom=($val[0]["givenname"][0]);
$this->function=($val[0]["description"][0]);
$this->adress=($val[0]["streetaddress"][0]);
$this->mail=($val[0]["mail"][0]);
$this->num=($val[0]["telephonenumber"][0]);
$name=($val[0]["samaccountname"][0]);
$_SESSION[$name]=$this;
}
	function edit ($domain,$ds)

{$dc=explode('.',$domain);
$dn="DC=".$dc[0].","."DC=".$dc[1];
//echo($dn);

//$result=ldap_search($ds,"DC=essaie,DC=du","sAMAccountName=Administrateur");
//$result=ldap_search($ds,"DC=essaie,DC=du","objectClass=User");
$result=ldap_search($ds,$dn,"objectClass=User");
$val=ldap_get_entries($ds, $result);


 for ($i=0;$i<$val["count"];$i++)
 {?>
<form name="secu" action="console.php" method="post">
	<table border="2">
	<tr><td>nom user</td> <td> <?php echo $val[$i]["name"][0]; ?> </td> </tr> 
	<tr><td>name of login </td> <td> <input type="text" name="log" value="<?php echo $val[$i]["name"][0]; ?> "</td> </tr>
	<tr><td>prenom user</td> <td><?php echo $val[$i]["givenname"][0]; ?> </td> </tr>
	<tr><td>Fonction</td> <td> <?php echo $val[$i]["description"][0]; ?></td> </tr>
	<tr><td>Mail</td> <td><?php echo $val[$i]["mail"][0]; ?> </td> </tr>
	<tr><td> numéro detéléphone</td> <td><?php echo $val[$i]["telephonenumber"][0];?> </td>   </tr>
	<tr><td> privilege </td> <td> <input type="radio" name="y" value="oui" checked="checked" /> 
<input type="radio" name="n" value="non" /> </td> </tr>
  <input type="hidden"; name="val="<?php $val[$i]["samaccountname"][0]; ?> "
 <tr><td> modifie </td>  <td> <input name="mod" value="modfier" type="submit"  />
 

  </td>
  

 <br>

  <table>

</form>
<?php

}
}


the first time i can connect but when i use the method edit and i click on the button submit in the form i lost my connection

thank for your helping

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > Add user


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT