If the user posts back any forms to their profile, they've completed step 4: profile customization
506301
public function ProfileController_Render_Before($Sender) {
      if (property_exists($Sender, 'Form') && $Sender->Form->AuthenticatedPostBack() === TRUE)
         $this->SaveStep('Plugins.GettingStarted.Profile');
   }
1011192
public function callbackSubmit()
    {
        // Get values from the submitted form
        $name       = $this->form->value("user");
        $password      = $this->form->value("password");

        $user = new User();
        $user->setDb($this->di->get("db"));
        $res = $user->verifyPassword($name, $password);

        if (!$res) {
            $this->form->rememberValues();
            $this->form->addOutput("User or password did not match.");
            return false;
        }

        $this->di->get('session')->set("user", $name); # set user in session
        $this->di->get("response")->redirect("user/profile");
    }
886121
def change_profile(self, profile_name):
        """"""
        self._server_side_completer = self._create_server_side_completer(
            session=botocore.session.Session(profile=profile_name))
963501
public function definition () {
        global $USER, $CFG;

        $mform = $this->_form;

        $strrequired = get_string('required');

        // Add some extra hidden fields.
        $mform->addElement('hidden', 'id');
        $mform->setType('id', PARAM_INT);
        $mform->addElement('hidden', 'action', 'editcategory');
        $mform->setType('action', PARAM_ALPHANUMEXT);

        $mform->addElement('text', 'name', get_string('profilecategoryname', 'admin'), 'maxlength="255" size="30"');
        $mform->setType('name', PARAM_TEXT);
        $mform->addRule('name', $strrequired, 'required', null, 'client');

        $this->add_action_buttons(true);

    }
872987
function addPrefs(profile, options) {
  var userPrefs = options.prefs || {};

  return when.promise(function(resolve, reject) {
    Object.keys(userPrefs).forEach(function(key) {
      profile.setPreference(key, userPrefs[key]);
    });
    profile.updatePreferences();
    resolve(profile);
  });
}
368723
def post(self, request):
        

        if request.user.is_authenticated():
            return self.error_to_response(request, dict(
                error=_("You are already logged in.")))

        try:
            user, profile, client = self.get_session_data(request)
        except KeyError:
            return self.error_to_response(request, dict(
                error=_("A social profile is missing from your session.")))
        
        form = self.get_form()(request.POST, request.FILES,
            initial=self.get_initial_data(request, user, profile, client))
        
        if not form.is_valid():
            additional_context = self.get_context(request, user, profile, client)
            return self.render_to_response(dict({'form': form}, **additional_context))
        
        user, profile = form.save(request, user, profile, client)
        
        user = profile.authenticate()
        
        self.send_connect_signal(request, user, profile, client)
        
        self.login(request, user)
        
        self.send_login_signal(request, user, profile, client)
        
        self.delete_session_data(request)
        
        return HttpResponseRedirect(self.get_next(request))
546851
public function createAction()
    {
        if ($this->request->isPost()) {

            $profile = new Profiles([
                'name' => $this->request->getPost('name', 'striptags'),
                'active' => $this->request->getPost('active')
            ]);

            if (!$profile->save()) {
                $this->flash->error($profile->getMessages());
            } else {
                $this->flash->success("Profile was created successfully");
            }

            Tag::resetInput();
        }

        $this->view->form = new ProfilesForm(null);
    }
847212
public function success(Form $form) : void
    {
        if ($this->presenter->isAjax())
        {
            $values = $form->getValues();

            try
            {
                $redirect = NULL;
                $page = $this->pageRepository->findOneById($values->pageId);

                if ($this->redirectId)
                {
                    $redirect = $this->onPageRepository->findOneRedirectById($this->redirectId);
                }

                $this->onPageManager->saveRedirect($redirect, $page, $values->oldUrl);

                $form->reset();

                $this->presenter->notificationAjax(
                    'URL přesměrována',
                    'URL byla úspěšně přesměrována.',
                    'success',
                    FALSE
                );

                $this->onSave();
            }
            catch (DatabaseException $exception)
            {
                $this->presenter->notificationAjax(
                    'Chyba',
                    $exception->getMessage(),
                    'error'
                );
            }
        }
    }
1091810
private function done(){
		$rtn = $this->form_endpoint->render(
			'form_edit_done.html',
			array(
				'href_backto'=>$this->options['href_backto'],
			)
		);

		$rtn = $this->form_endpoint->wrap_theme($rtn);
		return $rtn;
	}
332424
def handleProfileChange(self):
        
        # restore the profile settings
        prof    = self.currentProfile()
        vwidget = self.viewWidget()
        if vwidget:
            prof.restore(vwidget)
        
        if not self.signalsBlocked():
            self.currentProfileChanged.emit(self.currentProfile())
674567
public function callbackSubmit()
    {
        $user = new User();
        $user->setDb($this->di->get("db"));
        $user->find("id", $this->form->value("id"));
        $user->delete();

        $this->di->get("response")->redirect("admin");

        return true;
    }
405669
final void postComplete() {
        /*
         * On each step, variable f holds current dependents to pop
         * and run.  It is extended along only one path at a time,
         * pushing others to avoid unbounded recursion.
         */
        CompletableFuture<?> f = this; Completion h;
        while ((h = f.stack) != null ||
               (f != this && (h = (f = this).stack) != null)) {
            CompletableFuture<?> d; Completion t;
            if (f.casStack(h, t = h.next)) {
                if (t != null) {
                    if (f != this) {
                        pushStack(h);
                        continue;
                    }
                    h.next = null;    // detach
                }
                f = (d = h.tryFire(NESTED)) == null ? this : d;
            }
        }
    }
435781
function (req, res, next) {
    var profile = req.profile;
    var filter = { or: [{ yahoo: profile.guid }, { email: profile.email }] };

    User.find({ where: filter }, function(err, users) {
      var user = users[0];

      if (user) {
        if (!user.yahoo) {
          user.yahoo = body.profile.guid;
          user.displayName = user.displayName || body.profile.name;
          user.save(function() {
            req.user = user;
            next();
          });
          return;
        }

        req.user = user;
        next();
        return;
      }

      User.create({
        displayName: body.profile.name,
        yahoo: body.profile.guid,
        email: body.profile.email,
        password: body.profile.guid
      }, function (err, user) {
        req.user = user;
        next();
      });

    });
  }
556480
public function startManipulation(){
		$core			= ConfigurationManager::Get("profiles.{$this->getProfileName()}.coreDirectory");
		$public			= ConfigurationManager::Get("profiles.{$this->getProfileName()}.publicDirectory");
		$manipulations	= ConfigurationManager::Get("profiles.{$this->getProfileName()}.manipulations");

		# Fixing bootstrap
		$this->fixBootstrapper($public, $core);

		# Manipulate Codes
		foreach ($manipulations as $file => $lines) {
			$file = Utility::renderTemplate($file, [
				'{CORE}'	=> Utility::getCorePath($this->getAlias(), $core),
				'{PUBLIC}'	=> Utility::getPublicPath($this->getAlias(), $public)
			]);
			$file = Utility::normalizePath($file);
			if(\file_exists($file)){
				Utility::replaceInFile($file, $lines);
			}
		}
	}
965422
def profile(request):
    '''
        
    '''
    context = {}

    if request.method == 'POST':
        form = PasswordChangeForm(request.user, request.POST)
        if form.is_valid():
            form.save()
            messages.info(request, 'Password Changed.')
    else:
        form = PasswordChangeForm(request.user)

    key = Key.objects.get(email=request.user.email)
    
    #analytics
    endpoint_q = key.reports.values('api__name', 'endpoint').annotate(calls=Sum('calls')).order_by('-calls')
    endpoints = [{'endpoint':'.'.join((d['api__name'], d['endpoint'])),
                  'calls': d['calls']} for d in endpoint_q]
    date_q = key.reports.values('date').annotate(calls=Sum('calls')).order_by('date')
    context['endpoints'], context['endpoint_calls'] = _dictlist_to_lists(endpoints, 'endpoint', 'calls')
    context['timeline'] = date_q

    context['form'] = form
    context['key'] = key
    context['password_is_key'] = request.user.check_password(key.key)
    return render_to_response('locksmith/profile.html', context,
                              context_instance=RequestContext(request))
854152
public function formSubmit() {

		if ( empty( $this->isFormSubmission() ) || empty( current_user_can( 'edit_others_posts' ) ) ) {
			// Don't do anything in this function, bail.
			return;
		}

		// Process form
		if ( isset( $_GET['custom_styles'] ) && $_GET['custom_styles'] === 'yes' && isset( $_POST['your_styles'] ) && check_admin_referer( 'pb-custom-styles' ) ) {
			$slug = isset( $_POST['slug'] ) ? $_POST['slug'] : 'web';
			$redirect_url = get_admin_url( get_current_blog_id(), '/themes.php?page=' . $this::PAGE . '&slug=' . $slug );

			if ( ! isset( $_POST['post_id'], $_POST['post_id_integrity'] ) ) {
				debug_error_log( __METHOD__ . ' error: Missing post ID' );
				\Pressbooks\Redirect\location( $redirect_url . '&custom_styles_error=true' );
			}
			if ( md5( NONCE_KEY . $_POST['post_id'] ) !== $_POST['post_id_integrity'] ) {
				// A hacker trying to overwrite posts?.
				debug_error_log( __METHOD__ . ' error: unexpected value for post_id_integrity' );
				\Pressbooks\Redirect\location( $redirect_url . '&custom_styles_error=true' );
			}

			// Remove wp_filter_post_kses, this causes CSS escaping issues
			remove_filter( 'content_save_pre', 'wp_filter_post_kses' );
			remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
			remove_all_filters( 'content_save_pre' );

			// Write to database
			$my_post = [
				'ID' => absint( $_POST['post_id'] ),
				'post_content' => \Pressbooks\Sanitize\cleanup_css( $_POST['your_styles'] ),
			];
			$response = wp_update_post( $my_post, true );

			if ( is_wp_error( $response ) ) {
				// Something went wrong?
				debug_error_log( __METHOD__ . ' error, wp_update_post(): ' . $response->get_error_message() );
				\Pressbooks\Redirect\location( $redirect_url . '&custom_styles_error=true' );
			}

			if ( $slug === 'web' ) {
				// a recompile will be triggered whenever the user saves custom styles targeting web
				$this->updateWebBookStyleSheet();
			}

			// Ok!
			\Pressbooks\Redirect\location( $redirect_url );
		}

	}
126234
public function submitted()
    {
        if (parent::submitted()) {
            if (isset($this->reset) && $this->isClicked($this->reset)) {
                $this->forget();
                $this->js(null, $this->view->js()->reload())->reload()->execute();
            } else {
                $this->memorizeAll();
            }
            $this->view->js()->reload()->execute();
        }
    }