pva2pva 1.4.2
Loading...
Searching...
No Matches
ASCLIENT Struct Reference

Public Member Functions

void add (dbChannel *chan, ASCred &cred)
bool canWrite ()

Public Attributes

ASCLIENTPVT aspvt
std::vector< ASCLIENTPVT > grppvt

Detailed Description

Definition at line 107 of file pvif.h.

Constructor & Destructor Documentation

◆ ASCLIENT()

ASCLIENT::ASCLIENT ( )
inline

Definition at line 110 of file pvif.h.

110:aspvt(0) {}

◆ ~ASCLIENT()

ASCLIENT::~ASCLIENT ( )

Definition at line 135 of file pvif.cpp.

136{
137 asRemoveClient(&aspvt);
138 for(size_t i=0, N=grppvt.size(); i<N; i++) {
139 asRemoveClient(&grppvt[i]);
140 }
141}

Member Function Documentation

◆ add()

void ASCLIENT::add ( dbChannel * chan,
ASCred & cred )

Definition at line 143 of file pvif.cpp.

144{
145 asRemoveClient(&aspvt);
146 /* asAddClient() fails secure to no-permission */
147 (void)asAddClient(&aspvt, dbChannelRecord(chan)->asp, dbChannelFldDes(chan)->as_level, &cred.user[0], &cred.host[0]);
148
149 grppvt.resize(cred.groups.size(), 0);
150
151 for(size_t i=0, N=grppvt.size(); i<N; i++) {
152 asRemoveClient(&grppvt[i]);
153 (void)asAddClient(&grppvt[i], dbChannelRecord(chan)->asp, dbChannelFldDes(chan)->as_level, &cred.groups[i][0], &cred.host[0]);
154 }
155}

◆ canWrite()

bool ASCLIENT::canWrite ( )

Definition at line 157 of file pvif.cpp.

157 {
158 if(!asActive || (aspvt && asCheckPut(aspvt)))
159 return true;
160 for(size_t i=0, N=grppvt.size(); i<N; i++) {
161 if(grppvt[i] && asCheckPut(grppvt[i]))
162 return true;
163 }
164 return false;
165}

Member Data Documentation

◆ aspvt

ASCLIENTPVT ASCLIENT::aspvt

Definition at line 108 of file pvif.h.

◆ grppvt

std::vector<ASCLIENTPVT> ASCLIENT::grppvt

Definition at line 109 of file pvif.h.


The documentation for this struct was generated from the following files: