comparison Lib/IMPL/Security/AbstractContext.pm @ 238:b8c724f6de36

DOM model refactoring TT view refactoring, controls are no longer derived from DOM nodes bugfixes
author sergey
date Tue, 16 Oct 2012 01:33:06 +0400
parents 6d8092d8ce1b
children 2879cdb6b8cd
comparison
equal deleted inserted replaced
237:61db68166c37 238:b8c724f6de36
17 ]); 17 ]);
18 18
19 my $current; # current session if any 19 my $current; # current session if any
20 20
21 sub Impersonate { 21 sub Impersonate {
22 my ($this,$code) = @_; 22 my ($this,$code,@args) = @_;
23 23
24 my $old = $current; 24 my $old = $current;
25 $current = $this; 25 $current = $this;
26 my $result; 26 my $result;
27 my $e; 27 my $e;
28 28
29 { 29 {
30 local $@; 30 local $@;
31 eval { 31 eval {
32 $result = $code->(); 32 $result = $code->(@args);
33 }; 33 };
34 $e = $@; 34 $e = $@;
35 } 35 }
36 $current = $old; 36 $current = $old;
37 if($e) { 37 if($e) {