From f49fdf4e1c80fe5bde922c25bdd6ca0e2c912ddb Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sat, 30 Oct 2010 21:32:54 +0000 Subject: Refs #2124: Using get_loggedin_user functions instead of $vars['user'], $_SESSION['user'], etc. git-svn-id: http://code.elgg.org/elgg/trunk@7139 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/messages/start.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mod/messages/start.php') diff --git a/mod/messages/start.php b/mod/messages/start.php index bd8d0680e..a340169c1 100644 --- a/mod/messages/start.php +++ b/mod/messages/start.php @@ -114,7 +114,7 @@ function messages_notification_msg($hook_name, $entity_type, $return_value, $par strip_tags($parameters['entity']->description), $CONFIG->wwwroot . "pg/messages/" . $user->username, get_loggedin_user()->name, - $CONFIG->wwwroot . "mod/messages/send.php?send_to=" . get_loggedin_user()->guid + $CONFIG->wwwroot . "mod/messages/send.php?send_to=" . get_loggedin_userid() ); } else if ($parameters['method'] == 'site') return false;*/ } @@ -165,7 +165,7 @@ function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify // If $from == 0, set to current user if ($from == 0) - $from = (int) get_loggedin_user()->guid; + $from = (int) get_loggedin_userid(); // Initialise a new ElggObject $message_to = new ElggObject(); @@ -174,7 +174,7 @@ function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify $message_to->subtype = "messages"; $message_sent->subtype = "messages"; // Set its owner to the current user - // $message_to->owner_guid = $_SESSION['user']->getGUID(); + // $message_to->owner_guid = get_loggedin_userid(); $message_to->owner_guid = $send_to; $message_to->container_guid = $send_to; $message_sent->owner_guid = $from; @@ -226,14 +226,14 @@ function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify global $CONFIG; $message_contents = strip_tags($body); if ($send_to != get_loggedin_user() && $notify) - notify_user($send_to, get_loggedin_user()->guid, elgg_echo('messages:email:subject'), + notify_user($send_to, get_loggedin_userid(), elgg_echo('messages:email:subject'), sprintf( elgg_echo('messages:email:body'), get_loggedin_user()->name, $message_contents, $CONFIG->wwwroot . "pg/messages/" . $user->username, get_loggedin_user()->name, - $CONFIG->wwwroot . "mod/messages/send.php?send_to=" . get_loggedin_user()->guid + $CONFIG->wwwroot . "mod/messages/send.php?send_to=" . get_loggedin_userid() ) ); @@ -284,7 +284,7 @@ function messages_url($message) { function count_unread_messages() { //get the users inbox messages - //$num_messages = get_entities_from_metadata("toId", $_SESSION['user']->getGUID(), "object", "messages", 0, 10, 0, "", 0, false); + //$num_messages = get_entities_from_metadata("toId", get_loggedin_userid(), "object", "messages", 0, 10, 0, "", 0, false); $num_messages = elgg_get_entities_from_metadata(array('metadata_name_value_pairs' => array( 'toId' => get_loggedin_userid(), 'readYet' => 0, -- cgit v1.2.3