Giter Site home page Giter Site logo

kohana-pure-ldap's Introduction

Kohana Pure LDAP

An LDAP auth module for Kohana with no external dependencies.

Version 1.1 Released on 2011-11-02 By Stephen Eisenhauer

Introduction

Kohana-Pure-LDAP is a module for [Kohana] 0 which extends the core Auth module to allow for authenticating against an LDAP server.

This module is so-called 'Pure' because, unlike other Kohana LDAP auth modules in existence, this one does not use external libraries like PEAR or ZEND, instead only utilizing functions from PHP's standard [LDAP extension] 1.

Installation

To install, simply clone this repository into your Kohana installation's modules directory.

Configuration

This module provides an example configuration file located in config/pure-ldap.php. Simply copy this file into your Kohana installation's application/config directory and modify its variables using a text editor. The example configuration contains more information on the settings themselves.

In order to activate this module, you will need to do the following:

  1. Edit the application/bootstrap.php file in your Kohana install. Ensure that both 'auth' and 'kohana-pure-auth' are enabled in the Kohana::modules array.
  2. If you don't already have a file in your application/config directory called auth.php, copy the sample from modules/auth/config/auth.php to this location.
  3. Edit application/config/auth.php from the previous step and set the 'driver' key's value to PureLDAP.

Usage

Since this module extends the core Auth module, use it according to the Auth module's documentation and API.

In general, you'll want to create a login form whose backend contains something like this:

	$success = Auth::instance()->login($_POST['user'], $_POST['pass']);

	// If $success, redirect the user.
	// Else, display the login form again with an error message.

Additionally, Auth::instance()->get_user() will return a LDAP_User object representing the logged in user (or FALSE if no one is logged in). This object has three properties:

  • ->username, the username of the user
  • ->attributes, an associative array containing the attributes you specified in the config file
  • ->roles, an array of roles (groups) this user belongs to, given via an attribute specified in the config file

License

This code is released under the New BSD License. This means you can use and modify any of this code freely. See LICENSE for full legal details.

kohana-pure-ldap's People

Contributors

bhspitmonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kohana-pure-ldap's Issues

Integration for Open Classifieds

Open Classifieds (http://open-classifieds.com/download/) uses the Kohana framework, but uses MySQL for authentication. I'd like to use the kohana-pure-ldap class to implement LDAP authentication for the system. I'm having trouble figuring out where to exactly clone this. There is a modules directory that is under the application, but then there is also a folder called "ko323" which has a modules directory also. I've placed things where I think they need to be, and made the appropriate changes, but it looks like the PureLDAP class isn't getting picked up.

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.