Beispiel #1
0
def signup(request, *args, **kwargs):
    if request.POST.get("signup") :
        response = userCreate(request.POST)
       
        if response["code"] == 0 :
            login(request, response["user"])
            return redirect("/")
        else :
            response["isAdmin"] = False
            return HttpResponse(render(request, "user_register.html", response ))
        
    else :
        return HttpResponse(render(request, "user_register.html", _getContext(request) ))
Beispiel #2
0
def signup(request, *args, **kwargs):
    if request.POST.get("signup"):
        response = userCreate(request.POST)

        if response["code"] == 0:
            login(request, response["user"])
            return redirect("/")
        else:
            response["isAdmin"] = False
            return HttpResponse(render(request, "user_register.html",
                                       response))

    else:
        return HttpResponse(
            render(request, "user_register.html", _getContext(request)))
def userNew(request, *args, **kwargs):
    context = {}
    userinfo = UserInfo.getUserInfo(request)
    
    if request.POST.get("signup") :
        response = userCreate(request.POST, userinfo.isAdmin())
       
        if response["code"] == 0 :
            context["code"]     = 0
            context["message"]  = "사용자 {0} 이(가) 등록되었습니다.".format(response["username"])
        else :
            response["isAdmin"] = userinfo.isAdmin()
            return HttpResponse(render(request, "admin_user_new.html", response ))
        
    context["isAdmin"]  = userinfo.isAdmin()
    return HttpResponse(render(request, "admin_user_new.html", context))
Beispiel #4
0
def userNew(request, *args, **kwargs):
    context = {}
    userinfo = UserInfo.getUserInfo(request)

    if request.POST.get("signup"):
        response = userCreate(request.POST, userinfo.isAdmin())

        if response["code"] == 0:
            context["code"] = 0
            context["message"] = "사용자 {0} 이(가) 등록되었습니다.".format(
                response["username"])
        else:
            response["isAdmin"] = userinfo.isAdmin()
            return HttpResponse(
                render(request, "admin_user_new.html", response))

    context["isAdmin"] = userinfo.isAdmin()
    return HttpResponse(render(request, "admin_user_new.html", context))