original_string: public function maintenanceCheck($action, $warnings)
      {
          if ($this->module->podiumConfig->get('maintenance_mode') != '1') {
              return false;
          }
          if ($action->id === 'maintenance') {
              return false;
          }
          if ($warnings) {
              foreach ($warnings as $warning) {
                  if ($warning === static::warnings()['maintenance']) {
                      if (!User::can(Rbac::ROLE_ADMIN)) {
                          return $this->redirect(['forum/maintenance']);
                      }
                      return false;
                  }
              }
          }
          $this->warning(static::warnings()['maintenance'], false);
          if (!User::can(Rbac::ROLE_ADMIN)) {
              return $this->redirect(['forum/maintenance']);
          }
          return false;
      }
code: public function maintenanceCheck($action, $warnings)
      {
          if ($this->module->podiumConfig->get('maintenance_mode') != '1') {
              return false;
          }
          if ($action->id === 'maintenance') {
              return false;
          }
          if ($warnings) {
              foreach ($warnings as $warning) {
                  if ($warning === static::warnings()['maintenance']) {
                      if (!User::can(Rbac::ROLE_ADMIN)) {
                          return $this->redirect(['forum/maintenance']);
                      }
                      return false;
                  }
              }
          }
          $this->warning(static::warnings()['maintenance'], false);
          if (!User::can(Rbac::ROLE_ADMIN)) {
              return $this->redirect(['forum/maintenance']);
          }
          return false;
      }
code_tokens: public function maintenanceCheck ( $ action , $ warnings ) { if ( $ this -> module -> podiumConfig -> get ( 'maintenance_mode' ) != '1' ) { return false ; } if ( $ action -> id === 'maintenance' ) { return false ; } if ( $ warnings ) { foreach ( $ warnings as $ warning ) { if ( $ warning === static :: warnings ( ) [ 'maintenance' ] ) { if ( ! User :: can ( Rbac :: ROLE_ADMIN ) ) { return $ this -> redirect ( [ 'forum/maintenance' ] ) ; } return false ; } } } $ this -> warning ( static :: warnings ( ) [ 'maintenance' ] , false ) ; if ( ! User :: can ( Rbac :: ROLE_ADMIN ) ) { return $ this -> redirect ( [ 'forum/maintenance' ] ) ; } return false ; }
docstring: Performs maintenance check.
  @param Action $action the action to be executed.
  @param array $warnings Flash warnings
  @return bool|Response
  @since 0.2
docstring_tokens: Performs maintenance check .