当前位置: 首页>>代码示例>>Python>>正文


Python Organization.get_user方法代码示例

本文整理汇总了Python中pritunl.organization.Organization.get_user方法的典型用法代码示例。如果您正苦于以下问题:Python Organization.get_user方法的具体用法?Python Organization.get_user怎么用?Python Organization.get_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pritunl.organization.Organization的用法示例。


在下文中一共展示了Organization.get_user方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: user_put

# 需要导入模块: from pritunl.organization import Organization [as 别名]
# 或者: from pritunl.organization.Organization import get_user [as 别名]
def user_put(org_id, user_id):
    org = Organization(org_id)
    user = org.get_user(user_id)
    name = flask.request.json['name']
    name = ''.join(x for x in name if x.isalnum() or x in NAME_SAFE_CHARS)
    user.rename(name)
    return utils.jsonify({})
开发者ID:cDoru,项目名称:pritunl,代码行数:9,代码来源:user.py

示例2: _get_key_inline

# 需要导入模块: from pritunl.organization import Organization [as 别名]
# 或者: from pritunl.organization.Organization import get_user [as 别名]
def _get_key_inline(org_id, user_id):
    org = Organization(org_id)
    user = org.get_user(user_id)
    archive = user.build_key_inline()

    response = flask.Response(response=archive, mimetype='application/octet-stream' )
    response.headers.add('Content-Disposition', 'inline; filename="%s.ovpn"' % user.name)

    return response
开发者ID:gourneau,项目名称:pritunl,代码行数:11,代码来源:key.py

示例3: user_delete

# 需要导入模块: from pritunl.organization import Organization [as 别名]
# 或者: from pritunl.organization.Organization import get_user [as 别名]
def user_delete(org_id, user_id):
    org = Organization(org_id)
    user = org.get_user(user_id)
    user_id = user.id
    user.remove()
    for server in org.get_servers():
        server_clients = server.get_clients()
        if user_id in server_clients:
            server.restart()
    return utils.jsonify({})
开发者ID:CorbettBaker-Company,项目名称:pritunl,代码行数:12,代码来源:user.py

示例4: _get_key_archive

# 需要导入模块: from pritunl.organization import Organization [as 别名]
# 或者: from pritunl.organization.Organization import get_user [as 别名]
def _get_key_archive(org_id, user_id):
    org = Organization(org_id)
    user = org.get_user(user_id)
    archive_temp_path = user.build_key_archive()

    with open(archive_temp_path, "r") as archive_file:
        response = flask.Response(response=archive_file.read(), mimetype="application/x-tar")
        response.headers.add("Content-Disposition", 'inline; filename="%s.tar"' % user.name)

    os.remove(archive_temp_path)
    return response
开发者ID:CorbettBaker-Company,项目名称:pritunl,代码行数:13,代码来源:key.py

示例5: user_delete

# 需要导入模块: from pritunl.organization import Organization [as 别名]
# 或者: from pritunl.organization.Organization import get_user [as 别名]
def user_delete(org_id, user_id):
    org = Organization(org_id)
    user = org.get_user(user_id)
    user.remove()
    return utils.jsonify({})
开发者ID:cDoru,项目名称:pritunl,代码行数:7,代码来源:user.py

示例6: user_otp_secret_delete

# 需要导入模块: from pritunl.organization import Organization [as 别名]
# 或者: from pritunl.organization.Organization import get_user [as 别名]
def user_otp_secret_delete(org_id, user_id):
    org = Organization(org_id)
    user = org.get_user(user_id)
    user.generate_otp_secret()
    return utils.jsonify({})
开发者ID:CorbettBaker-Company,项目名称:pritunl,代码行数:7,代码来源:user.py


注:本文中的pritunl.organization.Organization.get_user方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。