Created
February 19, 2015 20:51
-
-
Save jsieber/014827cf4dc64d637593 to your computer and use it in GitHub Desktop.
custom returnLoginCheck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfif variables.$.event('expired') eq true> | |
<div class="alert alert-error">#variables.$.rbKey('user.forgotexpired')#</div> | |
</cfif> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user.forgotexpired=The temporary login link that you requested has expired. Please request a new link below. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="returnLoginCheckCustom" output="false"> | |
<cfargument name="$"> | |
<cfset var rs=""> | |
<cfif not arguments.$.currentUser().isLoggedIn() and len(arguments.$.event('returnID')) and len(arguments.$.event('returnUserID'))> | |
<cfquery name="rs" datasource="#variables.configBean.getReadOnlyDatasource()#" username="#variables.configBean.getReadOnlyDbUsername()#" password="#variables.configBean.getReadOnlyDbPassword()#"> | |
select created from tredirects | |
where redirectID=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.$.event('returnID')#" > | |
</cfquery> | |
<cfif rs.recordcount and rs.created gte dateAdd("d",-2,now())> | |
<cfset loginByUserID($.event('returnUserID'),arguments.$.event('siteID'))> | |
<cfset structDelete(session,"siteArray")> | |
<cfelse> | |
<cflocation url="?display=login&expired=true##reminder" addtoken="false"> | |
</cfif> | |
</cfif> | |
</cffunction> | |
<cffunction name="onApplicationLoad" output="no" returntype="void"> | |
<cfargument name="event"> | |
<cfset $.getBean("userUtility").injectMethod("returnLoginCheck",returnLoginCheckcustom) /> | |
</cffunction> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment