943,790 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 1328
  • ColdFusion RSS
Mar 15th, 2008
0

cfloops

Expand Post »
I'm trying to make a list of sub titles that links to mid topic jumps on another page. As the sub titlles are the same for each main title and the midtopic jumps increment numerically- I thought I could use cfloop - but I can't get it to work - either my titles all have to be the same or my links all have to be the same.... can anyone help??
I tried using nested loops but that made it worse as the inner loop had to loop through before the outer loop ... hope that makes sense!!! Can someone help me??

As you may have guessed - I'm a noobie so I would be grateful for any suggestions
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mollypepperpot is offline Offline
2 posts
since Mar 2008
Mar 18th, 2008
0

Re: cfloops

Are you outputting from a query?

If so you can use the group attribute of the cfoutput tag. Here's an example:

ColdFusion Syntax (Toggle Plain Text)
  1. <cfoutput query="queryname" group="title">
  2. #Title#
  3. <cfoutput>
  4. #SubTitle#<br />
  5. </cfoutput>
  6. </cfoutput>

This would ouput the following:

Title1
Subtitle1
Subtitle2
Subtitle3
Title2
Subtitle1
Subtitle2
Title3
Subtitle1

Post some of your code and I'll have a look at it.
Reputation Points: 23
Solved Threads: 10
Junior Poster in Training
cmhampton is offline Offline
79 posts
since Feb 2008
Mar 18th, 2008
0

Re: cfloops

Thanks this was really helpful, I got so bogged down with cflooping that I didn't think to try looking at it differently!!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mollypepperpot is offline Offline
2 posts
since Mar 2008
Mar 18th, 2008
0

Re: cfloops

Glad to help. Let me know if you have any other questions.
Reputation Points: 23
Solved Threads: 10
Junior Poster in Training
cmhampton is offline Offline
79 posts
since Feb 2008
Jul 15th, 2010
0

LDAP server encrypted and decrypted

I'm tasked to work on our LDAP server. It consists of validating the user credentials by checking and matching their passwords stored in the primary Active Directory server. If the passwords are not found there, the passwords will be checked and matched in the secondary Active Directory server. In this step, we want to ensure that the passwords are encrypted and are able to be decrypted going to the secondary server. Right now, I do a research on how to encrypt an decrypt passwords. I need help please see the code

<cfset root = "DC=pa,DC=mil">
<cfset attributes = "sAMAccountName,dn,cn">
<cfset filter = "(&(sAMAccountName=#Form.username#)(objectclass=*))">
<cfset LDAP_username = "CN=DMA Apps,CN=Users,DC=pa,DC=mil">
<cfset LDAP_password = "">
<cfset LDAP_SERVER = "">
<cfset LDAP_SERVER2 = "">
<cfset LDAP_PORT = >
<cfset UserSearchFailed = 0>

<cftry>
<p><b>washington.pa.mil</b></p>
<cfldap action = "QUERY"
name = "userSearch"
attributes = "#attributes#"
start = "#root#"
scope = "SUBTREE"
server = "#LDAP_SERVER2#"
port = "#LDAP_PORT#"
filter = "#filter#" timeout="10"
username = "#LDAP_username#"
password = "#LDAP_password#">

<cfcatch type = "ANY">
<cfset UserSearchFailed = 1>
</cfcatch>
</cftry>

<cfif UserSearchFailed EQ 1>
<p><b>comet.pa.mil</b></p>
<cfset UserSearchFailed = 0>
<cftry>
<cfldap action = "QUERY"
name = "userSearch"
attributes = "#attributes#"
start = "#root#"
scope = "SUBTREE"
server = "#LDAP_SERVER#"
port = "#LDAP_PORT#"
filter = "#filter#"
username = "#LDAP_username#" timeout="10"
password = "#LDAP_password#">
<cfcatch type = "ANY">
<cfset UserSearchFailed = 1>
</cfcatch>
</cftry>
</cfif>

<!------------ If error or no match for username ----------------->
<cfif IsDefined("userSearch.RecordCount") AND (NOT userSearch.recordcount)>
<cfset UserSearchFailed = 1>
</cfif>
<!--- <p><b>TESTING....</b></p> --->

<!--- pass the user's DN and password to see if the user authenticates --->
<cftry>
<p><b>washington.pa.mil</b></p>
<cfset UserSearchFailed = 0>
<cfldap action = "QUERY"
name = "auth"
attributes = "#attributes#"
start = "#root#"
scope = "SUBTREE"
filter = "#filter#"
server = "#LDAP_SERVER2#"
port = "#LDAP_PORT#"
username = "#userSearch.dn#"
password = "#Form.Password#">

<cfcatch type = "ANY">
<cfset UserSearchFailed = 1>
</cfcatch>
</cftry>

<cfif UserSearchFailed EQ 1>
<p><b>comet.pa.mil</b></p>
<cfset UserSearchFailed = 0>
<cftry>
<cfldap action = "QUERY"
name = "auth"
attributes = "#attributes#"
start = "#root#"
scope = "SUBTREE"
filter = "#filter#"
server = "#LDAP_SERVER#"
port = "#LDAP_PORT#"
username = "#userSearch.dn#"
password = "#Form.Password#">

<cfcatch type = "ANY">
<cfset UserSearchFailed = 1>
</cfcatch>
</cftry>
</cfif>

<!--- If ldap query returned the user is not valid --->
<cfif (NOT IsDefined("auth")) OR auth.RecordCount LTE 0>
<cfset UserSearchFailed = 1>
</cfif>

<cftry>
<cfset UserSearchFailed = 0>
<cfldap action = "QUERY"
name = "groupSearch"
attributes = "cn,member"
start = "#root#"
scope = "SUBTREE"
server = "#LDAP_SERVER2#"
port="#Variables.LDAP_PORT#"
filter="(&(objectclass=*)(cn=earlybird-users-dl))"
username = "#LDAP_username#"
password = "#LDAP_password#">
<cfcatch type="any">
<cfset UserSearchFailed = 1>
</cfcatch>
</cftry>

<cfif UserSearchFailed EQ 1>
<cftry>
<cfset UserSearchFailed = 0>
<cfldap action = "QUERY"
name = "groupSearch"
attributes = "cn,member"
start = "#root#"
scope = "SUBTREE"
server = "#LDAP_SERVER#"
port="#Variables.LDAP_PORT#"
filter="(&(objectclass=*)(cn=earlybird-users-dl))"
username = "#LDAP_username#"
password = "#LDAP_password#">
<cfcatch type="any">
<cfset UserSearchFailed = 1>
</cfcatch>
</cftry>
</cfif>

<cfif (IsDefined("userSearch.cn") AND IsDefined("groupSearch.member")) AND (NOT FindNoCase(userSearch.cn, groupSearch.member))>
<cfset UserSearchFailed = 1>
</cfif>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kimsamac is offline Offline
1 posts
since Jul 2010
Jul 21st, 2010
0
Re: cfloops
Tacking onto a question that's over 2 years old, (and is totally unrelated to what you're asking!), is probably not the best way to get an answer Open a new question ..
Reputation Points: 32
Solved Threads: 44
Posting Whiz
arrgh is offline Offline
349 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: Calling javascript confirm() function
Next Thread in ColdFusion Forum Timeline: <CFDIRECTORY not listing directories





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC