Show message on login page when login fails specific criteria
I need to lock certain accounts and warn people that their accounts have been locked. I added a column to the dB, AccountLocked, and added a new session variable to the SecurityAssist Authenticate User behavior for AccountLocked. I then edited the existing user rule to restrict access for those accounts when AccountLocked=1. So far so good, however I want to display a specific message on the login page to those users whose accounts have been locked, telling them what they need to do to unlock them. I added the info to the login page and wrapped it with
<?php if ($_SESSION['AccountLocked'] == "1") { // Show if ... ?> Message here <?php } // Show if column... ?>
It does work, but I added error reporting to the login page as it was taking a while to load, and the error is:
Notice: Undefined index: AccountLocked in /var/www/vhosts/[webaddress].co.uk/httpdocs/login.php on line 214
I assume this is showing because the session hasn't been set yet, so I realise I've probably set up the Show If wrongly but don't know how it should be done.