]> git.ipfire.org Git - thirdparty/squid.git/blame - src/acl/ExtUser.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / acl / ExtUser.cc
CommitLineData
abb929f0 1/*
bbc27441 2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
abb929f0 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
abb929f0 7 */
8
bbc27441
AJ
9/* DEBUG: section 28 Access Control */
10
582c2af2 11#include "squid.h"
2f1431ea
AJ
12
13#if USE_AUTH
14
127dce76
AR
15#include "acl/ExtUser.h"
16#include "acl/FilledChecklist.h"
17#include "acl/RegexData.h"
18#include "acl/UserData.h"
abb929f0 19#include "client_side.h"
20
abb929f0 21ACLExtUser::~ACLExtUser()
22{
00d77d6b 23 delete data;
abb929f0 24}
25
26ACLExtUser::ACLExtUser(ACLData<char const *> *newData, char const *newType) : data (newData), type_ (newType) {}
27
28ACLExtUser::ACLExtUser (ACLExtUser const &old) : data (old.data->clone()), type_ (old.type_)
29{}
30
31ACLExtUser &
32ACLExtUser::operator= (ACLExtUser const &rhs)
33{
34 data = rhs.data->clone();
35 type_ = rhs.type_;
36 return *this;
37}
38
39char const *
40ACLExtUser::typeString() const
41{
42 return type_;
43}
44
45void
46ACLExtUser::parse()
47{
bf8fe701 48 debugs(28, 3, "aclParseUserList: current is null. Creating");
abb929f0 49 data = new ACLUserData;
50 data->parse();
51}
52
53int
127dce76 54ACLExtUser::match(ACLChecklist *cl)
abb929f0 55{
af6a12ee 56 ACLFilledChecklist *checklist = Filled(cl);
abb929f0 57 if (checklist->request->extacl_user.size()) {
a7a42b14 58 return data->match(checklist->request->extacl_user.termedBuf());
abb929f0 59 } else {
60 return -1;
61 }
62}
63
8966008b 64SBufList
abb929f0 65ACLExtUser::dump() const
66{
67 return data->dump();
68}
69
70bool
4b0f5de8 71ACLExtUser::empty () const
abb929f0 72{
1bebfd93 73 return data->empty();
abb929f0 74}
75
76ACL *
77ACLExtUser::clone() const
78{
79 return new ACLExtUser(*this);
80}
81
2f1431ea 82#endif /* USE_AUTH */
f53969cc 83