4 * User password change tool
7 * @link http://www.open-emr.org
8 * @author Roberto Vasquez <robertogagliotta@gmail.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @author Ranganath Pathak <pathak@scrs1.org>
11 * @author Rod Roark <rod@sunsetsystems.com>
12 * @copyright Copyright (c) 2017 Roberto Vasquez <robertogagliotta@gmail.com>
13 * @copyright Copyright (c) 2017-2019 Brady Miller <brady.g.miller@gmail.com>
14 * @copyright Copyright (c) 2019 Ranganath Pathak <pathak@scrs1.org>
15 * @license https://github.com/openemr/openemr/blob/master/LICENSE CNU General Public License 3
18 require_once("../globals.php");
19 require_once("$srcdir/user.inc.php");
21 use OpenEMR\Common\Auth\AuthUtils
;
22 use OpenEMR\Common\Csrf\CsrfUtils
;
23 use OpenEMR\Core\Header
;
24 use OpenEMR\OeUI\OemrUI
;
26 if (AuthUtils
::useActiveDirectory()) {
29 $userid = $_SESSION['authUserID'];
30 $user_name = getUserIDInfo($userid);
31 $user_full_name = $user_name['fname'] . " " . $user_name['lname'];
35 <?php Header
::setupHeader(); ?
>
36 <title
><?php
echo xlt('Change Password'); ?
></title
>
38 <script src
="checkpwd_validation.js"></script
>
41 //Validating password and display message if password field is empty - starts
42 var webroot
=<?php
echo js_escape($webroot); ?
>;
43 function update_password()
50 $
.post("user_info_ajax.php",
52 curPass
: $
("input[name='curPass']").val(),
53 newPass
: $
("input[name='newPass']").val(),
54 newPass2
: $
("input[name='newPass2']").val(),
55 csrf_token_form
: <?php
echo js_escape(CsrfUtils
::collectCsrfToken()); ?
>
59 $
("input[type='password']").val("");
60 $
("#display_msg").html(data
);
69 $arrOeUiSettings = array(
70 'heading_title' => xl('Change Password'),
71 'include_patient_name' => false,
72 'expandable' => false,
73 'expandable_files' => array(),//all file names need suffix _xpd
74 'action' => "",//conceal, reveal, search, reset, link or back
76 'action_href' => "",//only for actions - reset, link or back
77 'show_help_icon' => false,
78 'help_file_name' => ""
80 $oemr_ui = new OemrUI($arrOeUiSettings);
83 <body
class="body_top" onload
="document.forms[0].curPass.focus()">
87 $res = sqlStatement("select fname,lname,username from users where id=?", array($_SESSION['authUserID']));
88 $row = sqlFetchArray($res);
91 <div id
="container_div" class="<?php echo $oemr_ui->oeContainer();?>">
93 <div
class="col-sm-12">
94 <?php
echo $oemr_ui->pageHeading() . "\r\n"; ?
>
98 <div
class="col-sm-12">
99 <div id
="display_msg"></div
>
103 <div
class="col-sm-12">
104 <form method
='post' action
='user_info.php' class='form-horizontal' onsubmit
='return update_password()'>
105 <input type
=hidden name
=secure_pwd value
="<?php echo attr($GLOBALS['secure_password']); ?>">
107 <legend
><?php
echo xlt('Change Password for') . " " . text($user_full_name); ?
></legend
>
108 <div
class="form-group">
109 <label
class='control-label col-sm-2'><?php
echo xlt('Full Name') . ":"; ?
></label
>
110 <div
class="col-sm-10">
111 <p
class="form-control-static"><?php
echo text($iter["fname"]) . " " . text($iter["lname"]) ?
></p
>
114 <div
class="form-group">
115 <label
class='control-label col-sm-2'><?php
echo xlt('User Name') . ":"; ?
></label
>
116 <div
class="col-sm-10">
117 <p
class="form-control-static"><?php
echo text($iter["username"]) ?
></p
>
120 <div
class="form-group">
121 <label
for='curPass' class='control-label col-sm-2'><?php
echo xlt('Current Password') . ":"; ?
></label
>
122 <div
class='col-sm-3'>
123 <input type
='password' class='form-control' name
='curPass' id
='curPass' value
="" autocomplete
='off'>
126 <div
class="form-group">
127 <label
class='control-label col-sm-2'><?php
echo xlt('New Password') . ":"; ?
></label
>
128 <div
class='col-sm-3'>
129 <input type
='password' class='form-control' name
='newPass' value
="" autocomplete
='off'>
130 <!-- Password Strength Meter
-->
131 <div id
="password_strength_meter" class="progress">
132 <div
class="progress-bar" role
="progressbar" aria
-valuenow
="0" aria
-valuemin
="0" aria
-valuemax
="100" style
="width:0%"></div
>
134 <div id
="password_strength_text"></div
>
137 <div
class="form-group">
138 <label
class='control-label col-sm-2'><?php
echo xlt('Repeat New Password') . ":"; ?
></label
>
139 <div
class='col-sm-3'>
140 <input type
='password' class='form-control' name
=newPass2 value
="" autocomplete
='off'>
144 <div
class="form-group">
145 <div
class='offset-sm-2 col-sm-10'>
146 <button type
="Submit" class='btn btn-secondary btn-save'><?php
echo xlt('Save Changes'); ?
></button
>
152 </div
><!--end of container div
-->
153 <?php
$oemr_ui->oeBelowContainerDiv();?
>
159 // da39a3ee5e6b4b0d3255bfef95601890afd80709 == blank