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
14 #include <afsconfig.h>
15 #include <afs/param.h>
20 #include "TaAfsAdmSvrClientInternal.h"
24 * ROUTINES ___________________________________________________________________
28 BOOL ADMINAPI asc_UserChange (UINT_PTR idClient, ASID idCell, ASID idUser, LPAFSADMSVR_CHANGEUSER_PARAMS pChange, ULONG *pStatus)
35 if ((rc = AfsAdmSvr_ChangeUser (idClient, idCell, idUser, pChange, &status)) != FALSE)
37 // If we succeeded in changing this user's properties, get the
38 // newest values for our cache.
41 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
47 status = RPC_S_CALL_FAILED_DNE;
57 BOOL ADMINAPI asc_UserPasswordSet (UINT_PTR idClient, ASID idCell, ASID idUser, int keyVersion, LPCTSTR pkeyString, PBYTE pkeyData, ULONG *pStatus)
64 BYTE keyData[ ENCRYPTIONKEYLENGTH ];
66 memcpy (keyData, pkeyData, sizeof(keyData));
68 memset (keyData, 0x00, sizeof(keyData));
72 lstrcpy (keyString, pkeyString);
74 memset (keyString, 0x00, sizeof(keyString));
76 if ((rc = AfsAdmSvr_SetUserPassword (idClient, idCell, idUser, keyVersion, keyString, keyData, &status)) == TRUE)
78 // If we succeeded in changing this user's password, get the
79 // newest user properties for our cache.
82 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
88 status = RPC_S_CALL_FAILED_DNE;
98 BOOL ADMINAPI asc_UserUnlock (UINT_PTR idClient, ASID idCell, ASID idUser, ULONG *pStatus)
105 if ((rc = AfsAdmSvr_UnlockUser (idClient, idCell, idUser, &status)) == TRUE)
107 // If we succeeded in unlocking this user's account, get the
108 // newest user properties for our cache.
110 ASOBJPROP Properties;
111 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
117 status = RPC_S_CALL_FAILED_DNE;
127 BOOL ADMINAPI asc_UserCreate (UINT_PTR idClient, ASID idCell, LPAFSADMSVR_CREATEUSER_PARAMS pCreate, ASID *pidUser, ULONG *pStatus)
134 if ((rc = AfsAdmSvr_CreateUser (idClient, idCell, pCreate, pidUser, &status)) == TRUE)
136 // If we succeeded in creating this user's account, get the
137 // initial user properties for our cache.
139 ASOBJPROP Properties;
140 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, *pidUser, &Properties, &status);
146 status = RPC_S_CALL_FAILED_DNE;
156 BOOL ADMINAPI asc_UserDelete (UINT_PTR idClient, ASID idCell, ASID idUser, LPAFSADMSVR_DELETEUSER_PARAMS pDelete, ULONG *pStatus)
163 if ((rc = AfsAdmSvr_DeleteUser (idClient, idCell, idUser, pDelete, &status)) == TRUE)
165 // If we succeeded in deleting this user's account, clean up our cache.
166 // Expect this call to fail (the user's deleted, right?)
168 ASOBJPROP Properties;
170 (void)asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &dummy);
176 status = RPC_S_CALL_FAILED_DNE;