Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
d13ddf71
Commit
d13ddf71
authored
Apr 23, 2014
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent users sending private messages to themselves
Fixes #27.
parent
36eacf90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
qa-page-message.php
qa-include/qa-page-message.php
+7
-1
No files found.
qa-include/qa-page-message.php
View file @
d13ddf71
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
$handle
=
qa_request_part
(
1
);
$handle
=
qa_request_part
(
1
);
$loginuserid
=
qa_get_logged_in_userid
();
$loginuserid
=
qa_get_logged_in_userid
();
$fromhandle
=
qa_get_logged_in_handle
();
$qa_content
=
qa_content_prepare
();
$qa_content
=
qa_content_prepare
();
...
@@ -53,6 +54,12 @@
...
@@ -53,6 +54,12 @@
return
$qa_content
;
return
$qa_content
;
}
}
if
(
$handle
===
$fromhandle
)
{
// prevent users sending messages to themselves
$qa_content
[
'error'
]
=
qa_lang_html
(
'users/no_permission'
);
return
$qa_content
;
}
// Find the user profile and their recent private messages
// Find the user profile and their recent private messages
...
@@ -114,7 +121,6 @@
...
@@ -114,7 +121,6 @@
else
else
$messageid
=
null
;
$messageid
=
null
;
$fromhandle
=
qa_get_logged_in_handle
();
$canreply
=
!
(
qa_get_logged_in_flags
()
&
QA_USER_FLAGS_NO_MESSAGES
);
$canreply
=
!
(
qa_get_logged_in_flags
()
&
QA_USER_FLAGS_NO_MESSAGES
);
$more
=
strtr
(
qa_lang
(
$canreply
?
'emails/private_message_reply'
:
'emails/private_message_info'
),
array
(
$more
=
strtr
(
qa_lang
(
$canreply
?
'emails/private_message_reply'
:
'emails/private_message_info'
),
array
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment