Hi,
Sounds Good! We had thought of this, but due to some of our resources encrypted, using them without password may not be feasible.
I think, I was not very clear in my question but have updated it.
So, there is one web application that uses (should use) primary(SERVER1) server only and when it fails over other(SERVER2) server will become primary and consumed by the web application. And same thing happens at night time when the primary(SERVER2 at this moment) server stops and taken over by other server (SERVER1) again. And this continues every month.
why do you want to stop httpd?
My plan was to enable the httpd.service for primary server, so if the httpd service stops other than during the patching then I want it to restart again.
So, if I could run the command for other server from primary server then I could also disable the service and perform few more other tasks.
My main concern was, If there anyway I can utilize the $ZF(-100) command.
The class CSS.CSP.Login inherits almost the same methods from %CSP.Login class and it's only the Styles that has been modified.
Class CSS.CSP.Login Extends %CSP.Login
{
Parameters....
// This method represents both the methods (OnPage() and OnLoginPage()) from %CSP.Login class
ClassMethod OnPage() As %Status
{
// text strings
Set ConfigName = $P($zu(86),"*",2)
// get key, lookup in localization global
Set tLang = $$$SessionLanguage
Set tTitle = $$FormatText^%occMessages($$$GetSysMessage(tLang,..#DOMAIN,"logintitle","Login %1"),ConfigName)
Set tPrompt = $$$GetSysMessage(tLang,..#DOMAIN,"loginenter","Please login")
Set tUserName = $$$GetSysMessage(tLang,..#DOMAIN,"loginusername","User Name")
Set tPassword = $$$GetSysMessage(tLang,..#DOMAIN,"loginpassword","Password")
Set tLogin = $$$GetSysMessage(tLang,..#DOMAIN,"login","LOGIN")
&html<<html><head>
<title></title>>
Do ..DrawHEAD()
&html<<script language="javascript" type="text/javascript">
function Validate()
{
/* Login validation */
var ok = true;
if ( IsTextNull('CompanyCode') )
{
document.getElementById('CompanyCodeErrorMsg').innerHTML="<br>Company Code is required";
ok = false;
}
else
document.getElementById('CompanyCodeErrorMsg').innerHTML="";
if ( IsTextNull('UserName') )
{
document.getElementById('UserNameErrorMsg').innerHTML="<br>User name is required";
ok = false;
}
else
document.getElementById('UserNameErrorMsg').innerHTML="";
if ( IsTextNull('CachePassword') )
{
document.getElementById('CachePasswordErrorMsg').innerHTML="<br>Password is required";
ok = false;
}
else
document.getElementById('CachePasswordErrorMsg').innerHTML="";
return ok;
}
</script>>
&html< </head>
<body style="margin-left:0; margin-top:0; margin-width:0 margin-height:0;" >
>
Do ..DrawTitle(tTitle)
// Show standard login form
&html<<div style="position: absolute; top:50%; left: 50%; transform:translate(-50%,-50%);">
<form name="Login" method="post" action="#($ZConvert($G(%request.Data("Error:FullURL",1)),"O","HTML"))#" onsubmit="return Validate();">
>
&html<<table class="entryTable" align="center">
<tr>
<td colspan="3">
<div class="loginCaption" style="padding-bottom: 5px;" align="center">#(tPrompt)#:</div>
</td>
</tr>
<tr>
<td class="loginCaption" nowrap>Company:</td>
<td colspan="2">
<input type="text" size="40" name="CompanyCode" id="CompanyCode"> <span class="errorText" id="CompanyCodeErrorMsg"></span>
</td>
</tr>
<tr>
<td class="loginCaption" nowrap>#(tUserName)#:</td>
<td colspan="2">
<input type="text" size="40" name="UserName" id="UserName"> <span class="errorText" id="UserNameErrorMsg"></span>
</td>
</tr>
<tr>
<td class="loginCaption" nowrap>#(tPassword)#:</td>
<td colspan="2">
<input type="password" size="25" name="CachePassword" id="CachePassword"> <span class="errorText" id="CachePasswordErrorMsg"></span>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="CacheLogin" value="#(tLogin)#" class="button"></td>
</tr>
>
// test for error
Set tMsg = $Get(%request.Data("Error:ErrorCode",1))
If ((tMsg'="")&&($SYSTEM.Status.GetErrorCodes(tMsg)'[$$$ERRORCODE($$$RequireAuthentication))) {
&html<<tr><td><center>>
Do ShowError^%apiCSP(tMsg)
&html<</center></td></tr>>
}
&html<</td></tr><tr><td style="height:180px;"><br/></td></tr></table></body></html>>
Quit $$$OK
}
And IBA.CSP.Page uses only the OnPreHTTP from %CSP.Page and gets called only if the login is successful. Whenever the login is unsuccessful the CSS.CSP.Login page is loaded to render the Login page with error message. This happens as soon as I hit the login button and the input validation is done in server side by the Cache standard methods itself, so I needed to access those methods to modify the data as per my need before the Cache does.
Class IBA.CSP.Page Extends %CSP.Page
{
ClassMethod OnPreHTTP() As %Boolean [ ServerOnly = 1 ]
{
/* If unknown user redirect to Login page */
if ($username = "UnknownUser" ) {
if ( %request.PageName '= "PasswordChange.csp" ) && ( %request.PageName '= "CSS.CSP.Login.cls" ) {
set %response.Redirect = "login page"
quit 0
}
} else {
if (%session.Get("User") '= $username) {
//check if user active and redirect to appropriate page
} else {
set %session.EndSession=1
set %response.Redirect = "logout"
quit 0
}
}
}
I have implemented other solution but it would be clean to use the available features, so any suggestion would be highly appreciated.
Many Thanks!
Hi @Timo Lindenschmid and @Pietro Montorfano ,
Thank you for you suggestions, these are really good stuffs you have shared but I had to stick with $ZF(-1) at the moment as it is working as expected with the current Cache version we are using.
I am sure your thoughts will help other developers with similar issue.