LLAMA is a Lightweight LDAP Account Management API written in PHP that provides an easily accessible web interface for automation.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 41 commits ahead of twilfong:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
img
templates
.gitignore
README.md
add-group.php
add-to-group.php
add-user.php
config.inc.example
footer.inc
functions.inc
group-add-form.inc
group-create-form.inc
group-remove-form.inc
header.inc
index.php
input-form.inc
ldapconnect.inc
ldappasswd-wrapper
modify-user-form.inc
modify-user.php
remove-from-group.php
view-user-form.inc
view-user.php

README.md

Lightweight LDAP Account Management API

DESCRIPTION

This application provides a generic but flexible LDAP API that can be used easily with anything that can make a GET or POST request. This application makes it trivial to write automation against LDAP.

SETUP

Copy config.inc.example to config.inc and configure for your environment.

Requirements

You need the php-ldap package. yum install php-ldap -y

USAGE

There are different endpoints for adding users, groups, removing users, modifying users, viewing users and adding users to groups... Just form a URL and call it with wget or curl.

Example: wget -O - -q "http://localhost/add-to-group.php/?uid=testuser&cn=testgroup"

Creating Users

  • URL: http://localhost/add-user.php

  • Returns: uidNumber of created account (plaintext)

  • GET/POST Parameters: uid,password,template,attributes

    • uid: Username (string plaintext) (Required)
    • password: Password (string plaintext) (Optional)
    • template: unixUser or ftpAccount (Required)
      • unixUser
        • required attributes: gidNumber (defaults to 1000)
        • optional attributes: uidNumber,homeDirectory
      • ftpAccount
        • required attributes: gidNumber (defaults to 1000)
        • optional attributes: uidNumber,,homeDirectory
        • attributes: LDAPAttribute=Value,LDAPAttribute=Value... (string plaintext) (Optional)
    • gidNumber (optional - defaults to 1000)
    • uidNumber (optional - determines next automatically if not set)

EXAMPLE: wget "http://localhost/add-user.php?uid=test&password=1234&template=unixUser&attributes=homeDirectory=/home/testuser,gidNumber=7000" -q -O -

Creating Groups

  • URL: http://localhost/add-group.php

  • Returns: gidNumber of created account (plaintext)

  • GET/POST Parameters: cn,attributes

    • cn: Group Name (string plaintext) (Required)
    • attributes: LDAPAttribute=Value,LDAPAttribute=Value... (string plaintext) (Optional)
      • gidNumber (defaults to 1000)

EXAMPLE: wget "http://localhost/add-group.php?cn=test&attributes=gidNumber=5000" -q -O -

Adding User to Group

  • URL: http://localhost/add-to-group.php

  • Returns: nothing

  • GET/POST Parameters: cn,uid

    • cn: Group Name (string plaintext) (Required)
    • uid: User Name (string plaintext) (Required)

Removing User from Group

View user attributes

Edit user attributes

  • URL: http://localhost/modify-user.php

  • Returns: nothing

  • GET/POST Parameters: uid, attributes

    • uid: User Name (string plaintext) (Required)
    • attributes: LDAPAttribute=Value,LDAPAttribute=Value... (string plaintext) (Optional)

EXAMPLE: wget "http://localhost/modify-user.php?uid=test&attributes=homeDirectory=/home/testuser,gidNumber=7000" -q -O -