created plugin to add users to a D1 nations group if they login from an IP address from one of those nations#1878
Merged
Merged
Conversation
…an IP address from one of those nations
…ves them from d1_nation and returns without doing any geo database lookup
Contributor
Author
|
New commit: At login, if the user is a member of d1_approved, the plugin now removes them from d1_nation and returns without doing any geo database lookup. The existing geo-based logic runs only for users not in d1_approved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation: file permissions require a group for people from D1 nations. Filling the iplocation table of the network database with a copy of the ip ranges applicable to the D1 nations group is silly because that's a lot of rows to copy and it creates a management problem to keep the copy up to date. Instead, this plugin uses an SQL query with a join operation.
Does plg_user_purdue duplicate what plg_user_geo could do if it was configured to use the purdue group and the "pu" location? From what I can see both use custom locations in the iplocation table of the network database, in this case it would be the "pu" location
[7:09 PM]There's a need to put users from D1 nations into a group at login, so that the tool access limitation done in PHP can be mirrored in the filesystem permissions for /apps by setting UNIX acls using that group
Three files created under core/plugins/user/d1/:
countrygroup == 'D1', adds the user to d1_nation. Any other countrygroup is logged but ignored. On account deletion, removes the user from d1_nation.