54        $this->
settings = $domain_service->settings();
 
   55        $this->provider_factory = $domain_service
 
   58        $this->admin_manager = $domain_service
 
   60        $this->rbacreview = $domain_service->rbac()->review();
 
   66        if (self::$online_users === 
null) {
 
   67            self::$online_user_ids = array();
 
   68            self::$online_users = array();
 
   73                    self::$online_users[$u[
"user_id"]] = $u;
 
   74                    self::$online_user_ids[] = $u[
"user_id"];
 
   89        $this->collections = array();
 
   93        $awrn_logger->debug(
"Start, Online Only: " . $a_online_only . 
", Current User: " . $this->user_id);
 
   97        foreach ($this->provider_factory->getAllProviders() as $prov) {
 
   98            $awrn_logger->debug(
"Provider: " . $prov->getProviderId() . 
", Activation Mode: " . $this->admin_manager->getActivationMode($prov->getProviderId()) . 
", Current User: " . $this->user_id);
 
  101            $collection = $this->data_service->userCollection();
 
  103            $provider_active = $this->admin_manager->isProviderActivated($prov->getProviderId());
 
  104            $provider_includes_offline = $this->admin_manager->includesProviderOfflineUsers($prov->getProviderId());
 
  106            if ($provider_active) {
 
  108                if (!$provider_includes_offline || $a_online_only) {
 
  109                    $awrn_logger->debug(
"Provider: " . $prov->getProviderId() . 
", Online Filter Users: " . count(self::$online_user_ids) . 
", Current User: " . $this->user_id);
 
  114                $awrn_logger->debug(
"Provider: " . $prov->getProviderId() . 
", Collected Users: " . count($coll) . 
", Current User: " . $this->user_id);
 
  116                foreach ($coll->getUsers() as 
$user_id) {
 
  126                    $awrn_logger->debug(
"Current User: " . $this->user_id . 
", " .
 
  127                        "Provider: " . $prov->getProviderId() . 
", Collected User: " . 
$user_id);
 
  130                    if ((!$a_online_only && $provider_includes_offline)
 
  131                        || in_array(
$user_id, self::$online_user_ids)) {
 
  133                        if (!in_array(
$user_id, $all_users)) {
 
  139            $this->collections[] = array(
 
  140                "uc_title" => $prov->getTitle(),
 
  141                "highlighted" => $prov->isHighlighted(),
 
  146        $remove_users = array();
 
  148        if ($this->
settings->get(
"hide_own_online_status") === 
"n") {
 
  151                $remove_users[] = $u;
 
  156            $remove_users = array_filter($all_users, 
function (
$i) use ($show_users) {
 
  157                return !in_array(
$i, $show_users);
 
  166                    $remove_users[] = $u;
 
  178        $coll = $this->data_service->userCollection();
 
  193        foreach ($this->collections as 
$c) {
 
  194            reset($a_remove_users);
 
  195            foreach ($a_remove_users as $u) {
 
  196                $c[
"collection"]->removeUser($u);
 
Administrate awareness tool.
 
Notes internal repo service.
 
Represents a set of collected users.
 
Collects users from all providers.
 
Awareness AdminManager $admin_manager
 
static array $online_user_ids
 
Awareness InternalDataService $data_service
 
removeUsersFromCollections(array $a_remove_users)
Remove users from collection.
 
__construct(int $user_id, int $ref_id, InternalDataService $data_service, InternalRepoService $repo_service, InternalDomainService $domain_service)
 
ProviderFactory $provider_factory
 
collectUsersFromProvider(Provider $prov, ?array $online_users)
 
InternalRepoService $repo_service
 
static array $online_users
 
collectUsers(bool $a_online_only=false)
Collect users.
 
static directCall(string $a_type, string $a_method)
Call context method directly without internal handling.
 
static getLogger(string $a_component_id)
Get component logger.
 
static _getUsersOnline(int $a_user_id=0, bool $a_no_anonymous=false)
reads all active sessions from db and returns users that are online OR returns only one active user i...
 
static getUsersAgreed(bool $a_agreed=true, ?array $a_users=null)
Get users that have or have not agreed to the user agreement.
 
static getUserSubsetByPreferenceValue(array $a_user_ids, string $a_keyword, string $a_val)
For a given set of user IDs return a subset that has a given user preference set.
 
isAssigned(int $a_usr_id, int $a_role_id)
check if a specific user is assigned to specific role
 
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
 
getInitialUserSet(?array $user_ids=null)
Get initial set of users.
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...