Index: trunk/extensions/SocialProfile/UserBoard/UserBoardClass.php |
— | — | @@ -281,7 +281,7 @@ |
282 | 282 | $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $message['user_name'], $message['user_name_from'] ) . '">' . wfMsgHtml( 'userboard_board-to-board' ) . '</a>'; |
283 | 283 | $board_link = '<a href="' . UserBoard::getUserBoardURL( $message['user_name_from'] ) . '">' . wfMsgHtml( 'userboard_sendmessage', $message['user_name_from'] ) . '</a>'; |
284 | 284 | } |
285 | | - if( $wgUser->getName() == $message['user_name'] ){ |
| 285 | + if( $wgUser->getName() == $message['user_name'] || $wgUser->isAllowed( 'userboard-delete' ) ){ |
286 | 286 | $delete_link = "<span class=\"user-board-red\"> |
287 | 287 | <a href=\"javascript:void(0);\" onclick=\"javascript:delete_message({$message["id"]})\">" . wfMsgHtml( 'userboard_delete' ) . "</a> |
288 | 288 | </span>"; |
Index: trunk/extensions/SocialProfile/UserBoard/UserBoard_AjaxFunctions.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | global $wgMemc, $wgUser; |
22 | 22 | |
23 | 23 | $b = new UserBoard(); |
24 | | - if( $b->doesUserOwnMessage( $wgUser->getID(), $ub_id ) ){ |
| 24 | + if( $b->doesUserOwnMessage( $wgUser->getID(), $ub_id ) || $wgUser->isAllowed( 'userboard-delete' ) ){ |
25 | 25 | $b->deleteMessage( $ub_id ); |
26 | 26 | } |
27 | 27 | return 'ok'; |
Index: trunk/extensions/SocialProfile/UserBoard/UserBoard.i18n.php |
— | — | @@ -53,6 +53,7 @@ |
54 | 54 | 'userboard_sendbutton' => 'send', |
55 | 55 | 'userboard_loggedout' => 'You must be <a href="$1">logged in</a> to post messages to other users.', |
56 | 56 | 'userboard_showingmessages' => 'Showing {{PLURAL:$4|message $3|messages $2-$3}} of {{PLURAL:$1|$1 message|$1 messages}}', |
| 57 | + 'right-userboard-delete' => "Delete others' board messages", |
57 | 58 | 'message_received_subject' => '$1 wrote on your board on {{SITENAME}}', |
58 | 59 | 'message_received_body' => 'Hi $1. |
59 | 60 | |
— | — | @@ -777,6 +778,7 @@ |
778 | 779 | 'userboard_sendbutton' => 'lähetä', |
779 | 780 | 'userboard_loggedout' => 'Sinun tulee olla <a href="$1">kirjautunut sisään</a> lähettääksesi viestejä toisille käyttäjille.', |
780 | 781 | 'userboard_showingmessages' => 'Näkyvillä on {{PLURAL:$4|viesti $3|viestit $2–$3}}. Yhteensä {{PLURAL:$1|$1 viesti|$1 viestiä}}.', |
| 782 | + 'right-userboard-delete' => 'Poistaa toisten käyttäjien keskustelualueviestejä', |
781 | 783 | 'message_received_subject' => '$1 kirjoitti keskustelualueellesi {{GRAMMAR:inessive|{{SITENAME}}}}', |
782 | 784 | 'message_received_body' => 'Hei $1: |
783 | 785 | |
Index: trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | if(\$(\"message\").value && !posted){ |
118 | 118 | posted = 1; |
119 | 119 | var url = \"index.php?action=ajax\"; |
120 | | - var pars = 'rs=wfSendBoardMessage&rsargs[]=' + escape(\$(\"user_name_to\").value) +'&rsargs[]=' + encodeURIComponent(\$(\"message\").value) + '&rsargs[]=' + \$(\"message_type\").value + '&rsargs[]={$per_page}' |
| 120 | + var pars = 'rs=wfSendBoardMessage&rsargs[]=' + encodeURIComponent(\$(\"user_name_to\").value) +'&rsargs[]=' + encodeURIComponent(\$(\"message\").value) + '&rsargs[]=' + \$(\"message_type\").value + '&rsargs[]={$per_page}' |
121 | 121 | |
122 | 122 | var callback = { |
123 | 123 | success: function(originalRequest){ |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | } |
235 | 235 | |
236 | 236 | if( $can_post ){ |
237 | | - if( $wgUser->isLoggedIn() ){ |
| 237 | + if( $wgUser->isLoggedIn() && !$wgUser->isBlocked() ){ |
238 | 238 | $output .= '<div class="user-page-message-form"> |
239 | 239 | <input type="hidden" id="user_name_to" name="user_name_to" value="' . $user_name_to . '"/> |
240 | 240 | <input type="hidden" id="user_name_from" name="user_name_from" value="' . $user_name_from . '"/> |
— | — | @@ -251,7 +251,7 @@ |
252 | 252 | |
253 | 253 | </div>'; |
254 | 254 | } else { |
255 | | - $login_link = SpecialPage::getTitleFor( 'UserLogin' ); |
| 255 | + $login_link = SpecialPage::getTitleFor( 'Userlogin' ); |
256 | 256 | $output .= '<div class="user-page-message-form"> |
257 | 257 | ' . wfMsg( 'userboard_loggedout', $login_link->escapeFullURL() ) . ' |
258 | 258 | </div>'; |
— | — | @@ -261,7 +261,7 @@ |
262 | 262 | |
263 | 263 | if( $ub_messages ){ |
264 | 264 | foreach( $ub_messages as $ub_message ) { |
265 | | - $user = Title::makeTitle( NS_USER, $ub_message['user_name_from'] ); |
| 265 | + $user = Title::makeTitle( NS_USER, $ub_message['user_name_from'] ); |
266 | 266 | $avatar = new wAvatar( $ub_message['user_id_from'], 'm' ); |
267 | 267 | |
268 | 268 | $board_to_board = ''; |
— | — | @@ -274,7 +274,7 @@ |
275 | 275 | } else { |
276 | 276 | $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . wfMsg( 'userboard_myboard' ) . '</a>'; |
277 | 277 | } |
278 | | - if( $wgUser->getName() == $ub_message['user_name'] ){ |
| 278 | + if( $wgUser->getName() == $ub_message['user_name'] || $wgUser->isAllowed( 'userboard-delete' ) ){ |
279 | 279 | $delete_link = "<span class=\"user-board-red\"> |
280 | 280 | <a href=\"javascript:void(0);\" onclick=\"javascript:delete_message({$ub_message["id"]})\">" . wfMsg( 'userboard_delete' ) . "</a> |
281 | 281 | </span>"; |