Sends a register request to sign up a new user to kik with the given details.
437040
def register(self, email, username, password, first_name, last_name, birthday="1974-11-20", captcha_result=None):
        
        self.username = username
        self.password = password
        register_message = sign_up.RegisterRequest(email, username, password, first_name, last_name, birthday, captcha_result,
                                                   self.device_id_override, self.android_id_override)
        log.info("[+] Sending sign up request (name: {} {}, email: {})...".format(first_name, last_name, email))
        return self._send_xmpp_element(register_message)
613772
def register(
            self,
            app: 'Quart',
            first_registration: bool,
            *,
            url_prefix: Optional[str]=None,
    ) -> None:
        """"""
        state = self.make_setup_state(app, first_registration, url_prefix=url_prefix)

        if self.has_static_folder:
            state.add_url_rule(
                self.static_url_path + '/<path:filename>',
                view_func=self.send_static_file, endpoint='static',
            )

        for func in self.deferred_functions:
            func(state)
1004860
@POST
  @PermitAll
  public Response signup(DUser user, @Context UriInfo uriInfo) {

    LOGGER.debug("Sign up user {}", user.getUsername());

    if (!shouldUseEmailAsUsername) {
      checkUsernameFormat(user.getUsername());
    }
    checkPasswordFormat(user.getPassword());
    checkEmailFormat(user.getEmail());

    user = userService.signup(user);

    // Location of created user resource
    UriBuilder uriBuilder = uriInfo.getAbsolutePathBuilder()
        .path(user.getId().toString());

    return Response.created(uriBuilder.build())
        .entity(user.getId())
        .build();
  }
953837
def register():
    """"""

    if _security.confirmable or request.is_json:
        form_class = _security.confirm_register_form
    else:
        form_class = _security.register_form

    if request.is_json:
        form_data = MultiDict(request.get_json())
    else:
        form_data = request.form

    form = form_class(form_data)

    if form.validate_on_submit():
        user = register_user(**form.to_dict())
        form.user = user

        if not _security.confirmable or _security.login_without_confirmation:
            after_this_request(_commit)
            login_user(user)

        if not request.is_json:
            if 'next' in form:
                redirect_url = get_post_register_redirect(form.next.data)
            else:
                redirect_url = get_post_register_redirect()

            return redirect(redirect_url)
        return _render_json(form, include_auth_token=True)

    if request.is_json:
        return _render_json(form)

    return _security.render_template(config_value('REGISTER_USER_TEMPLATE'),
                                     register_user_form=form,
                                     **_ctx('register'))
26596
def register(self, username, password, email, full_name):
        
        if all([username, password, email, full_name]):
            r = requests.post(self._base + 'user/register', params={
                'username': username,
                'password_1': password,
                'password_2': password,
                'email': email,
                'fullname': full_name
            })
            r.raise_for_status()
        else:
            raise Exception('None of the arguments may be "None"')
974101
def post_signup(self, user, login_user=None, send_email=None):
        
        self.signup_signal.send(self, user=user)

        if (login_user is None and self.options["login_user_on_signup"]) or login_user:
            self._login(user, user.signup_provider)

        to_email = getattr(user, self.options["email_column"], None)
        if to_email and ((send_email is None and self.options["send_welcome_email"]) or send_email):
            template = "users/welcome.txt" if self.options["send_welcome_email"] == True else self.options["send_welcome_email"]
            current_app.features.emails.send(to_email, template, user=user)
796632
async def AddUser(self, users):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='UserManager',
                   request='AddUser',
                   version=2,
                   params=_params)
        _params['users'] = users
        reply = await self.rpc(msg)
        return reply
1345728
def post(self, request, *args, **kwargs):
        """"""
        kwargs['pk'] = request.user.id
        self.kwargs['pk'] = request.user.id
        return super().post(request, *args, **kwargs)
864317
def activate(request, activation_key=None):
    
    utils.activate_user(activation_key)
    # if not activated
    success_url = utils.get_settings('REGISTRATION_API_ACTIVATION_SUCCESS_URL')
    if success_url is not None:
        return HttpResponseRedirect(success_url)
435843
def register(self, password):
        """"""

        if len(password) < 8:
            raise ValueError("Password must be at least 8 characters.")

        params = {"name": self.nick, "password": password}
        resp = self.conn.make_api_call("register", params)

        if "error" in resp:
            raise RuntimeError(f"{resp['error'].get('message') or resp['error']}")

        self.conn.make_call("useSession", resp["session"])
        self.conn.cookies.update({"session": resp["session"]})
        self.logged_in = True
861311
def send_reset_password_link(request):
    '''
    
    '''
    if not registration_settings.RESET_PASSWORD_VERIFICATION_ENABLED:
        raise Http404()
    serializer = SendResetPasswordLinkSerializer(data=request.data)
    serializer.is_valid(raise_exception=True)
    login = serializer.validated_data['login']

    user = None
    for login_field in get_login_fields():
        user = get_user_by_lookup_dict(
            {login_field: login}, default=None, require_verified=False)
        if user:
            break

    if not user:
        raise UserNotFound()

    signer = ResetPasswordSigner({
        'user_id': user.pk,
    }, request=request)

    template_config = (
        registration_settings.RESET_PASSWORD_VERIFICATION_EMAIL_TEMPLATES)
    send_verification_notification(user, signer, template_config)

    return get_ok_response('Reset link sent')
362142
def basic_register(username, password, password2):
    
    if password != password2:
        raise InvalidInput(password={'message': "Passwords do not match"},
                           username={'value': username})
    user = User.objects.create_user(username, password)
    return create_session(user.username, password)
478282
def new_application(request):
    
    # Note default kgapplications/index.html will display error if user logged
    # in.
    if not settings.ALLOW_REGISTRATIONS:
        return render(
            template_name='kgapplications/project_common_disabled.html',
            context={},
            request=request)

    roles = {'is_applicant', 'is_authorised'}

    if not request.user.is_authenticated:
        attrs, _ = saml.parse_attributes(request)
        defaults = {'email': attrs['email']}
        form = forms.UnauthenticatedInviteUserApplicationForm(
            request.POST or None, initial=defaults)
        if request.method == 'POST':
            if form.is_valid():
                email = form.cleaned_data['email']
                applicant, existing_person = get_applicant_from_email(email)

                # If applicant is None then there were multiple persons found.
                # This should never happen as the
                # UnauthenticatedInviteUserApplicationForm form disallows
                # existing users applying unauthenticated.
                assert applicant is not None
                # Similarly existing_person should always be False here.
                assert not existing_person

                application = ProjectApplication()
                application.applicant = applicant
                application.save()

                state_machine = get_application_state_machine()
                state_machine.start(request, application, roles)
                # we do not show unauthenticated users the application at this
                # stage.
                url = reverse('index')
                return HttpResponseRedirect(url)
        return render(
            template_name='kgapplications/'
            'project_common_invite_unauthenticated.html',
            context={'form': form, },
            request=request)
    else:
        if request.method == 'POST':
            person = request.user

            application = ProjectApplication()
            application.applicant = person
            application.save()

            state_machine = get_application_state_machine()
            response = state_machine.start(request, application, roles)
            return response
        return render(
            template_name='kgapplications/'
            'project_common_invite_authenticated.html',
            context={},
            request=request)
945289
def register():
    
    if request.method == "POST":
        username = request.form["username"]
        password = request.form["password"]
        error = None

        if not username:
            error = "Username is required."
        elif not password:
            error = "Password is required."
        elif db.session.query(
            User.query.filter_by(username=username).exists()
        ).scalar():
            error = f"User {username} is already registered."

        if error is None:
            # the name is available, create the user and go to the login page
            db.session.add(User(username=username, password=password))
            db.session.commit()
            return redirect(url_for("auth.login"))

        flash(error)

    return render_template("auth/register.html")
1241109
def adduser(app, username, password):
    """"""
    with app.app_context():
        create_user(username=username, password=password)
        click.echo('user created!')
1313388
def message_user(self, username, domain, subject, message):
        """"""
        jid = '%s@%s' % (username, domain)
        if self.api_version <= (14, 7):
            # TODO: it's unclear when send_message was introduced
            command = 'send_message_chat'
            args = domain, '%s@%s' % (username, domain), message
        else:
            command = 'send_message'
            args = 'chat', domain, jid, subject, message

        code, out, err = self.ctl(command, *args)
        if code != 0:
            raise BackendError(code)
504555
def _create_user(self, username, password, mail, method, uuid):
        """"""

        try:
            if method == 'Invited':
                config_role = self.config.group_accept_invited
            else:
                config_role = self.config.group_accept_enrolled

            roles = []
            if ',' in config_role:
                for item in config_role.split(','):
                    roles.append(item.lstrip().rstrip())
            else:
                roles = [config_role]

            newuser = objectmodels['user']({
                'name': username,
                'passhash': std_hash(password, self.salt),
                'mail': mail,
                'uuid': std_uuid(),
                'roles': roles,
                'created': std_now()
            })

            if method == 'Invited':
                newuser.needs_password_change = True

            newuser.save()
        except Exception as e:
            self.log("Problem creating new user: ", type(e), e,
                     lvl=error)
            return

        try:
            newprofile = objectmodels['profile']({
                'uuid': std_uuid(),
                'owner': newuser.uuid
            })
            self.log("New profile uuid: ", newprofile.uuid,
                     lvl=verbose)

            newprofile.save()

            packet = {
                'component': 'hfos.enrol.enrolmanager',
                'action': 'enrol',
                'data': [True, mail]
            }
            self.fireEvent(send(uuid, packet))

            # TODO: Notify crew-admins
        except Exception as e:
            self.log("Problem creating new profile: ", type(e),
                     e, lvl=error)