Ejemplo n.º 1
0
 def _logout(self, request):
     from hijack.helpers import release_hijack
     # Release masquerade on logout if masquerading
     try:
         release_hijack(request)
     except PermissionDenied:  # Means we are not hijacked
         super()._logout(request)
Ejemplo n.º 2
0
 def post(self, request, *args, **kwargs):
     impersonated = request.user
     release_hijack(request)
     request.user.log_action('pretix.control.auth.user.impersonate_stopped',
                             user=request.user,
                             data={
                                 'other': impersonated.pk,
                                 'other_email': impersonated.email
                             })
     return redirect(reverse('control:index'))
Ejemplo n.º 3
0
    def endmasquerade(self, request):
        from hijack.helpers import release_hijack

        if request.method != 'POST':
            raise BinderMethodNotAllowed()

        self._require_model_perm('unmasquerade', request)

        release_hijack(request)  # Ignore returned redirect response object
        return self.respond_with_user(request, request.user.id)
Ejemplo n.º 4
0
    def post(self, request, *args, **kwargs):
        impersonated = request.user
        hijs = request.session['hijacker_session']
        release_hijack(request)
        ss = request.user.get_active_staff_session(hijs)
        if ss:
            request.session.save()
            ss.session_key = request.session.session_key
            ss.save()

        request.user.log_action('pretix.control.auth.user.impersonate_stopped',
                                user=request.user,
                                data={
                                    'other': impersonated.pk,
                                    'other_email': impersonated.email
                                })
        return redirect(reverse('control:index'))
Ejemplo n.º 5
0
    def post(self, request, *args, **kwargs):
        impersonated = request.user
        hijs = request.session['hijacker_session']
        release_hijack(request)
        ss = request.user.get_active_staff_session(hijs)
        if ss:
            request.session.save()
            ss.session_key = request.session.session_key
            ss.save()

        request.user.log_action('pretix.control.auth.user.impersonate_stopped',
                                user=request.user,
                                data={
                                    'other': impersonated.pk,
                                    'other_email': impersonated.email
                                })
        return redirect(reverse('control:index'))
Ejemplo n.º 6
0
def end_su(request):
    return hijack.release_hijack(request)
Ejemplo n.º 7
0
def end_su(request):
    return hijack.release_hijack(request)