Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conf/Direct.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ LDAP_AUTH0_CONNECTION_NAME = @LDAP_AUTH0_CONNECTION_NAME@
REDIRECT_URL_AUTH0 = /reg2/callback.action
REG_SERVER_NAME= @REG_SERVER_NAME@

#Parameter whether we use login processor or not
USE_LOGIN_PROCESSOR = @useLoginProcessor@
Binary file modified jboss_files/lib/tcwebcommon.jar
Binary file not shown.
Binary file modified lib/third_party/aspclient/asp-client.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public class ProjectWorkManagementAction extends BaseDirectStrutsAction implemen
WORK_STEP_DISPLAY_NAME.put(WorkStep.StepType.completeDesigns.name(), "Complete Designs");
WORK_STEP_DISPLAY_NAME.put(WorkStep.StepType.finalFixes.name(), "Final Fixes");
WORK_STEP_DISPLAY_NAME.put(WorkStep.StepType.code.name(), "Code");
WORK_STEP_DISPLAY_NAME.put(WorkStep.StepType.codeFinalFixes.name(), "Code Final Fixes");
}

/**
Expand Down Expand Up @@ -821,11 +822,15 @@ private com.appirio.client.asp.api.Submission getStudioSubmissionDataForAPI(Subm
long sortOrder = resultContainer.getIntItem(i, "sort_order");
long imageTypeId = resultContainer.getLongItem(i, "image_type_id");
String imageFileName = resultContainer.getStringItem(i, "file_name");
SubmissionFile.FileRole fileRole = SubmissionFile.FileRole.PREVIEW;
SubmissionFile.FileRole fileRole;

// 29 = small watermark, 31 = full watermark

if (imageTypeId == 29L || imageTypeId == 31L) {
if (sortOrder == 1) {
fileRole = SubmissionFile.FileRole.COVER;
} else {
fileRole = imageTypeId == 29L ? SubmissionFile.FileRole.PREVIEW_SMALL : SubmissionFile.FileRole.PREVIEW_FULL;
}

files.add(createSubmissionFile(fileRole, getImageFilePath(submission, imageFileName)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import com.topcoder.web.common.SimpleRequest;
import com.topcoder.web.common.SimpleResponse;
import com.topcoder.web.common.security.LightAuthentication;
import com.topcoder.web.common.security.SSOCookieService;
import com.topcoder.web.common.security.SSOCookieServiceImpl;
import com.topcoder.web.common.security.SessionPersistor;
import org.apache.struts2.ServletActionContext;
import org.w3c.dom.Document;
Expand Down Expand Up @@ -193,6 +195,12 @@ public void processRequest(LoginAction action) {
new SimpleResponse(ServletActionContext.getResponse()));
auth.login(new SimpleUser(tcSubject.getUserId(), username, password), action.getFormData().isRemember());

//We need to set SSO cookie, BUT password in MockXmlAuthenticator.xml must be same with
//the one in database
SSOCookieService ssoCookieService = new SSOCookieServiceImpl();
ssoCookieService.setSSOCookie(ServletActionContext.getResponse(), tcSubject.getUserId(),
action.getFormData().isRemember());

// generate the jwt cookie
DirectJWTSigner jwtSigner = new DirectJWTSigner(DirectProperties.CLIENT_SECRET_AUTH0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ public final class DirectProperties {
*/
public static String LDAP_AUTH0_CONNECTION_NAME;

/**
* Paramater whether we use loginProcessor or not
*
*/
public static String USE_LOGIN_PROCESSOR;

/**
* <p>
* Initializes non-final static fields for this class with values for the same-named properties from the resource
Expand Down
9 changes: 6 additions & 3 deletions src/web/WEB-INF/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@


<script type="text/javascript">
var use_login_processor = <%=DirectProperties.USE_LOGIN_PROCESSOR%>;

function isEnterKeyPressed(e) {
if (window.event) return (window.event.keyCode == 13);
Expand All @@ -58,7 +59,7 @@

function submitOnEnter(e) {
if (!isEnterKeyPressed(e)) return true;
submitAuth0LoginForm();
doSubmitLoginForm();
return false;
}

Expand Down Expand Up @@ -144,6 +145,7 @@
<!-- End .headerInner -->
</div>
<!-- End #header -->
<s:form action="home" namespace="/" id="LoginForm" method="post">
<div class="loginBox">
<div class="loginBoxInner">
<h2>Login to your account</h2>
Expand All @@ -156,15 +158,16 @@

<p class="password inputF"><input type="password" placeholder="Password" onkeypress="submitOnEnter(event);" id="LoginForm_formData_password" name="formData.password" maxlength="50"><span></span></p>

<a class="login" href="javascript:;" onclick="submitAuth0LoginForm();">Login</a>
<a class="login" href="javascript:;" onclick="doSubmitLoginForm();">Login</a>

<p class="additonalAction jqtransform">
<span class="signForget"><a href="http://<%=ServerConfiguration.NEW_SERVER_NAME%>/?action=callback" target="_blank">Sign Up</a> | <a href="http://www.topcoder.com/password-recovery/" target="_blank">Forgot Password
?</a></span>
<input type="checkbox" name="formData.remember" id="remember_me"><label>Remember me</label>
</p>

</div>
</div>
</s:form>
<div class="socialNetwork">
<a href="javascript:;" class="salesforceIcon socialLogin" title="Login with Salesforce"></a>
<a href="javascript:;" class="githubIcon socialLogin" title="Login with GitHub"></a>
Expand Down
8 changes: 8 additions & 0 deletions src/web/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ var submitLoginForm = function() {
document.LoginForm.submit();
}

var doSubmitLoginForm = function() {
if (use_login_processor){
submitLoginForm();
}else{
submitAuth0LoginForm();
}

}
$(document).ready(function () {

var wrapperH = $('#landingPage #wrapper').height() + 25;
Expand Down
2 changes: 2 additions & 0 deletions token.properties.example
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@
##########################
# typical windows configuration
@loginProcessor@=com.topcoder.direct.services.view.processor.security.EJBLoginProcessor
# set to 'true' if you want to use @loginProcessor@ as authentication system
@useLoginProcessor@=false

# typical VM configuration
#@loginProcessor@=com.topcoder.direct.services.view.processor.security.LoginProcessor
Expand Down