Date: Fri, 29 Mar 2024 00:46:30 +0000 (UTC) Message-ID: <1941641451.3.1711673190571@6815902aa605> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2_1882904746.1711673190571" ------=_Part_2_1882904746.1711673190571 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The standard FarCry login screen can be customised in a variety of ways.=
Changing the properties on the standard FarCry login is easy. Just login= into the webtop and go to ADMIN > Configuration > General. You can c= hange the application name and tagline here. Also you can change the logo-i= mage by adding an absolute URL or an address relative to the webroot of you= r application.
You can completely replace the login template by adding a template of yo= ur own to ./yourproject/customadmin/login/login.cfm
<cfs= etting enablecfoutputonly=3D"Yes"> <cfprocessingDirective pageencoding=3D"utf-8"> <cfimport taglib=3D"/farcry/fourq/tags" prefix=3D"q4"> <cfoutput> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w= ww.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns=3D"http://www.w3.org/1999/xhtml"> <head>=20 <title>#application.config.general.siteTitle# :: #application.applica= tionname#</title> <!--- check for custom Admin CSS in project codebase ---> <cfif fileExists("#application.path.project#/www/css/customadmin/admin.c= ss")> <cfoutput> <link href=3D"#application.url.webroot#/css/customadmin/admin.css" r= el=3D"stylesheet" type=3D"text/css" /> </cfoutput> <cfelse> <cfoutput> <link href=3D"#application.url.farcry#/css/main.css" rel=3D"styleshe= et" type=3D"text/css" /> </cfoutput> </cfif> <script type=3D"text/javascript" src=3D"#application.url.farcry#/js/fade= .js"></script> </head> <body id=3D"sec-login" onload=3D"ol()"> </cfoutput> <cfset returnUrl =3D URLDecode(url.returnUrl)> <cfset returnUrl =3D replace( returnUrl, "logout=3D1", "" )> <cfset returnUrl =3D replace( returnUrl, "&&", "" )> <cfparam name=3D"error" default=3D""> <cfif isdefined("url.error") and url.error eq "draft"> <!--- TODO: i18n ---> <cfset error =3D "This page is in draft. Please login with your deta= ils below"> </cfif> <cfset currentNumberLoginAttempts =3D 0> <cfif isDefined("form.Normal")> <cfset bHasLoggedIn =3D request.dmSec.oAuthentication.login(userlogi= n=3Dform.userlogin,userpassword=3Dform.password,baudit=3D1)> <cfif bHasLoggedIn> <cfset o_userProfile =3D createObject("component", application.t= ypes.dmProfile.typePath)> <cfset session.dmProfile =3D o_userProfile.getProfile(userName= =3Dform.userlogin)> <cfelse> <!--- check the audit log to see if they have try to login befor= e and failed ---> <cfset dateTolerance =3D DateAdd("n","-#application.config.gener= al.loginAttemptsTimeOut#",Now())> <cfquery name=3D"qLogAudit" datasource=3D"#application.dsn#"> SELECT count(a.datetimeStamp) as numberOfLogin, max(a.datetimeStam= p) as lastlogindate, a.username FROM #application.dbowner#fqAudit a WHERE a.auditType =3D 'dmSec.loginfailed' AND a.datetimeStamp >=3D <cfqueryparam value=3D"#createOD= BCDateTime(dateTolerance)#" cfsqltype=3D"cf_sql_timestamp"> GROUP BY a.username </cfquery> <cfif qLogAudit.recordcount> <cfset currentNumberLoginAttempts =3D qLogAudit.numberOfLogi= n> </cfif> <cfset error =3D "<h5 class=3D'fade-FFDADA' id=3D'errortext'&= gt;<span style=3D'color:##c00'><b>Login failed:</b></s= pan> Invalid User Login</h5>"> </cfif> </cfif> <cfset oAuthentication =3D request.dmSec.oAuthentication> <cfset stLoggedIn =3D oAuthentication.getUserAuthenticationData()> <cfset bLoggedin =3D stLoggedIn.bloggedIn> <cfif bLoggedIn> <!--- dmSecMX automatically sets up session.dmSec.authentication str= ucture ---> <!--- check for ADMIN permissions ---> <cfset oAuthorisation =3D request.dmSec.oAuthorisation> <cfset iAdminState =3D oAuthorisation.checkPermission(permissionName= =3D"Admin",reference=3D"PolicyGroup")> =20 <cfif iAdminState eq 1> <!--- turn on admin permissions ---> <cfset request.mode.bAdmin =3D 1> <cfset session.dmSec.authentication.bAdmin =3D 1> =20 <!--- i18n: admin bits ---> <cfif NOT structKeyExists(application.adminBundle, session.dmPro= file.locale)> <!--- <cfset application.adminBundle[session.dmProfile.lo= cale]=3Dapplication.rB.getResourceBundle("farcry.admin",session.dmProfile.l= ocale,true)> ---> <!--- check if resource exist for this locale if not default= to en_AU ---> <cfif StructIsEmpty(application.rB.getResourceBundle("#appli= cation.path.core#/packages/resources/admin.properties",session.dmProfile.lo= cale,false))> <cfset application.adminBundle[session.dmProfile.locale]= =3Dapplication.rB.getResourceBundle("#application.path.core#/packages/resou= rces/admin.properties",session.dmProfile.locale,false)> <cfelse> <cfset application.adminBundle[session.dmProfile.locale]= =3Dapplication.rB.getResourceBundle("#application.path.core#/packages/resou= rces/admin.properties","en_AU",false)> =20 </cfif> </cfif> <!--- i18n: find out this locale's writing system direction usin= g our special psychic powers ---> <cfif application.i18nUtils.isBIDI(session.dmProfile.locale)> <cfset session.writingDir=3D"rtl"> <cfelse> <cfset session.writingDir=3D"ltr"> </cfif>=20 <!--- i18n: final bit, grab user language from locale, tarts up = html tag ---> <cfset session.userLanguage=3Dleft(session.dmProfile.locale,2)&g= t; </cfif> <!--- relocate to original location ---> <cflocation url=3D"#returnUrl#" addtoken=3D"No"> <cfabort> </cfif> <!--- set message [error], if user has logged out ---> <cfif not len(error) AND returnUrl contains "logout=3D1"> <cfset error=3D"<span style=3D'color:##008C0D'><b>OK:<= ;/b></span> You have successfully logged out."> </cfif> <cfset bShowLogin =3D "true"> <cfif currentNumberLoginAttempts GTE application.config.general.loginAtt= emptsAllowed> <cfset bShowLogin =3D "false"> <cfset error =3D "<h5 class=3D'fade-FFDADA' id=3D'errortext'>&= lt;span style=3D'color:##c00'><b>Login failed:</b></span&= gt; Invalid User Login<br />You have exceeded the ammount of login at= tempts allowed #application.config.general.loginAttemptsAllowed#. Please re= try later.</h5>"> </cfif> <cfoutput> <script type=3D"text/javascript"> function ol() { el=3Ddocument.getElementById('userLogin'); if ( el.value.length=3D=3D0 ) el.focus(); } </script> <form action=3D"#cgi.script_name#?#cgi.query_string#" method=3D"post">= ; <div id=3D"login"> <!--- default logo gif ---> <cfset siteLogo =3D "images/logo_placeholder.gif">=20 <!--- if there is a site logo, use it instead of the default placeho= lder ---> =20 <cfif structKeyExists(application.config.general,'siteLogoPath')> <cfif application.config.general.siteLogoPath NEQ ""> <cfset siteLogo =3D application.config.general.siteLogoPath&= gt; </cfif> </cfif> <h1><a href=3D"#application.url.webroot#/"><img src=3D"#= siteLogo#" alt=3D"#application.config.general.siteTitle#" /></a>#a= pplication.config.general.siteTitle#<span>#application.config.general= .siteTagLine#</span></h1> <fieldset><cfif bShowLogin EQ "true"> <label for=3D"userLogin"> Username <input type=3D"text" name=3D"userLogin" id=3D"userLogin" tabinde= x=3D"1" /> </label> <label for=3D"password"> Password <input type=3D"password" name=3D"password" id=3D"password" tabin= dex=3D"2" /> </label> <input type=3D"Submit" name=3D"Normal" value=3D"Log In" class=3D= "f-submit" tabindex=3D"3" /></cfif> #error# </fieldset> =20 <h3><img src=3D"images/powered_by_farcry_watermark.gif" al= t=3D"Powered by FarCry" />Tell it to someone who cares</h3> =20 </div> </form> </body> </html> </cfoutput> <cfsetting enablecfoutputonly=3D"No">