4 * Display a message indicating that the user's password has/will expire.
7 * @link http://www.open-emr.org
8 * @author ViCarePlus Team, Visolve <vicareplus_engg@visolve.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2010 ViCarePlus Team, Visolve <vicareplus_engg@visolve.com>
11 * @copyright Copyright (c) 2018-2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
17 use OpenEMR\Common\Auth\AuthUtils
;
18 use OpenEMR\Common\Csrf\CsrfUtils
;
19 use OpenEMR\Core\Header
;
21 if (AuthUtils
::useActiveDirectory()) {
22 // this user should never of been directed to this screen
23 die(xlt('Not Applicable'));
26 if (!CsrfUtils
::verifyCsrfToken($_GET["csrf_token_form"])) {
27 CsrfUtils
::csrfNotVerified();
30 $result = privQuery("select `last_update_password` from `users_secure` where `id` = ?", [$_SESSION["authUserID"]]);
31 $current_date = date("Y-m-d");
32 $pwd_expires = date("Y-m-d", strtotime($result['last_update_password'] . "+" . $GLOBALS['password_expiration_days'] . " days"));
33 $grace_time = date("Y-m-d", strtotime($pwd_expires . "+" . $GLOBALS['password_grace_time'] . " days"));
35 // Determine the expiration message to display
36 // (note that user can not even get to this screen if credentials are expired)
38 if (strtotime($current_date) > strtotime($pwd_expires)) {
39 //display warning if user is in grace period to change password
40 $msg_alert = xl("Change your password before it expires on") . " " . oeFormatShortDate($grace_time);
41 } else { // strtotime($pwd_expires) == strtotime($current_date)
42 // Display warning if password expires on current day
43 $msg_alert = xl("Your password expires today. Please change your password now.");
49 <?php Header
::setupHeader(); ?
>
50 <title
><?php
echo xlt('Password Expiration'); ?
></title
>
52 <body
class="body_top">
53 <div
class="container">
55 <div
class="col-sm-12">
56 <div
class="alert alert-danger" role
="alert"><?php
echo text($msg_alert);?
></div
>
60 <div
class="col-sm-12">
61 <a href
="../usergroup/user_info.php" class="btn btn-secondary btn-transmit" onclick
="top.restoreSession()"><?php
echo xlt("Change Password");?
></a
>