Beispiel #1
0
<?php

//gtalk
include_once 'includes/init.php';
$dmp = API_HIT_ENTRY_LIST;
debug("api({$dmp}): Start!");
//run
$api = new LDAP_Api($dmp);
$api->hit();
debug("api({$dmp}): act -> {$dmp}");
//free
unset($api);
debug("api({$dmp}): Done !");
Beispiel #2
0
|
|  LDAP_Api($action = API_HIT_ENTRY_SEARCH,$showres=true,$status=false)
|  
|    - SHOWRES = will output json reply
|    - STATUS  = will output headers
|
**/
$api = new LDAP_Api(API_HIT_ENTRY_RESTAPI, true, false);
debug("api(): VIA REST API > ");
//@ MAPPING of ROUTES
//ldap group
$app->group('/ldap', function () use($app, &$api) {
    $app->group('/restapi', function () use($app, &$api) {
        //sign-in
        $app->map('/signin', function () use($app, &$api) {
            $api->hit(API_HIT_SIGN_IN, $app);
            return true;
        })->via('GET', 'POST');
        //add entry
        $app->map('/add', function () use($app, &$api) {
            $api->hit(API_HIT_ENTRY_ADD, $app);
            return true;
        })->via('POST', 'PUT');
        //update entry
        $app->map('/modify', function () use($app, &$api) {
            $api->hit(API_HIT_ENTRY_UPDATE, $app);
            return true;
        })->via('POST', 'PUT');
        //search
        $app->map('/search', function () use($app, &$api) {
            $api->hit(API_HIT_ENTRY_SEARCH, $app);