Skip to content

Commit d23ec48

Browse files
committed
Merge branch 'develop' of github.com:topcoder-platform/forums into develop
2 parents 36b7bee + 799d3bd commit d23ec48

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

config/vanilla/config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// Embed
55
$Configuration['Garden']['Embed']['Allow'] = true;
66
$Configuration['Garden']['Embed']['ForceForum'] = false;
7+
$Configuration['Garden']['Embed']['RemoteUrl'] = getenv('VANILLA_ENV') === 'prod'? 'https://platform.topcoder.com':'https://platform.topcoder-dev.com';
78
// Trusted Domains. Specify one domain per line; use * for wildcard matches
89
$Configuration['Garden']['TrustedDomains'] = '*.topcoder-dev.com
910
*.topcoder.com';

vanilla/applications/dashboard/controllers/class.entrycontroller.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@ protected function checkOverride($type, $target, $transientKey = null) {
375375
// FIX: micro-frontends-forums-app issues-12
376376
$isEmbedded = (bool) c('Garden.Embed.Allow',false);
377377
$remoteUrl = c("Garden.Embed.RemoteUrl");
378-
if($isEmbedded && is_string( $remoteUrl)) {
378+
379+
// FIX Issues-681: signing from Forum
380+
//$forceEmbed = $this->Request->get('Source', '') != 'forum';
381+
$referer = $_SERVER['HTTP_REFERER'];
382+
if($isEmbedded && is_string( $remoteUrl) && $referer != '' && strpos($referer, $remoteUrl) !== false) {
379383
$targetUrl = rawurlencode($remoteUrl.'/#'.url($target));
380384
} else {
381385
$targetUrl = rawurlencode(url($target, true));

vanilla/applications/vanilla/controllers/class.vanillacontroller.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,13 @@ protected function buildBreadcrumbs($CategoryID) {
9696
$ancestors = CategoryModel::getAncestors($CategoryID);
9797
$parentCategoryID = val('ParentCategoryID', $Category);
9898
// FIX https://github.com/topcoder-platform/forums/issues/648
99-
10099
$showFullBreadcrumbs = true;
101100
$this->EventArguments['ShowFullBreadcrumbs'] = & $showFullBreadcrumbs;
102101
$this->fireEvent('BeforeBuildBreadcrumbs');
103-
// getIncomingValue('embed_type') == 'mfe'
104102
if(!$showFullBreadcrumbs) {
105103
$temp = [];
106104
if(val('GroupID', $Category) > 0) {
107-
$GroupCategoryID = $this->data('Breadcrumbs.Options.GroupCategoryID');
105+
$GroupCategoryID = $this->data('BreadcrumbsOptionsGroupCategoryID');
108106
foreach ($ancestors as $id => $ancestor) {
109107
if($GroupCategoryID == $ancestor['CategoryID']) {// root category for a group
110108
array_push($temp, ['Name' => $ancestor['Name'], 'Url'=>'/group/'.$ancestor['GroupID']]);
@@ -113,17 +111,14 @@ protected function buildBreadcrumbs($CategoryID) {
113111
}
114112
}
115113
}
116-
if(count($temp) == 1) {
117-
return [];
118-
}
119114
return $temp;
120115
} else {
121116

122117
if (val('GroupID', $Category) > 0) {
123118
$challenge = $this->data('Challenge');
124119
$track = $challenge ? $challenge['Track'] : false;
125120
$temp = [];
126-
$GroupCategoryID = $this->data('Breadcrumbs.Options.GroupCategoryID');
121+
$GroupCategoryID = $this->data('BreadcrumbsOptionsGroupCategoryID');
127122
foreach ($ancestors as $id => $ancestor) {
128123
if ($ancestor['GroupID'] > 0) {
129124
if ($GroupCategoryID == $ancestor['CategoryID']) {// root category for a group

vanilla/library/core/functions.render.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,8 @@ function signInUrl($target = '', $force = false) {
17291729
$target = '' ;
17301730
}
17311731

1732-
return '/entry/signin'.($target ? '?Target='.urlencode($target) : '');
1732+
// FIX Issues-681: signing from Forum
1733+
return '/entry/signin'.($target ? '?Source=forum&Target='.urlencode($target) : '?Source=forum');
17331734
}
17341735
}
17351736

0 commit comments

Comments
 (0)