This commit is contained in:
msyu
2025-09-19 10:00:06 +03:00
parent 3f89330b57
commit 036fa7b227
3 changed files with 35 additions and 19 deletions
+21 -5
View File
@@ -7,10 +7,10 @@
<!--- Pseudoconstructor --->
<!--- Set up the application. --->
<cfset this.Name = "PAYG-REPORT" />
<cfset this.applicationTimeout = createTimeSpan( 0, 0, 0, 30 ) />
<cfset this.applicationTimeout = createTimeSpan( 0, 3, 0, 0 ) />
<cfset this.sessionmanagement="Yes"/>
<cfset this.clientmanagement="No"/>
<cfset this.sessiontimeout=CreateTimeSpan(0, 0, 0, 20)/>
<cfset this.sessiontimeout=CreateTimeSpan(0, 1, 0, 0)/>
<cfset this.setclientcookies="No"/>
<cfset this.mappings = structNew() />
<cfset this.mappings["/mod"] = getDirectoryFromPath(getCurrentTemplatePath()) & "mod/" />
@@ -28,7 +28,13 @@
<cfset request.DS = "#this.datasource#">
<cfset request.language="">
<!--- кажется, нужно инициализировать датасорцы в псевдоконструкторе - onRequest не получается --->
<!--- <cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","ds_#this.datasource#")/> --->
<!--- *** проверить, что есть - если есть, не создавать --->
<!--- но так не работает --->
<!--- <cfif NOT structKeyExists(this.datasources,this.datasource)>
<cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","ds_#this.datasource#")/>
</cfif> --->
<!--- <cfdump var=#variables#/> --->
<cffunction
@@ -70,7 +76,7 @@
<!--- global settings --->
<cfset request.RECORDS_PER_PAGE=500/>
<cfset request.APP_VERSION="0.00.002"/>
<cfset request.APP_VERSION="0.00.005"/>
<cfset request.STAND=getStand()/>
<!--- application constants --->
@@ -169,6 +175,7 @@
--->
<cfif structKeyExists(session, "auth")>
<cfset request.auth = structCopy(session.auth)/>
<!--- <cfset request.auth.wz = "WZ01553"/> --->
<!--- тут нужно сделать проверку и рефреш токена --->
<!--- сессия есть --->
<cfelse>
@@ -336,9 +343,16 @@
<cfargument name="dsname" type="string" required="true"/>
<cfargument name="prefix" type="string" default=#dsname#/>
<cfset system = createObject("java", "java.lang.System")/>
<cfset var ds={}/>
<cftry>
<cfquery name="qTestDs" datasource=#arguments.dsname#>
select 1;
</cfquery>
<cfcatch type="database">
<cfset system = createObject("java", "java.lang.System")/>
<cfloop list="class,connectionString,database,driver,dbdriver,host,port,type,url,username,password,bundleName,bundleVersion,connectionLimit,liveTimeout,validate" item="field"><!--- driver vs dbdriver --->
<cfset var value=system.getEnv("#arguments.prefix#_#field#")/>
<cfif isDefined("value") AND len(value)>
@@ -348,6 +362,8 @@
<cfif structIsEmpty(ds)>
<cfthrow type="application" message="Datasource not configured" detail="Datasource not defined in the environment. Expected prefix is #arguments.prefix#"/>
</cfif>
</cfcatch>
</cftry>
<!--- test datasource (just to get exception if invalid) --->
<cftry>
+1 -1
View File
@@ -6,5 +6,5 @@
Сертификат открытого ключа можно каждый раз получать от IDP.
Запрос к IDP идет только для освежения сессии, а не на каждый запрос. Логаут на IDP не проверяется при каждом запросе.
<br/>
<!--- <cflocation url="payg.cfm" addtoken="No" /> --->
<cflocation url="payg.cfm" addtoken="No" />
<a href="payg.cfm">PAYG Report</a>
+1 -1
View File
@@ -12,7 +12,7 @@
<cfparam name="dt_start" type="date" default=#dateAdd('m',-1,dt_finish)#/>
<cfset hours=dateDiff('h',dt_start,dt_finish)/>
<cfset tenant_wz_index=val(mid(request.auth.WZ,3,5))/><!--- cut off WZ --->
<cfset tenant_wz_index=val(mid(request.auth.wz,3,5))/><!--- cut off WZ --->
<!--- Для начала выкатываем просто кусок каталога, не фильтруя по спеке (которой иногда нет) --->
<cfquery name="qSpec">