3 * Display a message indicating that the user's password has/will expire.
5 * Copyright 2010 ViCarePlus Team, Visolve <vicareplus_engg@visolve.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @author ViCarePlus Team, Visolve <vicareplus_engg@visolve.com>
20 * @link http://www.open-emr.org
26 include_once("../globals.php");
29 $q = $_SESSION["authUserID"];
30 $result = sqlStatement("select username, pwd_expiration_date from users where id = ?", array($q));
31 if ($row = sqlFetchArray($result)) {
32 $pwd_expires = $row['pwd_expiration_date'];
33 $username = $row['username'];
36 $current_date = date("Y-m-d");
37 $grace_time = date("Y-m-d", strtotime($pwd_expires . "+" . $GLOBALS['password_grace_time'] . "days"));
38 $pwd_alert = date("Y-m-d", strtotime($pwd_expires . "-7 days"));
41 // Determine the expiration message to display
42 if (($pwd_expires == "0000-00-00") or ($pwd_expires == "")) {
43 $msg_alert = xl("Your Password Expired. Please change your password.");
45 } else if ((strtotime($current_date) > strtotime($pwd_expires)) && ($grace_time != "") &&
46 ($pwd_expires != "") && (strtotime($current_date) < strtotime($grace_time))) {
47 //display warning if user is in grace period to change password
48 $msg_alert = xl("You are in Grace Login period. Change your password before")." ".$grace_time;
50 } else if (strtotime($pwd_expires) == strtotime($current_date)) {
51 // Display warning if password expires on current day
52 $msg_alert = xl("Your Password Expires today. Please change your password.");
54 } else if ((strtotime($current_date) >= strtotime($pwd_alert)) && strtotime($pwd_alert) != "") {
55 // Display a notice that password expires soon
56 $msg_alert = xl("Your Password Expires on")." ".$pwd_expires.". ".xl("Please change your password.");
64 <meta http
-equiv
="Content-Language" content
="en-us">
65 <?php
html_header_show();?
>
66 <link rel
='stylesheet' href
="<?php echo $css_header;?>" type
="text/css">
68 <body
class="body_bottom">
70 <br
/><br
/><br
/><span
class="pwdalert <?php echo attr($case); ?>">
71 <table align
="center" >
75 <td rowspan
="3"><?php
echo xlt("Welcome");
76 echo " ".text($username);?
>,<br
>
78 <?php
echo text($msg_alert);?
>