Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce access-question on anonymous page edits #596

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pwnage101
Copy link

@pwnage101 pwnage101 commented Jan 23, 2017

enforce access-question on anonymous page edits

This commit causes an access-question form field to appear on the edit page
for anonymous (logged out) users when require-authentication = none and
the access-question variables are non-empty. If the field is present,
and if the wrong answer is provided by the user, then the user is
returned to the edit page with an error message "Access code is
invalid.".

This new form field behaves in the same way as the access-question form
field on the unauthenticated registration page.


I tested the following cases using the following settings:

require-authentication: none
access-question: hello
access-question-answers: world
  1. logged out, click edit, type incorrect access answer, type a random change description, submit -> error
  2. logged out, click edit, type correct access answer "world", type a random change description, submit -> success
  3. logged in, click edit, type a random change description, submit -> success

...and again with the following settings:

require-authentication: none
access-question:
access-question-answers:
  1. logged out, click edit, type a random change description, submit -> success
  2. logged in, click edit, type a random change description, submit -> success

Look carefully, at the diff, I've never written a line of haskell before this!

Resolves #595

@pwnage101 pwnage101 force-pushed the access-question-anonymous-edits branch from 6a99ecb to 7130bfe Compare January 24, 2017 16:39
@pwnage101
Copy link
Author

I just updated the commit message for clarity.

@pwnage101 pwnage101 force-pushed the access-question-anonymous-edits branch from 7130bfe to b7a3376 Compare January 25, 2017 21:48
@pwnage101
Copy link
Author

updated code to have more consistent order of patterns and more consistent indentation.

@pwnage101 pwnage101 force-pushed the access-question-anonymous-edits branch from b7a3376 to 51a5944 Compare February 1, 2017 14:59
@pwnage101
Copy link
Author

I made more changes:

  • Updated comments in data/default.conf to reflect current behavior.
  • Removed tabindex attribute from the access question field on the edit page, it simply did not belong there.

This commit causes an access-question form field to appear on the edit page
for anonymous (logged out) users when require-authentication = none and
the access-question variables are non-empty.  If the field is present,
and if the wrong answer is provided by the user, then the user is
returned to the edit page with an error message "Access code is
invalid.".

This new form field behaves in the same way as the access-question form
field on the unauthenticated registration page.
@pwnage101 pwnage101 force-pushed the access-question-anonymous-edits branch from 51a5944 to e1488af Compare February 1, 2017 21:45
@pwnage101
Copy link
Author

I found more docs to update. This time I updated README.markdown which is also the Gitit User Guide.

@pwnage101
Copy link
Author

@jgm please take a look when you have the chance.

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.

None yet

1 participant