Stores submitted values in persistence
Redirects if submoitted via POST

@return void
@throws \Exception Rather than exit.
358933
private function redirectPost()
    {
        if (!isset($_SERVER['REQUEST_URI'])) {
            return;
        }
        if (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] != 'POST') {
            return;
        }
        if (!$this->cfg['prg']) {
            return;
        }
        if (!$this->status['submitted']) {
            return;
        }
        $this->debug->log('redirecting');
        $event = $this->eventManager->publish('page.redirect', null, array('location' => $_SERVER['REQUEST_URI']));
        $location = $event['location'];
        $this->debug->log('%cLocation:%c <a href="%s">%s</a>', 'font-weight:bold;', '', $location, $location);
        if (\headers_sent($file, $line)) {
            $this->debug->warn('headers alrady sent from '.$file.' line '.$line);
            return;
        }
        if ($event->isPropagationStopped()) {
            $this->debug->alert('<i class="fa fa-external-link fa-lg" aria-hidden="true"></i> Location: <a class="alert-link" href="'.\htmlspecialchars($location).'">'.\htmlspecialchars($location).'</a>', 'info');
        } else {
            \header('Location: '.$location);
        }
        throw new \Exception('exit');
    }
850061
protected function submitAddCollection()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('collection');
        $this->addCollection();
    }
161406
public function callbackSubmit()
    {
        // Get values from the submitted form
        $name       = $this->form->value("name");
        $email       = $this->form->value("email");
        $password      = $this->form->value("password");
        $passwordAgain = $this->form->value("password-again");

        // Check password matches
        if ($password !== $passwordAgain) {
            $this->form->rememberValues();
            $this->form->addOutput("Password did not match.");
            return false;
        }

        if (strpos($name, '%') !== false) {
            $this->form->addOutput("% is not allowed");
            return false;
        }

         $user = new User();
         $user->setDb($this->di->get("db"));

        if ($user->userExists($name)) {
             $this->form->addOutput("User already exists");
             return false;
        }

          $user->name = $name;
          $user->email = $email;
          $user->authority = $this->form->value("select");
          $user->setPassword($password);
          $user->save();

          $this->form->addOutput("You added the user");
          return true;
    }
215792
protected function submitEditCheckout()
    {
        $this->setSubmitted('order');

        $this->setAddressFormCheckout();
        $this->submitAddAddressCheckout();

        if ($this->isPosted('checkout_login') && empty($this->uid)) {
            $this->show_login_form = true;
        }

        $this->same_payment_address = (bool) $this->getPosted('same_payment_address', true, false, 'bool');

        if ($this->isPosted('update')) {
            $this->setMessage($this->text('Form has been updated'), 'success', false);
        }

        $this->submitLoginCheckout();

        if ($this->isPosted('checkout_anonymous')) {
            $this->show_login_form = false;
        }

        $this->validateCouponCheckout();
        $this->submitCartCheckout();
        $this->submitOrderCheckout();
    }
1241791
protected function submitEditPage()
    {
        if ($this->isPosted('delete')) {
            $this->deletePage();
        } else if ($this->isPosted('save') && $this->validateEditPage()) {
            $this->deleteImagesPage();
            if (isset($this->data_page['page_id'])) {
                $this->updatePage();
            } else {
                $this->addPage();
            }
        }
    }
1314653
protected function submitAddState()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('state');
        $this->addState();
    }
542448
protected function submitSelectedFileManager()
    {
        $command_id = $this->getPosted('command_id');
        $selected = $this->getPosted('selected', array(), false, 'array');

        if ($command_id && $selected) {
            $limit = 100; // Max number of items to keep in the session
            $save = array_slice(array_unique($selected), 0, $limit);
            $this->session->set('file_manager_selected', $save);
            $query = array('cmd' => $command_id, 'path' => $this->data_path, 'selected' => true);
            $this->url->redirect('', $query);
        }

        $this->redirect();
    }
1025905
public function process()
    {
        if (
            $this->getForm()->getHiddenField($this->id . '_submitted') === null
        ) {
            return;
        }

        parent::process();

        foreach ($this->values as $option_value) {
            $this->getEntryWidget($option_value)->process();
        }
    }
586530
public function store()
    {
        $user    = null;
        $message = '';
        $success = false;

        try{
            $input = Input::post();

            if($input['password'] != $input['confirm_password']){
                throw new Exception("Password and confirmation password not match", 1);
            }

            $user = Sentry::createUser(array(
                'email'       => $input['email'],
                'password'    => $input['password'],
                'first_name'  => $input['first_name'],
                'last_name'   => $input['last_name'],
                'activated'   => 1
            ));

            $success = true;
            $message = 'User created successfully';
        }catch (Exception $e){
            $message = $e->getMessage();
        }

        if(Request::isAjax()){
            Response::headers()->set('Content-Type', 'application/json');
            Response::setBody(json_encode(
                array(
                    'success'   => $success,
                    'data'      => ($user) ? $user->toArray() : $user,
                    'message'   => $message,
                    'code'      => $success ? 200 : 500
                )
            ));
        }else{
            Response::redirect($this->siteUrl('admin/user'));
        }
    }
48443
protected function loadSubmittedValues(): void
  {
    switch ($this->attributes['method'])
    {
      case 'post':
        $values = &$_POST;
        break;

      case 'get':
        $values = &$_GET;
        break;

      default:
        throw new FallenException('method', $this->attributes['method']);
    }

    // For all field sets load all submitted values.
    $this->fieldSets->loadSubmittedValuesBase($values, $this->values, $this->changedControls);
  }
1308941
public function persistData()
    {
        // we sort the array first, useful for doing ris match
        if (!empty($this->userAgentsWithDeviceID)) {
            ksort($this->userAgentsWithDeviceID);
            $this->persistenceProvider->save($this->getPrefix(), $this->userAgentsWithDeviceID);
        }
    }
247497
public function callbackSubmit()
    {
        $this->AddOutput("<p>DoSubmit(): Form was submitted.<p>");
        $this->AddOutput("<p>Do stuff (save to database) and return true (success) or false (failed processing)</p>");
        $this->AddOutput("<p><b>Name: " . $this->Value('name') . "</b></p>");
        $this->AddOutput("<p><b>Email: " . $this->Value('email') . "</b></p>");
        $this->AddOutput("<p><b>Phone: " . $this->Value('phone') . "</b></p>");
        $this->saveInSession = true;
        return true;
    }
7340
public function saveRedirect($slug, $postValues)
    {
        $redirectObject = RedirectsFactory::createRedirectFromPostValues($postValues);

        $redirects = $this->repository->redirects;
        foreach ($redirects as $key => $redirect) {
            if ($redirect->slug == $slug) {
                $redirects[$key] = $redirectObject;
            }
        }
        $this->repository->redirects = $redirects;
        $this->save();
    }
917246
public function persist(): void
    {
        foreach ($this->create() as $seed) {
            $this->seeder->persist($seed);
            $this->persistedSeeds++;
        }

        $this->seeder->flush();
    }
482848
public function markRejected(): bool
    {
        $this->owner->{$this->statusAttribute} = Status::REJECTED;

        if ($this->beforeModeration()) {
            return $this->owner->save();
        }

        return false;
    }
564409
public function callbackSubmit()
    {
        // Remember values during resubmit, useful when failing (retunr false)
        // and asking the user to resubmit the form.
        $this->form->rememberValues();
        $username = $this->form->value("username");
        $password = $this->form->value("password");
        try {
            $this->di->get("userService")->login($username, $password);
        } catch (\Peto16\User\Exception $e) {
            $this->form->addOutput($e->getMessage());
            return false;
        }
        return true;
    }
1050945
protected function submitSettings()
    {
        if ($this->isPosted('reset')) {
            $this->updateSettings(array());
        } else if ($this->isPosted('save') && $this->validateSettings()) {
            $this->updateSettings($this->getSubmitted());
        }
    }