~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/user.h

  • Committer: Olaf van der Spek
  • Date: 2011-03-06 15:49:49 UTC
  • mto: (2226.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2227.
  • Revision ID: olafvdspek@gmail.com-20110306154949-zzso0l15mbwi60xb
Provide drizzle/drizzle.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
 
22
 
#ifndef DRIZZLED_IDENTIFIER_USER_H
23
 
#define DRIZZLED_IDENTIFIER_USER_H
 
21
#pragma once
24
22
 
25
23
#include <string>
26
24
#include <boost/shared_ptr.hpp>
27
25
 
 
26
#include <drizzled/visibility.h>
 
27
 
28
28
namespace drizzled
29
29
{
30
30
namespace identifier
35
35
  @brief A set of Session members describing the current authenticated user.
36
36
*/
37
37
 
38
 
class User {
 
38
class User : public Identifier
 
39
{
39
40
public:
40
41
  typedef boost::shared_ptr<User> shared_ptr;
41
42
  typedef boost::shared_ptr<const User> const_shared_ptr;
42
 
  static shared_ptr make_shared();
 
43
  typedef const User& const_reference;
 
44
  DRIZZLED_API static shared_ptr make_shared();
43
45
 
44
46
  enum PasswordType
45
47
  {
 
48
    NONE,
46
49
    PLAIN_TEXT,
47
50
    MYSQL_HASH
48
51
  };
49
52
 
50
53
  User():
51
 
    password_type(PLAIN_TEXT),
 
54
    password_type(NONE),
52
55
    _user(""),
53
56
    _address("")
54
57
  { }
55
58
 
 
59
  virtual void getSQLPath(std::string &arg) const;
 
60
 
 
61
  bool hasPassword() const
 
62
  {
 
63
    switch (password_type)
 
64
    {
 
65
    case NONE:
 
66
      return false;
 
67
    case PLAIN_TEXT:
 
68
    case MYSQL_HASH:
 
69
      break;
 
70
    }
 
71
 
 
72
    return true;
 
73
  }
 
74
 
56
75
  const std::string& address() const
57
76
  {
58
77
    return _address;
102
121
 
103
122
} /* namespace identifier */
104
123
} /* namespace drizzled */
105
 
 
106
 
#endif /* DRIZZLED_IDENTIFIER_USER_H */