LP#1013786: Suggest password change on login if 4 digit PIN
authorJeff Godin <jgodin@tadl.org>
Thu, 29 Nov 2012 21:53:36 +0000 (16:53 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 27 Oct 2020 18:46:52 +0000 (14:46 -0400)
Suggest that the user change their password at login if the password
is a four digit PIN. Do this by redirecting to the update_password
page with a CGI param to trigger an optional message.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm

index 907ae8b..e7e6148 100644 (file)
@@ -625,6 +625,14 @@ sub load_login {
         )
     ];
 
+    # test for four-digit PIN as password -- suggest password change
+    if ($password =~ m/^\d{4}$/) {
+        my $update_password = sprintf(
+                'https://%s%s/myopac/update_password?initial=1',
+                $self->apache->hostname, $self->ctx->{opac_root} );
+        return $self->generic_redirect($update_password, $cookies);
+    }
+
     if ($client_tz) {
         # contains the client's tz, as passed by the client
         # trigger a redirect to https