POST /incline/signup
507660
def create
      @user = Incline::User.new(user_params :before_create)

      if system_admin? # skip recaptcha check if an admin is currently logged in.
        @user.recaptcha = :verified
      end

      if @user.valid?
        if @user.save
          @user.send_activation_email request.remote_ip
          if system_admin?
            flash[:info] = "The user #{@user} has been created, but will need to activate their account before use."
            additional_params = user_params :after_create
            if additional_params.any?
              unless @user.update_attributes(additional_params)
                flash[:warning] = 'Failed to apply additional attributes to new user account.'
              end
            end
            if inline_request?
              render 'show', formats: [ :json ]
            else
              redirect_to users_url
            end
            return
          else
            flash[:safe_info] = 'Your account has been created, but needs to be activated before you can use it.<br>Please check your email to activate your account.'
            if inline_request?
              render 'show', formats: [ :json ]
            else
              redirect_to main_app.root_url
            end
            return
          end
        else
          @user.errors[:base] << 'Failed to create user account.'
        end
      end
      render 'new'
    end
141770
def post(options)
      payload = {
        username: @options['name'],
        channel:  @options['channel']
      }.merge(options)
      payload[:channel] = payload[:channel].gsub(/^#?/, '#') #slack api needs leading # on channel
      request = Net::HTTP::Post.new(@uri.request_uri)
      request.set_form_data(payload: payload.to_json)
      @http.request(request)
      return nil # so as not to trigger text in outgoing webhook reply
    end
157101
public void postRegistration(String username, String password, String email, String fullname) {
        ClientResource resource = new ClientResource(Route.REGISTER.url());

        Form form = new Form();
        form.add("username", username);
        form.add("password_1", password);
        form.add("password_2", password);
        form.add("email", email);
        form.add("fullname", fullname);

        resource.post(form);
    }
866968
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # synchronous operation
        try:
            console = hmc.consoles.lookup_by_oid(None)
        except KeyError:
            raise InvalidResourceError(method, uri)
        check_required_fields(method, uri, body, ['name'])
        new_password_rule = console.password_rules.add(body)
        return {'element-uri': new_password_rule.uri}
421798
def post_accounts(new_account)
      @options = {path: '/accounts/content',
                  body:  Megam::JSONCompat.to_json(new_account)}.merge(@options)

      request(
        :expects  => 201,
        :method   => :post,
        :body     => @options[:body]
        )
    end
325317
function createUser (req, res, next) {
    User.insert(req.body, { private: true }, function (err, user) {
      if (err) {
        res.render('signup', {
          params: qs.stringify(req.body),
          request: req.body,
          providers: settings.providers,
          error: err.message
        })
      } else {
        authenticator.dispatch('password', req, res, next, function (err, user, info) {
          if (err) { return next(err) }
          if (!user) {
          } else {
            authenticator.login(req, user)
            req.sendVerificationEmail =
              req.provider.emailVerification.enable
            req.flash('isNewUser', true)
            next()
          }
        })
      }
    })
  }
1102560
static public function formSubmit() {

		// --------------------------------------------------------------------------------------------------------
		// Sanity check

		if ( false === static::isFormSubmission() || false === current_user_can( 'edit_posts' ) ) {
			// Don't do anything in this function, bail.
			return;
		}

		// --------------------------------------------------------------------------------------------------------
		// Determine at what stage of the import we are and do something about it

		$redirect_url = get_admin_url( get_current_blog_id(), '/tools.php?page=pb_import' );

		// Revoke
		if ( ! empty( $_GET['revoke'] ) && check_admin_referer( 'pb-revoke-import' ) ) {
			self::_revokeCurrentImport();
			\Pressbooks\Redirect\location( $redirect_url );
		}

		if ( isset( $_GET['import'] ) && ! empty( $_POST['import_type'] ) && check_admin_referer( 'pb-import' ) ) {
			self::setImportOptions(); // STEP 1
		}

		// Default, back to form
		\Pressbooks\Redirect\location( $redirect_url );
	}
652074
public function signUp()
  {
    if (isset($_POST['signUp'])) {
      // Сheck for occupancy
      if ($_POST['name'] == '' || $_POST['email'] == '' || $_POST['password'] == '' || $_POST['confirmPassword'] == '') {
        $this->errors[] = 'Fill in all the fields';
      } 

      // Check for existence username
      if (R::count('users', 'name = ?', array($_POST['name'])) > 0) {
        $this->errors[] = 'A user with this name already exists';
      } 

      // Check for existence email in table
      if (R::count('users', 'email = ?', array($_POST['email'])) > 0) {
        $this->errors[] = 'This account is already taken! Please Login';
      }

       // Check for password math
      if ($_POST['password'] != $_POST['confirmPassword']) {
        $this->errors[] = 'The passwords you entered do not match!';
      }

      // Set min symbols 8 on the password
      if (strlen($_POST['password']) < 8) {
        $this->errors[] = 'The password must contain at least 8 characters!';
      }

      // If All ok
      if (empty($this->errors)) {
        $createUser = R::dispense('users');
        $createUser->name = strip_tags($_POST['name']);
        $createUser->email = strip_tags($_POST['email']);
        $createUser->password = password_hash(strip_tags($_POST['password']), PASSWORD_DEFAULT);
        R::store($createUser);

        redirect('/login');
      } else {
        echo "<div class='alert alert-danger' role='alert'>" . array_shift($this->errors) . "</div>";
      }
    }
  }
493732
def signup(request, **kwargs):
    
    if not ALLAUTH:
        return http.HttpResponse(_('allauth not installed...'))
    if request.method == "POST" and 'login' in request.POST:
        form_class = LoginForm
        form = form_class(request.POST)
        redirect_field_name = "next"
        success_url = get_default_redirect(request, redirect_field_name)
        if form.is_valid():
            return form.login(request, redirect_url=success_url)
    response = allauth_signup(request, **kwargs)
    return response
207865
def sign_up(self):
        
        self.log("Bot player signing up.")
        self.subscribe_to_quorum_channel()
        while True:
            url = (
                "{host}/participant/{self.worker_id}/"
                "{self.hit_id}/{self.assignment_id}/"
                "debug?fingerprint_hash={hash}&recruiter=bots:{bot_name}".format(
                    host=self.host,
                    self=self,
                    hash=uuid.uuid4().hex,
                    bot_name=self.__class__.__name__,
                )
            )
            try:
                result = requests.post(url)
                result.raise_for_status()
            except RequestException:
                self.stochastic_sleep()
                continue

            if result.json()["status"] == "error":
                self.stochastic_sleep()
                continue

            self.on_signup(result.json())
            return True
601529
def signup(self, project_name, email):
        

        uri = 'openstack/sign-up'
        data = {
            "project_name": project_name,
            "email": email,
        }
        post_body = json.dumps(data)
        resp, body = self.post(uri, body=post_body)
        self.expected_success(200, resp.status)
        body = json.loads(body)
        return rest_client.ResponseBody(resp, body)
860559
def _post_login_page(self):
        """"""
        # Prepare post data
        data = {
            "form": "signInForm",
            "client_id": JANRAIN_CLIENT_ID,
            "redirect_uri": "https://www.fido.ca/pages/#/",
            "response_type": "token",
            "locale": "en-US",
            "userID": self.username,
            "currentPassword": self.password,
        }
        # HTTP request
        try:
            raw_res = yield from self._session.post(LOGIN_URL,
                                                    headers=self._headers,
                                                    data=data,
                                                    timeout=self._timeout)
        except OSError:
            raise PyFidoError("Can not sign in")

        return True
893140
def post(self, request, question_level, question_number, format=None):
        
        user = User.objects.get(username=request.user.username)
        question = Question.objects.filter(question_level=question_level).filter(question_number=question_number)
        if int(user.profile.user_access_level) < int(question_level):
            content = {'user_nick':profile.user_nick, 'please move along': 'Nothing to see here' }
            return Response(content, status=status.HTTP_406_NOT_ACCEPTABLE)

        time_last = None
        time_last_query = Comment.objects.filter(comment_user__username=request.user.username).order_by('comment_timestamp').last()
        if time_last_query:
            time_last = time_last_query.comment_timestamp
        time_limit = self.get_contest_consecutive_submission_halt_time() # the halt time for submission is kept same as submission halt time

#        print time_last, time_limit, datetime.datetime.now(), time_limit <= datetime.datetime.now()

        if(time_last is None or time_last + time_limit <= datetime.datetime.now()):

            serializer = CommentSerializer(data=request.data)
            if not request.data['comment_message'] or len(str(request.data['comment_message'])) >= 255:
                content = {'user_nick':profile.user_nick, 'Try to submit something small': 'Like your Dick' }
                return Response(content, status=status.HTTP_406_NOT_ACCEPTABLE)
            if serializer.is_valid():
                serializer.save(comment_user = request.user,
                                comment_question = question[0],
                )
                checker_queue.delay(int(serializer.data['id']))
                return Response(serializer.data, status=status.HTTP_201_CREATED)
            else:
                return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
        else:
            content = {'user_nick':profile.user_nick, 'Try to submit after some time': 'Nothing to see here' }
            return Response(content, status=status.HTTP_406_NOT_ACCEPTABLE)
699923
@SuppressWarnings({"UnusedDeclaration"})
    public void doSubmit(StaplerRequest req, StaplerResponse resp) throws IOException, ServletException {
        getACL().checkPermission(getPermission());

        bindParameters(req);
        // current user is bound to the thread and will be lost in the perform method
        User user = User.current();
        String ciUser = (user == null) ? "anonymous" : user.getId();

        JSONObject formData = req.getSubmittedForm();
        if (formData.has("promotionPlugin")) {
            JSONObject pluginSettings = formData.getJSONObject("promotionPlugin");
            if (pluginSettings.has("pluginName")) {
                String pluginName = pluginSettings.getString("pluginName");
                if (!UserPluginInfo.NO_PLUGIN_KEY.equals(pluginName)) {
                    PluginSettings settings = new PluginSettings();
                    Map<String, String> paramMap = Maps.newHashMap();
                    settings.setPluginName(pluginName);
                    Map<String, Object> filteredPluginSettings = Maps.filterKeys(pluginSettings,
                            new Predicate<String>() {
                                public boolean apply(String input) {
                                    return StringUtils.isNotBlank(input) && !"pluginName".equals(input);
                                }
                            });
                    for (Map.Entry<String, Object> settingsEntry : filteredPluginSettings.entrySet()) {
                        String key = settingsEntry.getKey();
                        paramMap.put(key, pluginSettings.getString(key));
                    }
                    paramMap.put("ciUser", ciUser);
                    if (!paramMap.isEmpty()) {
                        settings.setParamMap(paramMap);
                    }
                    setPromotionPlugin(settings);
                }
            }
        }

        final BuildInfoAwareConfigurator configurator = getCurrentConfigurator();
        ArtifactoryServer server = configurator.getArtifactoryServer();

        new PromoteWorkerThread(server, CredentialManager.getPreferredDeployer((DeployerOverrider) configurator, server), ciUser).start();

        resp.sendRedirect(".");
    }
269091
def create(self, user: str, *,
               pwd: str, sgrp: str, comment: str=None) -> None:
        """"""
        data = {
            'action': 'add',
            'user': user,
            'pwd': pwd,
            'grp': 'users',
            'sgrp': sgrp
        }

        if comment:
            data['comment'] = comment

        self._request('post', URL, data=data)
510812
def post(self, *args, **kwargs):
        
        if self.steps.current not in self.steps.all:
            logger.warning("Current step '%s' is no longer valid, returning "
                           "to last valid step in the wizard.",
                           self.steps.current)
            return self.render_goto_step(self.steps.all[-1])

        # -- Duplicated code from upstream
        # Look for a wizard_goto_step element in the posted data which
        # contains a valid step name. If one was found, render the requested
        # form. (This makes stepping back a lot easier).
        wizard_goto_step = self.request.POST.get('wizard_goto_step', None)
        if wizard_goto_step and wizard_goto_step in self.get_form_list():
            return self.render_goto_step(wizard_goto_step)

        # Check if form was refreshed
        management_form = ManagementForm(self.request.POST, prefix=self.prefix)
        if not management_form.is_valid():
            raise SuspiciousOperation(_('ManagementForm data is missing or has been tampered with'))

        form_current_step = management_form.cleaned_data['current_step']
        if (form_current_step != self.steps.current and
                self.storage.current_step is not None):
            # form refreshed, change current step
            self.storage.current_step = form_current_step
        # -- End duplicated code from upstream

        # This is different from the first check, as this checks
        # if the new step is available. See issue #65.
        if self.steps.current not in self.steps.all:
            logger.warning("Requested step '%s' is no longer valid, returning "
                           "to last valid step in the wizard.",
                           self.steps.current)
            return self.render_goto_step(self.steps.all[-1])

        return super(IdempotentSessionWizardView, self).post(*args, **kwargs)
173811
def post(self):
    """"""
    client_customer_id = self.request.get('clientCustomerId')
    if not client_customer_id:
      self.redirect('/')
    else:
      self.redirect('/showCampaigns?clientCustomerId=%s' % client_customer_id)