Conversation
Author
|
What do you think about this feature? Can you merge it into master? |
Owner
|
I'm not a huge fan of increasing the complexity of this plugin. If we do, it might be worth to see if we could adopt the syntax of something existing that does what we want instead of inventing our own. mod_rewrite comes to mind but might not be a good fit. With the syntax getting more complex than just |
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.
This pull request introduces an idea of conditional redirects, using a following syntax in a config file:
source destination ? condition | other_destination ? other_condition | else_destinationThe code above redirects the user from page "source" to the first page on the list which condition was met. If no condition is met the user is redirected to "else_destination". If no "else_destination" is provided the redirect doesn't trigger. Particularly we can use only one condition:
source destination ? conditionCurrently I've implemented two types of conditions:
$USER$=namewhich check if 'name' is currently login user$USER.grps$=groupwhich check if currently login user belongs to 'group'Of course the list of condition types can be easily extended.
I think that the idea can be useful in many use cases. What do you think about it?