Commits

Anonymous committed 1e7807b

Spammer action: deleting annontations

  • Participants
  • Parent commits 4f2d654

Comments (0)

Files changed (1)

File elgg/actions/admin/user/spammer.php

 	$entities = elgg_get_entities($options);
 	$count = count($entities);
 	
-	for( $i = 0; $i < $count; $i++){
-		$entities[$i]->delete();
+	if($entities){	
+		for( $i = 0; $i < $count; $i++){
+			$entities[$i]->delete();
+		}
 	}	
 
+	$annotations = get_annotations("", "", "", "", "", $guid, 1000);
+	$count = count($annotations);
+	
+	if($annotations){
+		for( $i = 0; $i < $count; $i++){
+			error_log($annotations[$i]->id);
+			delete_annotation($annotations[$i]->id);
+		}
+	}
+	
 	if($obj->ban()) {
 		system_message(sprintf(elgg_echo('admin:user:spammer:yes'), $name));
 	} else {