public function getLoggedSessions()
 {
     $result['root'] = $result['domains'] = array();
     $dir = $this->container->getHome() . 'core/temp/phpsessions/';
     if (is_dir($dir)) {
         $dh = opendir($dir);
         if ($dh) {
             while (($file = readdir($dh)) !== false) {
                 if ($file != '.' and $file != '..') {
                     if (filesize($dir . $file)) {
                         $content = file($dir . $file);
                         $extracted = $this->sessStringToArray($content[0]);
                         if (isset($extracted['INNOMATIC_ROOT_AUTH_USER'])) {
                             $result['root'][] = $file;
                         }
                         if (isset($extracted['INNOMATIC_AUTH_USER'])) {
                             $result['domains'][$extracted['INNOMATIC_AUTH_USER']][] = $file;
                         }
                     }
                 }
             }
             closedir($dh);
         }
     }
     return $result;
 }
示例#2
0
 /**
  * Loads the handler for a widget class.
  * @param widgetName string - widget class name to load.
  * @return True if the widget has been loaded. May return false if the widget handler file doesn't exists.
  * @deprecated
  */
 public function loadWidget($widgetName)
 {
     if (class_exists('\\Shared\\Wui\\Wui' . ucfirst($widgetName), true)) {
         $this->mLoadedWidgets[$widgetName] = $widgetName;
         return true;
     }
     if (class_exists('Wui' . ucfirst($widgetName), false)) {
         $this->mLoadedWidgets[$widgetName] = $widgetName;
         return true;
     }
     // @todo remove compatibility mode
     $widgetFile = $this->container->getHome() . 'core/classes/shared/wui/Wui' . ucfirst($widgetName) . '.php';
     $result = (include_once $widgetFile);
     if (!$result) {
         $log = $this->container->getLogger();
         $log->logEvent('innomatic.wui.wui.loadwidget', 'Unable to load widget handler file ' . $this->container->getHome() . 'core/classes/shared/wui/Wui' . ucfirst($widgetName) . '.php', \Innomatic\Logging\Logger::ERROR);
         throw new \Innomatic\Wui\WuiException(\Innomatic\Wui\WuiException::MISSING_WIDGET_FILE);
     }
     $this->mLoadedWidgets[$widgetName] = $widgetName;
     return true;
 }