Skip to content

Conversation

@simonLeary42
Copy link
Collaborator

No description provided.

@simonLeary42 simonLeary42 marked this pull request as draft June 17, 2025 18:59
@simonLeary42 simonLeary42 changed the title write disband PI script write script to remove users from class Jun 17, 2025
@simonLeary42 simonLeary42 changed the title write script to remove users from class write script to remove users from class group Jun 17, 2025
@simonLeary42
Copy link
Collaborator Author

changes:

  • check for too many arguments as well as not enough arguments
  • add trailing newline to error messages
  • put variables in quotes in error messages
  • return nonzero exit code on failure
  • change some variable names
root@web:/var/www/unity-web-portal/workers# php ./remove-users-from-group.php a a a a a a a
Usage: ./remove-users-from-group.php group_name filename_of_users_to_remove
root@web:/var/www/unity-web-portal/workers# php ./remove-users-from-group.php pi_user1005_org3_test foobar
PHP Warning:  fopen(foobar): Failed to open stream: No such file or directory in /var/www/unity-web-portal/workers/remove-users-from-group.php on line 17
Can't open 'foobar'
root@web:/var/www/unity-web-portal/workers# php ./remove-users-from-group.php pi_user1005_org3_testasdlkjasdlkj foobar
No such group 'pi_user1005_org3_testasdlkjasdlkj'
root@web:/var/www/unity-web-portal/workers# php ./remove-users-from-group.php pi_user1005_org3_test /tmp/file
root@web:/var/www/unity-web-portal/workers# php ./remove-users-from-group.php pi_user1005_org3_test /tmp/file
Skipping 'user203_org3_test' who doesn't appear to be in 'pi_user1005_org3_test'

@simonLeary42 simonLeary42 force-pushed the disband-group branch 4 times, most recently from a6ee98f to 7cab298 Compare September 12, 2025 13:34
@simonLeary42 simonLeary42 marked this pull request as ready for review September 12, 2025 13:45
@simonLeary42 simonLeary42 merged commit e1003ce into main Sep 12, 2025
2 checks passed
@simonLeary42 simonLeary42 deleted the disband-group branch September 12, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants