Changeset 4548
- Timestamp:
- 06/21/2011 07:22:17 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-actions.php
r4520 r4548 100 100 101 101 // Check access 102 if ( !bp_activity_user_can_delete() )102 if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) ) 103 103 return false; 104 104 -
trunk/bp-activity/bp-activity-template.php
r4515 r4548 717 717 } 718 718 719 function bp_activity_user_can_delete( ) {719 function bp_activity_user_can_delete( $activity = false ) { 720 720 global $activities_template, $bp; 721 722 if ( !$activity ) 723 $activity = $activities_template->activity; 721 724 722 725 $can_delete = false; … … 725 728 $can_delete = true; 726 729 727 if ( $activit ies_template->activity->user_id == $bp->loggedin_user->id )730 if ( $activity->user_id == $bp->loggedin_user->id ) 728 731 $can_delete = true; 729 732 -
trunk/bp-themes/bp-default/_inc/ajax.php
r4524 r4548 241 241 } 242 242 243 if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) 244 return false; 243 if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) { 244 echo '-1'; 245 return false; 246 } 245 247 246 248 $activity = new BP_Activity_Activity( (int) $_POST['id'] ); 247 249 248 250 // Check access 249 if ( !bp_activity_user_can_delete() ) 250 return false; 251 if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) ) { 252 echo '-1'; 253 return false; 254 } 251 255 252 256 // Call the action before the delete so plugins can still fetch information about it … … 257 261 return false; 258 262 } 259 263 260 264 do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id ); 261 265
Note: See TracChangeset
for help on using the changeset viewer.