]>
Commit | Line | Data |
---|---|---|
abb929f0 | 1 | /* |
ef57eb7b | 2 | * Copyright (C) 1996-2016 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 | 21 | ACLExtUser::~ACLExtUser() |
22 | { | |
00d77d6b | 23 | delete data; |
abb929f0 | 24 | } |
25 | ||
26 | ACLExtUser::ACLExtUser(ACLData<char const *> *newData, char const *newType) : data (newData), type_ (newType) {} | |
27 | ||
28 | ACLExtUser::ACLExtUser (ACLExtUser const &old) : data (old.data->clone()), type_ (old.type_) | |
29 | {} | |
30 | ||
31 | ACLExtUser & | |
32 | ACLExtUser::operator= (ACLExtUser const &rhs) | |
33 | { | |
34 | data = rhs.data->clone(); | |
35 | type_ = rhs.type_; | |
36 | return *this; | |
37 | } | |
38 | ||
39 | char const * | |
40 | ACLExtUser::typeString() const | |
41 | { | |
42 | return type_; | |
43 | } | |
44 | ||
45 | void | |
46 | ACLExtUser::parse() | |
47 | { | |
abb929f0 | 48 | data->parse(); |
49 | } | |
50 | ||
51 | int | |
127dce76 | 52 | ACLExtUser::match(ACLChecklist *cl) |
abb929f0 | 53 | { |
af6a12ee | 54 | ACLFilledChecklist *checklist = Filled(cl); |
abb929f0 | 55 | if (checklist->request->extacl_user.size()) { |
a7a42b14 | 56 | return data->match(checklist->request->extacl_user.termedBuf()); |
abb929f0 | 57 | } else { |
58 | return -1; | |
59 | } | |
60 | } | |
61 | ||
8966008b | 62 | SBufList |
abb929f0 | 63 | ACLExtUser::dump() const |
64 | { | |
65 | return data->dump(); | |
66 | } | |
67 | ||
68 | bool | |
4b0f5de8 | 69 | ACLExtUser::empty () const |
abb929f0 | 70 | { |
1bebfd93 | 71 | return data->empty(); |
abb929f0 | 72 | } |
73 | ||
74 | ACL * | |
75 | ACLExtUser::clone() const | |
76 | { | |
77 | return new ACLExtUser(*this); | |
78 | } | |
79 | ||
2f1431ea | 80 | #endif /* USE_AUTH */ |
f53969cc | 81 |