improved handling of webusers after creating a new list
This commit is contained in:
parent
0ae802b405
commit
07dec3420e
1 changed files with 17 additions and 3 deletions
|
@ -689,12 +689,26 @@ sub create_list {
|
||||||
die 'SQL table creation failed: ', $list->errmsg();
|
die 'SQL table creation failed: ', $list->errmsg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&set_webusers_permission;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
sub set_webusers_permission {
|
||||||
|
|
||||||
# Handle authentication stuff
|
# Handle authentication stuff
|
||||||
|
my ($contents, $old_contents);
|
||||||
if ($Q::webusers) {
|
if ($Q::webusers) {
|
||||||
open(WEBUSER, ">>$LIST_DIR/webusers") || die "Unable to open webusers: $!";
|
# remove old line
|
||||||
print WEBUSER "$Q::list: $Q::webusers\n";
|
open(WEBUSER, ">$LIST_DIR/webusers") || die "Unable to open webusers: $!";
|
||||||
close WEBUSER;
|
@old_contents = <WEBUSERS>;
|
||||||
|
@contents = (grep { ! /^$Q::list:/ } @old_contents);
|
||||||
|
push(@contents,"$Q::list: $Q::webusers\n");
|
||||||
|
print WEBUSER (@contents);
|
||||||
|
close WEBUSER;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue