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
23 $fake_register_globals=false;
24 $sanitize_all_escapes=true;
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'];
35 $current_date = date("Y-m-d");
36 $grace_time = date("Y-m-d", strtotime($pwd_expires . "+" . $GLOBALS['password_grace_time'] . "days"));
37 $pwd_alert = date("Y-m-d", strtotime($pwd_expires . "-7 days"));
40 // Determine the expiration message to display
41 if (($pwd_expires == "0000-00-00") or ($pwd_expires == "")) {
42 $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))) {
48 //display warning if user is in grace period to change password
49 $msg_alert = xl("You are in Grace Login period. Change your password before")." ".$grace_time;
52 else if (strtotime($pwd_expires) == strtotime($current_date)) {
53 // Display warning if password expires on current day
54 $msg_alert = xl("Your Password Expires today. Please change your password.");
57 else if ((strtotime($current_date) >= strtotime($pwd_alert)) && strtotime($pwd_alert) != "") {
58 // Display a notice that password expires soon
59 $msg_alert = xl("Your Password Expires on")." ".$pwd_expires.". ".xl("Please change your password.");
67 <meta http
-equiv
="Content-Language" content
="en-us">
68 <?php
html_header_show();?
>
69 <link rel
='stylesheet' href
="<?php echo $css_header;?>" type
="text/css">
71 <body
class="body_bottom">
73 <br
/><br
/><br
/><span
class="pwdalert <?php echo attr($case); ?>">
74 <table align
="center" >
78 <td rowspan
="3"><?php
echo xlt("Welcome"); echo " ".text($username);?
>,<br
>
80 <?php
echo text($msg_alert);?
>