summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-01-26 14:29:31 +0100
committerEvan Prodromou <evan@controlyourself.ca>2009-01-26 14:29:31 +0100
commit12b9d4346f75027d3a4f804db72222fbe2282e5d (patch)
tree0f6cbcc8dd12460cbabc929fa1d023077d550e64
parent6055516aaf6a0620d1c6f40b42090558e9e2cec1 (diff)
Warn not-logged-in users when they try to send a message
-rw-r--r--actions/newmessage.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/actions/newmessage.php b/actions/newmessage.php
index 609577db5..38e70c90d 100644
--- a/actions/newmessage.php
+++ b/actions/newmessage.php
@@ -98,6 +98,11 @@ class NewmessageAction extends Action
$user = common_current_user();
+ if (!$user) {
+ $this->clientError(_('Only logged-in users can send direct messages.'), 403);
+ return false;
+ }
+
$this->content = $this->trimmed('content');
$this->to = $this->trimmed('to');