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


Python User.get方法代码示例

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


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

示例1: admin

# 需要导入模块: from lib.User import User [as 别名]
# 或者: from lib.User.User import get [as 别名]
def admin():
    status = ["default", "none"]
    if Configuration.loginRequired():
        if not current_user.is_authenticated():
            return render_template('login.html', status=status)
        else:
            return render_template('admin.html', status=status, stats=adminStats())
    else:
        person = User.get("_dummy_")
        login_user(person)
        return render_template('admin.html', status=status, stats=adminStats())
开发者ID:crudbug,项目名称:cve-search,代码行数:13,代码来源:index.py

示例2: login_check

# 需要导入模块: from lib.User import User [as 别名]
# 或者: from lib.User.User import get [as 别名]
def login_check():
    # validate username and password
    username = request.form.get('username')
    password = request.form.get('password')
    person = User.get(username)
    try:
        if person and pbkdf2_sha256.verify(password, person.password):
            login_user(person)
            return render_template('admin.html', status=["logged_in", "success"], stats=adminStats())
        else:
            return render_template('login.html', status=["wrong_combination", "warning"])
    except:
        return render_template('login.html', status=["outdated_database", "error"])
开发者ID:crudbug,项目名称:cve-search,代码行数:15,代码来源:index.py

示例3: login_check

# 需要导入模块: from lib.User import User [as 别名]
# 或者: from lib.User.User import get [as 别名]
def login_check():
    # validate username and password
    username = request.form.get('username')
    password = request.form.get('password')
    person = User.get(username)
    try:
        if person and pbkdf2_sha256.verify(password, person.password):
            login_user(person)
            return render_template('admin.html', status="logged_in", **adminInfo())
        else:
            return render_template('login.html', status="wrong_user_pass")
    except:
        return render_template('login.html', status="outdated_database")
开发者ID:jefflaporte,项目名称:cve-search,代码行数:15,代码来源:index.py

示例4: admin

# 需要导入模块: from lib.User import User [as 别名]
# 或者: from lib.User.User import get [as 别名]
def admin():
    if Configuration.loginRequired():
        if not current_user.is_authenticated():
            return render_template('login.html')
    else:
        person = User.get("_dummy_")
        login_user(person)
    output = None
    if os.path.isfile(Configuration.getUpdateLogFile()):
        with open(Configuration.getUpdateLogFile()) as updateFile:
            separator="==========================\n"
            output=updateFile.read().split(separator)[-2:]
            output=separator+separator.join(output)
    return render_template('admin.html', status="default", stats=adminStats(), updateOutput=filterUpdateField(output))
开发者ID:axeliniyes,项目名称:cveScript,代码行数:16,代码来源:index.py

示例5: login_check

# 需要导入模块: from lib.User import User [as 别名]
# 或者: from lib.User.User import get [as 别名]
 def login_check(self):
   # validate username and password
   username = request.form.get('username')
   password = request.form.get('password')
   person = User.get(username, self.auth_handler)
   try:
     if person and person.authenticate(password):
       login_user(person)
       return render_template('admin.html', status="logged_in", **self.adminInfo())
     else:
       return render_template('login.html', status="wrong_user_pass")
   except Exception as e:
     print(e)
     return render_template('login.html', status="outdated_database")
开发者ID:adulau,项目名称:cve-search,代码行数:16,代码来源:index.py

示例6: load_user

# 需要导入模块: from lib.User import User [as 别名]
# 或者: from lib.User.User import get [as 别名]
def load_user(id):
    return User.get(id)
开发者ID:crudbug,项目名称:cve-search,代码行数:4,代码来源:index.py

示例7: load_user

# 需要导入模块: from lib.User import User [as 别名]
# 或者: from lib.User.User import get [as 别名]
 def load_user(self, id):
   return User.get(id, self.auth_handler)
开发者ID:adulau,项目名称:cve-search,代码行数:4,代码来源:index.py


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