Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-4688

PHP error on logout.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • Authentication
    • None

    Description

      I suspect this is being caused by the @ symbols in our usernames. We are authentication via LDAP using the UserPrincipalName. This has been the case for years. just seems to be a problem after updating recently.

      Version: 23.11.13173 (14th November 2023)

      On logout:
      Unsupported key character detected: "@". Please check: https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%5D-Unsupported-characters-in-key-identifiers in /opt/observium/libs/Phpfastcache8/Core/Pool/CacheItemPoolTrait.php:124

      #0: (unknown function) called at [/opt/observium/libs/Phpfastcache8/Core/Pool/CacheItemPoolTrait.php:124]

      119: * due to performance issue on huge
      120: * loop dispatching operations
      121: */
      122: if (!isset($this->itemInstances[$key]) || !$this->getConfig()->isUseStaticItemCaching()) {
      123: if (\preg_match('([' . \preg_quote(self::$unsupportedKeyChars, '~') . ']+)', $key, $matches)) {
      124: throw new PhpfastcacheInvalidArgumentException(
      125: 'Unsupported key character detected: "' . $matches[1] . '". Please check: https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%5D-Unsupported-characters-in-key-identifiers'
      126: );
      {{127: }}}
      128:
      129: $cacheSlamsSpendSeconds = 0;

      #1: getItem called at [/opt/observium/libs/Phpfastcache8/Core/Pool/TaggableCacheItemPoolTrait.php:88]

      83: * @throws PhpfastcacheInvalidArgumentException
      84: */
      85: protected function fetchItemsByTagFromBackend(string $tagName): array
      86: {
      87: if (\is_string($tagName)) {
      88: $driverResponse = $this->getItem($this->getTagKey($tagName));
      89: if ($driverResponse->isHit()) {
      90: $tagsItems = (array)$driverResponse->get();
      91:
      92: /**
      93: * getItems() may provides expired item(s)

      #2: fetchItemsByTagFromBackend called at [/opt/observium/libs/Phpfastcache8/Core/Pool/TaggableCacheItemPoolTrait.php:52]

      47: public function getItemsByTags(array $tagNames, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): array
      48: {
      49: $items = [];
      50: foreach (\array_unique($tagNames) as $tagName) {
      51: if (\is_string($tagName)) {
      52: $items[] = $this->fetchItemsByTagFromBackend($tagName);
      53: } else {
      54: throw new PhpfastcacheInvalidArgumentException('$tagName must be a a string');
      {{55: }}}
      {{56: }}}
      57:

      #3: getItemsByTags called at [/opt/observium/libs/Phpfastcache8/Core/Pool/TaggableCacheItemPoolTrait.php:131]

      126: */
      127: public function deleteItemsByTags(array $tagNames, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
      128: {
      129: $return = null;
      130:
      131: foreach ($this->getItemsByTags($tagNames, $strategy) as $item) {
      132: $result = $this->deleteItem($item->getKey());
      133: if ($return !== false) {
      134: $return = $result;
      {{135: }}}
      {{136: }}}

      #4: deleteItemsByTags called at [/opt/observium/includes/cache.inc.php:255]

      250: } else {
      251: // Cache not enabled
      252: return;
      {{253: }}}
      254:
      255: return $observium_cache->deleteItemsByTags($tags);
      {{256: }}}
      257:
      258: /**
      259: * Delete expired Items.
      260: * Used "workaround" as described here:

      #5: del_cache_items called at [/opt/observium/html/includes/sessions.inc.php:143]

      138: // Clean cache if possible
      139: $cache_tags = ['__anonymous'];
      140: if ($_SESSION['authenticated']) {
      141: $cache_tags = ['__username=' . $_SESSION['username']];
      {{142: }}}
      143: del_cache_items($cache_tags);
      144:
      145: // Unset session
      146: @session_start();
      147: if ($relogin) {
      148: // Reset session and relogin (for example: HTTP auth)

      #6: session_logout called at [/opt/observium/html/includes/authenticate.inc.php:142]

      137: if ($_SESSION['authenticated'] && str_starts(ltrim($_SERVER['REQUEST_URI'], '/'), 'logout')) {
      138: // Do not use $vars and get_vars here!
      139: //print_vars($_SERVER['REQUEST_URI']);
      140: if (auth_can_logout()) {
      141: // No need for a feedback message if user requested a logout
      142: session_logout(function_exists('auth_require_login'));
      143:
      144: $redirect = auth_logout_url();
      145: if ($redirect) {
      146: redirect_to_url($redirect);
      147: exit();

      #7: include called at [/opt/observium/html/index.php:72]

      67: $_SERVER['PATH_INFO'] = $_SERVER['PATH_INFO'] ?? ($_SERVER['ORIG_PATH_INFO'] ?? '');
      68:
      69: // Clean global $vars variable, it populated only after correct authenticating
      70: unset($vars);
      71:
      72: include($config['html_dir'] . "/includes/authenticate.inc.php");
      73:
      74: // Default theme set in global or user setting
      75: if ($config['web_theme_default'] === 'system' && isset($_COOKIE['screen_scheme'])) {
      76: $theme = $_COOKIE['screen_scheme'];
      77: } else {

      Attachments

        Activity

          People

            landy Mike Stupalov
            rhebert Ryan Hébert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: