startpage.php 680 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Startpage action. Decides what to show on the first page.
  4. */
  5. if (!defined('GNUSOCIAL')) { exit(1); }
  6. class StartpageAction extends ManagedAction
  7. {
  8. function isReadOnly($args)
  9. {
  10. return true;
  11. }
  12. function showPage()
  13. {
  14. if (common_config('singleuser', 'enabled')) {
  15. $user = User::singleUser();
  16. common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), 303);
  17. } elseif (common_config('public', 'localonly')) {
  18. common_redirect(common_local_url('public'), 303);
  19. } else {
  20. common_redirect(common_local_url('networkpublic'), 303);
  21. }
  22. }
  23. }