I was playing with the different debugging settings on my development box the other day and I changed the Report Execution Times from 'classic' to 'tree' thinking that it would be something different.
I needed to do some work on a a FB 5 application and it continued to hang and hang until it ultimately timed out. I've been scratching my head for the past 2 hours trying to track down what is going on and amazingly remembered the change to the debugging settings. Go figure that when I changed back to 'classic' the pages load as they should.
Tuesday, September 25, 2007
Cisco VPN Client for Vista
Just a note for those early adopters of Vista out there (I got it the first day because I'm just cool like that), the Cisco VPN clients < 4.X will not work. You need to find a copy of 5.X and hope that the security policies will allow you to use that adapter.
good luck
good luck
Thursday, September 20, 2007
Processing Dynamic Checkboxes with CF
One of the more common tasks that I deal with is the processing of dynamically created check boxes:
The code below generates a list of checkboxes from a query (they are groups pulled from a Active Directory), if the name of the group is in a list (as in a list of groups that an AD user is a member of) the box is checked.
Simple enough... based on the information in my AD query a list of 150 groups is displayed.
There are a couple of different ways to process these checkboxes, you can
So here is my (usual) solution:
Wow, take out the comments and your down to 5 lines of code which handle all of the work you would have to do for the other solutions.
And YES I know that in general you want to avoid using cfevaluate but running a quick time trial; my code vs. re-querying the AD my code was 50% faster, my code against a simple DB query was still 20% faster...
The code below generates a list of checkboxes from a query (they are groups pulled from a Active Directory), if the name of the group is in a list (as in a list of groups that an AD user is a member of) the box is checked.
<cfoutput>
<cfloop query="DirectoryTree">
<!--- SHOW A LIST OF CHECK BOXES FOR EACH GROUP AVAILABLE,
IF THE SELECTED USER IS A MEMBER MARK THAT GROUP AS CHECKED --->
<input type="checkbox" name="#DirectoryTree.Name#"
<cfif listContainsNoCase(MembersList, #DirectoryTree.Name#)>checked</cfif> >
#DirectoryTree.Name#<br />
</cfloop>
</cfoutput>
Simple enough... based on the information in my AD query a list of 150 groups is displayed.
There are a couple of different ways to process these checkboxes, you can
- Preform another query against the AD (or what ever datasource your using), loop over it and create a series of cfparam tags with the name of the checkbox and a default value of false.
- Use a hidden form field and pass a list of names and again create a series of cfparams
So here is my (usual) solution:
<!--- LOOP OVER ALL OF THE FIELDS FROM THE FORM USING THE FORM.FIELDNAMES LIST
(WHICH PROVIDES A COMPLETE LIST OF ALL THE FIELDS PASSED IN VIA THE
SUBMISSION PAGE MINUS THE 'FIELDNAMES' COLUMN) --->
<cfloop list="#Form.FieldNames#" index="FieldName">
<!--- TAKE A LOOK AT THE VALUE OF THE FORM FIELDS LOOKING FOR A VALUE
OF 'ON'; KEEP IN MIND THAT IF YOU HAVE ANY OTHER FIELDS WHICH PASS
THE SAME VALUE YOU WILL GET FALSE POSITIVES, WHICH CAN BE AVOIDED BY
A LITTLE MORE LOGIC AND GOOD NAMING CONVENTIONS --->
<cfif evaluate("Form.#FieldName#") EQ "on">
<cfoutput>#FieldName# is a checked box!<br /></cfoutput>
</cfif>
</cfloop>
Wow, take out the comments and your down to 5 lines of code which handle all of the work you would have to do for the other solutions.
And YES I know that in general you want to avoid using cfevaluate but running a quick time trial; my code vs. re-querying the AD my code was 50% faster, my code against a simple DB query was still 20% faster...
Labels:
coding notes,
coldfusion,
lazy coding,
LDAP,
my stupid moments
Tuesday, September 18, 2007
LDAP Got Me!
Fighting with LDAP (always a pleasant experience) and I forgot a key element... You don't add groups to users, you add users (or groups, or computers ..) to groups !
Friday, September 14, 2007
A useful Link For Ektron's CMS
After much searching I finally found 1 good document from Ektron about setting up their CMS
http://dev.ektron.com/kb_article.aspx?id=10656&terms=indexing+service
http://dev.ektron.com/kb_article.aspx?id=10656&terms=indexing+service
Wednesday, September 12, 2007
Odd cfmail Issue
So I was troubleshooting an issue with Coldfusion and cfmail. The code for the actual tag worked fine in our development environment and on my personal machines but no one was receiving emails from the production machine.
Checking all of the settings, I found that the mail server was properly defined in the Administrator and the log reported that all the emails had gone out. But the mail server logs didn't have any record of those emails...
Strange right?
I'm still not sure what is causing the problem but the issue was resolved by adding the 'server' attribute to the cfmail tag. The thing that makes this really strange is that there are other applications on the same box which do not have the server attribute set and are successfully sending email...
Checking all of the settings, I found that the mail server was properly defined in the Administrator and the log reported that all the emails had gone out. But the mail server logs didn't have any record of those emails...
Strange right?
I'm still not sure what is causing the problem but the issue was resolved by adding the 'server' attribute to the cfmail tag. The thing that makes this really strange is that there are other applications on the same box which do not have the server attribute set and are successfully sending email...
Labels:
coding notes,
coldfusion,
Configuration,
issues
Friday, September 07, 2007
A Note on CFLDAP tag attributes
Livedocs for the cfldap tag list the scope attribute as defaulting to 'onelevel' while in reality the default is 'subtree'.
Thursday, September 06, 2007
Windows Server 2003 Security Issue?
I'm running Windows Server 2003 Standard and noticed something interesting. When connected via remote desktop the machine would prompt me to restart the server after installing updates. I kept clicking 'Restart Later' and then walked from my machine long enough for it to automatically lock.
What was interesting is that through the remote desktop connection the desktop was locked and when the restart your server dialog came up again I clicked 'restart now'. It not only restarted the machine but before it did, the desktop was unlocked for long enough for me to make some changes to a text file before shutting down.
What was interesting is that through the remote desktop connection the desktop was locked and when the restart your server dialog came up again I clicked 'restart now'. It not only restarted the machine but before it did, the desktop was unlocked for long enough for me to make some changes to a text file before shutting down.
Subscribe to:
Posts (Atom)