40        $this->user_id = $a_user_id;
 
   51        $this->ref_id = $a_val;
 
   72        if (!isset(self::$instances[$a_user_id])) {
 
   76        return self::$instances[$a_user_id];
 
   87        if (self::$online_users === 
false) {
 
   88            self::$online_user_ids = array();
 
   89            self::$online_users = array();
 
   90            include_once(
"./Services/User/classes/class.ilObjUser.php");
 
   91            foreach (ilObjUser::_getUsersOnline() as $u) {
 
   95                    self::$online_users[$u[
"user_id"]] = $u;
 
   96                    self::$online_user_ids[] = $u[
"user_id"];
 
  113        $this->collections = array();
 
  117        $awrn_logger->debug(
"Start, Online Only: " . $a_online_only . 
", Current User: " . $this->user_id);
 
  120        include_once(
"./Services/Awareness/classes/class.ilAwarenessUserProviderFactory.php");
 
  121        $all_users = array();
 
  123            $awrn_logger->debug(
"Provider: " . $prov->getProviderId() . 
", Activation Mode: " . $prov->getActivationMode() . 
", Current User: " . $this->user_id);
 
  126            include_once(
"./Services/Awareness/classes/class.ilAwarenessUserCollection.php");
 
  130                $prov->setUserId($this->user_id);
 
  131                $prov->setRefId($this->ref_id);
 
  132                $prov->setOnlineUserFilter(
false);
 
  134                    $awrn_logger->debug(
"Provider: " . $prov->getProviderId() . 
", Online Filter Users: " . count(self::$online_user_ids) . 
", Current User: " . $this->user_id);
 
  135                    $prov->setOnlineUserFilter(self::$online_user_ids);
 
  138                $coll = $prov->collectUsers();
 
  139                $awrn_logger->debug(
"Provider: " . $prov->getProviderId() . 
", Collected Users: " . count($coll) . 
", Current User: " . $this->user_id);
 
  141                foreach ($coll->getUsers() as 
$user_id) {
 
  143                    if (
$user_id == ANONYMOUS_USER_ID) {
 
  147                    $awrn_logger->debug(
"Current User: " . $this->user_id . 
", " .
 
  148                        "Provider: " . $prov->getProviderId() . 
", Collected User: " . 
$user_id);
 
  152                        || in_array(
$user_id, self::$online_user_ids)) {
 
  154                        if (!in_array(
$user_id, $all_users)) {
 
  160            $this->collections[] = array(
 
  161                "uc_title" => $prov->getTitle(),
 
  162                "highlighted" => $prov->isHighlighted(),
 
  167        $remove_users = array();
 
  169        if ($this->
settings->get(
"hide_own_online_status") == 
"n") {
 
  172                $remove_users[] = $u;
 
  177            $remove_users = array_filter($all_users, 
function (
$i) use ($show_users) {
 
  178                return !in_array(
$i, $show_users);
 
  183        require_once 
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
 
  186                if ($u != SYSTEM_USER_ID && !$rbacreview->isAssigned($u, SYSTEM_ROLE_ID)) {
 
  188                    $remove_users[] = $u;
 
  205        foreach ($this->collections as $c) {
 
  206            reset($a_remove_users);
 
  207            foreach ($a_remove_users as $u) {
 
  208                $c[
"collection"]->removeUser($u);
 
An exception for terminatinating execution or to throw for unit testing.
static getInstance()
Get instance.
Collects users from all providers.
removeUsersFromCollections($a_remove_users)
Remove users from collection.
setRefId($a_val)
Set ref id.
__construct($a_user_id)
Constructor.
static getOnlineUsers()
Get online users.
static getInstance($a_user_id)
Get instance (for a user)
collectUsers($a_online_only=false)
Collect users.
static getAllProviders()
Get all awareness providers.
static directCall($a_type, $a_method)
Call context method directly without internal handling.
static getLogger($a_component_id)
Get component logger.
static getUserSubsetByPreferenceValue($a_user_ids, $a_keyword, $a_val)
For a given set of user IDs return a subset that has a given user preference set.
static getUsersAgreed($a_agreed=true, $a_users=null)
Get users that have or have not agreed to the user agreement.