~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/authentication.cc

  • Committer: Monty Taylor
  • Date: 2008-10-22 21:31:15 UTC
  • Revision ID: monty@inaugust.com-20081022213115-xuxc80r939tl88p1
Renamed drizzle_common again. Removed sql_common. (empty) 
Now all we need to do is merge/disect base.h, common.h, common_includes.h, server_includes.h and globa.h (good grief)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include <drizzled/server_includes.h>
22
22
#include <drizzled/authentication.h>
23
 
#include <libdrizzle/gettext.h>
 
23
#include <drizzled/gettext.h>
24
24
 
25
25
static bool are_plugins_loaded= false;
26
26
 
27
 
static bool authenticate_by(THD *thd, plugin_ref plugin, void* p_data)
 
27
static bool authenticate_by(Session *session, plugin_ref plugin, void* p_data)
28
28
{
29
29
  const char *password= (const char *)p_data;
30
30
  authentication_st *auth= plugin_data(plugin, authentication_st *);
33
33
 
34
34
  if (auth && auth->authenticate)
35
35
  {
36
 
    if (auth->authenticate(thd, password))
 
36
    if (auth->authenticate(session, password))
37
37
      return true;
38
38
  }
39
39
 
40
40
  return false;
41
41
}
42
42
 
43
 
bool authenticate_user(THD *thd, const char *password)
 
43
bool authenticate_user(Session *session, const char *password)
44
44
{
45
45
  /* If we never loaded any auth plugins, just return true */
46
46
  if (are_plugins_loaded != true)
47
47
    return true;
48
48
 
49
 
  return plugin_foreach(thd, authenticate_by, DRIZZLE_AUTH_PLUGIN, (void *)password);
 
49
  return plugin_foreach(session, authenticate_by, DRIZZLE_AUTH_PLUGIN, (void *)password);
50
50
}
51
51
 
52
52