Closed (duplicate)
Project:
Privatemsg
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2009 at 02:43 UTC
Updated:
19 Feb 2009 at 22:59 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirYes, it seems that the menu system thinks that the user_id is a thread_id because it's on the same depth, especially as privatemsg_thread_load isn't doing any checking.
I had several ideas to fix it, most of them don't work..
Not working:
- move write new message to userX to the user page. As I'd like to make that page support multiple recipients per url, that doesn't really work..
- Validate the $thread_id... there is no way to tell if $some_int is either a user id or a thread_id, it can be both
- Prefix it with something... not supported by the menu system
- Other things I forgot again... (probably better... )
Working:
1. Move user id a depth deeper, simplest solution: messages/new/to/%uid
2. Change it to use the username instead of the uid, for example: messages/new/Berdir
I am in favor of solution 1, it is simple to fix in hook_menu (change arg parameter for 2 to 3) but I'd like to delay that until the api patch has been committed, as it simplify the changing of the links.
Comment #2
naheemsays commentedI am in favour of delaying *everything* til that lands...
Comment #3
naheemsays commentedAnother option for user specific messages would to move from
messages/new/%tousers/%/messages/new- but to keepmessages/newas it is?Or go to
messages/%/newto fit in with themessages/%to get to a different users messages.It could be a good idea to cover this along with #298502: Better access to another user's messages.
Comment #4
naheemsays commentedAnother way would be to add an access check function to the read messages page which would return false if the page was anything other than /messages/view/%
Comment #5
berdir@#2
sounds good :)
@#3
As I mentioned, I'd like to keep an option open to do somethink like messages/new/to/uid1+uid2+uid3, so the To-field would get pre-filled with "UserX, UserY, UserZ". Using %user wouldn't allow that anymore. But it's not really important, just thought it would be nice to have the possibility to easily send a message to a defined group of users..
@#4
That could work too. One of my ideas was to put such a check directly inside privatemsg_thread_load, but that is a bad idea, as I want to extend that function to an actual api function which loads all thread stuff (messages, participants, .. that could simplify the view page *a lot*)
Comment #6
naheemsays commentedSome untested probably psuedo code:
Comment #7
naheemsays commentedAttached patch seems to work correctly after clearing the cache.
Just a note, the other things discussed in this issue may also be important, but for this bug, they would just hide it instead of fixing it.
Comment #8
naheemsays commentedoops, should be cnr
Comment #9
berdirFixed a a lowercase FALSE, other than that, patch looks good.
Comment #10
berdirIncluded patch in #376250-1: Kill disallow_anon().