Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-17378

The 503 HTTP status should be sent to bots in the update process

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 3.3.12, 3.3.13-RC1
    • Update system

      When an administrator disables the board through the ACP, the 503 HTTP status is sent to bots.

      That status sending is achieved thanks to that code in phpbb/user.php

       

              // Is board disabled and user not an admin or moderator?
              if ($config['board_disable'] && !defined('IN_INSTALL') && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
              {
                  if ($this->data['is_bot'])
                  {
                      send_status_line(503, 'Service Unavailable');
                  }

       

      When a directory named install is located at the board root (= someone is updating the board to a newer version of phpbb), the board is automatically disabled. However, the reported HTTP status for bots is 200 (everything is OK, there is currently no maintenance according to the HTTP status).

       

      The 503 HTTP status should be sent to bots in the update process.

       

      That code in phpbb/user.php...

              if (!$phpbb_container->getParameter('allow_install_dir') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
              {
                  // Adjust the message slightly according to the permissions
                  if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
                  {
                      $message = 'REMOVE_INSTALL';
                  }
                  else
                  {
                      $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
                  }
                  trigger_error($message);
              } 

      ... should be replaced by this one:

              if (!$phpbb_container->getParameter('allow_install_dir') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
              {
                  if ($this->data['is_bot'])
                  {
                      send_status_line(503, 'Service Unavailable');
                  }
                  // Adjust the message slightly according to the permissions
                  if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
                  {
                      $message = 'REMOVE_INSTALL';
                  }
                  else
                  {
                      $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
                  }
                  trigger_error($message);
              } 

            Unassigned Unassigned
            Big Monstro Big Monstro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: