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