Handles request for saving / updating account
322385
@RequestMapping(value = "/update", method = RequestMethod.POST)
	public @ResponseBody
	void update(
			@RequestParam(value = "username", required = true) String username,
			@RequestParam(value = "name", required = false) String name,
			@RequestParam(value = "surname", required = false) String surname,
			@RequestParam(value = "telephoneNumber", required = false) String telephoneNumber) {
		logger.debug("Received request to update account");

		accountService.update(new Account(username, name, surname,
				telephoneNumber));

	}
1141588
@RequestMapping(value = "{accountId}/update", method = RequestMethod.PUT)
    public Account updateAccount(@PathVariable ID accountId, @RequestBody @Valid AccountInput input) {
        return accountService.updateAccount(accountId, input);
    }
945669
def update_account_data(self) -> None:
        """"""
        response = get(
            _url(
                "/accounts/{0}/identifiers".format(self._account_uid),
                self._sandbox
            ),
            headers=self._auth_headers
        )
        response.raise_for_status()

        response = response.json()

        self.account_identifier = response.get('accountIdentifier')
        self.bank_identifier = response.get('bankIdentifier')
        self.iban = response.get('iban')
        self.bic = response.get('bic')
224605
def save_bank(self, bank_form, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinAdminSession.update_bin
        if bank_form.is_for_update():
            return self.update_bank(bank_form, *args, **kwargs)
        else:
            return self.create_bank(bank_form, *args, **kwargs)
786863
def on_put(self, request, response, txn_id=None):
        """"""
        response.body = "{}"

        # Check whether repeat txn_id
        if not self._is_new(txn_id):
            response.status = falcon.HTTP_200
            return

        request.context["body"] = request.stream.read()
        try:
            events = json.loads(request.context["body"].decode("utf-8"))["events"]
        except(KeyError, ValueError, UnicodeDecodeError):
            response.status = falcon.HTTP_400
            response.body = "Malformed request body"
            return

        if self.handler(EventStream(events, self.Api)):
            response.status = falcon.HTTP_200
        else:
            response.status = falcon.HTTP_400
1065977
def updateAccountValue(self, key, val, currency, accountName):
        """"""
        return _swigibpy.EWrapper_updateAccountValue(self, key, val, currency, accountName)
56754
function handlePermissionUpdate() {
            permissionArea.find("form").submit(function (e) {
                e.preventDefault();
                //console.log(e);
                var form = e.currentTarget;
                appendFormFields(form);
                Rocket.Util.submitFormAsync(form, function (responseData) {
                    //console.log(responseData);
                    if (responseData && responseData.status && responseData.status == "success") {
                        location.reload();
                    }
                });
            });
        }
1244183
def deposit(self, account_id, **params):
        """"""
        for required in ['payment_method', 'amount', 'currency']:
            if required not in params:
                raise ValueError("Missing required parameter: %s" % required)
        response = self._post('v2', 'accounts', account_id, 'deposits', data=params)
        return self._make_api_object(response, Deposit)
569277
function handleStatusChange(response) {
  if (response.authResponse) {
    logResponse(response);
    window.location.hash = '#menu';
    updateUserInfo(response);
  } else {
    window.location.hash = '#login';
  }
}
844651
def save(self):
        """"""

        import json

        payload = {}
        payload.update(self._store)
        payload["user"] = payload["username"]
        payload["passwd"] = payload["password"]
        del(payload["username"])
        del(payload["password"])

        payload = json.dumps(payload, default=str)
        if not self.URL :
            if "username" not in self._store or "password" not in self._store :
                raise KeyError("You must define self['name'] and self['password'] to be able to create a new user")

            r = self.connection.session.post(self.users.URL, data = payload)
            data = r.json()
            if r.status_code == 201 :
                self._set(data)
            else :
                raise CreationError("Unable to create new user", data)
        else :
            r = self.connection.session.put(self.URL, data = payload)
            data = r.json()
            if r.status_code == 200 :
                self._set(data)
            else :
                raise UpdateError("Unable to update user, status: %s" %r.status_code, data)
767913
def save(self, *args, **kwargs):
        
        # fill name and email
        if self.user:
            self.from_name = self.user.get_full_name()
            self.from_email = self.user.email

        # if not sent yet
        if int(self.status) < 1:
            # tries sending email (will modify self.status!)
            self.send()

        # save in the database unless logging is explicitly turned off in the settings file
        if INWARD_LOG:
            super(Inward, self).save(*args, **kwargs)
411648
@CacheControl(policy = { CachePolicy.PRIVATE, CachePolicy.MUST_REVALIDATE }) 
	@RequestMapping("/account.do")
	public String handleAccountRequest(Model model) {
		model.addAttribute("pageName", "Your Account");
		return "page";
	}
275166
def put(self, accountId):
        """"""
        self.reqparse.add_argument('accountName', type=str, required=True)
        self.reqparse.add_argument('accountType', type=str, required=True)
        self.reqparse.add_argument('contacts', type=dict, required=True, action='append')
        self.reqparse.add_argument('enabled', type=int, required=True, choices=(0, 1))
        self.reqparse.add_argument('requiredRoles', type=str, action='append', default=())
        self.reqparse.add_argument('properties', type=dict, required=True)
        args = self.reqparse.parse_args()

        account_class = get_plugin_by_name(PLUGIN_NAMESPACES['accounts'], args['accountType'])
        if not account_class:
            raise InquisitorError('Invalid account type: {}'.format(args['accountType']))

        validate_contacts(args['contacts'])

        if not args['accountName'].strip():
            raise Exception('You must provide an account name')

        if not args['contacts']:
            raise Exception('You must provide at least one contact')

        class_properties = {from_camelcase(key): value for key, value in args['properties'].items()}
        for prop in account_class.class_properties:
            if prop['key'] not in class_properties:
                raise InquisitorError('Missing required property {}'.format(prop))

        account = account_class.get(accountId)
        if account.account_type != args['accountType']:
            raise InquisitorError('You cannot change the type of an account')

        account.account_name = args['accountName']
        account.contacts = args['contacts']
        account.enabled = args['enabled']
        account.required_roles = args['requiredRoles']
        account.update(**args['properties'])
        account.save()

        auditlog(event='account.update', actor=session['user'].username, data=args)

        return self.make_response({'message': 'Object updated', 'account': account.to_json(is_admin=True)})
653783
def save(self):
        """"""
        check_bind(self)

        creating = self.id is None
        if creating and not self.__class__._has_schema_method("create"):
            raise MethodNotSupported("{} do not support creating.".format(self.__class__.__name__))
        if not creating and not self.__class__._has_schema_method("update"):
            raise MethodNotSupported("{} do not support updating.".format(self.__class__.__name__))

        try:
            self._resource.save()
        except HTTPError as e:
            if e.response.status_code == 400:
                err_json = e.response.json().get("errors", [])
                msg = pretty_print_error(err_json)
                raise ServerError(msg)
            elif e.response.status_code == 404:
                action = "creating" if creating else "updating"
                raise MethodNotSupported(
                    "{} do not support {}.".format(self.__class__.__name__, action)
                )
            elif e.response.status_code == 409:
                raise ServerError("This {} object already exists".format(self.__class__.__name__))
            else:
                raise e
43192
def save
      raise ArgumentError.new("Account is missing.") unless account
      
      account.require_secret
      
      hash = {}
      hash["settings"] = to_hash
      hash["secret"] = account.secret
      
      RippleRest.post "v1/accounts/#{account.address}/settings", hash
    end
1339197
function (account, cb) {

		Stripeaccount.findOrCreate(account.id, account)
	    .exec(function (err, foundAccount){
	      if (err) return cb(err);
	      Stripeaccount.update(foundAccount.id, account)
	      .exec(function(err, updatedAccounts){
	      	if (err) return cb(err);
	      	cb(null, updatedAccounts[0]);
	      });
	    });
	}
267780
function handleReset(req, res, next) {
		var p = new Promise(function (resolve, reject) {
			const currentToken = req.params.token || 'missing';
			const email = req.params.email || 'missing@email.com';
			const password = req.params.password;
			if (!password) {
				return reject(new restifyErrors.BadRequestError("New password is missing"));
			}
			const qry = {
				local_auth_type: 'password',
				active: true,
				email: email,
				verify_token: currentToken
			};
			AclUser.findOne(qry, function (err, usr) {
				if (err) {
					debug(`Error finding user for password reset`, err);
					return reject(new restifyErrors.InternalError(err));
				}
				if (!usr) {
					debug(`Password reset email address and reset token did not match`, email);
					return reject(new restifyErrors.InvalidCredentialsError("Email address and reset token did not match"));
				}
				usr.verify_token = "password-reset:" + usr.generateVerifyHash();
				usr.modifiedBy = 'password-reset';

				debug(`Updating ${email} with a password reset`);
				usr.setPassword(password, function () {
					usr.save(function (err, user) {
						if (err) {
							debug(`Error updating user during password reset`, err);
							return reject(new restifyErrors.InternalError(err));
						}
						const data = {
							'success': true,
							'message': "Password updated"
						};
						resolve(data);
					});
				});
			});
		}).then(function (data) {
			res.json(data);
			next();
		}).catch(function (err) {
			debug(`Password reset request failed`, err);
			next(err);
		});
	}