Ejemplo n.º 1
0
 def __before__(self):
     if config['jvkk.login'] != 'yes':
         # now that we have no login controller.
         session['sr_user_id'] = 157
         session['sr_session_id'] = '__dummy__'
         session['sr_com'] = 'xray'
         s = model.Session()
         session['sr_user'] = s.query(model.User).get(session['sr_user_id'])
         session['sr_component'] = s.query(model.Component).get(
             model.Component.XrayId)
         session.save()
     else:
         # real environment
         if request.path_info == h.url_for(action='login'):
             return
         if not srutil.check_session(request, session, model.Session()):
             action = request.environ.get('PATH_INFO').split('/')[-1]
             if action not in ['background']:
                 session.clear()
                 session.save()
                 return redirect_to(config['pylons.g'].loginurl)
         session['sr_com'] = 'xray'
         s = model.Session()
         session['sr_user'] = s.query(model.User).get(session['sr_user_id'])
         session['sr_component'] = s.query(model.Component).get(
             model.Component.XrayId)
         session.save()
Ejemplo n.º 2
0
 def __before__(self):
     if config['jvkk.login'] != 'yes':
         # now that we have no login controller.
         session['sr_user_id'] = 157
         session['sr_session_id'] = '__dummy__'
         session.save()
     else:
         # real environment
         if request.path_info == h.url_for(action='login'):
             return
         if not srutil.check_session(request, session, model.Session()):
             session.clear()
             session.save()
             return redirect_to(config['pylons.g'].loginurl)
Ejemplo n.º 3
0
 def __before__(self):
     if config['jvkk.login'] != 'yes':
         # now that we have no login controller.
         session['sr_user_id'] = 157
         session['sr_session_id'] = 'dummysessionvalue'
         session.save()
     else:
         # real environment
         if request.path_info == h.url_for(action='login'):
             return
         if not srutil.check_session(request, session, model.Session()):
             action = request.environ.get('PATH_INFO').split('/')[-1]
             if action not in [
                     'get_result', 'test_result', 'cure_result',
                     'get_used_tools', 'get_req_test_reason',
                     'get_req_test_item'
             ]:
                 session.clear()
                 session.save()
                 return redirect_to(config['pylons.g'].loginurl)