2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 #include <afs/param.h>
15 #include "TaAfsAdmSvrClientInternal.h"
19 * ROUTINES ___________________________________________________________________
23 BOOL ADMINAPI asc_UserChange (DWORD idClient, ASID idCell, ASID idUser, LPAFSADMSVR_CHANGEUSER_PARAMS pChange, ULONG *pStatus)
30 if ((rc = AfsAdmSvr_ChangeUser (idClient, idCell, idUser, pChange, &status)) != FALSE)
32 // If we succeeded in changing this user's properties, get the
33 // newest values for our cache.
36 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
42 status = RPC_S_CALL_FAILED_DNE;
52 BOOL ADMINAPI asc_UserPasswordSet (DWORD idClient, ASID idCell, ASID idUser, int keyVersion, LPCTSTR pkeyString, PBYTE pkeyData, ULONG *pStatus)
59 BYTE keyData[ ENCRYPTIONKEYLENGTH ];
61 memcpy (keyData, pkeyData, sizeof(keyData));
63 memset (keyData, 0x00, sizeof(keyData));
67 lstrcpy (keyString, pkeyString);
69 memset (keyString, 0x00, sizeof(keyString));
71 if ((rc = AfsAdmSvr_SetUserPassword (idClient, idCell, idUser, keyVersion, keyString, keyData, &status)) == TRUE)
73 // If we succeeded in changing this user's password, get the
74 // newest user properties for our cache.
77 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
83 status = RPC_S_CALL_FAILED_DNE;
93 BOOL ADMINAPI asc_UserUnlock (DWORD idClient, ASID idCell, ASID idUser, ULONG *pStatus)
100 if ((rc = AfsAdmSvr_UnlockUser (idClient, idCell, idUser, &status)) == TRUE)
102 // If we succeeded in unlocking this user's account, get the
103 // newest user properties for our cache.
105 ASOBJPROP Properties;
106 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
112 status = RPC_S_CALL_FAILED_DNE;
122 BOOL ADMINAPI asc_UserCreate (DWORD idClient, ASID idCell, LPAFSADMSVR_CREATEUSER_PARAMS pCreate, ASID *pidUser, ULONG *pStatus)
129 if ((rc = AfsAdmSvr_CreateUser (idClient, idCell, pCreate, pidUser, &status)) == TRUE)
131 // If we succeeded in creating this user's account, get the
132 // initial user properties for our cache.
134 ASOBJPROP Properties;
135 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, *pidUser, &Properties, &status);
141 status = RPC_S_CALL_FAILED_DNE;
151 BOOL ADMINAPI asc_UserDelete (DWORD idClient, ASID idCell, ASID idUser, LPAFSADMSVR_DELETEUSER_PARAMS pDelete, ULONG *pStatus)
158 if ((rc = AfsAdmSvr_DeleteUser (idClient, idCell, idUser, pDelete, &status)) == TRUE)
160 // If we succeeded in deleting this user's account, clean up our cache.
161 // Expect this call to fail (the user's deleted, right?)
163 ASOBJPROP Properties;
165 (void)asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &dummy);
171 status = RPC_S_CALL_FAILED_DNE;