Gets all the updates for a given user's list of followers for a given time
period

@param type $member
@param type $beforeTime
@param type $number
14440
public function getTimeline(DataObject $member, $sortBy = 'ID',  $since = 0, $before = false, $topLevelOnly = true, $tags = array(), $offset = 0, $number = 10) {
		$following = $this->friendsList($member);

		// TODO Following points to a list of Profile IDs, NOT user ids.
		$number = (int) $number;
		$userIds = array();
		if ($following) {
			$userIds = $following->map('OtherID', 'OtherID');
			$userIds = $userIds->toArray();
		}

		$userIds[] = $member->ID;
		
		$filter = array(
			'OwnerID' => $userIds, 
		);
		
		return $this->microPostList($filter, $sortBy, $since, $before, $topLevelOnly, $tags, $offset, $number);
	}
690125
public function all($includingRead = false, $participating = false, DateTime $since = null, DateTime $before = null)
    {
        $parameters = [
            'all' => $includingRead,
            'participating' => $participating,
        ];

        if ($since !== null) {
            $parameters['since'] = $since->format(DateTime::ISO8601);
        }

        if ($before !== null) {
            $parameters['before'] = $before->format(DateTime::ISO8601);
        }

        return $this->get('/notifications', $parameters);
    }
465725
private function before(callable $before): void
    {
        if ($before instanceof Closure) {
            $this->options["before"] = $before->bindTo($this);
        } else {
            $this->options["before"] = $before;
        }
    }
440945
private function executeUpdates($class)
    {
        $className        = $class->getClassName();
        $persister        = $this->getEntityPersister($className);
        $preUpdateInvoke  = $this->listenersInvoker->getSubscribedSystems($class, Events::preUpdate);
        $postUpdateInvoke = $this->listenersInvoker->getSubscribedSystems($class, Events::postUpdate);

        foreach ($this->entityUpdates as $oid => $entity) {
            if ($this->em->getClassMetadata(get_class($entity))->getClassName() !== $className) {
                continue;
            }

            if ($preUpdateInvoke !== ListenersInvoker::INVOKE_NONE) {
                $this->listenersInvoker->invoke($class, Events::preUpdate, $entity, new PreUpdateEventArgs($entity, $this->em, $this->getEntityChangeSet($entity)), $preUpdateInvoke);

                $this->recomputeSingleEntityChangeSet($class, $entity);
            }

            if (! empty($this->entityChangeSets[$oid])) {
                $persister->update($entity);
            }

            unset($this->entityUpdates[$oid]);

            if ($postUpdateInvoke !== ListenersInvoker::INVOKE_NONE) {
                $this->listenersInvoker->invoke($class, Events::postUpdate, $entity, new LifecycleEventArgs($entity, $this->em), $postUpdateInvoke);
            }
        }
    }
1190481
public function beforeCreate()
    {
        $this->timestamp_create = time();
        $this->timestamp_update = 0;
        $this->create_user_id = Module::getAuthorUserId();
        $this->update_user_id = Module::getAuthorUserId();
        $this->slugifyAlias();
    }
39693
public function relative($limit = 2, $before = null, $after = null) {
        
        $this->updateJalaliFromGeorgian();
        
        $diff = $this->carbon->diffInSeconds();
        if (abs($diff) < 10) {
            return static::t('right now');
        }
        
        $time    = static::scopes();
        $seconds = array_reverse(array_keys($time));
        $titles  = array_reverse(array_values($time));
        $stamp   = abs($diff);
        
        $out = [];
        foreach ($seconds as $k => $scope) {
            if ($stamp >= $scope) {
                $remainPart = (int) floor($stamp / $scope);
                if ($limit) {
                    $stamp -= ($remainPart * $scope);
                    $out[] = $remainPart . ' ' . $titles[$k];
                    $limit--;
                }
            }
        }
        
        $out = implode(' ' . static::t('and') . ' ', $out);
        
        if ($this->carbon->isFuture()) {
            if (empty($after)) {
                $after = static::t('after');
            }
            $out .= ' ' . $after;
        } else {
            if (empty($before)) {
                $before = static::t('before');
            }
            $out .= ' ' . $before;
        }
        
        return $out;
        
    }
49055
private CompletableFuture<Void> updateNode(Member member) {
    long updateTime = System.currentTimeMillis();
    long lastUpdateTime = updateTimes.getOrDefault(member.id(), 0L);

    Collection<InternalSubscriptionInfo> subscriptions = topics.values()
        .stream()
        .flatMap(t -> t.remoteSubscriptions().stream().filter(subscriber -> subscriber.timestamp().unixTimestamp() >= lastUpdateTime))
        .collect(Collectors.toList());

    CompletableFuture<Void> future = new CompletableFuture<>();
    messagingService.sendAndReceive(member.address(), GOSSIP_MESSAGE_SUBJECT, SERIALIZER.encode(subscriptions))
        .whenComplete((result, error) -> {
          if (error == null) {
            updateTimes.put(member.id(), updateTime);
          }
          future.complete(null);
        });
    return future;
  }
648233
public function membercardUpdateuser($updateuser = [])
    {
        if (empty($updateuser) || !is_array($updateuser)) {
            $this->setError('参数错误');

            return false;
        }

        $queryStr = $updateuser;

        $this->apitype = 'card';
        $this->module  = 'membercard';
        $res           = $this->_post('updateuser', $queryStr);

        return $res;
    }
14752
public function updateMemberGroups($data, Member $member)
    {
        if (isset($data['memberof'])) {
            $ldapGroups = is_array($data['memberof']) ? $data['memberof'] : [$data['memberof']];
            foreach ($ldapGroups as $groupDN) {
                foreach (LDAPGroupMapping::get() as $mapping) {
                    if (!$mapping->DN) {
                        $this->getLogger()->debug(
                            sprintf(
                                'LDAPGroupMapping ID %s is missing DN field. Skipping',
                                $mapping->ID
                            )
                        );
                        continue;
                    }

                    // the user is a direct member of group with a mapping, add them to the SS group.
                    if ($mapping->DN == $groupDN) {
                        $group = $mapping->Group();
                        if ($group && $group->exists()) {
                            $group->Members()->add($member, [
                                'IsImportedFromLDAP' => '1'
                            ]);
                            $mappedGroupIDs[] = $mapping->GroupID;
                        }
                    }

                    // the user *might* be a member of a nested group provided the scope of the mapping
                    // is to include the entire subtree. Check all those mappings and find the LDAP child groups
                    // to see if they are a member of one of those. If they are, add them to the SS group
                    if ($mapping->Scope == 'Subtree') {
                        $childGroups = $this->getNestedGroups($mapping->DN, ['dn']);
                        if (!$childGroups) {
                            continue;
                        }

                        foreach ($childGroups as $childGroupDN => $childGroupRecord) {
                            if ($childGroupDN == $groupDN) {
                                $group = $mapping->Group();
                                if ($group && $group->exists()) {
                                    $group->Members()->add($member, [
                                        'IsImportedFromLDAP' => '1'
                                    ]);
                                    $mappedGroupIDs[] = $mapping->GroupID;
                                }
                            }
                        }
                    }
                }
            }
        }

        // Lookup the previous mappings and see if there is any mappings no longer present.
        $unmappedGroups = $member->Groups()->alterDataQuery(function (DataQuery $query) {
            // join with the Group_Members table because we only want those group members assigned by this module.
            $query->leftJoin("Group_Members", '"Group_Members"."GroupID" = "Group"."ID"');
            $query->where('"Group_Members"."IsImportedFromLDAP" = 1');
        });

        // Don't remove associations which have just been added and we know are already correct!
        if (!empty($mappedGroupIDs)) {
            $unmappedGroups = $unmappedGroups->filter("GroupID:NOT", $mappedGroupIDs);
        }

        // Remove the member from any previously mapped groups, where the mapping
        // has since been removed in the LDAP data source
        if ($unmappedGroups->count()) {
            foreach ($unmappedGroups as $group) {
                $group->Members()->remove($member);
            }
        }
    }
87378
protected function resolveBefore($before)
    {
        $getBefore = $this->resolveMiddleware($before);

        return function (Request $request, Application $app) use ($getBefore) {
            $callback = $getBefore($request);
            if (!is_callable($callback)) {
                return null;
            }

            return $callback($request, $app);
        };
    }
1238192
public function onSkipRegistration(Member $member)
    {
        $this->getAuditLogger()->info(sprintf(
            '"%s" (ID: %s) skipped MFA registration',
            $member->Email ?: $member->Title,
            $member->ID
        ));
    }
560008
function(member) {
            users = $module.data('users');
            if(member.id != 'anonymous' && users[ member.id ] === undefined ) {
              users[ member.id ] = member.info;
              if(settings.randomColor && member.info.color === undefined) {
                member.info.color = settings.templates.color(member.id);
              }
              html = settings.templates.userList(member.info);
              if(member.info.isAdmin) {
                $(html)
                  .prependTo($userList)
                ;
              }
              else {
                $(html)
                  .appendTo($userList)
                ;
              }
              if(settings.partingMessages) {
                $log
                  .append( settings.templates.joined(member.info) )
                ;
                module.message.scroll.test();
              }
              module.user.updateCount();
            }
          }
1292882
public function preUpdate(PreUpdateEventArgs $args)
    {
        $entity = $args->getObject();

        /** @var object $entity */
        if (true === in_array(EditableEntityTrait::class, class_uses($entity))) {
            $entity->setUpdated(new DateTime());
        }
    }
295681
public function recordActivity($event, $before, $after)
    {
        if ($before == $after || Chronos::paused()) {
            return;
        }

        $this->activities()->create([
            'event' => $event,
            'before' => $before,
            'after' => $after,
        ]);
    }
1166464
static function MemberCheckList($name, Member $member)
    {    
        $field = new CheckList($name);
        self::AddMembergroupOptions($field);
        $groupIDs = Membergroup::GetKeyList(self::MemberMembergroups($member));
        $field->SetValue($groupIDs);
        return $field;
    }
778667
public static void beforeCompletion(TransactionImpl tran, int syncLevel) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "beforeCompletion", new Object[] { tran, syncLevel });

        if (syncLevel >= 0) {
            final ArrayList syncs = _syncLevels.get(syncLevel);

            if (syncs != null) {
                final int localID = (int) tran.getLocalTID();
                final byte[] globalID = tran.getTID();
                final int numSyncs = syncs.size();

                for (int s = 0; s < numSyncs; s++) {
                    ((SynchronizationCallback) syncs.get(s)).beforeCompletion(localID, globalID);
                    // exception here means rollback
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "beforeCompletion");
    }
918725
public function clearVisits(DateTime $before, $type = null)
    {
        $query = 'delete from CommunityTranslationIPControl where dateTime < ?';
        $params = [$before->format($this->connection->getDatabasePlatform()->getDateTimeFormatString())];
        if ($type !== null) {
            $query .= ' and type = ?';
            $params[] = (string) $type;
        }
        $rs = $this->connection->executeQuery($query, $params);

        return (int) $rs->rowCount();
    }