diff options
Diffstat (limited to 'mod/messages')
-rw-r--r-- | mod/messages/manifest.xml | 2 | ||||
-rw-r--r-- | mod/messages/pages/messages/inbox.php | 9 | ||||
-rw-r--r-- | mod/messages/pages/messages/read.php | 9 | ||||
-rw-r--r-- | mod/messages/pages/messages/sent.php | 9 |
4 files changed, 20 insertions, 9 deletions
diff --git a/mod/messages/manifest.xml b/mod/messages/manifest.xml index 73a58d9d4..6e3462901 100644 --- a/mod/messages/manifest.xml +++ b/mod/messages/manifest.xml @@ -6,8 +6,8 @@ <category>bundled</category> <category>communication</category> <description>Elgg internal messages plugin. This plugin lets user send each other messages.</description> - <copyright>See COPYRIGHT.txt</copyright> <website>http://www.elgg.org/</website> + <copyright>See COPYRIGHT.txt</copyright> <license>GNU General Public License version 2</license> <requires> <type>elgg_release</type> diff --git a/mod/messages/pages/messages/inbox.php b/mod/messages/pages/messages/inbox.php index fdfc20c43..de5b8b231 100644 --- a/mod/messages/pages/messages/inbox.php +++ b/mod/messages/pages/messages/inbox.php @@ -8,8 +8,13 @@ gatekeeper(); $page_owner = elgg_get_page_owner_entity(); -if (!$page_owner) { - register_error(elgg_echo()); + +if (!$page_owner || !$page_owner->canEdit()) { + $guid = 0; + if($page_owner){ + $guid = $page_owner->getGUID(); + } + register_error(elgg_echo("pageownerunavailable", array($guid))); forward(); } diff --git a/mod/messages/pages/messages/read.php b/mod/messages/pages/messages/read.php index 19e3ecdd7..4223c6bac 100644 --- a/mod/messages/pages/messages/read.php +++ b/mod/messages/pages/messages/read.php @@ -8,8 +8,8 @@ gatekeeper(); $message = get_entity(get_input('guid')); -if (!$message) { - forward('messages/inbox'); +if (!$message || !elgg_instanceof($message, "object", "messages")) { + forward('messages/inbox/' . elgg_get_logged_in_user_entity()->username); } // mark the message as read @@ -38,8 +38,9 @@ if ($inbox) { ); $body_params = array('message' => $message); $content .= elgg_view_form('messages/reply', $form_params, $body_params); - - if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) { + $from_user = get_user($message->fromId); + + if ((elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) && $from_user) { elgg_register_menu_item('title', array( 'name' => 'reply', 'href' => '#messages-reply-form', diff --git a/mod/messages/pages/messages/sent.php b/mod/messages/pages/messages/sent.php index af06ab273..3d08cd5ee 100644 --- a/mod/messages/pages/messages/sent.php +++ b/mod/messages/pages/messages/sent.php @@ -8,8 +8,13 @@ gatekeeper(); $page_owner = elgg_get_page_owner_entity(); -if (!$page_owner) { - register_error(elgg_echo()); + +if (!$page_owner || !$page_owner->canEdit()) { + $guid = 0; + if($page_owner){ + $guid = $page_owner->getGUID(); + } + register_error(elgg_echo("pageownerunavailable", array($guid))); forward(); } |