forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07a59ea
commit ee70c06
Showing
1 changed file
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,11 @@ | |
* @author Roberto Vasquez <[email protected]> | ||
* @author Brady Miller <[email protected]> | ||
* @copyright Copyright (c) 2015 Roberto Vasquez <[email protected]> | ||
* @copyright Copyright (c) 2017-2018 Brady Miller <[email protected]> | ||
* @copyright Copyright (c) 2017-2019 Brady Miller <[email protected]> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
*/ | ||
|
||
|
||
require_once("../globals.php"); | ||
require_once("../../library/acl.inc"); | ||
require_once("$srcdir/auth.inc"); | ||
|
@@ -39,23 +40,25 @@ | |
$show_message=0; | ||
|
||
/* Sending a mail to the admin when the breakglass user is activated only if $GLOBALS['Emergency_Login_email'] is set to 1 */ | ||
$bg_count=count($_POST['access_group']); | ||
$mail_id = explode(".", $SMTP_HOST); | ||
for ($i=0; $i<$bg_count; $i++) { | ||
if (($_POST['access_group'][$i] == "Emergency Login") && ($_POST['active'] == 'on') && ($_POST['pre_active'] == 0)) { | ||
if (($_POST['get_admin_id'] == 1) && ($_POST['admin_id'] != "")) { | ||
$res = sqlStatement("select username from users where id= ? ", array($_POST["id"])); | ||
$row = sqlFetchArray($res); | ||
$uname=$row['username']; | ||
$mail = new MyMailer(); | ||
$mail->From = $GLOBALS["practice_return_email_path"]; | ||
$mail->FromName = "Administrator OpenEMR"; | ||
$text_body = "Hello Security Admin,\n\n The Emergency Login user ".$uname. | ||
" was activated at ".date('l jS \of F Y h:i:s A')." \n\nThanks,\nAdmin OpenEMR."; | ||
$mail->Body = $text_body; | ||
$mail->Subject = "Emergency Login User Activated"; | ||
$mail->AddAddress($_POST['admin_id']); | ||
$mail->Send(); | ||
if (is_array($_POST['access_group'])) { | ||
$bg_count = count($_POST['access_group']); | ||
$mail_id = explode(".", $SMTP_HOST); | ||
for ($i = 0; $i < $bg_count; $i++) { | ||
if (($_POST['access_group'][$i] == "Emergency Login") && ($_POST['active'] == 'on') && ($_POST['pre_active'] == 0)) { | ||
if (($_POST['get_admin_id'] == 1) && ($_POST['admin_id'] != "")) { | ||
$res = sqlStatement("select username from users where id= ? ", array($_POST["id"])); | ||
$row = sqlFetchArray($res); | ||
$uname = $row['username']; | ||
$mail = new MyMailer(); | ||
$mail->From = $GLOBALS["practice_return_email_path"]; | ||
$mail->FromName = "Administrator OpenEMR"; | ||
$text_body = "Hello Security Admin,\n\n The Emergency Login user " . $uname . | ||
" was activated at " . date('l jS \of F Y h:i:s A') . " \n\nThanks,\nAdmin OpenEMR."; | ||
$mail->Body = $text_body; | ||
$mail->Subject = "Emergency Login User Activated"; | ||
$mail->AddAddress($_POST['admin_id']); | ||
$mail->Send(); | ||
} | ||
} | ||
} | ||
} | ||
|