Change the active profile.

@return \hisorange\bbcoder\BBCoder
519608
public function setProfile($profile)
	{
		$this->_profile = $profile;

		// Set the parser configs.
		$this->setConfig($this->getProfileConfig('parser'));
        $this->reset($this->_string, true);
        $this->defaults();

        return $this;
	}
1253953
public function changepasswordAction()
    {
        // if the user isn't logged in, we can't change password
        if (!$this->zfcUserAuthentication()->hasIdentity()) {
            // redirect to the login redirect route
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }

        $form = $this->getChangePasswordForm();
        $prg = $this->prg(static::ROUTE_CHANGEPASSWD);

        $fm = $this->flashMessenger()->setNamespace('change-password')->getMessages();
        if (isset($fm[0])) {
            $status = $fm[0];
        } else {
            $status = null;
        }

        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
                'status' => $status,
                'changePasswordForm' => $form,
            );
        }

        $form->setData($prg);

        if (!$form->isValid()) {
            return array(
                'status' => false,
                'changePasswordForm' => $form,
            );
        }

        if (!$this->getUserService()->changePassword($form->getData())) {
            return array(
                'status' => false,
                'changePasswordForm' => $form,
            );
        }

        $this->flashMessenger()->setNamespace('change-password')->addMessage(true);
        return $this->redirect()->toRoute(static::ROUTE_CHANGEPASSWD);
    }
1238786
public function changeImportPositionAction()
    {
        $authResponse  = $this->checkAuth([AdminResources::IMPORT], [], [AccessManager::UPDATE]);
        if ($authResponse !== null) {
            return $authResponse;
        }

        $query = $this->getRequest()->query;

        $this->dispatch(
            TheliaEvents::IMPORT_CHANGE_POSITION,
            new UpdatePositionEvent(
                $query->get('id'),
                $this->matchPositionMode($query->get('mode')),
                $query->get('value')
            )
        );

        return $this->generateRedirectFromRoute('import.list');
    }
835605
public function editAction()
    {
        $this->view->disable();
        $id     = $this->request->getPost('hidden_id');    
        $user   = Users::findFirstById($id);
        $msg    = "";
        if (!$user) {
            $alert = "sukses";
            $msg .= "User was not found";
        }

        if ($this->request->isPost()) {

            $user->assign([
                'name' => $this->request->getPost('name', 'striptags'),
                'profilesId' => $this->request->getPost('profile', 'int'),
                'email' => $this->request->getPost('email', 'email'),
                'banned' => $this->request->getPost('banned'),
                'suspended' => $this->request->getPost('suspended'),
                'active' => $this->request->getPost('active')
            ]);
            
            if (!$user->save()) {
                $alert = "error";
                foreach($user->getMessages() as $message)
                {
                    $msg .= $message ." ";
                }
            } else {
                $alert = "sukses";
                $msg .= "User was updated successfully";
            }
        }

        $response = new \Phalcon\Http\Response();
        $response->setContentType('application/json', 'UTF-8');
        $response->setJsonContent(array('_id' => $this->request->getPost("name"),'alert' => $alert, 'msg' => $msg ));
        return $response->send();
    }
633170
public function stopProfile()
    {
        $finalTime = microtime(true);
        $activeProfile = $this->_activeProfile;
        $activeProfile->setFinalTime($finalTime);

        $initialTime = $activeProfile->getInitialTime();
        $this->_totalSeconds = $this->_totalSeconds + ($finalTime - $initialTime);

        if ( $this->_db ) {
            $pdo  = $this->_db->getInternalHandler();
            $sql  = $activeProfile->getSQLStatement();
            $data = array( 'last_insert_id'=>0, 'affect_rows'=>0 );
            $data['connection']=$this->getConnectionInfo();
            if ( stripos( $sql, 'INSERT' )===0 ) {
                $data['last_insert_id'] =  $pdo->lastInsertId();
            }
            if ( stripos( $sql, 'INSERT')===0  || stripos( $sql, 'UPDATE')===0 || stripos( $sql, 'DELETE')===0) {
                $data['affect_rows'] =  $this->_db->affectedRows();
            }
            if ( stripos( $sql, 'SELECT')===0 && $this->_explainQuery ) {
                try{
                    $stmt = $pdo->query( 'explain '.$activeProfile->getRealSQL());
                    $data['explain'] = $stmt->fetchAll(\PDO::FETCH_CLASS);
                }catch (\Exception $e){

                }
            }
            $activeProfile->setExtra($data);
        }

        $this->_allProfiles[] = $activeProfile;

        if (method_exists($this, "afterEndProfile")) {
            $this->afterEndProfile($activeProfile);
        }

        $this->_stoped = true;
        return $this;
    }
1146095
public function active()
    {
        $args = func_get_args();
        $this->active = current($args);

        if (func_num_args() > 1) {
            $this->active = $args;
        }

        return $this;
    }
426711
public function addActive()
    {
        $row = new FormCheckbox('active', 'Опубликован');
        $this->rows['active'] = $row->setTab('main', 'Дата, вес, активность')
            ->setValid('integer|max:1|nullable')->setDefaultValue(1)->setInTableAdminEditable()->setFillable()
            ->setCssClassGroup('uk-width-1-3');

        return $this;
    }
228944
public function getProfile()
    {
        if (!$this->hasProfile()) {
            return null;
        }
        $profileClass = $this->profileClass;
        $profileModel = $profileClass::buildNoInitModel();
        return $this->hasOne($profileClass,
                [$profileModel->createdByAttribute => $this->guidAttribute])->inverseOf('user');
    }
98679
public function change()
    {
		$table = $this->table('comment');
        $table->addColumn('external', 'boolean', array(
            'null' => false,
            'after' => 'article',
			'default' => 0,
		))
		->addColumn('pending', 'boolean', array(
            'null' => false,
            'after' => 'active',
			'default' => 0,
			'comment' => 'Pending approval',
        ))
        ->addColumn('spam', 'boolean', array(
            'null' => false,
            'after' => 'active',
			'default' => 0,
        ))
        ->addColumn('name', 'string', array(
            'null' => true,
            'after' => 'user',
            'length' => 32,
        ))
        ->addColumn('ip', 'string', array(
            'null' => true,
            'after' => 'timestamp',
            'length' => 30,
        ))
        ->addColumn('referer', 'string', array(
            'null' => true,
            'after' => 'ip',
            'length' => 300,
        ))
        ->addColumn('useragent', 'string', array(
            'null' => true,
            'after' => 'referer',
            'length' => 300,
        ))
        ->addColumn('email', 'string', array(
            'null' => true,
            'after' => 'useragent',
            'length' => 300,
        ))
		->addIndex(array('name'))
		->addIndex(array('pending'))
        ->save(); 
    }
343523
public function activeUrl() {
        $this->check_role = 'activeUrl';
        $result = checkdnsrr($this->value);
        $this->checkResult($result);
        return $this;
    }
886121
def change_profile(self, profile_name):
        """"""
        self._server_side_completer = self._create_server_side_completer(
            session=botocore.session.Session(profile=profile_name))
1112885
public function actionProfile()
    {
        /** @var User $user */
        $user = Yii::$app->getUser()->getIdentity();
        $model = new MultiModel([
            'models' => [
                'user' => $user,
                'profile' => $user->profile,
            ],
        ]);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->addFlash('success', Yii::t('maddoger/user', 'Changes have been saved.'));
            return $this->refresh();
        } else {
            return $this->render('profile', [
                'model' => $model,
            ]);
        }
    }
629942
public function actionProfile() {

		// Find Model
		$model = Yii::$app->core->getUser();

		// Avatar
		$avatar = $model->avatar;

		// Address
		$address = $model->primaryAddress;

		if( empty( $address ) ) {

			$address = $this->addressService->getModelObject();
		}

		// Clear Sidebar
		$this->sidebar = [];

		$genderMap = $this->optionService->getIdNameMapByCategorySlug( CoreGlobal::CATEGORY_GENDER, [ 'default' => true ] );

		$countryMap		= Yii::$app->factory->get( 'countryService' )->getIdNameMap();
		$countryId		= isset( $address->country ) ? $address->country->id : array_keys( $countryMap )[ 0 ];
		$provinceMap	= Yii::$app->factory->get( 'provinceService' )->getMapByCountryId( $countryId, [ 'default' => true, 'defaultValue' => Yii::$app->core->provinceLabel ] );
		$provinceId		= isset( $address->province ) ? $address->province->id : array_keys( $provinceMap )[ 0 ];
		$regionMap		= Yii::$app->factory->get( 'regionService' )->getMapByProvinceId( $provinceId, [ 'default' => true, 'defaultValue' => Yii::$app->core->regionLabel ] );

		return $this->render( 'profile', [
			'model' => $model,
			'avatar' => $avatar,
			'address' => $address,
			'genderMap' => $genderMap,
			'countryMap' => $countryMap,
			'provinceMap' => $provinceMap,
			'regionMap' => $regionMap
		]);
	}
8474
public function removeAll()
    {
        foreach ($this->getProfiles() as $profile => $child) {
            $this->remove($profile);
        }

        return $this;
    }
790383
public function clean()
    {
        // Empty Profile.
        $this->profile = null;
        // Empty credentials.
        $this->credentialsName = null;

        // Recreate a new container.
        $this->newUpContainer();
        // Clean headers.
        $this->cleanHeaders();
        // Clean Query
        $this->cleanQuery();

        // Return calling object.
        return $this;
    }
46589
public function getActiveProfiles()
    {
        if ($this->cache->contains($this->activeProfilesSettingName)) {
            $profiles = $this->cache->fetch($this->activeProfilesSettingName);
        } else {
            $profiles = [];
            $allProfiles = $this->getAllProfiles();

            foreach ($allProfiles as $profile) {
                if (!$profile['active']) {
                    continue;
                }

                $profiles[] = $profile['name'];
            }

            $this->cache->save($this->activeProfilesSettingName, $profiles);
        }

        $profiles = array_merge($profiles, $this->activeProfilesList);

        return $profiles;
    }
211683
public function removeAvatar()
    {
        $profile         = auth()->user();
        $profile->avatar = '';
        $profile->save();

        event(new ProfileWasUpdated($profile));

        return redirect()->route('administrator.profile.edit');
    }