From c5c8f1089bce1d2d58521df64de4dbee075362be Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Tue, 29 Apr 2014 12:24:34 +0200 Subject: [PATCH] MT#6789 Add switch to allow anonymous pwd recovery --- lib/NGCP/Panel/Controller/Subscriber.pm | 3 +++ ngcp_panel.conf | 1 + share/templates/login/login.tt | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index 5415a9c998..774dd4625d 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -584,6 +584,9 @@ sub reset_webpassword :Chained('base') :PathPart('resetwebpassword') :Args(0) { sub reset_webpassword_nosubscriber :Chained('/') :PathPart('resetwebpassword') :Args(0) { my ($self, $c) = @_; + $c->detach('/denied_page') + unless($c->config->{security}->{password_allow_recovery}); + my $posted = $c->req->method eq "POST"; my $form = NGCP::Panel::Form::Subscriber::RecoverPassword->new; my $params = {}; diff --git a/ngcp_panel.conf b/ngcp_panel.conf index c6bdcb1f74..25433a2122 100644 --- a/ngcp_panel.conf +++ b/ngcp_panel.conf @@ -76,6 +76,7 @@ log4perl.appender.Default.layout.ConversionPattern=%d{ISO8601} [%p] [%F +%L] %m{ password_musthave_uppercase 0 password_musthave_digit 0 password_musthave_specialchar 0 + password_allow_recovery 0 diff --git a/share/templates/login/login.tt b/share/templates/login/login.tt index 9b75f686df..871bec0ab1 100644 --- a/share/templates/login/login.tt +++ b/share/templates/login/login.tt @@ -29,7 +29,7 @@ -%] [% c.loc('Go to [_1] login.', links.join(c.loc(' or '))) %]
- [% IF realm == 'subscriber' -%] + [% IF realm == 'subscriber' && c.config.security.password_allow_recovery -%] [% c.loc('Forgot your password?') %] [% c.loc('Reset Password') %].
[% END -%]