Пример #1
0
def register(request):
    """
        超级管理员注册
    """
    super_manager = mysql_game_manager.get_super_manager()
    if not super_manager:
        if request.method == "POST":
            account = request.POST.get('account')
            password = request.POST.get('password')
            re_password = request.POST.get('re_password')
            name = request.POST.get('name')
            description = request.POST.get('description')

            if password != re_password:
                return render_to_response("auth/register.html", {'status': 1},
                                          RequestContext(request))
            else:
                _gm = GameManager()
                _gm.account = account
                _gm.password = password
                _gm.name = name
                _gm.description = description
                _gm.permissions = 'Super'
                mysql_game_manager.insert_game_manager(_gm)
                # 操作日志记录
                insert_action_super_manager_register(_gm)
                return HttpResponseRedirect(game_manage_define.MAIN_URL)
        else:
            return render_to_response("auth/register.html", {},
                                      RequestContext(request))
    else:
        return HttpResponseRedirect(game_manage_define.MAIN_URL + "/login/")
Пример #2
0
def register(request):
    """
        超级管理员注册
    """
    super_manager = mysql_game_manager.get_super_manager()
    if not super_manager:
        if request.method == "POST":
            account = request.POST.get('account')
            password = request.POST.get('password')
            re_password = request.POST.get('re_password')
            name = request.POST.get('name')
            description = request.POST.get('description')

            if password != re_password:
                return render_to_response("auth/register.html", {'status': 1}, RequestContext(request))
            else:
                _gm = GameManager()
                _gm.account = account
                _gm.password = password
                _gm.name = name
                _gm.description = description
                _gm.permissions = 'Super'
                mysql_game_manager.insert_game_manager(_gm)
                # 操作日志记录
                insert_action_super_manager_register(_gm)
                return HttpResponseRedirect(game_manage_define.MAIN_URL)
        else:
            return render_to_response("auth/register.html", {}, RequestContext(request))
    else:
        return HttpResponseRedirect(game_manage_define.MAIN_URL + "/login/")
Пример #3
0
def index(request):
    """
        index
    """
    super_manager = mysql_game_manager.get_super_manager()
    if not super_manager:
        return HttpResponseRedirect(game_manage_define.MAIN_URL + "/register/")
    else:
        return HttpResponseRedirect(game_manage_define.MAIN_URL + "/login/")
Пример #4
0
def index(request):
    """
        index
    """
    super_manager = mysql_game_manager.get_super_manager()
    if not super_manager:
        return HttpResponseRedirect(game_manage_define.MAIN_URL + "/register/")
    else:
        return HttpResponseRedirect(game_manage_define.MAIN_URL + "/login/")