Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    9,655
    Plugin Contributions
    73

    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
    9,655
    Plugin Contributions
    73

    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
    819
    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
    9,655
    Plugin Contributions
    73

    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
    819
    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
    9,655
    Plugin Contributions
    73

    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
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    819
    Plugin Contributions
    2

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

    Thanks for the link. A bit of light reading for bedtime. I will get back when I get the changes done and paste the code in here.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    9,655
    Plugin Contributions
    73

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

    Thanks to mprough for submitting an updated version (v1.1.0) that includes the Zen Cart v1.5.3 changes.

    Please Note: Due to the password-related changes (and new functions introduced) in Zen Cart v1.5.3, this version will work only on Zen Cart v1.5.3 installations. Please continue to use v1.0.0 on Zen Cart v1.5.0 through v1.5.2 installations.

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    9,655
    Plugin Contributions
    73

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

    v1.1.2 is now available from the Plugins area. The update provides downwardly-compatible changes required for Zen Cart v1.5.4.

  10. #10
    Join Date
    Jan 2004
    Posts
    65,410
    Blog Entries
    7
    Plugin Contributions
    232

    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.

 

 
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: 88
    Last Post: 1 Feb 2020, 05:43 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

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR