getgrouppasswd

The getgrouppasswd() function prompts first for a user (member of the specified group) then for the password of that user.

result = getgrouppasswd(group[, prompt[, attempts]]);
group Required. The name of the group for which a username and password must be entered.
prompt Optional. The password prompt that is displayed to the user. If a prompt is not provided, then the following default prompt is displayed: Enter the username and group of someone in the <group name> group.
attempts Optional. Number of attempts that the user gets to enter the correct password. If the user does not enter the correct password in the specified number of attempts, then the task request is rejected. If the number of attempts is not specified, then the default value of 3 is used.
true Password matched the user password.
false Password did not match the user password.
result = getgrouppasswd("HelpDeskUsers", "Please enter HelpDesk Password:", 1);

In this example, a user has one attempt to enter a correct username and password for a member of the HelpDeskUsers group. If the correct password in not entered in one attempt, then result contains 0. If the correct password is entered in one attempt, then result contains 1.