Skip to content

Commit

Permalink
Merge pull request #356 from zdohnal/fix-setting-groups-1.4
Browse files Browse the repository at this point in the history
Fix setting groups via web ui
  • Loading branch information
michaelrsweet authored Mar 22, 2024
2 parents 78d1ee4 + 0c2fa7b commit 32de7f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pappl/system-webif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,15 +1421,15 @@ _papplSystemWebSecurity(

if ((group = cupsGetOption("admin_group", num_form, form)) != NULL)
{
if (getgrnam_r(group, &grpbuf, buffer, sizeof(buffer), &grp) || !grp)
if (strcmp(group, "") && (getgrnam_r(group, &grpbuf, buffer, sizeof(buffer), &grp) || !grp))
status = _PAPPL_LOC("Bad administration group.");
else
papplSystemSetAdminGroup(system, group);
}

if ((group = cupsGetOption("print_group", num_form, form)) != NULL)
{
if (getgrnam_r(group, &grpbuf, buffer, sizeof(buffer), &grp) || !grp)
if (strcmp(group, "") && (getgrnam_r(group, &grpbuf, buffer, sizeof(buffer), &grp) || !grp))
{
status = _PAPPL_LOC("Bad print group.");
}
Expand Down Expand Up @@ -1471,7 +1471,7 @@ _papplSystemWebSecurity(
papplClientHTMLPrintf(client,
" <table class=\"form\">\n"
" <tbody>\n"
" <tr><th><label for=\"admin_group\">%s:</label></th><td><select name\"admin_group\"><option value=\"\">%s</option>", papplClientGetLocString(client, _PAPPL_LOC("Admin Group")), papplClientGetLocString(client, _PAPPL_LOC("None")));
" <tr><th><label for=\"admin_group\">%s:</label></th><td><select name=\"admin_group\"><option value=\"\">%s</option>", papplClientGetLocString(client, _PAPPL_LOC("Admin Group")), papplClientGetLocString(client, _PAPPL_LOC("None")));

setgrent();
while ((grp = getgrent()) != NULL)
Expand All @@ -1481,7 +1481,7 @@ _papplSystemWebSecurity(

papplClientHTMLPrintf(client,
"</select></td></tr>\n"
" <tr><th><label for=\"print_group\">%s:</label></th><td><select name\"print_group\"><option value=\"\">%s</option>", papplClientGetLocString(client, _PAPPL_LOC("Print Group")), papplClientGetLocString(client, _PAPPL_LOC("None")));
" <tr><th><label for=\"print_group\">%s:</label></th><td><select name=\"print_group\"><option value=\"\">%s</option>", papplClientGetLocString(client, _PAPPL_LOC("Print Group")), papplClientGetLocString(client, _PAPPL_LOC("None")));

setgrent();
while ((grp = getgrent()) != NULL)
Expand Down

0 comments on commit 32de7f9

Please sign in to comment.