Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 27d28fe

Browse files
author
jamesdotcom
committed
Merge pull request #123 from appirio-tech/work-step-fix
Work step fix
2 parents e993fc6 + f5482bc commit 27d28fe

File tree

9 files changed

+38
-4
lines changed

9 files changed

+38
-4
lines changed

conf/Direct.properties

+2
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ LDAP_AUTH0_CONNECTION_NAME = @LDAP_AUTH0_CONNECTION_NAME@
1818
REDIRECT_URL_AUTH0 = /reg2/callback.action
1919
REG_SERVER_NAME= @REG_SERVER_NAME@
2020

21+
#Parameter whether we use login processor or not
22+
USE_LOGIN_PROCESSOR = @useLoginProcessor@

jboss_files/lib/tcwebcommon.jar

55.4 KB
Binary file not shown.
56 Bytes
Binary file not shown.

src/java/main/com/topcoder/direct/services/view/action/project/ProjectWorkManagementAction.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public class ProjectWorkManagementAction extends BaseDirectStrutsAction implemen
152152
WORK_STEP_DISPLAY_NAME.put(WorkStep.StepType.completeDesigns.name(), "Complete Designs");
153153
WORK_STEP_DISPLAY_NAME.put(WorkStep.StepType.finalFixes.name(), "Final Fixes");
154154
WORK_STEP_DISPLAY_NAME.put(WorkStep.StepType.code.name(), "Code");
155+
WORK_STEP_DISPLAY_NAME.put(WorkStep.StepType.codeFinalFixes.name(), "Code Final Fixes");
155156
}
156157

157158
/**
@@ -821,11 +822,15 @@ private com.appirio.client.asp.api.Submission getStudioSubmissionDataForAPI(Subm
821822
long sortOrder = resultContainer.getIntItem(i, "sort_order");
822823
long imageTypeId = resultContainer.getLongItem(i, "image_type_id");
823824
String imageFileName = resultContainer.getStringItem(i, "file_name");
824-
SubmissionFile.FileRole fileRole = SubmissionFile.FileRole.PREVIEW;
825+
SubmissionFile.FileRole fileRole;
826+
827+
// 29 = small watermark, 31 = full watermark
825828

826829
if (imageTypeId == 29L || imageTypeId == 31L) {
827830
if (sortOrder == 1) {
828831
fileRole = SubmissionFile.FileRole.COVER;
832+
} else {
833+
fileRole = imageTypeId == 29L ? SubmissionFile.FileRole.PREVIEW_SMALL : SubmissionFile.FileRole.PREVIEW_FULL;
829834
}
830835

831836
files.add(createSubmissionFile(fileRole, getImageFilePath(submission, imageFileName)));

src/java/main/com/topcoder/direct/services/view/processor/security/MockLoginProcessor.java

+8
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import com.topcoder.web.common.SimpleRequest;
2424
import com.topcoder.web.common.SimpleResponse;
2525
import com.topcoder.web.common.security.LightAuthentication;
26+
import com.topcoder.web.common.security.SSOCookieService;
27+
import com.topcoder.web.common.security.SSOCookieServiceImpl;
2628
import com.topcoder.web.common.security.SessionPersistor;
2729
import org.apache.struts2.ServletActionContext;
2830
import org.w3c.dom.Document;
@@ -193,6 +195,12 @@ public void processRequest(LoginAction action) {
193195
new SimpleResponse(ServletActionContext.getResponse()));
194196
auth.login(new SimpleUser(tcSubject.getUserId(), username, password), action.getFormData().isRemember());
195197

198+
//We need to set SSO cookie, BUT password in MockXmlAuthenticator.xml must be same with
199+
//the one in database
200+
SSOCookieService ssoCookieService = new SSOCookieServiceImpl();
201+
ssoCookieService.setSSOCookie(ServletActionContext.getResponse(), tcSubject.getUserId(),
202+
action.getFormData().isRemember());
203+
196204
// generate the jwt cookie
197205
DirectJWTSigner jwtSigner = new DirectJWTSigner(DirectProperties.CLIENT_SECRET_AUTH0);
198206

src/java/main/com/topcoder/direct/services/view/util/DirectProperties.java

+6
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ public final class DirectProperties {
132132
*/
133133
public static String LDAP_AUTH0_CONNECTION_NAME;
134134

135+
/**
136+
* Paramater whether we use loginProcessor or not
137+
*
138+
*/
139+
public static String USE_LOGIN_PROCESSOR;
140+
135141
/**
136142
* <p>
137143
* Initializes non-final static fields for this class with values for the same-named properties from the resource

src/web/WEB-INF/index.jsp

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050

5151
<script type="text/javascript">
52+
var use_login_processor = <%=DirectProperties.USE_LOGIN_PROCESSOR%>;
5253
5354
function isEnterKeyPressed(e) {
5455
if (window.event) return (window.event.keyCode == 13);
@@ -58,7 +59,7 @@
5859
5960
function submitOnEnter(e) {
6061
if (!isEnterKeyPressed(e)) return true;
61-
submitAuth0LoginForm();
62+
doSubmitLoginForm();
6263
return false;
6364
}
6465
@@ -144,6 +145,7 @@
144145
<!-- End .headerInner -->
145146
</div>
146147
<!-- End #header -->
148+
<s:form action="home" namespace="/" id="LoginForm" method="post">
147149
<div class="loginBox">
148150
<div class="loginBoxInner">
149151
<h2>Login to your account</h2>
@@ -156,15 +158,16 @@
156158

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

159-
<a class="login" href="javascript:;" onclick="submitAuth0LoginForm();">Login</a>
161+
<a class="login" href="javascript:;" onclick="doSubmitLoginForm();">Login</a>
160162

161163
<p class="additonalAction jqtransform">
162164
<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
163165
?</a></span>
164166
<input type="checkbox" name="formData.remember" id="remember_me"><label>Remember me</label>
165167
</p>
166168

167-
</div>
169+
</div>
170+
</s:form>
168171
<div class="socialNetwork">
169172
<a href="javascript:;" class="salesforceIcon socialLogin" title="Login with Salesforce"></a>
170173
<a href="javascript:;" class="githubIcon socialLogin" title="Login with GitHub"></a>

src/web/scripts/scripts.js

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ var submitLoginForm = function() {
7070
document.LoginForm.submit();
7171
}
7272

73+
var doSubmitLoginForm = function() {
74+
if (use_login_processor){
75+
submitLoginForm();
76+
}else{
77+
submitAuth0LoginForm();
78+
}
79+
80+
}
7381
$(document).ready(function () {
7482

7583
var wrapperH = $('#landingPage #wrapper').height() + 25;

token.properties.example

+2
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@
202202
##########################
203203
# typical windows configuration
204204
@loginProcessor@=com.topcoder.direct.services.view.processor.security.EJBLoginProcessor
205+
# set to 'true' if you want to use @loginProcessor@ as authentication system
206+
@useLoginProcessor@=false
205207

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

0 commit comments

Comments
 (0)