Link to mark as spam

@param Member $member

@return string
770626
public function SpamLink($member = null)
    {
        if ($this->canEdit($member) && !$this->IsSpam) {
            return $this->actionLink('spam', $member);
        }
    }
927725
protected function process(FormRequest $request, Member $member)
    {
        // Prepare required input fields
        $data = $request->validated();

        ! $request->hasFile('profile_picture')
        || $member->addMediaFromRequest('profile_picture')
                ->sanitizingFileName(function ($fileName) {
                    return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
                })
                ->toMediaCollection('profile_picture', config('cortex.auth.media.disk'));

        ! $request->hasFile('cover_photo')
        || $member->addMediaFromRequest('cover_photo')
                ->sanitizingFileName(function ($fileName) {
                    return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
                })
                ->toMediaCollection('cover_photo', config('cortex.auth.media.disk'));

        // Save member
        $member->fill($data)->save();

        return intend([
            'url' => route('adminarea.members.index'),
            'with' => ['success' => trans('cortex/foundation::messages.resource_saved', ['resource' => trans('cortex/auth::common.member'), 'identifier' => $member->username])],
        ]);
    }
1361992
public function getMember($member)
    {
        $timeStamp = time();
        if ($member instanceof BundleEntity\Member) {
            return new ModelResponse($member, 1, 0, null, false, 'S:D:002', 'Entries successfully fetched from database.', $timeStamp, time());
        }
        $result = null;
        switch ($member) {
            case is_numeric($member):
                $response = $this->getMemberById($member);
                if (!$response->error->exist) {
                    return $response;
                }
                break;
            case is_string($member):
                $response = $this->getMemberByEmail($member);
                if (!$response->error->exist) {
                    return $response;
                }
                break;
        }
        $response = $this->getMemberByUsername($member);
        if (!$response->error->exist) {
            return $response;
        }
        return new ModelResponse($result, 0, 0, null, true, 'E:D:002', 'Unable to find request entry in database.', $timeStamp, time());
    }
497123
public function sAdd($key, $member) {
        return $this->getHandler($this->judge(__FUNCTION__))->sAdd($key, $member);
    }
612896
public function RoleOf($member)
    {
        if (is_numeric($member)) {
            $member = Member::get()->byId($member);
        }

        if (!$member) {
            return null;
        }

        if ($this->isEditor($member)) {
            return _t(__CLASS__ . '.EDITOR', 'Editor');
        }

        if ($this->isWriter($member)) {
            return _t(__CLASS__ . '.WRITER', 'Writer');
        }

        if ($this->isContributor($member)) {
            return _t(__CLASS__ . '.CONTRIBUTOR', 'Contributor');
        }

        return null;
    }
689438
public function addToUrl($url, $member)
    {
        $salt = $this->generate(15); // New random salt; Will be passed into url
        // Generate salt specific to this member
        $memberSalt = $this->memberSalt($salt, $member);
        $token = $this->getToken($memberSalt);
        return Controller::join_links(
            $url,
            sprintf(
                '?t=%s&s=%s',
                urlencode($token),
                urlencode($salt)
            )
        );
    }
494554
public function hasStaticMember($member)
    {
        if (is_string($this->$member)) {
            $tokens = token_get_all('<?php '.$this->$member);

            return
                count($tokens) === 2 &&
                is_array($tokens[1]) &&
                in_array($tokens[1][0], [T_CONSTANT_ENCAPSED_STRING, T_DNUMBER, T_LNUMBER]);
        }

        return false;
    }
1207198
def _member_def(self, member):
        
        member_docstring = textwrap.dedent(member.docstring).strip()
        member_docstring = textwrap.fill(
            member_docstring, width=78, initial_indent=' '*4,
            subsequent_indent=' '*4
        )
        return '%s\n%s\n' % (member.name, member_docstring)
1072291
public function FormatFromSettings($member = null)
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }

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

        // Get user format
        $format = $member->getTimeFormat();
        return $this->Format($format);
    }
1168987
public function isAuthor($member = null)
    {
        if (!$member || !$member->exists()) {
            return false;
        }

        $list = $this->Authors();

        if ($list instanceof UnsavedRelationList) {
            return in_array($member->ID, $list->getIDList());
        }

        return $list->byID($member->ID) !== null;
    }
560010
public function getMostRecentActionForUser($member = null)
    {
        if (!$member) {
            if (!Security::getCurrentUser()) {
                return false;
            }
            $member = Security::getCurrentUser();
        }

        // WorkflowActionInstances in reverse creation-order so we get the most recent one's first
        $history = $this->Actions()->filter(array(
            'Finished' =>1,
            'BaseAction.ClassName' => AssignUsersToWorkflowAction::class
        ))->Sort('Created', 'DESC');

        $i = 0;
        foreach ($history as $inst) {
            /*
             * This iteration represents the 1st instance in the list - the most recent AssignUsersToWorkflowAction
             * in $history.
             * If there's no match for $member here or on the _previous_ AssignUsersToWorkflowAction, then bail out:
             */
            $assignedMembers = $inst->BaseAction()->getAssignedMembers();
            if ($i <= 1 && $assignedMembers->count() > 0 && $assignedMembers->find('ID', $member->ID)) {
                return $inst;
            }
            ++$i;
        }
        return false;
    }
1263847
private function memberMentions($message)
    {
        $filteredMessage = $message['content'];
        foreach ($message['mentions'] as $mention) {
            $filteredMessage = str_replace('<@'.$mention['id'].'>', '@'.$mention['username'], $filteredMessage);
        }
        return $filteredMessage;
    }
1148953
protected function FormUrl(Member $member = null)
    {
        $args = array();
        if ($member)
        {
            $args['member'] = $member->GetID();
        }
        return BackendRouter::ModuleUrl(new MemberForm(), $args);
    }
412319
public function canDelete($member = null) {
        $extended = $this->extend('canDelete', $member);
        if($extended && $extended !== null) return $extended;

        return $this->Parent()->canEdit($member);
    }
1097882
public function sitesManagedByMember($member = null)
    {
        $member = $member ?: Member::currentUser();
        if (!$member) return array();

        $sites = Site::get();

        if (Permission::check('ADMIN')) {
            return $sites->column('ID');
        }

        $memberGroups = $member->Groups()->column('ID');
        $sites        = $sites->filter("EditorGroups.ID:ExactMatch", $memberGroups);

        return $sites->column('ID');
    }
1000904
public function canDelete($member = null)
    {
        $member = $this->getMember($member);

        if (!$member) {
            return false;
        }

        $extended = $this->extendedCan('canDelete', $member);
        if ($extended !== null) {
            return $extended;
        }

        return $this->canEdit($member);
    }
481323
public function canEditAuthors($member = null)
    {
        $member = $this->getMember($member);

        $extended = $this->extendedCan('canEditAuthors', $member);

        if ($extended !== null) {
            return $extended;
        }

        $parent = $this->Parent();

        if ($parent instanceof Blog && $parent->exists()) {
            if ($parent->isEditor($member)) {
                return true;
            }

            if ($parent->isWriter($member) && $this->isAuthor($member)) {
                return true;
            }
        }

        return Permission::checkMember($member, Blog::MANAGE_USERS);
    }