~kalebral-deactivatedaccount/drizzle/change-error_num_to_enum-2

« back to all changes in this revision

Viewing changes to plugin/auth_file/auth_file.cc

  • Committer: Monty Taylor
  • Date: 2010-08-17 15:18:37 UTC
  • mfrom: (1711.1.20 build)
  • Revision ID: mordred@inaugust.com-20100817151837-xg0sc9n6tgjaf4mn
Rollup merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "drizzled/security_context.h"
29
29
#include "drizzled/util/convert.h"
30
30
#include "drizzled/algorithm/sha1.h"
 
31
#include <boost/program_options.hpp>
 
32
#include <drizzled/module/option_map.h>
 
33
#include <iostream>
31
34
 
 
35
namespace po= boost::program_options;
32
36
using namespace std;
33
37
using namespace drizzled;
34
38
 
208
212
 
209
213
static int init(module::Context &context)
210
214
{
 
215
  const module::option_map &vm= context.getOptions();
 
216
 
 
217
  if (vm.count("users"))
 
218
  {
 
219
    users_file= const_cast<char *>(vm["users"].as<string>().c_str());
 
220
  }
 
221
 
211
222
  AuthFile *auth_file = new AuthFile("auth_file");
212
223
  if (!auth_file->loadFile())
213
224
  {
235
246
  NULL
236
247
};
237
248
 
 
249
static void init_options(drizzled::module::option_context &context)
 
250
{
 
251
  context("users", 
 
252
          po::value<string>()->default_value(DEFAULT_USERS_FILE),
 
253
          N_("File to load for usernames and passwords"));
 
254
}
 
255
 
238
256
} /* namespace auth_file */
239
257
 
240
 
DRIZZLE_PLUGIN(auth_file::init, auth_file::sys_variables, NULL);
 
258
DRIZZLE_PLUGIN(auth_file::init, auth_file::sys_variables, auth_file::init_options);