C H A P T E R 2
Working with Nodes
aCurLength +=
aTempLength);
aCurLength += aTempLength;
aDirErr = dsDoDirNodeAuth(inDirNodeRef, anAuthType2Use, true, anAuthDataBuf, aAuthRespBuf, &aContinueData);
switch(aDirErr)
{
case eDSNoErr: aResult = true; break;
default:
//If any other error, assume the name or password is bad. aResult = false;
break;
}
// Clean up allocations.
aDirErr = dsDataBufferDeAllocate(inDirRef, anAuthDataBuf); anAuthDataBuf = NULL;
// Don't need to keep the response.
aDirErr = dsDataBufferDeAllocate(inDirRef, aAuthRespBuf); aAuthRespBuf = NULL;
//Don't need the authentication type value. Build a new one if needed
//later.
aDirErr = dsDataNodeDeAllocate(inDirRef, anAuthType2Use); anAuthType2Use = NULL;
//Return the result of the authentication. return (aResult);
}
Authenticating a User to a Node | 31 |