Giter VIP home page Giter VIP logo

codeigniter-ldap's Introduction

Using debian 8

Install open ldap

$apt-get install slapd ldap-utils

change /etc/ldap/ldap.conf for you base eg: dc=test,dc=com,dc=my

$dpkg-reconfigure slapd

install php5

$apt-get install php5 $apt-get install php5-ldap

install phpldap admin

$apt-get install phpldapadmin

codeigniter-ldap

codeigniter ldap class

for using this class , just put in /application/libraries

load in config/autoload.php

$autoload['libraries'] = array('ldap');

setting configure ldap

$config['ldap_server'] = 'localhost';
$config['ldap_port'] = '389';
$config['ldap_bs'] = 'dc=test,dc=com,dc=my';
$config['ldap_user'] = 'ou=users,dc=test,dc=com,dc=my';
$config['ldap_admin'] = 'cn=admin,dc=test,dc=com,dc=my';
$config['ldap_password'] = 'password';

you nead install openldap and set the ldap admin user and password first.

now you can call the class from controllers or models

just

$this->ldap->test();

eg:- for add user

$info["givenName"]="tets";
$info["sn"]=$user;
$info["uid"]="tets";
$info["mail"]="tets";
$info["displayName"]= "tets";
$info["gidNumber"] = 500;
$info["uidNumber"] = 500;
$info["homeDirectory"] = "/home/hasnan";
$info["cn"] = $user;
$info["userPassword"]="tets{sha}";
$info["objectclass"][0] = "top";
$info["objectclass"][1] = "person";
$info["objectclass"][2] = "inetOrgPerson";
$info["objectclass"][3] = "organizationalPerson";
$info["objectclass"][4] = "posixAccount";

$this->ldap->add_user($user,$info);

codeigniter-ldap's People

Contributors

asklinux avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.