Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Admin Password Change Alert Message Display -- Support Thread

    Now that 1.5.0 is available, your admin users might have noticed that their password must be changed within 90 days but there's no way for them to tell when they last changed it!

    This small add-on displays the currently signed-on admin's "last password change date" within the header of the admin page. Simply copy two files to your shop's admin directory and you're good to go!

    The add-on is now available for download: http://www.zen-cart.com/index.php?ma...oducts_id=2064

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    An updated v1.1.0 is now available from the Free Software Add Ons area. I've updated the display to show, for the currently logged-in admin, the last time his/her password was changed and the date and IP address associated with that admin's previous login.

  3. #3
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Very good plug-in. I would like to change the order of date time: At the moment its says '2013-08-06 15:10:49' I would like to change it to something like '08-September-2013 @ 15:10'

    Thanks in advance

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Look at the block of code added to /YOUR_ADMIN/includes/header.php, starting at line 211:
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . $adminInfo['pwd_last_change_date']; ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9
    and change that to
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . substr($adminInfo['pwd_last_change_date'], 0, 10) . ' @ ' . substr($adminInfo['pwd_last_change_date'], 11, 5); ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9

  5. #5
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Quote Originally Posted by lat9 View Post
    Look at the block of code added to /YOUR_ADMIN/includes/header.php, starting at line 211:
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . $adminInfo['pwd_last_change_date']; ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9
    and change that to
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . substr($adminInfo['pwd_last_change_date'], 0, 10) . ' @ ' . substr($adminInfo['pwd_last_change_date'], 11, 5); ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9
    Thanks for the code.

    The date is still wrong way round.

    It is displayed: 2013-08-06
    I would like it 06-08-2013 however like 6 August 2013

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    OK, let's try like this:
    Code:
    //-bof-lat9 Display last password change and login
      if (function_exists('zen_get_admin_name') && function_exists('zen_read_user')) {
        $adminInfo = zen_read_user(zen_get_admin_name($_SESSION['admin_id']));
        $year = substr($adminInfo['pwd_last_change_date'], 0, 4);
        $month = substr($adminInfo['pwd_last_change_date', 5, 2);
        $day = substr($adminInfo['pwd_last_change_date', 8, 2);
        $hour = substr($adminInfo['pwd_last_change_date', 11, 2);
        $minute = substr($adminInfo['pwd_last_change_date', 14, 2);
        $second = substr($adminInfo['pwd_last_change_date, 17, 2);
        $timestamp = mktime($hour, $minute, $second, $month, $day, $year);
    ?>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_PASSWORD_LAST_CHANGE . strftime('%d-%B-%Y @ %H:%M', $timestamp); ?></td>
      </tr>
      <tr>
        <td align="right" class="main" valign="top"><?php echo TEXT_LAST_LOGIN_INFO . $_SESSION['last_login_date'] . ' [' . $_SESSION['last_login_ip'] . ']'; ?></td>
    <?php
      }
    //-eof-lat9
    The format I chose for strftime will output something similar to '14-September-2013 @ 12:25'. There are many, many more formatting options available for the strftime function (http://us2.php.net/manual/en/function.strftime.php)!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Quote Originally Posted by lat9 View Post
    Now that 1.5.0 is available, your admin users might have noticed that their password must be changed within 90 days but there's no way for them to tell when they last changed it!
    2 Questions:
    1. But ... why do they need to know "when they last changed it"?
    2. You said "must be changed within 90 days". But, that's not correct. The system will auto-prompt them to set new password after 90 days is up. It won't suddenly "lock them out because they forgot to change it in time".

    The sites where I've seen this mod installed make the admin home screen seem like there will be sudden doom if they don't pay careful attention to changing their password "in the nick of time". But that's the wrong concept. Passwords are tough enough to manage without creating alarm and fear of getting locked out because they weren't watching the calendar.

    Other than dropping PCI rules altogether, how can the system be changed so that there's no need for this plugin?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    Quote Originally Posted by DrByte View Post
    2 Questions:
    1. But ... why do they need to know "when they last changed it"?
    2. You said "must be changed within 90 days". But, that's not correct. The system will auto-prompt them to set new password after 90 days is up. It won't suddenly "lock them out because they forgot to change it in time".

    The sites where I've seen this mod installed make the admin home screen seem like there will be sudden doom if they don't pay careful attention to changing their password "in the nick of time". But that's the wrong concept. Passwords are tough enough to manage without creating alarm and fear of getting locked out because they weren't watching the calendar.

    Other than dropping PCI rules altogether, how can the system be changed so that there's no need for this plugin?
    1) I modeled this plugin after a similar display that one of my banks uses. They, too, have a "change your password every 90 days" requirement and I've found it useful (I log into the account once a week) to "know" that I'm going to need to have a new password ready for next week's login (kind of a heads-up).
    2) The wording (and I've not reviewed the plugin's readme ) was based on my initial reading at the introduction of the feature in ZC v1.5.0 (about 3 years ago). When installed, the plugin adds 2 items to the header, indicating the date the password was last changed and the IP address of the last login using their account -- I'm missing the doom and gloom there.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    My point about doom and gloom is partially the wording but also the big bold front-and-center alert that draws the eye to that message as though it's a crucial urgent warning.

    In 1.6.0 we've changed the wording of all the password-expiry stuff so that it's better understood by the lay person, who has no concept of what "password expiry" has been about for the past 20 years.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Admin Password Change Alert Message Display -- Support Thread

    I have also seen systems (perhaps only described), regardless of when the password is due to change provide such, last whatever time (login, password change, etc) to allow the individual looking at the information to identify if there was a "human" issue such as someone else logging in or changing the password and then basically changing it back without covering all of their tracks...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Display Log Files [Support Thread] (v1.5.1-to-v1.5.6)
    By lat9 in forum Addon Admin Tools
    Replies: 94
    Last Post: 25 Dec 2021, 07:02 PM
  2. v151 Password Protect Categories by Ausgirl [Support Thread]
    By Ausgirl in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 20 Feb 2016, 06:33 PM
  3. Password Protected Categories (PPC) - Support Thread
    By stevish in forum All Other Contributions/Addons
    Replies: 31
    Last Post: 29 Sep 2012, 09:23 PM
  4. Message/Alert back grounds - how do I change?
    By Tomjoolery in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Oct 2008, 02:16 PM
  5. Change Alert Message text /box color
    By WebElements in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Oct 2008, 07:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg