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')
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')
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')
def userList(request): mod = usermod.UserMod() userlist = {'data': mod.getUserList(), 'status': 1} return HttpResponse(json.dumps(userlist), content_type='application/json')
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')
def updateRank(request): mod = usermod.UserMod() mod.updateRank(request) result = {'data': 'success', 'status': 1} return HttpResponse(json.dumps(result), content_type='application/json')