acknowledgments update
[openemr.git] / interface / usergroup / user_info_ajax.php
blob9c4f2f83b8f214a45afbfa677e14dc8e23c5012b
1 <?php
2 /**
3 *
4 * Controller to handle user password change requests.
5 *
6 * <pre>
7 * Expected REQUEST parameters
8 * $_REQUEST['pk'] - The primary key being used for encryption. The browser would have requested this previously
9 * $_REQUEST['curPass'] - ciphertext of the user's current password
10 * $_REQUEST['newPass'] - ciphertext of the new password to use
11 * $_REQUEST['newPass2']) - second copy of ciphertext of the new password to confirm proper user entry.
12 * </pre>
13 * Copyright (C) 2013 Kevin Yeh <kevin.y@integralemr.com> and OEMR <www.oemr.org>
15 * LICENSE: This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 3
18 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
26 * @package OpenEMR
27 * @author Kevin Yeh <kevin.y@integralemr.com>
28 * @link http://www.open-emr.org
31 //SANITIZE ALL ESCAPES
32 $sanitize_all_escapes=true;
34 //STOP FAKE REGISTER GLOBALS
35 $fake_register_globals=false;
37 include_once("../globals.php");
38 require_once("$srcdir/authentication/password_change.php");
40 $curPass=$_REQUEST['curPass'];
41 $newPass=$_REQUEST['newPass'];
42 $newPass2=$_REQUEST['newPass2'];
44 if($newPass!=$newPass2)
46 echo xlt("Passwords Don't match!");
47 exit;
49 $errMsg='';
50 $success=update_password($_SESSION['authId'],$_SESSION['authId'],$curPass,$newPass,$errMsg);
51 if($success)
53 echo xlt("Password change successful");
55 else
57 // If update_password fails the error message is returned
58 echo text($errMsg);