Ejemplo n.º 1
0
 def valid_session(self, task, session, request):
     if self.admin.safe_mode:
         user_info = session['user_info']
         if not (user_info and user_info.get('user_id')):
             return False
         if not self.admin.ignore_change_ip and task != self.admin:
             ip = self.get_client_address(request);
             if not adm_server.user_valid_ip(self.admin, user_info['user_id'], ip):
                 return False
         if not self.admin.ignore_change_uuid and task != self.admin:
             if not adm_server.user_valid_uuid(self.admin, user_info['user_id'], session['uuid']):
                 return False
     return True
Ejemplo n.º 2
0
 def valid_session(self, task, session, request):
     if self.admin.safe_mode:
         user_info = session['user_info']
         if not (user_info and user_info.get('user_id')):
             return False
         if not self.admin.ignore_change_ip and task != self.admin:
             ip = self.get_client_address(request);
             if not adm_server.user_valid_ip(self.admin, user_info['user_id'], ip):
                 return False
         if not self.admin.ignore_change_uuid and task != self.admin:
             if not adm_server.user_valid_uuid(self.admin, user_info['user_id'], session['uuid']):
                 return False
     return True