Commit 3ba39e42 by Nilu Committed by Harsh Shah

check user role when login in to admin portal

parent 4ae53b28
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package performa.form;
import java.util.Map;
import oneit.objstore.ObjectTransaction;
import oneit.security.LoginProcessor;
import oneit.security.SecUser;
import oneit.servlets.forms.SubmissionDetails;
import oneit.utils.MultiException;
import oneit.utils.parsers.FieldException;
import performa.utils.Utils;
/**
*
* @author nilu
*/
public class UserLoginFP extends LoginProcessor
{
@Override
protected void checkUserCanLogin(ObjectTransaction trans, SecUser userToCheck, SubmissionDetails submission, Map requestParams) throws FieldException, MultiException
{
super.checkUserCanLogin(trans, userToCheck, submission, requestParams);
if(!Utils.checkAdminPortalAccess(userToCheck))
{
throw new FieldException("You're not an authorised user to access admin portal.", SecUser.FIELD_UserName);
}
}
}
\ No newline at end of file
......@@ -36,7 +36,7 @@
<NODE name="signin_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
<FORM name="*.login" factory="Participant" class="oneit.security.LoginProcessor">
<FORM name="*.login" factory="Participant" class="performa.form.UserLoginFP">
<NODE name="loginFailureMessage" factory="String" value="Invalid password, please re-check your login details ... "/>
<NODE name="onSuccessURL" factory="String" value="frame.jsp"/>
<PARSER name="username" factory="Participant" class="oneit.utils.parsers.StringParser">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment