~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/authentication.cc

updating to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
  }
65
65
};
66
66
 
67
 
bool plugin::Authentication::isAuthenticated(drizzled::identifier::User::const_shared_ptr sctx,
 
67
bool plugin::Authentication::isAuthenticated(drizzled::identifier::User::const_reference sctx,
68
68
                                             const std::string &password)
69
69
{
70
70
  /* If we never loaded any auth plugins, just return true */
74
74
  /* Use find_if instead of foreach so that we can collect return codes */
75
75
  std::vector<plugin::Authentication *>::iterator iter=
76
76
    std::find_if(all_authentication.begin(), all_authentication.end(),
77
 
                 AuthenticateBy(*sctx, password));
 
77
                 AuthenticateBy(sctx, password));
78
78
 
79
79
  /* We only require one plugin to return success in order to authenticate.
80
80
   * If iter is == end() here, that means that all of the plugins returned
82
82
   */
83
83
  if (iter == all_authentication.end())
84
84
  {
85
 
    my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
86
 
             sctx->username().c_str(),
87
 
             sctx->address().c_str(),
88
 
             password.empty() ? ER(ER_NO) : ER(ER_YES));
 
85
    error::access(sctx);
89
86
 
90
87
    return false;
91
88
  }