Terry Farrell (dir
Q:
Using the same
Q:
Django templat
Q:
How to remove
The influence of f
---
abstract: 'The
Rapids midfielder
The present disclo
Epidemiology of cu
// Copyright 2015 Q:
Adding custom user to LDAP
I have installed LDAP and trying to add my cPanel credentials to LDAP using PHP
I don't know where to find '192.168.1.101' in my LDAP, so I need some help.
My domain is already setup and I just need to know how to add this cPanel credentials in there.
A:
I use this tutorial http://www.php-mysql-and-ldap-tutorial.com/ to create users in AD and also to manage our ldap server and all works fine.
Just follow this tutorial and you will be able to read/write/delete users using php script.
Hope it helps.
A:
Go through phpLDAPAdmin link, I think you may get idea
A:
I have some idea, how I will solve this problem. First of all need to install LDAP server that is used with cPanel
$ sudo apt-get install samba ldap-utils
sudo dpkg-reconfigure -plow samba-common
sudo dpkg-reconfigure -plow samba-common-bin
sudo dpkg-reconfigure -plow samba
Installing cPanel
Download zip from this site http://www.cpanel.net/downloads/
Unzip it and copy all the files in this folder to your cpanel directory
cd /usr/local/cpanel/
cp -rp /tmp/cpanel_files/* .
/etc/init.d/smb restart
cd /home/USERNAMEHERE/public_html/
cp -rf /tmp/cpanel_files/scripts/* .
/etc/init.d/smb restart
Setting LDAP server to active directory (sudo nano /etc/group)
Allow users to modify LDAP
sudo nano /etc/group
sudo vi /etc/passwd
sudo vi /etc/group
sudo vi /etc/cpanel_password
Set password (sudo htpasswd -c /etc/cpanel_password USERNAMEHERE)
Set the user you want to manage cPanel to AD (sudo smbpasswd -a -L USERNAMEHERE)
Now if you have user with passwrod, you can manage cpanel with user and password using php
To add you can use this code
0) {
$info = ldap_get_entries($ds, $result);
var_dump($info);
} else {
echo "ERROR: Could not bind to LDAP server
";
}
?>
To delete you can use this code
Thank You all for your time.