Exemple #1
0
    def POST(self):
        '''
		'''
        self.id = web.input().authorityId
        self.temp = web.input(menuId4=False).menuId4
        self.selectMenuId = []
        self.text = web.input().text
        self.menuAll = MenuManagement.selectAll()
        for item in self.menuAll:
            temp = None
            exec('temp=web.input(menuId%d=False).menuId%d' %
                 (item["menuId"], item["menuId"]))
            if temp == "on":
                self.selectMenuId.append(item["menuId"])

        if self.id == "":
            # 新建数据
            Logger.info('新建数据')
            self.id = AuthorityManagement.createAuthority(self.text)
            '''
			for item in self.menuAll:
				self.dictMenuAuthority[item['menuId']] = ""
			'''

        else:
            # 更新数据
            Logger.info('更新数据')

            AuthorityManagement.updateAuthority(self.id, self.text,
                                                self.selectMenuId)

        # return Common.render.authority.modify(self)
        return web.seeother('/authority/modify?id=' + str(self.id))
Exemple #2
0
	def POST(self):
		'''
		'''
		self.id = web.input().authorityId
		self.temp = web.input(menuId4=False).menuId4
		self.selectMenuId = [];
		self.text = web.input().text
		self.menuAll = MenuManagement.selectAll()
		for item in self.menuAll:
			temp = None
			exec('temp=web.input(menuId%d=False).menuId%d' % (item["menuId"], item["menuId"]))
			if temp == "on":
				self.selectMenuId.append(item["menuId"])

		if self.id == "":
			# 新建数据
			Logger.info('新建数据')
			self.id = AuthorityManagement.createAuthority(self.text)

			'''
			for item in self.menuAll:
				self.dictMenuAuthority[item['menuId']] = ""
			'''
			
		else:
			# 更新数据
			Logger.info('更新数据')
			
			AuthorityManagement.updateAuthority(self.id, self.text, self.selectMenuId)
			
		# return Common.render.authority.modify(self)
		return web.seeother('/authority/modify?id=' + str(self.id))
Exemple #3
0
	def POST(self):
		'''
		'''
		self.authorityId = web.input().rdoAuthroity
		self.userName = web.input().hidUserName
		AuthorityManagement.replaceAuthority(userName=self.userName, authorityId=self.authorityId)
		return web.seeother('/userInfo/authority?un=' + str(self.userName))
Exemple #4
0
	def GET(self):
		'''
		'''
		urlParam = web.input(un=None)
		self.userName = urlParam.un
		self.authorityList = AuthorityManagement.selectAll("")
		self.authorityId = AuthorityManagement.selectAuthorityByUserName(self.userName)
		for item in self.authorityList:
			if self.authorityId !=[] and item['id'] == self.authorityId['authorityId']:
				item['checked'] = 'checked'
			else:
				item['checked'] = ''
		
		return Common.render.userInfo.authority(self)
Exemple #5
0
	def GET(self):
		'''
		'''
		urlParam = web.input(id=None)
		self.id = urlParam.id
		'''
		self.menuAll = MenuManagement.selectAll()
		for item in self.menuAll:
			self.dictMenuAuthority[item['menuId']] = ""
		'''
		if self.id == None:
			self.id = ""
			self.menuAll = []
			self.text = ""
		else:
			self.menuAuthority = AuthorityManagement.selectAuthorityById(self.id)
			self.text = self.menuAuthority[0]["comment"]
			self.menuAll = MenuManagement.selectAll()
			for item in self.menuAll:
				self.dictMenuAuthority[item['menuId']] = ""
				
			for item in self.menuAuthority:
				self.dictMenuAuthority[item['menuId']] = 'checked'
		
		return Common.render.authority.modify(self)
Exemple #6
0
	def POST(self):
		'''
		'''
		# 获取用户列表
		self.text = web.input().text
		self.authorityList = AuthorityManagement.selectAll(self.text)
		return Common.render.authority.list(self)
Exemple #7
0
    def POST(self):
        '''
		'''
        # 获取用户列表
        self.text = web.input().text
        self.authorityList = AuthorityManagement.selectAll(self.text)
        return Common.render.authority.list(self)
Exemple #8
0
    def GET(self):
        '''
		'''
        urlParam = web.input(id=None)
        self.id = urlParam.id
        '''
		self.menuAll = MenuManagement.selectAll()
		for item in self.menuAll:
			self.dictMenuAuthority[item['menuId']] = ""
		'''
        if self.id == None:
            self.id = ""
            self.menuAll = []
            self.text = ""
        else:
            self.menuAuthority = AuthorityManagement.selectAuthorityById(
                self.id)
            self.text = self.menuAuthority[0]["comment"]
            self.menuAll = MenuManagement.selectAll()
            for item in self.menuAll:
                self.dictMenuAuthority[item['menuId']] = ""

            for item in self.menuAuthority:
                self.dictMenuAuthority[item['menuId']] = 'checked'

        return Common.render.authority.modify(self)
Exemple #9
0
 def POST(self):
     if self.register_form().validates():
         # 登陆验证
         userName = web.input().userName
         password = web.input().password
         if AuthorityManagement.login(userName, password):
             # 登录成功
             return web.seeother('/')
         else:
             # 登录失败
             return Common.render.login(self.register_form())
     else:
         # 输入错误
         print "输入错误"
         return Common.render.login(self.register_form())
Exemple #10
0
	def POST(self):
		if self.register_form().validates():
			# 登陆验证
			userName = web.input().userName
			password = web.input().password
			if AuthorityManagement.login(userName, password):
				# 登录成功
				return web.seeother('/')
			else:
				# 登录失败
				return Common.render.login(self.register_form())
		else:
			# 输入错误
			print "输入错误"
			return Common.render.login(self.register_form())