commentaccess.php 741 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Comment access upgrade page
  4. */
  5. // Upgrade also possible hidden comments. This feature gets run
  6. // by an administrator so there's no need to ignore access.
  7. $access_status = access_get_show_hidden_status();
  8. access_show_hidden_entities(true);
  9. $dbprefix = elgg_get_config('dbprefix');
  10. $options = array(
  11. 'type' => 'object',
  12. 'subtype' => 'comment',
  13. 'joins' => array(
  14. "JOIN {$dbprefix}entities e2 ON e.container_guid = e2.guid"
  15. ),
  16. 'wheres' => array(
  17. "e.access_id != e2.access_id"
  18. ),
  19. 'count' => true
  20. );
  21. $count = elgg_get_entities($options);
  22. echo elgg_view('admin/upgrades/view', array(
  23. 'count' => $count,
  24. 'action' => 'action/admin/upgrades/upgrade_comments_access',
  25. ));
  26. access_show_hidden_entities($access_status);