21#include <drizzled/item.h>
22#include <drizzled/plugin.h>
24#include <boost/program_options.hpp>
25#include "auth_schema.h"
27namespace po= boost::program_options;
32namespace auth_schema {
39static bool update_table(Session*, set_var* var)
43 errmsg_printf(error::ERROR, _(
"auth_schema table cannot be NULL"));
47static void init_options(module::option_context &context)
52 po::value<string>(&auth_schema->sysvar_table)->default_value(
"auth.users"),
53 N_(
"Database-qualified auth table name"));
56static int init(module::Context &context)
58 const module::option_map &vm= context.getOptions();
60 if (not vm[
"table"].as<string>().empty())
61 auth_schema->setTable(vm[
"table"].as<string>());
63 context.add(auth_schema);
64 context.registerVariable(
new sys_var_bool_ptr(
"enabled", &auth_schema->sysvar_enabled));
65 context.registerVariable(
new sys_var_std_string(
"table", auth_schema->sysvar_table, NULL, &update_table));
79 N_(
"Authentication against a table with encrypted passwords"),
81 drizzle_plugin::auth_schema::init,
83 drizzle_plugin::auth_schema::init_options,
85DRIZZLE_DECLARE_PLUGIN_END;
bool setTable(const string &table)
Set the authentication table.
An Proxy Wrapper around boost::program_options::variables_map.