Example #1
0
def modifyUser(request):
    mod = usermod.UserMod()
    username = str(request.POST.get('username'))
    conditions = ['username='******'password'))
    value = [username, newpwd]
    mod.updateUser(value, conditions)
    result = {'data': 'success', 'status': 1}
    return HttpResponse(json.dumps(result), content_type='application/json')
Example #2
0
def addUser(request):
    mod = usermod.UserMod()
    username = str(request.POST.get('username'))
    userpwd = str(request.POST.get('password'))
    value = ['3', username, userpwd, '2']
    mod.addUser(value)
    mod.addUsertoadmin(username)
    path = settings.FILEPATH + "/private/" + username
    if not os.path.exists(path):
        os.makedirs(path)
    result = {'data': 'success', 'status': 1}
    return HttpResponse(json.dumps(result), content_type='application/json')
Example #3
0
def settingUser(request):
    mod = usermod.UserMod()
    sfileauth = str(request.POST.get('sfileauth'))
    wdaystarttime = str(request.POST.get('wdaystarttime'))
    wdaystoptime = str(request.POST.get('wdaystoptime'))
    wendstarttime = str(request.POST.get('wendstarttime'))
    wendstoptime = str(request.POST.get('wendstoptime'))
    limit = str(request.POST.get('limit'))
    username = str(request.POST.get('username'))
    conditions = ['username='******'data': 'success', 'status': 1}
    return HttpResponse(json.dumps(result), content_type='application/json')
Example #4
0
def userList(request):
    mod = usermod.UserMod()
    userlist = {'data': mod.getUserList(), 'status': 1}
    return HttpResponse(json.dumps(userlist), content_type='application/json')
Example #5
0
def settingDetail(request):
    mod = usermod.UserMod()
    username = str(request.GET.get('username'))
    detail = mod.selectSettingDetail(username)
    result = {'data': detail, 'status': 1}
    return HttpResponse(json.dumps(result), content_type='application/json')
Example #6
0
def updateRank(request):
    mod = usermod.UserMod()
    mod.updateRank(request)
    result = {'data': 'success', 'status': 1}
    return HttpResponse(json.dumps(result), content_type='application/json')