Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a fix to restrict duplicate provider URLs for LDEV-4476 #2461

Open
wants to merge 2 commits into
base: 6.2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions core/src/main/cfml/context/admin/ext.providers.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@
</cfloop>
</cfcase>
<cfcase value="#stText.Buttons.save#">
<cfset providerUrls = QueryColumnData( query=getProvider(), columnName="url" ) />
<cfset data.urls=toArrayFromForm("url")>
<cfset data.rows=toArrayFromForm("row")>
<cfloop from="1" to="#arrayLen(data.urls)#" index="idx">
<cfif !isNull(data.rows[idx])>
<cfset uniqUrl = true />
<cfloop from="1" to="#arrayLen(providerUrls)#" index="index">
<cfif providerUrls[index] EQ data.urls[idx]>
<cfset uniqUrl = false />
</cfif>
</cfloop>
<cfif !isNull(data.rows[idx]) && uniqUrl>
<cfadmin
action="updateRHExtensionProvider"
type="#request.adminType#"
Expand Down Expand Up @@ -92,22 +99,27 @@

<!--- Error Output --->
<cfset printError(error)>

<cfadmin
action="getRHExtensionProviders"
type="#request.adminType#"
password="#session["password"&request.adminType]#"
returnVariable="providers">


<cffunction access="public" name="getProvider" returntype="query">
<cfadmin
action="getRHExtensionProviders"
type="#request.adminType#"
password="#session["password"&request.adminType]#"
returnVariable="providers">
<cfreturn providers/>
</cffunction>
<cfset providers = getProvider()/>
<cfscript>
hasAccess=true;
thread name="provider:data" {
thread.datas=getProvidersInfo(providers:queryColumnData(providers,'url'));
}
thread action="join" name="provider:data" timeout=100;
datas=isNull(cfthread["provider:data"].datas)?{}:cfthread["provider:data"].datas;
// thread name="provider:data" {
// thread.datas=getProvidersInfo(providers:queryColumnData(providers,'url'));
// }
// thread action="join" name="provider:data" timeout=100;
// datas=isNull(cfthread["provider:data"].datas)?{}:cfthread["provider:data"].datas;

datas = getProvidersInfo(queryColumnData(providers, 'url'));
if (isNull(datas)) {
datas = {};
}
</cfscript>


Expand Down
Loading