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