From 7aaf82e266f928e2205f8d9958ef1d483bf273b5 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 13 Feb 2013 17:43:31 +0000 Subject: [PATCH] Pass username to get_policy helps a lot. --- Webperl/Block.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Webperl/Block.pm b/Webperl/Block.pm index 8a3fc2c..947df7a 100644 --- a/Webperl/Block.pm +++ b/Webperl/Block.pm @@ -401,8 +401,11 @@ sub build_password_policy { # Anonymous user can have no policy return '' if($self -> {"session"} -> anonymous_session()); + my $user = $self -> {"session"} -> get_user_byid() + or return ''; + # Fetch the policy, and give up if there isn't one. - my $policy = $self -> {"session"} -> {"auth"} -> get_policy() + my $policy = $self -> {"session"} -> {"auth"} -> get_policy($user -> {"username"}) or return ''; my $policystr = "";