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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #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 5th Plane (7000 - 7499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,395 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 4 h 48 m 59 sec
Reputation Power: 255
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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway