增加群组成员
@param array|string $member
@param int $silence
@return BaseResponse|AddGroupMemberInfoResponse
@throws Exception\TIMException
330471
public function addMember($member, $silence = 0)
    {
        $request = new AddGroupMemberRequest($this->groupId, $member, $silence);
        $response = new AddGroupMemberInfoResponse();
        return $this->client->sendRequest($request, $response);
    }
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);
            }
        }
    }
39371
public function canCreate($member = null, $context = [])
    {
        // Allow Only Root Level:
        
        if (isset($context['Parent'])) {
            return false;
        }
        
        // Answer Permission Check:
        
        return Permission::checkMember($member, ['ADMIN', 'SILVERWARE_FOLDER_CREATE']);
    }
592541
public function removeMember($member)
    {
        $member = ($member instanceof Model ? $member->getDn() : $member);

        if (is_null($member)) {
            throw new InvalidArgumentException(
                'Cannot remove member to group. The members distinguished name cannot be null.'
            );
        }

        $mod = $this->newBatchModification(
            $this->schema->member(),
            LDAP_MODIFY_BATCH_REMOVE,
            [$member]
        );

        return $this->addModification($mod)->save();
    }
1092925
public static function becauseUnknownMember(string $enum, string $member): EnumException
    {
        return new self(sprintf('Unknown member "%s" for enum %s', $member, $enum));
    }
808890
public function lock($member = null) {
		if (!$member) {
			$member = Member::currentUser();
		}

		// set the updated lock expiry based on now + lock timeout
		$this->WikiLastEditor = $member->Email;
		$this->WikiLockExpiry = date('Y-m-d H:i:s', time() + $this->config()->get('lock_time'));

		// save it with us as the editor
		$this->write();
	}
336464
public function setMemberList(array $members)
    {
        $memberLists = [];
        foreach ($members as $key => $value) {
            $memberLists[] = ['Member_Account' => $key, 'Role' => $value];
        }
        $this->setParameter('MemberList', $memberLists);
        return $this;
    }
799968
public function mapMemberExpression(NestedMember $member) : MemberMapping
    {
        try {
            $subclassMappings = $this->findSubclassMappings(
                $this->rootEntityMapper,
                $member
            );

            $nestedRelations = $this->mapMemberExpressionsToRelations(
                $this->rootEntityMapper,
                $member->getPartsExceptLast(),
                $finalMapper
            );

            return $this->mapFinalMember($finalMapper, $subclassMappings, $nestedRelations, $member->getLastPart());
        } catch (BaseException $inner) {
            if ($inner instanceof MemberExpressionMappingException && $inner->getPrevious()) {
                $inner = $inner->getPrevious();
            }

            throw new MemberExpressionMappingException(
                sprintf(
                    'Could not map member expression \'%s\' of entity type %s: %s',
                    $member->asString(), $this->rootEntityMapper->getObjectType(), $inner->getMessage()
                ),
                1,
                $inner
            );
        }
    }
345074
public function forgotPassword($member) {
		if(Config::inst()->get('OpauthMemberLoginFormExtension', 'allow_password_reset')) {
			return null;
		}

		$identity = OpauthIdentity::get()->find('MemberID', $member->ID);
		if(!$member->Password && $identity) {
			$this->owner->sessionMessage(
				_t(
					'OpauthMemberLoginFormExtension.NoResetPassword',
					'Can\'t reset password for accounts registered through {provider}',
					array('provider' => $identity->Provider)
				),
				'bad'
			);
			return false;
		} else {
			return null;
		}
	}
246694
protected function CanEdit(Member $member)
    {
        return self::Guard()->Allow(BackendAction::Edit(), $member) && 
                self::Guard()->Allow(BackendAction::UseIt(), new MemberForm());
    }
19344
public function sendSystemNotification($content, $members = [])
    {
        $request = new SendGroupSystemNotificationRequest($this->groupId);
        $request->setContent($content);
        $request->setToMembersAccount($members);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
1148953
protected function FormUrl(Member $member = null)
    {
        $args = array();
        if ($member)
        {
            $args['member'] = $member->GetID();
        }
        return BackendRouter::ModuleUrl(new MemberForm(), $args);
    }
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;
    }
383850
def add(self, member):
        
        return self._client.sadd(self.key_prefix, self._dumps(member))
1264099
public function merge(NestedMember $member) : NestedMember
    {
        $parts = $this->parts;

        $isNullable = $this->getResultingType()->isNullable();
        foreach ($member->getParts() as $part) {
            $parts[] = $isNullable ? $part->asNullable() : $part;
        }

        return new self($parts);
    }
618516
public function FormatFromSettings($member = null)
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }

        // Fall back to nice
        if (!$member) {
            return $this->Nice();
        }

        // Get user format
        return $this->Format($member->getDateFormat(), $member->getLocale());
    }
116369
public function canCreate($member = null, $context = [])
    {
        $extended = $this->extend('canCreate', $member);
        if ($extended && $extended !== null) {
            return $extended;
        }

        return true;
    }