Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing use statement in facility admin script #7428

Merged
merged 5 commits into from May 13, 2024

Conversation

stephenwaite
Copy link
Sponsor Member

Fixes #7427

Short description of what this resolves:

Changes proposed in this pull request:

@@ -12,26 +12,32 @@
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
*/

use OpenEMR\Common\Acl\AclMain;
use OpenEMR\Common\Session\SessionUtil;
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work on the portal, but would make sure it works on the portal.


if (isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite_two'])) {
$pid = $_SESSION['pid'];
$ignoreAuth = true;
global $ignoreAuth;
} else {
OpenEMR\Common\Session\SessionUtil::portalSessionCookieDestroy();
SessionUtil::portalSessionCookieDestroy();
header('Location: ' . $landingpage . '?w');
exit;
}
} else {
// Check authorization.
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a weird else block (try best to never include globals.php twice). Would just have this block set up a flag such as notPatientPortal = true

Then use that flag to run the auth after the includes below (so will then be below the globals.php below)

use OpenEMR\Common\Acl\AclMain;
use OpenEMR\Common\Session\SessionUtil;
use OpenEMR\Common\Twig\TwigContainer;
use PHPMailer\PHPMailer\PHPMailer;
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also generally try to do the use block after globals.php is brought to avoid ever messing up things in that core script. in this case could just put the use for SessionUtil here and the put the other after globals.php is brought in below

@@ -141,7 +141,7 @@
$e_InformationSystem = $ccr->createElement('InformationSystem');
$e_Actor->appendChild($e_InformationSystem);

$e_Name = $ccr->createElement('Name', $row1['facility']);
$e_Name = $ccr->createElement('Name', htmlentities($row1['facility'] ?? ''));
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @stephenwaite , Just checking why the htmlentities() function call is being used here?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The facility has an & in its name :)

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will text() function get what you need? Been avoiding htmlentities since I don't understand it :)

@stephenwaite stephenwaite merged commit 6d8bddc into openemr:master May 13, 2024
25 checks passed
sjpadgett added a commit to sjpadgett/openemr that referenced this pull request May 13, 2024
…_last

* 'master' of https://github.com/openemr/openemr:
  fix: add missing use statement in facility admin script (openemr#7428)
stephenwaite added a commit to stephenwaite/openemr that referenced this pull request May 21, 2024
* fix: add missing use statement in facility admin script

* add missing use statement in facility add script

* fix use statement in create ccr

* better placement of use statements per review plus warns fixed

* use text() instead
stephenwaite added a commit that referenced this pull request May 21, 2024
* fix: add missing use statement in facility admin script (#7428)

* fix: add missing use statement in facility admin script

* add missing use statement in facility add script

* fix use statement in create ccr

* better placement of use statements per review plus warns fixed

* use text() instead

* fix: bug (#7435)

* fix: bug

* else die

* fix: bug (#7434)

* fix: billing manager To Encounter button to load proper person (#7420)

* fix: fix billing manager To Encounter button to load proper person

* better to edit the person so it loads the dashboard tab if missing

* change button name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: missing use aclmain statement in prior commit
2 participants