/** @file
The functions to add a user profile.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "UserProfileManager.h"
/**
Get user name from the popup windows.
@param[in, out] UserNameLen On entry, point to UserName buffer lengh, in bytes.
On exit, point to input user name length, in bytes.
@param[out] UserName The buffer to hold the input user name.
@retval EFI_ABORTED It is given up by pressing 'ESC' key.
@retval EFI_NOT_READY Not a valid input at all.
@retval EFI_SUCCESS Get a user name successfully.
**/
)
{
NameLen = 0;
while (TRUE) {
&Key,
L"Input User Name",
L"---------------------",
Name,
);
//
// Check key.
//
//
// Add the null terminator.
//
NameLen++;
break;
) {
continue;
} else {
if (NameLen > 0) {
NameLen--;
}
} else {
NameLen++;
//
// Add the null terminator.
//
NameLen++;
break;
}
}
}
}
return EFI_ABORTED;
}
}
if (NameLen <= 1) {
return EFI_NOT_READY;
}
return EFI_NOT_READY;
}
return EFI_SUCCESS;
}
/**
Set a user's username.
@param[in] User Handle of a user profile .
@param[in] UserNameLen The lengh of UserName.
@param[in] UserName Point to the buffer of user name.
@retval EFI_NOT_READY The usernme in mAddUserName had been used.
@retval EFI_SUCCESS Change the user's username successfully with
username in mAddUserName.
**/
)
{
&TempUser,
NULL,
);
//
// The user name had been used, return error.
//
return EFI_NOT_READY;
}
User,
&UserInfo,
);
return EFI_SUCCESS;
}
/**
Set create date of the specified user.
@param[in] User Handle of a user profile.
**/
)
{
sizeof (EFI_USER_INFO) +
sizeof (EFI_USER_INFO_CREATE_DATE)
);
return ;
}
User,
&UserInfo,
);
}
/**
Set the default identity policy of the specified user.
@param[in] User Handle of a user profile.
**/
)
{
sizeof (EFI_USER_INFO) +
sizeof (EFI_USER_INFO_IDENTITY_POLICY)
);
User,
&UserInfo,
);
}
/**
Set the default access policy of the specified user.
@param[in] User Handle of a user profile.
**/
)
{
sizeof (EFI_USER_INFO) +
sizeof (EFI_USER_INFO_ACCESS_CONTROL)
);
User,
&UserInfo,
);
}
/**
Add a new user profile into the user profile database.
**/
)
{
QuestionStr = NULL;
//
// Get user name to add.
//
UserNameLen = sizeof (UserName);
if (Status != EFI_ABORTED) {
goto Done;
}
return ;
}
//
// Create a new user profile.
//
} else {
//
// Add default user information.
//
goto Done;
}
}
Done:
&Key,
L"",
);
}