index.phtml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. function showForbidden() {
  3. ?><div class="post content">
  4. <h1><?php echo Minz_Translate::t ('forbidden_access'); ?></h1>
  5. <p><?php echo Minz_Configuration::canLogIn() ?
  6. Minz_Translate::t ('forbidden_access_description') :
  7. Minz_Translate::t ('forbidden_access') . ' (' . Minz_Configuration::authType() . ')'; ?></p>
  8. <p><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></p>
  9. </div><?php
  10. }
  11. $output = Minz_Request::param ('output', 'normal');
  12. if ($this->loginOk || Minz_Configuration::allowAnonymous()) {
  13. if ($output === 'normal') {
  14. $this->renderHelper ('view/normal_view');
  15. } elseif ($output === 'rss') {
  16. $this->renderHelper ('view/rss_view');
  17. } elseif ($output === 'reader') {
  18. $this->renderHelper ('view/reader_view');
  19. } elseif ($output === 'global') {
  20. $this->renderHelper ('view/global_view');
  21. } else {
  22. $this->renderHelper ('view/normal_view');
  23. }
  24. } elseif ($output === 'rss') {
  25. $token = $this->conf->token;
  26. $token_param = Minz_Request::param ('token', '');
  27. $token_is_ok = ($token != '' && $token == $token_param);
  28. if ($token_is_ok) {
  29. $this->renderHelper ('view/rss_view');
  30. } else {
  31. showForbidden();
  32. }
  33. } else {
  34. showForbidden();
  35. }