1
0
Эх сурвалжийг харах

Adding readme and contributing + fixed type (binddn --> basedn)

clement 2 жил өмнө
parent
commit
49e78acb3a

+ 39 - 0
CONTRIBUTING.md

@@ -0,0 +1,39 @@
+# Contributing to BIM
+
+To contribute to BIM, follow these steps:
+
+* Install the [requirements](#requirements)
+* Fork the repo
+* Clone it
+* Install the [dependencies](#installing-dependencies)
+* Set up the dev [environnement](#setting-up-the-dev-environnnement)
+* Create a topic branch from master
+* Change what you want to change
+* Push the branch to your repo
+* Open a pull request
+
+## Requirements
+
+* PHP
+* Composer
+* php-ldap (depending on your distro you may need to install a package (debian) or activating it in `/etc/php/php.ini` (arch))
+
+## Installing dependencies
+
+```
+$ cd BIM
+$ composer install
+```
+
+## Setting up the dev environnnement
+
+Copy `includes/config.ini.example` to `includes/config.ini` and edit it.
+
+> hostname : hostname or ip of ldap test server
+
+> port : port of ldap test server
+
+> basedn : where to search
+
+Then, you can start the development web server with :
+`php -S localhost:8080`

+ 38 - 0
README.md

@@ -0,0 +1,38 @@
+# BIM
+Bretzel Identity Manager ou BIM Identity Manager
+
+1. [Installation](#installation)
+2. [Contributing](#contributing)
+
+
+## Installation
+
+* Clone this repo and serve the files with a web server.
+Make sure to exclude: `/vendor/` `templates` and `includes`
+* Rename `includes/config.ini.example` to `includes/config.ini` and edit the file with your parameters
+
+### Example using caddy behind HTTPS reverse proxy
+
+```
+http://bim.example.org {
+	
+  @blocked {
+	path /vendor/* /templates/* /includes/*
+  }
+
+  respond @blocked 403
+
+  handle {
+    root * /srv/bim
+    php_fastcgi caddy-phpfpm:9000 {
+	index signin.php
+    }
+  }
+}
+```
+
+BIM will be accessible using bim.example.org.
+
+## Contributing
+
+Please refer to [this page](CONTRIBUTING.md).

+ 1 - 1
auth.php

@@ -25,7 +25,7 @@ try {
 }
 
 if ($ldapconn) {
-    $ldapbind = @ldap_bind($ldapconn, "uid=" . ldap_escape($id) . ',' . $ini["binddn"], $_POST['password']);
+    $ldapbind = @ldap_bind($ldapconn, "uid=" . ldap_escape($id) . ',' . $ini["basedn"], $_POST['password']);
     if ($ldapbind) {
         $_SESSION['user'] = $id;
         header('Location: home.php');

+ 1 - 1
changepasswd.php

@@ -45,7 +45,7 @@ try {
     die ('ERROR: ' . $e->getMessage());
 }
 
-$dn = "uid=" . ldap_escape($_SESSION['user']) . ',' . $ini["binddn"];
+$dn = "uid=" . ldap_escape($_SESSION['user']) . ',' . $ini["basedn"];
 $ldap_bind = @ldap_bind($ldapconn, $dn, $current_password);
 
 if ($ldap_bind) {

+ 1 - 1
includes/config.ini.example

@@ -1,4 +1,4 @@
 [ldap_server]
 hostname = "example.com"
 port = "389"
-binddn = "ou=people,dc=example,dc=com"
+basedn = "ou=people,dc=example,dc=com"