/** @file\r
- This driver is a configuration tool for adding, deleting or modifying user \r
- profiles, including gathering the necessary information to ascertain their \r
- identity in the future, updating user access policy and identification \r
+ This driver is a configuration tool for adding, deleting or modifying user\r
+ profiles, including gathering the necessary information to ascertain their\r
+ identity in the future, updating user access policy and identification\r
policy, etc.\r
\r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
\r
/**\r
- This function gets all the credential providers in the system and saved them \r
+ This function gets all the credential providers in the system and saved them\r
to mProviderInfo.\r
\r
@retval EFI_SUCESS Init credential provider database successfully.\r
@retval Others Fail to init credential provider database.\r
- \r
+\r
**/\r
EFI_STATUS\r
InitProviderInfo (\r
EFI_STATUS Status;\r
UINTN HandleCount;\r
EFI_HANDLE *HandleBuf;\r
- UINTN Index; \r
- \r
+ UINTN Index;\r
+\r
//\r
// Try to find all the user credential provider driver.\r
//\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
//\r
// Get provider infomation.\r
//\r
FreePool (mProviderInfo);\r
}\r
mProviderInfo = AllocateZeroPool (\r
- sizeof (CREDENTIAL_PROVIDER_INFO) - \r
+ sizeof (CREDENTIAL_PROVIDER_INFO) -\r
sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) +\r
HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *)\r
);\r
if (QuestionId != QUESTIONID_USER_MANAGE) {\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
//\r
// Get current user\r
//\r
DEBUG ((DEBUG_ERROR, "Error: current user does not exist!\n"));\r
return EFI_NOT_READY;\r
}\r
- \r
+\r
//\r
// Get current user's right information.\r
//\r
if (EFI_ERROR (Status)) {\r
CurrentAccessRight = EFI_USER_INFO_ACCESS_ENROLL_SELF;\r
}\r
- \r
+\r
//\r
// Init credential provider information.\r
//\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
//\r
// Initialize the container for dynamic opcodes.\r
//\r
StartOpCodeHandle = HiiAllocateOpCodeHandle ();\r
ASSERT (StartOpCodeHandle != NULL);\r
- \r
+\r
EndOpCodeHandle = HiiAllocateOpCodeHandle ();\r
ASSERT (EndOpCodeHandle != NULL);\r
- \r
+\r
//\r
// Create Hii Extend Label OpCode.\r
//\r
);\r
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;\r
StartLabel->Number = LABEL_USER_MANAGE_FUNC;\r
- \r
+\r
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (\r
EndOpCodeHandle,\r
&gEfiIfrTianoGuid,\r
);\r
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;\r
EndLabel->Number = LABEL_END;\r
- \r
+\r
//\r
// Add user profile option.\r
//\r
0 // Action String ID\r
);\r
}\r
- \r
+\r
//\r
// Add modify user profile option.\r
//\r
EFI_IFR_FLAG_CALLBACK, // Question flag\r
KEY_MODIFY_USER // Question ID\r
);\r
- \r
+\r
//\r
// Add delete user profile option\r
//\r
KEY_DEL_USER // Question ID\r
);\r
}\r
- \r
+\r
HiiUpdateForm (\r
mCallbackInfo->HiiHandle, // HII handle\r
&gUserProfileManagerGuid, // Formset GUID\r
StartOpCodeHandle, // Label for where to insert opcodes\r
EndOpCodeHandle // Replace data\r
);\r
- \r
+\r
HiiFreeOpCodeHandle (StartOpCodeHandle);\r
HiiFreeOpCodeHandle (EndOpCodeHandle);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
break;\r
Status = EFI_SUCCESS;\r
break;\r
\r
- case EFI_BROWSER_ACTION_CHANGING:\r
- { \r
+ case EFI_BROWSER_ACTION_CHANGED:\r
+ {\r
//\r
// Handle the request from form.\r
//\r
if ((Value == NULL) || (ActionRequest == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// Judge first 2 bits.\r
//\r
// Judge next 2 bits.\r
//\r
switch (QuestionId & KEY_SECOND_FORM_MASK) {\r
- //\r
- // Enter delete user profile form.\r
- //\r
- case KEY_ENTER_NEXT_FORM:\r
- SelectUserToDelete ();\r
- break;\r
-\r
//\r
// Delete specified user profile.\r
//\r
// Judge next 2 bits.\r
//\r
switch (QuestionId & KEY_SECOND_FORM_MASK) {\r
- //\r
- // Enter modify user profile form.\r
- //\r
- case KEY_ENTER_NEXT_FORM:\r
- SelectUserToModify ();\r
- break;\r
-\r
//\r
// Enter user profile information form.\r
//\r
// Judge next 3 bits.\r
//\r
switch (QuestionId & KEY_MODIFY_INFO_MASK) {\r
- //\r
- // Display user information form.\r
- //\r
- case KEY_ENTER_NEXT_FORM:\r
- ModifyUserInfo ((UINT8) QuestionId);\r
- break;\r
-\r
//\r
// Modify user name.\r
//\r
// Judge next 3 bits\r
//\r
switch (QuestionId & KEY_MODIFY_IP_MASK) {\r
- //\r
- // Display identity policy modify form.\r
- //\r
- case KEY_ENTER_NEXT_FORM:\r
- ModifyIdentityPolicy ();\r
- break;\r
-\r
//\r
// Change credential provider option.\r
//\r
- case KEY_MODIFY_PROV: \r
+ case KEY_MODIFY_PROV:\r
mProviderChoice = Value->u8;\r
break;\r
\r
//\r
case KEY_IP_RETURN_UIF:\r
SaveIdentityPolicy ();\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
break;\r
\r
default:\r
// Judge next 3 bits.\r
//\r
switch (QuestionId & KEY_MODIFY_AP_MASK) {\r
- //\r
- // Display access policy modify form.\r
- //\r
- case KEY_ENTER_NEXT_FORM:\r
- ModidyAccessPolicy ();\r
- break;\r
-\r
//\r
// Change access right choice.\r
//\r
mAccessInfo.AccessBootOrder = Value->u32;\r
break;\r
\r
- //\r
- // Load device path form.\r
- //\r
- case KEY_MODIFY_LOAD:\r
- //\r
- // Judge next 2 bits.\r
- //\r
- switch (QuestionId & KEY_DISPLAY_DP_MASK) {\r
- //\r
- // Permit load device path.\r
- //\r
- case KEY_PERMIT_MODIFY:\r
- DisplayLoadPermit ();\r
- break;\r
-\r
- //\r
- // Forbid load device path.\r
- //\r
- case KEY_FORBID_MODIFY:\r
- DisplayLoadForbid ();\r
- break;\r
-\r
- default:\r
- break;\r
- }\r
- break;\r
-\r
- //\r
- // Connect device path form.\r
- //\r
- case KEY_MODIFY_CONNECT:\r
- //\r
- // Judge next 2 bits.\r
- //\r
- switch (QuestionId & KEY_DISPLAY_DP_MASK) {\r
- //\r
- // Permit connect device path.\r
- //\r
- case KEY_PERMIT_MODIFY:\r
- DisplayConnectPermit ();\r
- break;\r
-\r
- //\r
- // Forbid connect device path.\r
- //\r
- case KEY_FORBID_MODIFY:\r
- DisplayConnectForbid ();\r
- break;\r
-\r
- default:\r
- break;\r
- }\r
- break;\r
-\r
//\r
// Return to user profile information form.\r
//\r
case KEY_AP_RETURN_UIF:\r
SaveAccessPolicy ();\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
break;\r
\r
default:\r
}\r
break;\r
\r
+\r
+ case EFI_BROWSER_ACTION_CHANGING:\r
+ {\r
+ //\r
+ // Handle the request from form.\r
+ //\r
+ if (Value == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Judge first 2 bits.\r
+ //\r
+ switch (QuestionId & KEY_FIRST_FORM_MASK) {\r
+ //\r
+ // Delete user profile operation.\r
+ //\r
+ case KEY_DEL_USER:\r
+ //\r
+ // Judge next 2 bits.\r
+ //\r
+ switch (QuestionId & KEY_SECOND_FORM_MASK) {\r
+ //\r
+ // Enter delete user profile form.\r
+ //\r
+ case KEY_ENTER_NEXT_FORM:\r
+ SelectUserToDelete ();\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+\r
+ //\r
+ // Modify user profile operation.\r
+ //\r
+ case KEY_MODIFY_USER:\r
+ //\r
+ // Judge next 2 bits.\r
+ //\r
+ switch (QuestionId & KEY_SECOND_FORM_MASK) {\r
+ //\r
+ // Enter modify user profile form.\r
+ //\r
+ case KEY_ENTER_NEXT_FORM:\r
+ SelectUserToModify ();\r
+ break;\r
+\r
+ //\r
+ // Enter user profile information form.\r
+ //\r
+ case KEY_SELECT_USER:\r
+ //\r
+ // Judge next 3 bits.\r
+ //\r
+ switch (QuestionId & KEY_MODIFY_INFO_MASK) {\r
+ //\r
+ // Display user information form.\r
+ //\r
+ case KEY_ENTER_NEXT_FORM:\r
+ ModifyUserInfo ((UINT8) QuestionId);\r
+ break;\r
+\r
+ //\r
+ // Modify identity policy.\r
+ //\r
+ case KEY_MODIFY_IP:\r
+ //\r
+ // Judge next 3 bits\r
+ //\r
+ switch (QuestionId & KEY_MODIFY_IP_MASK) {\r
+ //\r
+ // Display identity policy modify form.\r
+ //\r
+ case KEY_ENTER_NEXT_FORM:\r
+ ModifyIdentityPolicy ();\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+\r
+ //\r
+ // Modify access policy.\r
+ //\r
+ case KEY_MODIFY_AP:\r
+ //\r
+ // Judge next 3 bits.\r
+ //\r
+ switch (QuestionId & KEY_MODIFY_AP_MASK) {\r
+ //\r
+ // Display access policy modify form.\r
+ //\r
+ case KEY_ENTER_NEXT_FORM:\r
+ ModidyAccessPolicy ();\r
+ break;\r
+ //\r
+ // Load device path form.\r
+ //\r
+ case KEY_MODIFY_LOAD:\r
+ //\r
+ // Judge next 2 bits.\r
+ //\r
+ switch (QuestionId & KEY_DISPLAY_DP_MASK) {\r
+ //\r
+ // Permit load device path.\r
+ //\r
+ case KEY_PERMIT_MODIFY:\r
+ DisplayLoadPermit ();\r
+ break;\r
+\r
+ //\r
+ // Forbid load device path.\r
+ //\r
+ case KEY_FORBID_MODIFY:\r
+ DisplayLoadForbid ();\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+\r
+ //\r
+ // Connect device path form.\r
+ //\r
+ case KEY_MODIFY_CONNECT:\r
+ //\r
+ // Judge next 2 bits.\r
+ //\r
+ switch (QuestionId & KEY_DISPLAY_DP_MASK) {\r
+ //\r
+ // Permit connect device path.\r
+ //\r
+ case KEY_PERMIT_MODIFY:\r
+ DisplayConnectPermit ();\r
+ break;\r
+\r
+ //\r
+ // Forbid connect device path.\r
+ //\r
+ case KEY_FORBID_MODIFY:\r
+ DisplayConnectForbid ();\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ }\r
+ break;\r
+\r
default:\r
//\r
// All other action return unsupported.\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ *Progress = Configuration;\r
+\r
return EFI_NOT_FOUND;\r
}\r
\r
if (EFI_ERROR (Status)) {\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
//\r
// Initialize driver private data.\r
//\r
ZeroMem (&mAccessInfo, sizeof (mAccessInfo));\r
\r
CallbackInfo = AllocateZeroPool (sizeof (USER_PROFILE_MANAGER_CALLBACK_INFO));\r
- ASSERT (CallbackInfo != NULL); \r
+ ASSERT (CallbackInfo != NULL);\r
\r
CallbackInfo->Signature = USER_PROFILE_MANAGER_SIGNATURE;\r
CallbackInfo->ConfigAccess.ExtractConfig = FakeExtractConfig;\r
CallbackInfo->ConfigAccess.RouteConfig = FakeRouteConfig;\r
CallbackInfo->ConfigAccess.Callback = UserProfileManagerCallback;\r
CallbackInfo->DriverHandle = NULL;\r
- \r
+\r
//\r
// Install Device Path Protocol and Config Access protocol to driver handle.\r
//\r
UserProfileManagerVfrBin,\r
NULL\r
);\r
- ASSERT (CallbackInfo->HiiHandle != NULL); \r
+ ASSERT (CallbackInfo->HiiHandle != NULL);\r
mCallbackInfo = CallbackInfo;\r
\r
return Status;\r
}\r
\r
- \r
+\r