Edit a user login.

        Update an existing login for a user in the given account.
336292
def edit_user_login(self, id, account_id, login_integration_id=None, login_password=None, login_sis_user_id=None, login_unique_id=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        # OPTIONAL - login[unique_id]
        """The new unique ID for the login."""
        if login_unique_id is not None:
            data["login[unique_id]"] = login_unique_id

        # OPTIONAL - login[password]
        """The new password for the login. Can only be set by an admin user if admins
        are allowed to change passwords for the account."""
        if login_password is not None:
            data["login[password]"] = login_password

        # OPTIONAL - login[sis_user_id]
        """SIS ID for the login. To set this parameter, the caller must be able to
        manage SIS permissions on the account."""
        if login_sis_user_id is not None:
            data["login[sis_user_id]"] = login_sis_user_id

        # OPTIONAL - login[integration_id]
        """Integration ID for the login. To set this parameter, the caller must be able to
        manage SIS permissions on the account. The Integration ID is a secondary
        identifier useful for more complex SIS integrations."""
        if login_integration_id is not None:
            data["login[integration_id]"] = login_integration_id

        self.logger.debug("PUT /api/v1/accounts/{account_id}/logins/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("PUT", "/api/v1/accounts/{account_id}/logins/{id}".format(**path), data=data, params=params, no_data=True)
74627
def user(context, name, email):
    """"""
    existing_user = context.obj['store'].user(email)
    if existing_user:
        click.echo(existing_user.to_dict())
    elif name:
        new_user = context.obj['store'].add_user(name, email)
        click.echo(click.style(f"New user added: {email} ({new_user.id})", fg='green'))
    else:
        click.echo(click.style('User not found', fg='yellow'))
506613
def account_settings_update(self, data, **kwargs):
        ""
        api_path = "/api/v2/account/settings.json"
        return self.call(api_path, method="PUT", data=data, **kwargs)
659542
def updatePassword(self,
                       user,
                       currentPassword,
                       newPassword):
        """"""
        return self.__post('/api/updatePassword',
                           data={
                               'user': user,
                               'currentPassword': currentPassword,
                               'newPassword': newPassword
                           })
463927
def update(self, user, name=None, password=None, host=None):
        
        if not any((name, password, host)):
            raise exc.MissingDBUserParameters("You must supply at least one of "
                    "the following: new username, new password, or new host "
                    "specification.")
        if not isinstance(user, CloudDatabaseUser):
            # Must be the ID/name
            user = self.get(user)
        dct = {}
        if name and (name != user.name):
            dct["name"] = name
        if host and (host != user.host):
            dct["host"] = host
        if password:
            dct["password"] = password
        if not dct:
            raise exc.DBUpdateUnchanged("You must supply at least one changed "
                    "value when updating a user.")
        uri = "/%s/%s" % (self.uri_base, user.name)
        body = {"user": dct}
        resp, resp_body = self.api.method_put(uri, body=body)
        return None
627626
def set_account_username(account, old_username, new_username):
    
    for datastore in _get_datastores():
        datastore.set_account_username(account, old_username, new_username)
1300476
def change_credentials(self, user=None, auth_token=None):
        
        self.r_session.set_credentials(user, auth_token)
        self.r_session.login()
99557
def edit(self, customer_id, data={}, **kwargs):
        "
        url = '{}/{}'.format(self.base_url, customer_id)

        return self.put_url(url, data, **kwargs)
775755
def put(self, account_id, user_id):
        
        return self.connection.put('account/access', data=dict(account_id=account_id,           user_id=user_id))
940474
def update_from(user)
      @name = user.name
      @password = user.password
      @roster = user.roster.map {|c| c.clone }
    end
926007
def set_user(self, user):
        
        self.session['user_id'] = user.key
        self.session['user_data'] = user.clean_value()
        role = self.get_role()
        # TODO: this should be remembered from previous login
        # self.session['role_data'] = default_role.clean_value()
        self.session['role_id'] = role.key
        self.current.role_id = role.key
        self.current.user_id = user.key
        # self.perm_cache = PermissionCache(role.key)
        self.session['permissions'] = role.get_permissions()
1371824
def add_user(self, username, password):
        """"""
        self.server.user_dict[username] = password
        self.server.isAuth = True
25853
public function editUserLogin()
    {
        $this->controlAccessUserLogin();
        $this->setTitleEditUserLogin();
        $this->setBreadcrumbEditUserLogin();

        $this->submitUserLogin();
        $this->outputEditUserLogin();
    }
355025
def update
      if @user.update_attributes(permitted_params.user.merge({:password_required => true}))
        redirect_to new_session_url, :notice => t(:signed_up_successfully)
      else
        render :action => 'edit'
      end
    end
1364699
public Account updateAccount(final String accountCode, final Account account) {
        return doPUT(Account.ACCOUNT_RESOURCE + "/" + accountCode, account, Account.class);
    }
740797
private Account prepareAccountForUpdate(final Account account,
            final MultivaluedMap<String, String> data,
            UserIdentityContext userIdentityContext) {
        Account.Builder accBuilder = Account.builder();
        //copy full incoming account, and let override happen
        //in a separate instance later
        accBuilder.copy(account);


        if (data.containsKey("Status")) {
            Account.Status newStatus = Account.Status.getValueOf(data.getFirst("Status").toLowerCase());
            accBuilder.setStatus(newStatus);
        }
        if (data.containsKey("FriendlyName")) {
            accBuilder.setFriendlyName(data.getFirst("FriendlyName"));
        }
        if (data.containsKey("Password")) {
            // if this is a reset-password operation, we also need to set the account status to active
            if (account.getStatus() == Account.Status.UNINITIALIZED) {
                accBuilder.setStatus(Account.Status.ACTIVE);
            }

            String password = data.getFirst("Password");
            PasswordValidator validator = PasswordValidatorFactory.createDefault();
            if (!validator.isStrongEnough(password)) {
                CustomReasonPhraseType stat = new CustomReasonPhraseType(Response.Status.BAD_REQUEST, "Password too weak");
                throw new WebApplicationException(status(stat).build());
            }
            final String hash = new Md5Hash(data.getFirst("Password")).toString();
            accBuilder.setAuthToken(hash);
        }

        if (data.containsKey("Role")) {
            // Only allow role change for administrators. Multitenancy checks will take care of restricting the modification scope to sub-accounts.
            if (userIdentityContext.getEffectiveAccountRoles().contains(permissionEvaluator.getAdministratorRole())) {
                accBuilder.setRole(data.getFirst("Role"));
            } else {
                CustomReasonPhraseType stat = new CustomReasonPhraseType(Response.Status.FORBIDDEN, "Only Administrator allowed");
                throw new WebApplicationException(status(stat).build());
            }
        }

        return accBuilder.build();
    }
613876
def update_company_user(self, email, userdata):
        

        if not isinstance(userdata, dict):
            raise AttributeError('userdata must be a <dict>')

        method, url = get_URL('company_update_user')

        payload = {
            'apikey': self.config.get('apikey'),
            'logintoken': self.session.cookies.get('logintoken'),
            'useremail': email
            }

        payload.update(userdata)

        res = getattr(self.session, method)(url, params=payload)

        if res.status_code == 200:
            return True

        hellraiser(res)