コード例 #1
0
def _update_admin_password(new_password):
    """Update the admin user's password."""
    with setup_flask_app().app_context():
        user = user_datastore.get_user('admin')
        user.password = hash_password(new_password)
        # Unlock account
        user.failed_logins_counter = 0
        user_datastore.commit()
コード例 #2
0
def _update_admin_password(new_password):
    """Update the admin user's password."""
    with setup_flask_app().app_context():
        config.instance.load_configuration()
        user = user_datastore.get_user('admin')
        user.password = hash_password(new_password)
        # Unlock account
        user.failed_logins_counter = 0
        user.active = True
        user_datastore.commit()
コード例 #3
0
    def get(self, username, multi_tenancy):
        """
        Get details for a single user
        """
        rest_utils.validate_inputs({'username': username})

        # allow user that queries about himself to avoid admin authorization
        if username == current_user.username:
            return user_datastore.get_user(current_user.username)
        return multi_tenancy.get_user(username)
コード例 #4
0
ファイル: users.py プロジェクト: vbohinc/cloudify-manager
 def get(self):
     """
     Get details for the current user
     """
     return user_datastore.get_user(current_user.username)
コード例 #5
0
def get_user_from_auth(auth):
    if not auth:
        return None
    return user_datastore.get_user(auth.username)
コード例 #6
0
def get_user_from_auth(auth):
    if not auth or not auth.username:
        return None
    if auth.username[0] not in string.ascii_letters:
        return None
    return user_datastore.get_user(auth.username)
コード例 #7
0
def get_user_from_auth(auth):
    return user_datastore.get_user(auth.username)
コード例 #8
0
def _update_admin_password(new_password):
    adm = user_datastore.get_user('admin')
    if verify_password(new_password, adm.password):  # no change
        return
    adm.password = hash_password(new_password)
    user_datastore.commit()
コード例 #9
0
 def get(self):
     """
     Get details for the current user
     """
     return user_datastore.get_user(current_user.username)