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 <afs/param.h>
18 #include "TaAfsAdmSvrClientInternal.h"
22 * ROUTINES ___________________________________________________________________
26 BOOL ADMINAPI asc_UserChange (UINT_PTR idClient, ASID idCell, ASID idUser, LPAFSADMSVR_CHANGEUSER_PARAMS pChange, ULONG *pStatus)
33 if ((rc = AfsAdmSvr_ChangeUser (idClient, idCell, idUser, pChange, &status)) != FALSE)
35 // If we succeeded in changing this user's properties, get the
36 // newest values for our cache.
39 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
45 status = RPC_S_CALL_FAILED_DNE;
55 BOOL ADMINAPI asc_UserPasswordSet (UINT_PTR idClient, ASID idCell, ASID idUser, int keyVersion, LPCTSTR pkeyString, PBYTE pkeyData, ULONG *pStatus)
62 BYTE keyData[ ENCRYPTIONKEYLENGTH ];
64 memcpy (keyData, pkeyData, sizeof(keyData));
66 memset (keyData, 0x00, sizeof(keyData));
70 lstrcpy (keyString, pkeyString);
72 memset (keyString, 0x00, sizeof(keyString));
74 if ((rc = AfsAdmSvr_SetUserPassword (idClient, idCell, idUser, keyVersion, keyString, keyData, &status)) == TRUE)
76 // If we succeeded in changing this user's password, get the
77 // newest user properties for our cache.
80 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
86 status = RPC_S_CALL_FAILED_DNE;
96 BOOL ADMINAPI asc_UserUnlock (UINT_PTR idClient, ASID idCell, ASID idUser, ULONG *pStatus)
103 if ((rc = AfsAdmSvr_UnlockUser (idClient, idCell, idUser, &status)) == TRUE)
105 // If we succeeded in unlocking this user's account, get the
106 // newest user properties for our cache.
108 ASOBJPROP Properties;
109 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &status);
115 status = RPC_S_CALL_FAILED_DNE;
125 BOOL ADMINAPI asc_UserCreate (UINT_PTR idClient, ASID idCell, LPAFSADMSVR_CREATEUSER_PARAMS pCreate, ASID *pidUser, ULONG *pStatus)
132 if ((rc = AfsAdmSvr_CreateUser (idClient, idCell, pCreate, pidUser, &status)) == TRUE)
134 // If we succeeded in creating this user's account, get the
135 // initial user properties for our cache.
137 ASOBJPROP Properties;
138 rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, *pidUser, &Properties, &status);
144 status = RPC_S_CALL_FAILED_DNE;
154 BOOL ADMINAPI asc_UserDelete (UINT_PTR idClient, ASID idCell, ASID idUser, LPAFSADMSVR_DELETEUSER_PARAMS pDelete, ULONG *pStatus)
161 if ((rc = AfsAdmSvr_DeleteUser (idClient, idCell, idUser, pDelete, &status)) == TRUE)
163 // If we succeeded in deleting this user's account, clean up our cache.
164 // Expect this call to fail (the user's deleted, right?)
166 ASOBJPROP Properties;
168 (void)asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idUser, &Properties, &dummy);
174 status = RPC_S_CALL_FAILED_DNE;