[system] / trunk / webwork / system / system_webwork_setup.pl Repository:
ViewVC logotype

Diff of /trunk/webwork/system/system_webwork_setup.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 231 Revision 417
281 # in demo mode, the group is set to the user's primary group 281 # in demo mode, the group is set to the user's primary group
282 $groupName = $userGroupName; 282 $groupName = $userGroupName;
283 } else { 283 } else {
284 # in working mode, we get to chose 284 # in working mode, we get to chose
285 page($GROUP_TEXT); 285 page($GROUP_TEXT);
286 my $validGroup = 0;
287 while(1) { 286 while(1) {
288 $groupName = questionString("What is the admin group name?", $DEFAULT_ADMIN_GROUP); 287 $groupName = questionString("What is the admin group name?", $DEFAULT_ADMIN_GROUP);
288 my @group = getgrnam $groupName;
289 unless(@group) {
290 print "$groupName does not exist.\n";
291 next;
292 }
289 my @members = split / /, (getgrnam $groupName)[3]; 293 my @members = split / /, $group[3];
290 if($groupName eq $userGroupName) { 294 if($groupName eq $userGroupName) {
291 print "$groupName is ${userName}'s primary group. Good.\n"; 295 print "$groupName is ${userName}'s primary group. Good.\n";
296 last;
292 } elsif(grep /$userName/, @members) { 297 } elsif(grep { $_ eq $userName } @members) {
293 print "$userName is a member of $groupName. Good.\n"; 298 print "$userName is a member of $groupName. Good.\n";
294 last; 299 last;
295 } elsif($< == 0) { # we're root! 300 } elsif($< == 0) { # we're root!
296 print "$userName isn't a member of $groupName, but you're root, so who cares?\n"; 301 print "$userName isn't a member of $groupName, but you're root, so who cares?\n";
297 last; 302 last;
298 } else { 303 } else {
299 print "That group is not valid. Please make sure the group exists and you are a member.\n"; 304 print "$groupName is not a valid group. Please make sure the group exists and $userName are a member.\n";
300 } 305 }
301 } 306 }
302 } 307 }
303} 308}
304print "Admin group is: $groupName\n"; 309print "Admin group is: $groupName\n";

Legend:
Removed from v.231  
changed lines
  Added in v.417

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9