2 //-------------------------------------------------------------------
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 //Author:- Author:- ViCarePlus Team, Visolve
8 //Email ID:- vicareplus_engg@visolve.com
9 //-------------------------------------------------------------------
10 // Display a message indicating that the user's password has/will expire.
11 include_once("../globals.php");
12 include_once("$srcdir/sql.inc");
13 require_once("$srcdir/translation.inc.php");
16 $q = $_SESSION["authUserID"];
17 $result = sqlStatement("select username, pwd_expiration_date from users where id = '".$q."'");
18 if($row = sqlFetchArray($result)) {
19 $pwd_expires = $row['pwd_expiration_date'];
20 $username = $row['username'];
22 $current_date = date("Y-m-d");
23 $grace_time = date("Y-m-d", strtotime($pwd_expires . "+" . $GLOBALS['password_grace_time'] . "days"));
24 $pwd_alert = date("Y-m-d", strtotime($pwd_expires . "-7 days"));
27 // Determine the expiration message to display
28 if (($pwd_expires == "0000-00-00") or ($pwd_expires == "")) {
29 $msg_alert = xl("Your Password Expired. Please change your password.");
32 else if ((strtotime($current_date) > strtotime($pwd_expires)) && ($grace_time != "") &&
33 ($pwd_expires != "") && (strtotime($current_date) < strtotime($grace_time))) {
35 //display warning if user is in grace period to change password
36 $msg_alert = xl("You are in Grace Login period. Change your password before")." ".$grace_time;
39 else if (strtotime($pwd_expires) == strtotime($current_date)) {
40 // Display warning if password expires on current day
41 $msg_alert = xl("Your Password Expires today. Please change your password.");
44 else if ((strtotime($current_date) >= strtotime($pwd_alert)) && strtotime($pwd_alert) != "") {
45 // Display a notice that password expires soon
46 $msg_alert = xl("Your Password Expires on")." ".$pwd_expires.". ".xl("Please change your password.");
54 <meta http
-equiv
="Content-Language" content
="en-us">
55 <?php
html_header_show();?
>
56 <link rel
='stylesheet' href
="<?php echo $css_header;?>" type
="text/css">
58 <body
class="body_bottom">
60 <br
/><br
/><br
/><span
class="pwdalert <?php echo $case; ?>">
61 <table align
="center" >
65 <td rowspan
="3"><?php
xl("Welcome",e
); echo " ".$username;?
>,<br
>
67 <?php
echo $msg_alert;?
>