diff --git a/portal/account/index_reset.php b/portal/account/index_reset.php index f5199fed21a..99925b43444 100644 --- a/portal/account/index_reset.php +++ b/portal/account/index_reset.php @@ -17,7 +17,7 @@ require_once(dirname(__FILE__) . "/../../src/Common/Session/SessionUtil.php"); OpenEMR\Common\Session\SessionUtil::portalSessionStart(); -$landingpage = "./../index.php?site=" . urlencode($_SESSION['site_id']); +$landingpage = "./../index.php?site=" . urlencode($_SESSION['site_id'] ?? ''); // kick out if patient not authenticated if (isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite_two'])) { $ignoreAuth_onsite_portal = true; @@ -56,12 +56,11 @@ $sql = "SELECT " . implode(",", array(COL_ID, COL_PID, COL_POR_PWD, COL_POR_USER, COL_POR_LOGINUSER, COL_POR_PWD_STAT)) . " FROM " . TBL_PAT_ACC_ON . " WHERE pid = ?"; - $auth = privQuery($sql, array($_SESSION['pid'])); $password = trim($_POST['pass_current'] ?? ''); -$password_new = trim($_POST['pass_new']); -$valid = ((!empty(trim($_POST['uname']))) && - (!empty(trim($_POST['login_uname']))) && +$password_new = trim($_POST['pass_new'] ?? ''); +$valid = ((!empty(trim($_POST['uname'] ?? ''))) && + (!empty(trim($_POST['login_uname'] ?? ''))) && (!empty($password)) && (!empty($password_new)) && (trim($_POST['uname']) == $auth[COL_POR_USER]) && diff --git a/portal/account/register.php b/portal/account/register.php index 429c7594379..73da249864c 100644 --- a/portal/account/register.php +++ b/portal/account/register.php @@ -2,32 +2,35 @@ /** * Portal Registration Wizard + * twig loader for registration * * @package OpenEMR * @link http://www.open-emr.org * @author Jerry Padgett - * @author Brady Miller - * @copyright Copyright (c) 2017-2019 Jerry Padgett - * @copyright Copyright (c) 2019 Brady Miller + * @copyright Copyright (c) 2024 Jerry Padgett * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ // script is brought in as require_once in index.php when applicable use OpenEMR\Common\Logging\SystemLogger; -use OpenEMR\Core\Header; +use OpenEMR\Common\Session\SessionUtil; +use OpenEMR\Common\Twig\TwigContainer; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Error\SyntaxError; if ($portalRegistrationAuthorization !== true) { - (new SystemLogger())->debug("attempted to use register.php directly, so failed"); - OpenEMR\Common\Session\SessionUtil::portalSessionCookieDestroy(); + (new SystemLogger())->debug("Attempted to use register.php directly, so failed"); + SessionUtil::portalSessionCookieDestroy(); echo xlt("Not Authorized"); header('HTTP/1.1 401 Unauthorized'); die(); } if (empty($GLOBALS['portal_onsite_two_register']) || empty($GLOBALS['google_recaptcha_site_key']) || empty($GLOBALS['google_recaptcha_secret_key'])) { - (new SystemLogger())->debug("attempted to use register.php despite register feature being turned off, so failed"); - OpenEMR\Common\Session\SessionUtil::portalSessionCookieDestroy(); + (new SystemLogger())->debug("Attempted to use register.php despite register feature being turned off, so failed"); + SessionUtil::portalSessionCookieDestroy(); echo xlt("Not Authorized"); header('HTTP/1.1 401 Unauthorized'); die(); @@ -41,430 +44,27 @@ $landingpage = "index.php?site=" . urlencode($_SESSION['site_id']); -?> - - - - <?php echo xlt('New Patient'); ?> | <?php echo xlt('Register'); ?> - - - - - - - +// Prepare data for the template +$data = [ +'global' => $GLOBALS, +'session' => $_SESSION, +'languageRegistration' => $languageRegistration ?? '', +'fnameRegistration' => $fnameRegistration ?? '', +'mnameRegistration' => $mnameRegistration ?? '', +'lnameRegistration' => $lnameRegistration ?? '', +'dobRegistration' => $dobRegistration ?? '', +'emailRegistration' => $emailRegistration ?? '', +]; + +// Render Register Twig template +$twig = (new TwigContainer(null, $GLOBALS['kernel']))->getTwig(); +try { + echo $twig->render('portal/registration/portal_register.html.twig', $data); +} catch (LoaderError | SyntaxError | RuntimeError $e) { + (new SystemLogger())->error($e->getMessage()); + echo text($e->getMessage()); + header('HTTP/1.1 500 Internal Server Error'); + die(); +} - -
-

-
-
-
- 1 -

-
-
- 2 -

-
-
- 3 -

-
-
- 4 -

-
-
-
- -
-
-
- - - - - - - -
- -
-
- -
- -
- -
- -
- - -
- - +exit(); diff --git a/portal/get_patient_documents.php b/portal/get_patient_documents.php index c3f743ea837..7af8313b13d 100644 --- a/portal/get_patient_documents.php +++ b/portal/get_patient_documents.php @@ -67,7 +67,7 @@ - <?php echo text("Download On File Documents"); ?> + <?php echo xlt("Download On File Documents"); ?> + + + +
+

{{ 'Account Registration'|xlt }}

+
+
+
+ 1 +

{{ 'Verify Email'|xlt }}

+
+
+ 2 +

{{ 'Profile'|xlt }}

+
+
+ 3 +

{{ 'Insurance'|xlt }}

+
+
+ 4 +

{{ 'Register'|xlt }}

+
+
+
+
+
+
+ + + + + + + +
+ +
+
+
+ +
+
+ +
+ + +
+ +