projects
/
plack-app-gruntmaster.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c534387
)
Cache remote_user per-request
author
Marius Gavrilescu
<marius@ieval.ro>
Sun, 29 Mar 2015 20:08:17 +0000
(23:08 +0300)
committer
Marius Gavrilescu
<marius@ieval.ro>
Wed, 12 Aug 2015 15:15:13 +0000
(18:15 +0300)
lib/Plack/App/Gruntmaster.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/App/Gruntmaster.pm
b/lib/Plack/App/Gruntmaster.pm
index 1af76d0c14072c2696922b3d892e9034fc636df6..d48166ef714a24ba4353221687ba1ec8f7e78bc9 100644
(file)
--- a/
lib/Plack/App/Gruntmaster.pm
+++ b/
lib/Plack/App/Gruntmaster.pm
@@
-44,9
+44,12
@@
my ($env, $privacy);
sub db { $env->{'gruntmaster.dbic'} }
sub remote_user {
- my $user = $env->{REMOTE_USER};
- $user &&= db->user_entry($user);
- $user
+ unless ($env->{'gruntmaster.user'}) {
+ my $user = $env->{REMOTE_USER};
+ $user &&= db->user_entry($user);
+ $env->{'gruntmaster.user'} = $user;
+ }
+ $env->{'gruntmaster.user'}
}
sub admin { remote_user && remote_user->{admin} }
This page took
0.009892 seconds
and
4
git commands to generate.