~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/auth_ldap/auth_ldap.cc

mergeĀ lp:~hingo/drizzle/drizzle-auth_ldap-fix-and-docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
std::string password_attribute;
52
52
std::string DEFAULT_PASSWORD_ATTRIBUTE= "userPassword";
53
53
std::string mysql_password_attribute;
54
 
const std::string DEFAULT_MYSQL_PASSWORD_ATTRIBUTE= "mysqlUserPassword";
 
54
const std::string DEFAULT_MYSQL_PASSWORD_ATTRIBUTE= "drizzleMysqlUserPassword";
55
55
static const int DEFAULT_CACHE_TIMEOUT= 600;
56
56
typedef constrained_check<int, DEFAULT_CACHE_TIMEOUT, 0, 2147483647> cachetimeout_constraint;
57
57
static cachetimeout_constraint cache_timeout= 0;
272
272
 
273
273
void AuthLDAP::lookupUser(const string& user)
274
274
{
275
 
  string filter("(cn=" + user + ")");
 
275
  string filter("(uid=" + user + ")");
276
276
  const char *attributes[3]=
277
277
  {
278
278
    (char *)password_attribute.c_str(),
421
421
 
422
422
  context.registerVariable(new sys_var_const_string_val("uri", uri));
423
423
  context.registerVariable(new sys_var_const_string_val("bind-dn", bind_dn));
424
 
  context.registerVariable(new sys_var_const_string_val("bind-password", bind_password));
 
424
  //context.registerVariable(new sys_var_const_string_val("bind-password", bind_password));
425
425
  context.registerVariable(new sys_var_const_string_val("base-dn", base_dn));
426
426
  context.registerVariable(new sys_var_const_string_val("password-attribute",password_attribute));
427
427
  context.registerVariable(new sys_var_const_string_val("mysql-password-attribute", mysql_password_attribute));
435
435
{
436
436
  context("uri", po::value<string>(&uri)->default_value(DEFAULT_URI),
437
437
          N_("URI of the LDAP server to contact"));
438
 
  context("bind-db", po::value<string>(&bind_dn)->default_value(""),
 
438
  context("bind-dn", po::value<string>(&bind_dn)->default_value(""),
439
439
          N_("DN to use when binding to the LDAP server"));
440
440
  context("bind-password", po::value<string>(&bind_password)->default_value(""),
441
441
          N_("Password to use when binding the DN"));
451
451
 
452
452
} /* namespace auth_ldap */
453
453
 
454
 
DRIZZLE_PLUGIN(auth_ldap::init, NULL, auth_ldap::init_options);
 
454
DRIZZLE_DECLARE_PLUGIN
 
455
{
 
456
  DRIZZLE_VERSION_ID,
 
457
  "auth_ldap",
 
458
  "0.2",
 
459
  "Eric Day, Henrik Ingo, Edward Konetzko",
 
460
  "LDAP based authenication.",
 
461
  PLUGIN_LICENSE_GPL,
 
462
  auth_ldap::init, /* Plugin Init */
 
463
  NULL,   /* depends */
 
464
  auth_ldap::init_options    /* config options */
 
465
}
 
466
DRIZZLE_DECLARE_PLUGIN_END;
 
467