~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/auth_http/auth_http.cc

  • Committer: Brian Aker
  • Date: 2010-12-07 09:12:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1985.
  • Revision ID: brian@tangent.org-20101207091212-1m0w20tck6z7632m
This is a fix for bug lp:686197

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <cassert>
26
26
#include <boost/program_options.hpp>
27
27
#include <drizzled/module/option_map.h>
28
 
#include "drizzled/identifier.h"
 
28
#include "drizzled/security_context.h"
29
29
#include "drizzled/plugin/authentication.h"
30
30
#include "drizzled/gettext.h"
31
31
namespace po= boost::program_options;
73
73
    curl_global_cleanup();
74
74
  }
75
75
 
76
 
  virtual bool authenticate(const identifier::User &sctx, const string &password)
 
76
  virtual bool authenticate(const SecurityContext &sctx, const string &password)
77
77
  {
78
78
    long http_response_code;
79
79
 
80
 
    assert(sctx.username().c_str());
 
80
    assert(sctx.getUser().c_str());
81
81
 
82
82
    // set the parameters: url, username, password
83
83
    rv= curl_easy_setopt(curl_handle, CURLOPT_URL, auth_url.c_str());
84
84
#if defined(HAVE_CURLOPT_USERNAME)
85
85
 
86
86
    rv= curl_easy_setopt(curl_handle, CURLOPT_USERNAME,
87
 
                         sctx.username().c_str());
 
87
                         sctx.getUser().c_str());
88
88
    rv= curl_easy_setopt(curl_handle, CURLOPT_PASSWORD, password.c_str());
89
89
 
90
90
#else
91
91
 
92
 
    string userpwd(sctx.username());
 
92
    string userpwd(sctx.getUser());
93
93
    userpwd.append(":");
94
94
    userpwd.append(password);
95
95
    rv= curl_easy_setopt(curl_handle, CURLOPT_USERPWD, userpwd.c_str());