2 // Copyright (C) 2011 Cassian LUP <cassi.lup@gmail.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 //setting the session & other config options
12 //don't require standard openemr authorization in globals.php
15 //SANITIZE ALL ESCAPES
16 $fake_register_globals=false;
18 //STOP FAKE REGISTER GLOBALS
19 $sanitize_all_escapes=true;
22 require_once('../interface/globals.php');
23 require_once("$srcdir/sha1.js");
26 //exit if portal is turned off
27 if ( !(isset($GLOBALS['portal_onsite_enable'])) ||
!($GLOBALS['portal_onsite_enable']) ) {
28 echo htmlspecialchars( xl('Patient Portal is turned off'), ENT_NOQUOTES
);
32 // security measure -- will check on next page.
33 $_SESSION['itsme'] = 1;
39 <title
><?php
echo htmlspecialchars( xl('Access your patient information'), ENT_NOQUOTES
); ?
></title
>
41 <script type
="text/javascript" src
="../library/js/jquery-1.5.js"></script
>
42 <script type
="text/javascript" src
="../library/js/jquery.gritter.min.js"></script
>
44 <link rel
="stylesheet" type
="text/css" href
="css/jquery.gritter.css" />
45 <link rel
="stylesheet" type
="text/css" href
="css/base.css" />
47 <script type
="text/javascript">
51 alert ('<?php echo addslashes( xl('Field(s
) are missing
!') ); ?>');
54 document
.getElementById('code').value
= SHA1(document
.getElementById('pass').value
);
55 document
.getElementById('pass').value
='';
59 if (document
.getElementById('uname').value
== "") {
60 document
.getElementById('uname').style
.border
= "1px solid red";
63 if (document
.getElementById('pass').value
== "") {
64 document
.getElementById('pass').style
.border
= "1px solid red";
69 function process_new_pass() {
71 if (!(validate_new_pass())) {
72 alert ('<?php echo addslashes( xl('Field(s
) are missing
!') ); ?>');
75 if (document
.getElementById('pass_new').value
!= document
.getElementById('pass_new_confirm').value
) {
76 alert ('<?php echo addslashes( xl('The
new password fields are not the same
.') ); ?>');
79 if (document
.getElementById('pass').value
== document
.getElementById('pass_new').value
) {
80 alert ('<?php echo addslashes( xl('The
new password can not be the same
as the current password
.') ); ?>');
83 document
.getElementById('code').value
= SHA1(document
.getElementById('pass').value
);
84 document
.getElementById('pass').value
='';
85 document
.getElementById('code_new').value
= SHA1(document
.getElementById('pass_new').value
);
86 document
.getElementById('pass_new').value
='';
87 document
.getElementById('code_new_confirm').value
= SHA1(document
.getElementById('pass_new_confirm').value
);
88 document
.getElementById('pass_new_confirm').value
='';
90 function validate_new_pass() {
92 if (document
.getElementById('uname').value
== "") {
93 document
.getElementById('uname').style
.border
= "1px solid red";
96 if (document
.getElementById('pass').value
== "") {
97 document
.getElementById('pass').style
.border
= "1px solid red";
100 if (document
.getElementById('pass_new').value
== "") {
101 document
.getElementById('pass_new').style
.border
= "1px solid red";
104 if (document
.getElementById('pass_new_confirm').value
== "") {
105 document
.getElementById('pass_new_confirm').style
.border
= "1px solid red";
111 <style type
="text/css">
113 font
-family
: sans
-serif
;
114 background
-color
: #638fd0;
116 background
: -webkit
-radial
-gradient(circle
, white
, #638fd0);
117 background
: -moz
-radial
-gradient(circle
, white
, #638fd0);
128 <?php
if (isset($_SESSION['password_update'])) { ?
>
129 <div id
="wrapper" class="centerwrapper">
130 <h2
class="title"><?php
echo htmlspecialchars( xl('Please Enter a New Password'), ENT_NOQUOTES
); ?
></h2
>
131 <form action
="get_patient_info.php" method
="POST" onsubmit
="return process_new_pass()" >
134 <td
class="algnRight"><?php
echo htmlspecialchars( xl('User Name'), ENT_NOQUOTES
); ?
></td
>
135 <td
><input name
="uname" id
="uname" type
="text" /></td
>
138 <td
class="algnRight"><?php
echo htmlspecialchars( xl('Current Password'), ENT_NOQUOTES
);?
></>
140 <input name
="pass" id
="pass" type
="password" />
141 <input type
="hidden" id
="code" name
="code" type
="hidden" />
145 <td
class="algnRight"><?php
echo htmlspecialchars( xl('New Password'), ENT_NOQUOTES
);?
></>
147 <input name
="pass_new" id
="pass_new" type
="password" />
148 <input type
="hidden" id
="code_new" name
="code_new" type
="hidden" />
152 <td
class="algnRight"><?php
echo htmlspecialchars( xl('Confirm New Password'), ENT_NOQUOTES
);?
></>
154 <input name
="pass_new_confirm" id
="pass_new_confirm" type
="password" />
155 <input type
="hidden" id
="code_new_confirm" name
="code_new_confirm" type
="hidden" />
159 <td colspan
=2><br
><center
><input type
="submit" value
="<?php echo htmlspecialchars( xl('Log In'), ENT_QUOTES);?>" /></center
></td
>
164 <div
class="copyright"><?php
echo htmlspecialchars( xl('Powered by'), ENT_NOQUOTES
);?
> <a href
="../../">OpenEMR
</a
></div
>
167 <div id
="wrapper" class="centerwrapper">
168 <h2
class="title"><?php
echo htmlspecialchars( xl('Access your patient information'), ENT_NOQUOTES
); ?
></h2
>
169 <form action
="get_patient_info.php" method
="POST" onsubmit
="return process()" >
172 <td
class="algnRight"><?php
echo htmlspecialchars( xl('User Name'), ENT_NOQUOTES
); ?
></td
>
173 <td
><input name
="uname" id
="uname" type
="text" /></td
>
176 <td
class="algnRight"><?php
echo htmlspecialchars( xl('Password'), ENT_NOQUOTES
);?
></>
178 <input name
="pass" id
="pass" type
="password" />
179 <input type
="hidden" id
="code" name
="code" type
="hidden" />
183 <td colspan
=2><br
><center
><input type
="submit" value
="<?php echo htmlspecialchars( xl('Log In'), ENT_QUOTES);?>" /></center
></td
>
188 <div
class="copyright"><?php
echo htmlspecialchars( xl('Powered by'), ENT_NOQUOTES
);?
> <a href
="../../">OpenEMR
</a
></div
>
194 <script type
="text/javascript">
195 $
(document
).ready(function() {
197 <?php
// if something went wrong
198 if (isset($_GET['w'])) { ?
>
199 var unique_id
= $
.gritter
.add({
200 title
: '<span class="red"><?php echo htmlspecialchars( xl('Oops
!'), ENT_QUOTES);?></span>',
201 text
: '<?php echo htmlspecialchars( xl('Something went wrong
. Please
try again
.', ENT_QUOTES)); ?>',
204 class_name
: 'my-nonsticky-class'
208 <?php
// if successfully logged out
209 if (isset($_GET['logout'])) { ?
>
210 var unique_id
= $
.gritter
.add({
211 title
: '<span class="green"><?php echo htmlspecialchars( xl('Success
'), ENT_QUOTES);?></span>',
212 text
: '<?php echo htmlspecialchars( xl('You have been successfully logged out
.'), ENT_QUOTES);?>',
215 class_name
: 'my-nonsticky-class'