diff --git a/Gruntfile.js b/Gruntfile.js index 0d4e6f55..c04a7d8f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -47,7 +47,7 @@ module.exports = function(grunt) { communityURL: grunt.option('community-url') || '//community.topcoder.com', reviewAppURL: grunt.option('review-app-url') || 'software.topcoder.com/review', helpAppURL: grunt.option('help-app-url') || 'help.topcoder.com', - forumsAppURL: grunt.option('review-app-url') || 'forums.topcoder.com', + forumsAppURL: grunt.option('forums-app-url') || 'forums.topcoder.com', swiftProgramId: grunt.option('swift-program-id') || 3445, // only used on wp setup diff --git a/src/conf/build-dev.sh b/src/conf/build-dev.sh index 6805ba1b..76521c2f 100755 --- a/src/conf/build-dev.sh +++ b/src/conf/build-dev.sh @@ -1 +1 @@ -grunt --main-url=https://www.topcoder-dev.com --auth-main-url=topcoder-dev.auth0.com --auth-client-id=JFDo7HMkf0q2CkVFHojy3zHWafziprhT --auth-callback-url=https://www.topcoder-dev.com/reg2/callback.action --api-url=https://api.topcoder-dev.com/v2 --lc-url=https://dev-lc1-ext-challenge-service.herokuapp.com --lc-discussion-url=https://dev-lc1-discussion-service.herokuapp.com --lc-user-url=https://dev-lc1-user-service.herokuapp.com --lc-site-url=https://dev-lc1-challenge-app.herokuapp.com --my-filters-url=https://staging-user-settings-service.herokuapp.com --community-url=//community.topcoder-dev.com --photo-link-base=http://community.topcoder-dev.com --blog-rss-feed="https://www.topcoder-dev.com/feed/?post_type=blog" --api3-url=https://api.topcoder-dev.com/v3 --use-cdn=1 --use-min=1 +grunt --main-url=https://www.topcoder-dev.com --auth-main-url=topcoder-dev.auth0.com --auth-client-id=JFDo7HMkf0q2CkVFHojy3zHWafziprhT --auth-callback-url=https://www.topcoder-dev.com/reg2/callback.action --api-url=https://api.topcoder-dev.com/v2 --lc-url=https://dev-lc1-ext-challenge-service.herokuapp.com --lc-discussion-url=https://dev-lc1-discussion-service.herokuapp.com --lc-user-url=https://dev-lc1-user-service.herokuapp.com --lc-site-url=https://dev-lc1-challenge-app.herokuapp.com --my-filters-url=https://staging-user-settings-service.herokuapp.com --community-url=//community.topcoder-dev.com --photo-link-base=http://community.topcoder-dev.com --review-app-url=software.topcoder-dev.com/review --help-app-url=help.topcoder-dev.com --forums-app-url=forums.topcoder-dev.com --swift-program-id=3445 --blog-rss-feed="https://www.topcoder-dev.com/feed/?post_type=blog" --api3-url=https://api.topcoder-dev.com/v3 --use-cdn=1 --use-min=1 diff --git a/src/conf/build-qa.sh b/src/conf/build-qa.sh index a31d0f18..23312aed 100755 --- a/src/conf/build-qa.sh +++ b/src/conf/build-qa.sh @@ -1 +1 @@ -grunt --main-url=https://www.topcoder-qa.com --auth-main-url=topcoder-qa.auth0.com --auth-client-id=EVOgWZlCtIFlbehkq02treuRRoJk12UR --auth-callback-url="https://www.topcoder-qa.com/reg2/callback.action" --api-url=https://api.topcoder-qa.com/v2 --lc-url=https://qa-lc1-ext-challenge-service.herokuapp.com --lc-discussion-url=https://qa-lc1-discussion-service.herokuapp.com --lc-user-url=https://qa-lc1-user-service.herokuapp.com --lc-site-url=https://qa-lc1-challenge-app.herokuapp.com --my-filters-url=https://staging-user-settings-service.herokuapp.com --community-url=//community.topcoder-qa.com --photo-link-base=http://community.topcoder-qa.com --blog-rss-feed="https://www.topcoder-qa.com/feed/?post_type=blog" --api3-url=https://api.topcoder-qa.com/v3 --use-cdn=1 --use-min=1 \ No newline at end of file +grunt --main-url=https://www.topcoder-qa.com --auth-main-url=topcoder-qa.auth0.com --auth-client-id=EVOgWZlCtIFlbehkq02treuRRoJk12UR --auth-callback-url="https://www.topcoder-qa.com/reg2/callback.action" --api-url=https://api.topcoder-qa.com/v2 --lc-url=https://qa-lc1-ext-challenge-service.herokuapp.com --lc-discussion-url=https://qa-lc1-discussion-service.herokuapp.com --lc-user-url=https://qa-lc1-user-service.herokuapp.com --lc-site-url=https://qa-lc1-challenge-app.herokuapp.com --my-filters-url=https://staging-user-settings-service.herokuapp.com --community-url=//community.topcoder-qa.com --photo-link-base=http://community.topcoder-qa.com --review-app-url=software.topcoder-qa.com/review --help-app-url=help.topcoder-qa.com --forums-app-url=forums.topcoder-qa.com --swift-program-id=3445 --blog-rss-feed="https://www.topcoder-qa.com/feed/?post_type=blog" --api3-url=https://api.topcoder-qa.com/v3 --use-cdn=1 --use-min=1 \ No newline at end of file diff --git a/src/conf/tc-nginx.conf b/src/conf/tc-nginx.conf index 7fea2507..10998e33 100644 --- a/src/conf/tc-nginx.conf +++ b/src/conf/tc-nginx.conf @@ -10,7 +10,7 @@ upstream www { server { listen 80; - server_name local.topcoder.com; + server_name local.topcoder.com local.topcoder-dev.com local.topcoder-qa.com; set $app_base /home/vagrant; ## CHANGE ME root apps folder reference set $root_base $app_base/tc-site; @@ -70,6 +70,8 @@ server { } location ~ ^/fonts/ { + add_header 'Access-Control-Allow-Origin' "$http_origin" always; + add_header 'Access-Control-Allow-Headers' "Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since" always; root $root_base/dist; } diff --git a/src/js/app/challenge-details/js/controllers/challenge-details-controller.js b/src/js/app/challenge-details/js/controllers/challenge-details-controller.js index 8c0da85a..eee71fe7 100644 --- a/src/js/app/challenge-details/js/controllers/challenge-details-controller.js +++ b/src/js/app/challenge-details/js/controllers/challenge-details-controller.js @@ -58,7 +58,7 @@ vm.challengeType = challengeType; vm.siteURL = siteURL; - vm.isLoggedIn = typeof $cookies.tcjwt !== 'undefined' && typeof $cookies.tcsso !== 'undefined'; + vm.isLoggedIn = typeof $cookies.tcjwt !== 'undefined'; vm.delayAction = typeof $cookies.tcDelayChallengeAction !== 'undefined'; if (vm.delayAction) { vm.tcDoAction = $cookies.tcDelayChallengeAction.split('|'); diff --git a/src/js/app/challenge-details/js/ng-challenge-detail-software.js b/src/js/app/challenge-details/js/ng-challenge-detail-software.js index 79e84716..3ef1b11f 100644 --- a/src/js/app/challenge-details/js/ng-challenge-detail-software.js +++ b/src/js/app/challenge-details/js/ng-challenge-detail-software.js @@ -84,7 +84,6 @@ $(document).ready(function () { // init tab nav app.tabNavinit(); - var tcsso = getCookie('tcsso'); var tcjwt = getCookie('tcjwt'); }); diff --git a/src/js/scripts.js b/src/js/scripts.js index f889197e..e9f43ae4 100644 --- a/src/js/scripts.js +++ b/src/js/scripts.js @@ -45,21 +45,19 @@ var app = { $('body').addClass('ie7'); ie7 = true; } - // expiry date for tcjwt and tcsso cookies extended 1 year if rememberme true + // expiry date for tcjwt cookie extended 1 year if rememberme true if ($.cookie('rememberMe')) { $.cookie.raw = true; var tcjwt = $.cookie('tcjwt'); - var tcsso = $.cookie('tcsso'); - if ((typeof tcjwt != 'undefined') && (typeof tcsso != 'undefined')) { + if ((typeof tcjwt != 'undefined')) { var cookieConfig = { expires: 365, path: '/', domain: '.topcoder.com' }; $.cookie('tcjwt', tcjwt, cookieConfig); - $.cookie('tcsso', tcsso, cookieConfig); } else { - // if tcjwt and tcsso not present remove rememberme + // if tcjwt not present remove rememberme $.removeCookie('rememberMe'); } } @@ -1710,9 +1708,8 @@ var app = { isLoggedIn: function() { var tcjwt = $.cookie('tcjwt'); - var tcsso = $.cookie('tcsso'); - if (typeof tcjwt == "undefined" || typeof tcsso == "undefined") { + if (typeof tcjwt == "undefined") { return false; } diff --git a/src/js/terms.js b/src/js/terms.js index 5aa88409..c7858125 100644 --- a/src/js/terms.js +++ b/src/js/terms.js @@ -101,7 +101,7 @@ appChallengeTerms = { if ($(this).parents(".notAgreed").length === 0) { app.setLoading(); $.ajax({ - type: "GET", + type: "POST", url: tcconfig.apiURL + "/terms/" + termsOfUseID + "/agree", dataType: 'json', headers: { @@ -171,7 +171,7 @@ appChallengeTerms = { var termId = getParameterByName('termId'); if (termId) { $.ajax({ - type: "GET", + type: "POST", url: tcconfig.apiURL + "/terms/" + termId + "/agree", dataType: 'json', headers: { diff --git a/wp/wp-content/plugins/TcApi-hookup/includes/header.php b/wp/wp-content/plugins/TcApi-hookup/includes/header.php index 3049cdd0..585880a2 100644 --- a/wp/wp-content/plugins/TcApi-hookup/includes/header.php +++ b/wp/wp-content/plugins/TcApi-hookup/includes/header.php @@ -34,66 +34,6 @@ - 'Main Navigation', - 'menu_class' => '', - 'container' => '', - 'menu_class' => 'root', - 'items_wrap' => '%3$s', - 'walker' => new nav_menu_walker () -); - -// Print a cookie -//echo $_COOKIE["tcsso"]; - -//Get the TopCoder SSO Cookie -$cookie = $_COOKIE["tcsso"]; -$cookie_parts = explode( "|", $cookie); -$user_id = $cookie_parts[0]; -$tc_token = $cookie_parts[1]; -#$user_id = "22760600"; - -// PEMULA - update this to correctly parts the "handle" from the json and set it to $handle - $url = "https://community.topcoder.com/tc?module=BasicData&c=get_handle_by_id&dsid=30&uid=".$user_id."&json=true"; - $response = get_json_from_url ( $url ); - #print_r($response); - // print_r( json_decode ( $response )->data[0]->handle ); - -// if (is_wp_error ( $response ) || ! isset ( $response ['data'] )) { -// return "Error in processing"; -// } - //$handle_obj = json_decode ( $response ['data'], true); - //echo print_r ($handle_obj); - //print_r($handle_obj->{'handle'}); - -$handle = json_decode ( $response )->data[0]->handle; //Replace this with a call to http://community.topcoder.com/tc?module=BasicData&c=get_handle_by_id&dsid=30&uid=8547899&json=true and parse the handle from the result. - -if ( isset($_COOKIE["user"]) ) -{ - $user = $handle; - $welcome = "hide"; - $reg = ""; -} -else -{ - $user = "newUser"; - $welcome = ""; - $reg = "hide"; -} - -global $coder; -$coder = get_raw_coder($handle); -$memberSince = explode(" ",$coder->memberSince); -$memberSince = explode(".",$memberSince[0]); -$memberEarning = '$'.$coder->overallEarning; -if ( $coder->photoLink != '') -$photoLink = 'http://community.topcoder.com'.$coder->photoLink; -else -$photoLink = 'http://community.topcoder.com/i/m/nophoto_login.gif'; - -?> -