@param EditUser $editUserCommand
@return StatusResult[]

@throws NothingToModifyException
769340
public function editUser(EditUser $editUserCommand)
    {
        $body = get_object_vars($editUserCommand);
        $putList = array();
        $index = 0;
        foreach($body as $key => $value)
        {
            if (!empty($value)) {
                $putList[$index]['key'] = $key;
                $putList[$index]['value'] = $value;
                $index++;
            }
        }

        if (count($body) === 0) {
            throw new NothingToModifyException('Nothing is specified to be modified');
        }
        $responseCollection = array();
        foreach($putList as $put)
        {
            $apiResponse = $this->apiConnection->sendRequest("PUT", "/users/" . $editUserCommand->getUserName(), $this->buildFormParams($put));
            $responseCollection[$put['key']] = $this->responseParser->parseResponse($apiResponse);
        }
        return $responseCollection;
    }
935774
public function getPastEvaluationsByUserAndActivityParams(
        User $user,
        ActivityParameters $activityParams,
        $executeQuery = true
    )
    {
        return $this->pastEvaluationRepo->findPastEvaluationsByUserAndActivityParams(
            $user,
            $activityParams,
            $executeQuery
        );
    }
262499
protected function filter(UpdateIncidentUpdateCommand $command)
    {
        $params = [
            'status'  => $command->status,
            'message' => $command->message,
            'user_id' => $command->user->id,
        ];

        return array_filter($params, function ($val) {
            return $val !== null;
        });
    }
599089
public function quarterback2fa($createUserCommand) {

        // Get inputs into array
        $data = (array) $createUserCommand;


        // Sanitize
        $data = $this->sanitize($data, "create");

        // Wash the phone number
        $data['phone_number'] = $this->repository->washPhoneNumber($data['phone_number']);


        // Validate
        if ($this->validate($data, "create") != "passed") {
            // Prepare the response array, and then return to the edit form with error messages
            return $this->prepareResponseArray('validation_failed', 500, $data, $this->validate($data, "create"));
        }

        // Extra user validation
        $extraUserValidation = $this->extraUserValidation->extraValidation($data);
        if ($extraUserValidation['status_text'] != "extra_validation_successful") {
            // Prepare the response array, and then return to the edit form with error messages
            return $this->prepareResponseArray('validation_failed', 500, $data, $extraUserValidation['errorMessages']);
        }


        // We're here just to validate the data, not to create a database record.
        // So, no persist!

        // Prepare the response array, and then return to the command
        return $this->prepareResponseArray('validation_successful', 200, $data);
    }
537865
public void setUserLastModified(String userLastModified) {

        if (null == userLastModified) { // The optional user last modified information is not provided
            m_resourceBuilder.setUserLastModified(getRequestContext().getCurrentUser().getId());
        } else { // use the user last modified information from the manifest
            try {
                String userLastModifiedName = OpenCms.getImportExportManager().translateUser(userLastModified);
                try {
                    m_resourceBuilder.setUserLastModified(getCms().readUser(userLastModifiedName).getId());
                } catch (@SuppressWarnings("unused") CmsDbEntryNotFoundException e) {
                    m_resourceBuilder.setUserLastModified(getRequestContext().getCurrentUser().getId());
                }
            } catch (Throwable e) {
                setThrowable(e);
            }
        }

    }
119156
public function getShowAdminTabs(UserInterface $user)
    {
        $tabs = [];
        foreach ($this->extensions as $name => $extension) {
            if (null !== $tab = $extension->getAdminShowTab($user)) {
                $tabs[$name] = $tab;
            }
        }
        uasort($tabs, function (ShowTabInterface $a, ShowTabInterface $b) {
            if ($a->getPosition() == $b->getPosition()) {
                return 0;
            }
            return $a->getPosition() > $b->getPosition() ? 1 : -1;
        });
        return $tabs;
    }
203891
public function editAction(Request $request, User $userToEdit)
    {
        $form = $this->createForm(UserType::class, $userToEdit);

        $form->handleRequest($request);

        if ($form->isValid()) {

            /** @var $userManager \FOS\UserBundle\Model\UserManagerInterface */
            $userManager = $this->get('fos_user.user_manager');
            $userManager->updateUser($userToEdit);

            $this->addFlash(
                'success',
                'The user '.$userToEdit->getNameAndUsername().' was edited successfully.'
            );

            return $this->redirectToRoute('campaignchain_core_user_edit', array('id' => $userToEdit->getId()));
        }

        return $this->render(
            'CampaignChainCoreBundle:User:edit.html.twig',
            array(
                'page_title' => 'Edit User '.$userToEdit->getNameAndUsername(),
                'form' => $form->createView(),
                'form_submit_label' => 'Save',
                'user' => $userToEdit,
            ));
    }
753645
public static function find_ongoing_request_types_for_users(array $userids) : array {
        global $DB;

        if (empty($userids)) {
            return [];
        }

        // Check if the user already has an incomplete data request of the same type.
        $nonpendingstatuses = [
            self::DATAREQUEST_STATUS_COMPLETE,
            self::DATAREQUEST_STATUS_CANCELLED,
            self::DATAREQUEST_STATUS_REJECTED,
            self::DATAREQUEST_STATUS_DOWNLOAD_READY,
            self::DATAREQUEST_STATUS_EXPIRED,
            self::DATAREQUEST_STATUS_DELETED,
        ];
        list($statusinsql, $statusparams) = $DB->get_in_or_equal($nonpendingstatuses, SQL_PARAMS_NAMED, 'st', false);
        list($userinsql, $userparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED, 'us');

        $select = "userid {$userinsql} AND status {$statusinsql}";
        $params = array_merge($statusparams, $userparams);

        $requests = $DB->get_records_select(data_request::TABLE, $select, $params, 'userid', 'id, userid, type');

        $returnval = [];
        foreach ($userids as $userid) {
            $returnval[$userid] = (object) [];
        }

        foreach ($requests as $request) {
            $returnval[$request->userid]->{$request->type} = true;
        }

        return $returnval;
    }
918521
public function deleteAllItemsByUser($userId)
    {
        if (empty($userId)) {
            return [];
        }

        $command = \Yii::$app->getDb()->createCommand();
        $command->delete($this->assignmentTable, 'user_id = :user_id', ['user_id' => $userId]);
        return $command->execute();
    }
366560
public function getResumableDeliveries(User $user)
    {
        $deliveryExecutionService = ServiceProxy::singleton();
        $resumable = array();
        foreach ($this->getResumableStates() as $state) {
            foreach ($deliveryExecutionService->getDeliveryExecutionsByStatus($user->getIdentifier(), $state) as $execution) {
                $delivery = $execution->getDelivery();
                if ($delivery->exists()) {
                    $resumable[] = $execution;
                }
            }
        }
        return $resumable;
    }
1130967
function statusModificationList( $user = false )
    {
        if ( $user === false )
            $user = eZUser::currentUser();
        else if ( is_numeric( $user ) )
            $user = eZUser::fetch( $user );

        if ( !is_object( $user ) )
        {
            eZDebug::writeError( "Cannot calculate status access list without a user", __METHOD__ );
            return false;
        }

        $accessResult = $user->hasAccessTo( 'shop' , 'setstatus' );
        $accessWord = $accessResult['accessWord'];
        $access = false;

        $currentStatusID = $this->attribute( "status_id" );

        $statusList = array();
        if ( $accessWord == 'yes' )
        {
            // We have full access so we return all of them
            $statusList = eZOrderStatus::fetchOrderedList( true, false );
            return $statusList;
        }

        if ( $accessWord == 'limited' )
        {
            $limitationList = $accessResult['policies'];
            $access = true;
            // All 'to' statues will be appended to this array
            $accessList = array();
            foreach ( $limitationList as $pid => $limit )
            {
                $access = true;
                foreach ( $limit as $name => $value )
                {
                    if ( $name == 'FromStatus' )
                    {
                        if ( !in_array( $currentStatusID, $value )  )
                            $access = false;
                    }
                    if ( !$access )
                        break;
                }
                if ( $access )
                {
                    if ( isset( $limit['ToStatus'] ) )
                    {
                        $accessList = array_merge( $accessList, $limit['ToStatus'] );
                    }
                    else
                    {
                        // We have full access for the current status so we return all of them
                        $statusList = eZOrderStatus::fetchOrderedList( true, false );
                        return $statusList;
                    }
                }
            }
            if ( count( $accessList ) > 0 )
            {
                $accessList = array_unique( array_merge( $accessList, array( $currentStatusID ) ) );
                $statuses = eZOrderStatus::fetchOrderedList( true, false );
                foreach ( $statuses as $status )
                {
                    if ( in_array( $status->attribute( 'status_id' ), $accessList ) )
                        $statusList[] = $status;
                }
            }
        }
        return $statusList;
    }
1062151
public function syncMappingUser(int $userId): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/user/:user_id/sync', (string)$userId),
            Request::METHOD_POST);
    }
479145
public static function messageuser_link_params(int $useridto) : array {
        global $USER;

        return [
            'id' => 'message-user-button',
            'role' => 'button',
            'data-conversationid' => api::get_conversation_between_users([$USER->id, $useridto]),
            'data-userid' => $useridto,
        ];
    }
640875
public void submit(CmsUser user, CmsObject cms, Runnable afterWrite, boolean force) {

        try {
            if (isValid() | force) {
                if (force) {
                    removeValidators();
                }
                m_binder.commit();
                PropertyUtilsBean propUtils = new PropertyUtilsBean();
                for (CmsAccountInfo info : OpenCms.getWorkplaceManager().getAccountInfos()) {
                    boolean editable = (m_editLevel == EditLevel.all)
                        || ((m_editLevel == EditLevel.configured) && info.isEditable());
                    if (editable) {
                        if (info.isAdditionalInfo()) {
                            user.setAdditionalInfo(info.getAddInfoKey(), m_infos.getItemProperty(info).getValue());
                        } else {
                            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(
                                (String)m_infos.getItemProperty(info).getValue())) {
                                propUtils.setProperty(
                                    user,
                                    info.getField().name(),
                                    m_infos.getItemProperty(info).getValue());
                            }
                        }
                    }
                }
                cms.writeUser(user);
                afterWrite.run();
            }
        } catch (CmsException | CommitException | IllegalAccessException | InvocationTargetException
        | NoSuchMethodException e) {
            LOG.error("Unable to commit changes to user..", e);
        }
    }
44586
@Column(header = org.opencms.workplace.commons.Messages.GUI_LABEL_USER_LAST_MODIFIED_0, order = 70)
    public String getUserLastModified() {

        return m_bean.getUserLastModified();
    }
131844
private function byInvitationSpecification($user)
    {
        (new InviteUserCommandBuilder($this->container, $this->persistence))->build($user);
        (new ResendInvitationUserCommandBuilder($this->container, $this->persistence))->build($user);

        return [
            'command'          => ByInvitationSignUpUserCommand::class,
            'handler'          => ByInvitationSignUpUserHandler::class,
            'handlerArguments' => $this->invitationHandlerArguments($user),
        ];
    }
1311846
protected function actionListUser()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $deleted = $updated = 0;

        foreach ($selected as $uid) {

            if ($this->isSuperadmin($uid)) {
                continue;
            }

            if ($action === 'status' && $this->access('user_edit')) {
                $updated += (int) $this->user->update($uid, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('user_delete')) {
                $deleted += (int) $this->user->delete($uid);
            }
        }

        if ($updated > 0) {
            $text = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($text, 'success');
        }

        if ($deleted > 0) {
            $text = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($text, 'success');
        }
    }