Пример #1
0
 def admin_user_edit(self):
     '''
     admin user page
     :return: template
     '''
     id = self.data.get_request_parameter("km_user_edit_id");
     self.result['menu_list'] = get_menu_list()
     self.result['user'] = KMUser.get(id)
Пример #2
0
 def save_user(cls, data):
     id = data.get_request_parameter("id")
     delete = data.get_request_parameter("delete", default=None)
     if delete is None:
         user = KMUser.get(id)
         user.set_data(data)
         user.save()
     else:
         KMUser.delete_by_id(id)
Пример #3
0
 def admin_user_edit(self):
     '''
     admin user page
     :return: template
     '''
     id = self.data.get_request_parameter("km_user_edit_id")
     self.result['menu_list'] = get_menu_list()
     self.result['user'] = KMUser.get(id)
     self.result['groups'] = KMGroup.all()
     self.result['roles'] = KMRole.all()
Пример #4
0
 def wrapper(*args, **kwargs):
     user_id = get_value_to_session(request, 'user_id')
     if user_id is not None:
         user = KMUser.get(user_id)
         user_id = user.id
         role = KMRole(user_id)
         if check_target(request, role):
             return callback(*args, **kwargs)
         else:
             # TODO: 例外スロー時にエラー画面に遷移するようにする
             return "<p>Access is not allowed!</p>"
Пример #5
0
 def admin_user_save(self):
     '''
     admin user page
     :return: template
     '''
     id = self.data.get_request_parameter("id")
     delete = self.data.get_request_parameter("delete", default=None)
     if delete is None:
         user = KMUser.get(id)
         user.set_data(self.data)
         user.save()
     else:
         KMUser.delete_by_id(id)
     self.result['menu_list'] = get_menu_list()
     self.result['users'] = KMUser.all()
Пример #6
0
 def admin_user_save(self):
     '''
     admin user page
     :return: template
     '''
     id = self.data.get_request_parameter("id");
     delete = self.data.get_request_parameter("delete", default=None);
     if delete is None:
         user = KMUser.get(id)
         user.set_data(self.data)
         user.save()
     else:
         KMUser.delete_by_id(id)
     self.result['menu_list'] = get_menu_list()
     self.result['users'] = KMUser.all()