Example #1
0
   directory for users (ie, if your LDAP server does not allow anonymous binds. */
// $servers->setValue('login','bind_id','');
  $servers->setValue('login','bind_id',$adminRdn.",".$ldap_base_dn);
//echo $adminRdn.",".$ldap_base_dn;exit;


/* Your LDAP password. If you specified an empty bind_id above, this MUST also
   be blank. */
// $servers->setValue('login','bind_pass','');
#  $servers->setValue('login','bind_pass','secret');

$rights=exec(" ldapsearch -xLLL member='uid=$loggin,ou=People,".$ldap_base_dn."' dn | grep '^dn: cn=lcs_is_admin' | wc -l");
//echo " ldapsearch -xLLL member='uid=$login,ou=People,".$ldap_base_dn."' dn | grep '^dn: cn=lcs_is_admin' | wc -l";exit;
if  ( ($loggin!="" && $rights=="1")  ) {
    $loggin="admin";
    $servers->SetValue('login','bind_pass',$adminPw);
} else
    $servers->SetValue('login','bind_pass','');

/* Use TLS (Transport Layer Security) to connect to the LDAP server. */
// $servers->setValue('server','tls',false);

/************************************
 *      SASL Authentication         *
 ************************************/

/* Enable SASL authentication LDAP SASL authentication requires PHP 5.x
   configured with --with-ldap-sasl=DIR. If this option is disabled (ie, set to
   false), then all other sasl options are ignored. */
// $servers->setValue('server','sasl_auth',false);
Example #2
0
/* Use this array if you want to have your attributes displayed in a specific
   order. You can use default attribute names or their fridenly names.
   For example, "sn" will be displayed right after "givenName". All the other
   attributes that are not specified in this array will be displayed after in
   alphabetical order. */
// $config->custom->appearance['attr_display_order'] = array();
#  $config->custom->appearance['attr_display_order'] = array(
#   'givenName',
#   'sn',
#   'cn',
#   'displayName',
#   'uid',
#   'uidNumber',
#   'gidNumber',
#   'homeDirectory',
#   'mail',
#   'userPassword'
#  );
/*********************************************/
/* Define your LDAP servers in this section  */
/*********************************************/
$servers = new Datastore();
/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
   declaration. */
$servers->newServer('ldap_pla');
$servers->setValue('server', 'name', 'Samba4 AD Server');
$servers->setValue('server', 'host', 'ldapi://%2Fvar%2Flib%2Fsamba%2Fprivate%2Fldapi');
$servers->setValue('login', 'auth_type', 'session');
$servers->setValue('login', 'attr', 'dn');
$servers->SetValue('login', 'bind_id', 'cn=Administrator,cn=Users,CHANGETHISBASE');
Example #3
0
   4. 'config': specify your login dn and password here in this config file. No
      login will be required to use phpLDAPadmin for this server.

   Choose wisely to protect your authentication information appropriately for
   your situation. If you choose 'cookie', your cookie contents will be
   encrypted using blowfish and the secret your specify above as
   session['blowfish']. */
// $servers->setValue('login','auth_type','session');
/* The DN of the user for phpLDAPadmin to bind with. For anonymous binds or
   'cookie' or 'session' auth_types, LEAVE THE LOGIN_DN AND LOGIN_PASS BLANK. If
   you specify a login_attr in conjunction with a cookie or session auth_type,
   then you can also specify the bind_id/bind_pass here for searching the
   directory for users (ie, if your LDAP server does not allow anonymous binds. */
// $servers->setValue('login','bind_id','');
#  $servers->setValue('login','bind_id','cn=Manager,dc=example,dc=com');
$servers->SetValue('login', 'bind_id', 'cn=admin,dc=karoshi,dc=local');
/* Your LDAP password. If you specified an empty bind_id above, this MUST also
   be blank. */
// $servers->setValue('login','bind_pass','');
#  $servers->setValue('login','bind_pass','secret');
/* Use TLS (Transport Layer Security) to connect to the LDAP server. */
// $servers->setValue('server','tls',false);
/************************************
 *      SASL Authentication         *
 ************************************/
/* Enable SASL authentication LDAP SASL authentication requires PHP 5.x
   configured with --with-ldap-sasl=DIR. If this option is disabled (ie, set to
   false), then all other sasl options are ignored. */
// $servers->setValue('server','sasl_auth',false);
/* SASL auth mechanism */
// $servers->setValue('server','sasl_mech','PLAIN');