Skip to content

[feature/alwaysreply] Add a permission to separate sending PMs and replying to them#492

Closed
imkingdavid wants to merge 9 commits intophpbb:developfrom
imkingdavid:feature/alwaysreply
Closed

[feature/alwaysreply] Add a permission to separate sending PMs and replying to them#492
imkingdavid wants to merge 9 commits intophpbb:developfrom
imkingdavid:feature/alwaysreply

Conversation

@imkingdavid
Copy link
Copy Markdown
Contributor

Related Links:
Request topic
Ticket

Adds a new permission (u_pm_reply) that can allow users to reply to Private Messages without being able to compose new PMs. The permission is ignored when u_sendpm is set to Yes, and is taken into account when u_sendpm is Never. In other words, a user will always be able to reply unless both u_sendpm AND u_pm_reply are Never.

@imkingdavid
Copy link
Copy Markdown
Contributor Author

By the way, I don't know why those other three commits are there... I'm certain that I forked/branched the most recent develop revision. :/ Let me know if I need to change something.

@nickvergessen
Copy link
Copy Markdown
Contributor

There should be a check whether the original pm was really send and it should than be only possible to reply to the sender, not any other additional users

@imkingdavid
Copy link
Copy Markdown
Contributor Author

I see what you mean... I just changed senders within the reply and it still allowed it to send. I'll add a way for it to confirm that the reply is to only the original sender.

@imkingdavid
Copy link
Copy Markdown
Contributor Author

Actually, there's a bug in that I just noticed, but I have no time to fix it atm. Will do later.

@imkingdavid
Copy link
Copy Markdown
Contributor Author

Alright, this has been tested locally and works for me. Please feel free to test it and let me know if something needs to be changed or done differently.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 8, 2011

You need to reset your develop branch to upstream develop and then rebase this branch on the resulting develop.

git checkout develop
git branch backup-develop
git reset --hard upstream/develop
git checkout ticket/10517
git branch backup-ticket/10517
git rebase -i develop
(make sure only this ticket's commits are listed)

@p
Copy link
Copy Markdown
Contributor

p commented Dec 8, 2011

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that if we're talking about always letting users reply, should we remove the permission for the first one (U_POST_REPLY_PM) and only require the permission to U_POST_REPLY_ALL? And in that case, we'd need some added logic to make sure that if they don't have to permission, they're actually replying to the original sender.

And on a non-related note, why is it POST_REPLY instead of SEND_REPLY or PM_REPLY?

@nickvergessen
Copy link
Copy Markdown
Contributor

We should also ensure, that there is still a way to "silence" people.

@imkingdavid
Copy link
Copy Markdown
Contributor Author

Well as the patch currently is, if they have no u_sendpm and no u_pm_reply, they cannot send messages, so they are effectively "silenced".

@imkingdavid
Copy link
Copy Markdown
Contributor Author

Okay, so current progress is:
-Permission u_pm_reply is added.
-Logic is as such: If user has u_sendpm, ignore u_pm_reply (even set to NEVER). If user has u_pm_reply, still allow PM (even if u_sendpm is NEVER).

Do we want to make sure that if only u_pm_reply is enabled (no u_sendpm), the user is only replying to the original sender? I think for the most part this is done, other than that. Am I missing stuff?

Of course it still needs to be tested.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted, ideally the commit where this is changed should be fixed.

@travisbot
Copy link
Copy Markdown

This pull request fails (merged e4e0f092 into 1d0607c).

@travisbot
Copy link
Copy Markdown

This pull request fails (merged 3e8afd3b into 1d0607c).

@travisbot
Copy link
Copy Markdown

This pull request fails (merged c1fd31fb into 1d0607c).

@travisbot
Copy link
Copy Markdown

This pull request fails (merged dd3d0fcf into 1d0607c).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(19:22:58) nx-: that file had an a9 which is i'm assuming iso-8859-1 but not utf-8
(19:24:25) nx-: c2 a9 is valid utf-8
(19:24:31) nx-: github must be misrendering it
(19:24:56) nx-: it renders the new version correctly
(19:25:16) nx-: obviously it is impossible to render 8859-1 and utf8 mix correctly
(19:25:49) nx-: i would suggest going through all existing files grepping for a9 not preceded by c2
(19:25:51) nx-: and fixing them

@travisbot
Copy link
Copy Markdown

This pull request fails (merged 5d2b841e into 61eb015).

@imkingdavid
Copy link
Copy Markdown
Contributor Author

I believe that this is done, but I haven't looked at it in a while. If someone doesn't mind reviewing it I think it's ready for a merge.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 7, 2012

I am not seeing any database updater changes. The rest looks ok.

@imkingdavid
Copy link
Copy Markdown
Contributor Author

@p Database updater changes have been added.

@imkingdavid
Copy link
Copy Markdown
Contributor Author

This should wait for #985 as that PR introduces a new function for adding permissions that this PR can then use.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 13, 2012

Merged #985.

@imkingdavid
Copy link
Copy Markdown
Contributor Author

@p i've implemented the _add_permission() function in this PR, so it should be ready for a merge.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 15, 2012

Does not appear to actually work.

  1. Database updated a QI installed board.
  2. Gave admin never for sendpm
  3. Sent admin a pm
  4. Admin sees reply link
  5. Following it produces: We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more to be able to use this feature.

Investigate S_NO_AUTH_SEND_MESSAGE.

@p
Copy link
Copy Markdown
Contributor

p commented Dec 15, 2012

Also please use italicized styling like acl_a_user does.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest:
Can send private messages (implies send and reply)
Can reply to private messages

@EXreaction
Copy link
Copy Markdown
Contributor

Do we want to make sure that if only u_pm_reply is enabled (no u_sendpm), the user is only replying to the original sender?

Yes please.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should at least apply De Morgan here and make it else if (!$auth->acl_get('u_pm_reply') && !$auth->acl_get('u_sendpm'))

@p
Copy link
Copy Markdown
Contributor

p commented Apr 30, 2013

No test coverage based on my comment about this feature not working?

@EXreaction
Copy link
Copy Markdown
Contributor

@imkingdavid bump

@imkingdavid
Copy link
Copy Markdown
Contributor Author

I'll close this for now. Someone else is welcome to take over if they want before I come back to it.

@imkingdavid imkingdavid closed this Jul 7, 2013
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.

6 participants