diff --git a/.holo/branches/emergence-site/_emergence-saml2.toml b/.holo/branches/emergence-site/_emergence-saml2.toml index d19835d..230fc73 100644 --- a/.holo/branches/emergence-site/_emergence-saml2.toml +++ b/.holo/branches/emergence-site/_emergence-saml2.toml @@ -1,5 +1,2 @@ [holomapping] -files = [ - "*/**", - "!php-config/Git.config.d/" -] +files = "**" \ No newline at end of file diff --git a/.holo/branches/emergence-site/_skeleton-v2.toml b/.holo/branches/emergence-site/_skeleton-v2.toml index 8897372..ff2c9cd 100644 --- a/.holo/branches/emergence-site/_skeleton-v2.toml +++ b/.holo/branches/emergence-site/_skeleton-v2.toml @@ -1,6 +1,3 @@ [holomapping] -files = [ - "**", - "!php-config/Git.config.d/*" -] +files = "**" before = "*" diff --git a/.holo/sources/skeleton-v2.toml b/.holo/sources/skeleton-v2.toml index e5bed2f..9a6d9d6 100644 --- a/.holo/sources/skeleton-v2.toml +++ b/.holo/sources/skeleton-v2.toml @@ -1,6 +1,6 @@ [holosource] url = "https://github.com/JarvusInnovations/emergence-skeleton-v2" -ref = "refs/tags/v2.4.2" +ref = "refs/tags/v2.4.4" [holosource.project] holobranch = "emergence-skeleton" diff --git a/event-handlers/Site/beforeScriptExecute/hub-token-session.php b/event-handlers/Site/beforeScriptExecute/hub-token-session.php index fca8dcf..a95fa89 100644 --- a/event-handlers/Site/beforeScriptExecute/hub-token-session.php +++ b/event-handlers/Site/beforeScriptExecute/hub-token-session.php @@ -3,11 +3,11 @@ use Firebase\JWT\JWT; use Slate\NetworkHub\School; +use Slate\NetworkHub\SchoolUser; use Slate\NetworkHub\User; -$hubToken = $_REQUEST['hub_token']; - -if (!empty($hubToken)) { +if (!empty($_REQUEST['hub_token'])) { + $hubToken = $_REQUEST['hub_token']; list($header, $payload, $signature) = explode('.', $hubToken); $decodedPayload = json_decode(base64_decode($payload), true); @@ -21,9 +21,16 @@ return RequestHandler::throwInvalidRequestError('hub_token is invalid. Please retry the request or contact an administrator if the issue persists.'); } - $NetworkUser = User::getByUsername($decodedPayload['user']['PrimaryEmail']); + // error out if user can not be found with decoded email + if (!$NetworkUser = User::getByField('Email', $decodedPayload['user']['PrimaryEmail'])) { + return RequestHandler::throwInvalidRequestError('hub_token is invalid. Please retry the request or contact an administrator if the issue persists.'); + } - if (!$NetworkUser || $NetworkUser->SchoolID !== $NetworkSchool->ID) { + // error out if user is not associated with network school + if (!$SchoolUser = SchoolUser::getByWhere([ + 'PersonID' => $NetworkUser->ID, + 'SchoolID' => $NetworkSchool->ID + ])) { return RequestHandler::throwInvalidRequestError('hub_token is invalid. Please retry the request or contact an administrator if the issue persists.'); } diff --git a/html-templates/connectors/network-hub/createJob.tpl b/html-templates/connectors/network-hub/createJob.tpl index 169c286..03d223a 100644 --- a/html-templates/connectors/network-hub/createJob.tpl +++ b/html-templates/connectors/network-hub/createJob.tpl @@ -40,6 +40,19 @@
+ + +