Updates username after change.
@param int $id
@param string $username
@param string $slug
345322
public static function updateName($id, $username, $slug)
    {
        $activity = static::find()->where(['user_id' => $id])->limit(1)->one();
        if (empty($activity)) {
            Log::error('Cannot update user activity', $id, __METHOD__);
            return;
        }
        $activity->username = $username;
        $activity->user_slug = $slug;
        if (!$activity->save()) {
            Log::error('Cannot update user activity', $id, __METHOD__);
            return;
        }
        Podium::getInstance()->podiumCache->delete('forum.lastactive');
    }
1067870
public function update($id)
    {
        $user = $this->userRepo->getById($id);
        if (!empty($user)) {
            $this->authorize('update', $user);
            $input = $this->validator->bind('nick', ['user_id' => $user->id])->bind('email', ['user_id' => $user->id])
                ->validate('update');
            $user  = $this->userRepo->update($user, $input);
            return $this->respondWithSuccess($user, new UserTransformer());
        }
        return $this->respondNotFound();
    }
504346
public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            'description' => 'max:256',
            'name' => 'required|max:32',
        ]);
        $memberTag = MemberTag::findOrFail($id);
        $this->authorize('update', $memberTag);
        if ($request->has('description')) {
            $memberTag->description = $request->description;
        }
        $memberTag->name = $request->name;
        $memberTag->save();
        return fractal($memberTag, new MemberTagTransformer())
            ->withResourceName('memberTag')
            ->respond();

    }
1347899
public static function checkSlug($slug, $id = 0)
    {
        $count = self::factory()
                    ->where('slug',$slug)
                    ->where_not_equal('id',$id)
                    ->count();

        return $count > 0;
    }
690010
public function delete($id)
    {
        $user = $this->findById($id);
        $eventData = $user;
        $user->delete();
        $this->event->fire('users.delete', array($eventData));
    }
675004
protected function setUser($user_id)
    {
        $this->data_user = array();

        if (is_numeric($user_id)) {

            $this->data_user = $this->user->get($user_id);

            if (empty($this->data_user)) {
                $this->outputHttpStatus(404);
            }
        }
    }
224411
public function setUsername($username)
    {
        if ($this->validateUsername($username) === false) {
            throw new Zend_Uri_Exception("Username \"$username\" is not a valid HTTP username");
        }

        $oldUsername     = $this->_username;
        $this->_username = $username;

        return $oldUsername;
    }
1181464
public function update(Request $request, $id)
    {
        $entry = $this->entriesRepository->getById($id, $this->resource);
        $this->validate($request, $this->validationRules($this->resource, $entry));

        $this->entriesRepository->update($id, $request, $this->resource);

        return redirect()->back()->with('success', 'Updated');
    }
548427
public function update($id)
    {
        $inputs = Input::all();
        $inputs['id'] = $id;

        try
        {
            if ( $this->form->update($inputs) )
            {
                return Redirect::route('cpanel.permissions.index')
                    ->with('success', Lang::get('cpanel::permissions.update_success'));
            }

            return Redirect::back()
                ->withInput()
                ->withErrors($this->form->getErrors());
        }
        catch ( PermissionNotFoundException $e )
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('error', Lang::get('cpanel::permissions.model_not_found'));
        }
    }
1161226
public function update($id)
	{
		$messages = $this->users->validForUpdate(
			$id,
			Input::get('first_name'),
			Input::get('last_name'),
			Input::get('email'),
			Input::get('password')
		);

		if (count($messages) > 0)
		{
			return Response::json($messages->all(), 400);
		}

		return $this->users->update(
			$id,
			Input::get('first_name'),
			Input::get('last_name'),
			Input::get('email'),
			(bool) Input::get('active'),
			Input::get('password')
		);
	}
554214
public function setName($id, $name)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/name', array('value' => $name));
    }
1216175
public function update($id, UpdateUserRequest $request)
    {
        $this->user->updateAndSyncRoles($id, $request->all(), $request->roles);

        return $this->successUpdated();
    }
889465
public function update($id)
    {
        // Get the model instance
        $item = $this->findOrFail($id);

        // Remove nested model data from input and prepare to insert on save
        $input = (new NestedModels)->relateTo($item);

        // Hydrate for drag-and-drop sorting
        if (Request::ajax()
            && ($position = new Position($item, $this->self_to_parent))
            && $position->has()) {
            $position->fill();
        }

        // ... else hydrate normally
        else {
            $item->fill($input);
            if (isset($item::$rules['slug'])) {
                $pattern = '#(unique:\w+)(,slug)?(,(NULL|\d+))?#';
                $item::$rules['slug'] = preg_replace($pattern, '$1,slug,'.$id, $item::$rules['slug']);
            }
        }

        // Save the record
        $this->validate($item);
        $item->save();

        // Redirect to the edit view
        if (Request::ajax()) {
            return Response::json();
        } else {
            return Redirect::to(URL::current())
            ->with('success', $this->successMessage($item));
        }
    }
717227
protected function updateUser($user_id)
    {
        if (!$this->isError() && !$this->user->update($user_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
1051375
public function setId($id)
    {
        $context = $this->_context;

        if (!$context->started) {
            $this->_start();
        }

        $context->session_id = $id;
    }
1363117
public function iHaveUserGroupWithId( $id )
    {
        $name = $this->findNonExistingUserGroupName();

        $userGroup = $this->getUserGroupManager()->ensureUserGroupExists( $name );
        $this->addValuesToKeyMap( $id, $userGroup->id );
    }
589580
public function run($id = null, $slug = null)
    {
        if (!is_numeric($id) || $id < 1 || empty($slug)) {
            $this->controller->error(Yii::t('podium/flash', 'Sorry! We can not find the user you are looking for.'));
            return $this->controller->redirect(['members/index']);
        }

        $user = User::find()->where(['and',
            ['id' => $id],
            ['or',
                ['slug' => $slug],
                ['slug' => ''],
                ['slug' => null],
            ]
        ])->limit(1)->one();
        if (empty($user)) {
            $this->controller->error(Yii::t('podium/flash', 'Sorry! We can not find the user you are looking for.'));
            return $this->controller->redirect(['members/index']);
        }
        return $this->controller->render($this->view, ['user' => $user]);
    }