User choice action.

@return Response
323747
public function paymentAction()
    {
        $order = $this->checkRequest();

        return $this->render('SonataPaymentBundle:Payment:debug.html.twig', [
            'order' => $order,
            'check' => $this->getCurrentRequest()->get('check'),
        ]);
    }
159435
protected function runSelect()
    {
        return $this->connection->select(
            $this->toSql(), $this->getBindings(), ! $this->useWritePdo
        );
    }
1194504
public function indexAction()
        {

            $id = $this->getUser()->getId();

            /** @var User $oUser */
            $oUser = UserQuery::create()->findOneById($id);

            $form = $this->createFormBuilder($oUser)
                ->setAction($this->generateUrl("notification_center_update"))
                ->add('notification_change', 'checkbox')
                ->add('notification_error', 'checkbox')
                ->add('save', 'submit', array('label' => $this->get('translator')->trans('notificationcenter.form.save')))
                ->getForm();


            return $this->render('SlashworksAppBundle:NotificationCenter:index.html.twig', array(
                'user' => $oUser,
                'form' => $form->createView()
            ));
        }
49386
public function selectAction()
  {
    $this->setNoRender();

    /* grab user parameters from $_REQUEST array */
    $sid = TeamSpeak3_Helper_Uri::getUserParam("id", 0);

    try
    {
      /* start server */
      $this->ts3->serverSelect($sid);

      /* update session variables */
      $_SESSION["_serverqry"] = serialize($this->ts3);

      /* save custom ok mesage */
      $this->setLastEvent("The virtual server (ID " . $sid . ") has been selected.");
    }
    catch(Exception $e)
    {
      /* save catched error mesage */
      $this->setLastEvent($e->getMessage(), TRUE);
    }

    /* goto indexAction() */
    $this->redirect("server");
  }
988614
final public function invokeAction()
    {
        $time = time();
        $success = $this->doAction();
        $this->actionRequired = !$success;
        $this->lastActionSuccess = $success;
        $this->lastActionAttemptTime = $time;

        if ($success) {
            $this->lastActionSuccessTime = $time;
        } else {
            $this->lastActionFailTime = $time;
        }

        return $success;
    }
216372
public function me()
    {
        $this->loadModel('User.Users');
        $user = $this->Users->get(user()->id, ['conditions' => ['status' => 1]]);
        $languages = LocaleToolbox::languagesList();

        if ($this->request->data()) {
            $user->accessible(['id', 'username', 'roles', 'status'], false);
            $user = $this->Users->patchEntity($user, $this->request->data);
            if ($this->Users->save($user)) {
                $this->Flash->success(__d('user', 'User information successfully updated!'), ['key' => 'user_profile']);
                $this->redirect($this->referer());
            } else {
                $this->Flash->danger(__d('user', 'User information could not be saved, please check your information.'), ['key' => 'user_profile']);
            }
        }

        $this->title(__d('user', 'Account'));
        $this->set(compact('user', 'languages'));
        $this->viewMode('full');
    }
1197844
public function defaultAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth(AdminResources::MODULE, Team::getModuleCode(),
                AccessManager::VIEW)
        ) {
            return $response;
        }

        return $this->getListRenderTemplate();
    }
912950
public function action() {
		$this->load->language('information/gdpr');

		$json = array();

		if (isset($this->request->post['email'])) {
			$email = $this->request->post['email'];
		} else {
			$email = '';
		}

		if (isset($this->request->post['action'])) {
			$action = $this->request->post['action'];
		} else {
			$action = '';
		}

		// Validate E-Mail
		if ((utf8_strlen($email) > 96) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
			$json['error']['email'] = $this->language->get('error_email');
		}

		// Validate Action
		$allowed = array(
			'export',
			'remove'
		);

		if (!in_array($action, $allowed)) {
			$json['error']['action'] = $this->language->get('error_action');
		}

		if (!$json) {
			// Added additional check so people are not spamming requests
			$status = true;

			$this->load->model('account/gdpr');

			$results = $this->model_account_gdpr->getGdprsByEmail($email);

			foreach ($results as $result) {
				if ($result['action'] == $action) {
					$status = false;

					break;
				}
			}

			if ($status) {
				$this->model_account_gdpr->addGdpr(token(), $email, $action);
			}

			$json['success'] = $this->language->get('text_success');
		}

		$this->response->addHeader('Content-Type: application/json');
		$this->response->setOutput(json_encode($json));
	}
505443
public function autoCompleteUserAction()
    {
        $field = $this->getEvent()->getRouteMatch()->getParam('field');
        $value = $this->getEvent()->getRouteMatch()->getParam('value');
        $request = $this->getRequest();
        $response = $this->getResponse();

        $result = $this->getUserService()->autoCompleteUser($field, $value);
        $response->setContent(\Zend\Json\Json::encode($result));

        return $response;
    }
953916
public function userLinksAction()
    {
        $response = new Response();
        $response->setSharedMaxAge(3600);
        $response->setVary('Cookie');

        return $this->render(
            'eZDemoBundle::page_header_links.html.twig',
            array(),
            $response
        );
    }
729699
public function editAction()
    {
        // Load entity
        $entity = $this->getMapper()->findById($this->params('id'));
        if (!$entity) {
            // Add failure message
            $this->flashMessenger()
                    ->addMessage(
                            'That ' . strtolower($this->getEntityName())
                            . ' does not exist.'
            );
            return $this->redirect()->toRoute($this->indexRoute);
        }

        // Load form
        $form = $this->getForm('Edit' . $this->getEntityName());
        $form->bind($entity);

        // Implement Post/Redirect/Get pattern
        $prg = $this->prg();
        if ($prg instanceof Response) {
            return $prg;
        } else if (false !== $prg) {

            // Set form data
            $form->setData($prg);

            // Edit entity
            $result = $this->getService()->edit();
            if ($result) {
                return $this->redirect()->toRoute($this->indexRoute);
            }
        }

        // Set up view model
        $viewModel = new ViewModel(array(
            'entityName' => $this->getEntityName(),
            'form'       => $form,
        ));
        $viewModel->setTemplate('infinity-base/crud/edit');

        return $viewModel;
    }
323087
protected function runSelect()
    {
        if ($this->lock) {
            $this->connection->beginTransaction();
            $result = $this->connection->select($this->toSql(), $this->getBindings(), ! $this->useWritePdo);
            $this->connection->commit();

            return $result;
        }

        return $this->connection->select($this->toSql(), $this->getBindings(), ! $this->useWritePdo);
    }
797350
public function getDispatchAction()
    {
        $args = $this->request->getAsArray('args');
        $arg = array_shift($args);
        if (preg_match('/^(\w+\.\w+)$/', $arg, $matches)) {
            $action = $matches[1];
            return $action;
        }
    }
239788
public function actionPoll()
    {
        if (!Yii::$app->request->isAjax) {
            return $this->redirect(['forum/index']);
        }

        $data = [
            'error' => 1,
            'msg' => Html::tag('span',
                Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                . ' ' . Yii::t('podium/view', 'Error while voting in this poll!'),
                ['class' => 'text-danger']
            ),
        ];

        if ($this->module->user->isGuest) {
            $data['msg'] = Html::tag('span',
                Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                . ' ' . Yii::t('podium/view', 'Please sign in to vote in this poll'),
                ['class' => 'text-info']
            );
            return Json::encode($data);
        }

        $pollId = Yii::$app->request->post('poll_id');
        $votes = Yii::$app->request->post('poll_vote');

        if (is_numeric($pollId) && $pollId > 0 && !empty($votes)) {
            /* @var $poll Poll */
            $poll = Poll::find()->where([
                'and',
                ['id' => $pollId],
                [
                    'or',
                    ['>', 'end_at', time()],
                    ['end_at' => null]
                ]
            ])->limit(1)->one();
            if (empty($poll)) {
                $data['msg'] = Html::tag('span',
                    Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                    . ' ' . Yii::t('podium/view', 'This poll is not active.'),
                    ['class' => 'text-danger']
                );
                return Json::encode($data);
            }

            $loggedId = User::loggedId();

            if ($poll->getUserVoted($loggedId)) {
                $data['msg'] = Html::tag('span',
                    Html::tag('span', '', ['class' => 'glyphicon glyphicon-info-sign'])
                    . ' ' . Yii::t('podium/view', 'You have already voted in this poll.'),
                    ['class' => 'text-info']
                );
                return Json::encode($data);
            }

            $checkedAnswers = [];
            foreach ($votes as $vote) {
                if (!$poll->hasAnswer((int)$vote)) {
                    $data['msg'] = Html::tag('span',
                        Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                        . ' ' . Yii::t('podium/view', 'Invalid poll answer given.'),
                        ['class' => 'text-danger']
                    );
                    return Json::encode($data);
                }
                $checkedAnswers[] = (int)$vote;
            }
            if (empty($checkedAnswers)) {
                $data['msg'] = Html::tag('span',
                    Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                    . ' ' . Yii::t('podium/view', 'You need to select at least one answer.'),
                    ['class' => 'text-warning']
                );
                return Json::encode($data);
            }
            if (count($checkedAnswers) > $poll->votes) {
                $data['msg'] = Html::tag('span',
                    Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                    . ' ' . Yii::t('podium/view', 'This poll allows maximum {n, plural, =1{# answer} other{# answers}}.', ['n' => $poll->votes]),
                    ['class' => 'text-danger']
                );
                return Json::encode($data);
            }
            if ($poll->vote($loggedId, $checkedAnswers)) {
                $data = [
                    'error' => 0,
                    'votes' => $poll->currentVotes,
                    'count' => $poll->votesCount,
                    'msg' => Html::tag('span',
                        Html::tag('span', '', ['class' => 'glyphicon glyphicon-ok-circle'])
                        . ' ' . Yii::t('podium/view', 'Your vote has been saved!'),
                        ['class' => 'text-success']
                    ),
                ];
            }
        }
        return Json::encode($data);
    }
602794
protected function response()
	{
		if (!isset($this->response)) {
			$this->response = Response::make();
		}
		
		return $this->response;
	}
1318836
public function actionSetIdentity()
    {
        $user_id = Yii::$app->request->post('user_id');

        $userSwitch = new UserSwitch();
        $newIdentity = Yii::$app->user->identity->findIdentity($user_id);
        $userSwitch->setUserByIdentity($newIdentity);
        return Yii::$app->user;
    }
551299
public function run()
    {
        $this->getLastActionDates();
        $this->getInfoUsers();

        return Response::data([
            'count' => $this->info_users_count,
            'items' => $this->info_users_items,
        ]);
    }