- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 03:01 AM
Hi All ,
I have to set a security disclaimer page only who logins for the first time . Beneath that page there will be 2 check boxes Accept and Decline .
1. When user will click Accept it should redirect to the Service Portal homepage.
2. If Decline it should again go back to login page.
Security disclaimer page should get set after login on Service portal page.
Version : Istanbul .
Please provide help how to achieve this .
Thanks
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2016 12:41 AM
Hey Aastha,
Let's take it stepwise:
You might find an installation exit called: Login
It basically checks the username and password and based on a match, home page redirection applies. I have modified the script as belows (change highlighted in bold):
gs.include("PrototypeServer");
var Login = Class.create();
Login.prototype = {
initialize : function() {
},
process : function() {
// the request is passed in as a global
var userName = request.getParameter("user_name");
var userPassword = request.getParameter("user_password");
var user = GlideUser;
var authed = user.authenticate(userName, userPassword);
if (authed) {
var gr = new GlideRecord("sys_user");
gr.addQuery('user_name',userName);
gr.addNullQuery("last_login_time");
gr.query();
if (gr.next()) {
gs.setRedirect("https://yourinstance/customer_service");
}
return user.getUser(userName);
}
this.loginFailed();
return "login.failed";
},
loginFailed : function() {
if (GlideController.exists("glide.ldap.error.connection")) {
var ldapConnError = GlideController.getGlobal("glide.ldap.error.connection");
if ( GlideStringUtil.notNil(ldapConnError) )
GlideSession.get().addErrorMessage(ldapConnError);
} else {
var message = GlideSysMessage.format("login_invalid");
GlideSession.get().addErrorMessage(message);
}
}
}
Here, gs.setRedirect("https://yourinstance/customer_service") is redirecting user to customer_service content site, you can have your own customer page here. Once, you are able to redirect to customer_service site, you can try creating your UI page with Custom Buttons. These custom buttons will redirect based on your requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 03:44 AM
1. Create a UI page with 2 Buttons, 1 redirects to Portal, another redirects back to login page.
2. Create a login rule, that checks is 'Last Login Time' is empty, then redirect to that UI page.
This is how I would do in Helsinki. Step 2 can be performed by login properties also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 09:17 PM
Hi anurag92 ,
1. How to create a UI Page ?How to redirect ? Can you please provide some screenshots so that I can understand it in a better way .
2. How to create this login rule ? Where ? Please help me out with code.
Also can you confirm if this is possible in Istanbul Version.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 10:03 PM
Hi, have you checked the documentation for login_redirect - Redirect to Service Portal after login This should also be doable on Istanbul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 04:23 AM
Yes saw this but getting confused for the second part regarding the script include.
Please provide me the solution according to my requirement .