Article ID: 970782 - Last Review: April 29, 2009 - Revision: 1.0 Howto disable autocomplete for an entire SharePoint farmSource: Microsoft Support RAPID PUBLISHINGRAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION. SymptomSome 3rd party security applications will flag the built in AutoComplete SharePoint functionality as a security risk when users access the SharePoint resources on a public machine. ResolutionRecommendations include setting autocomplete to "off" on all your forms. Or, writing some custom code to override the feature. Here is some SAMPLE CODE that can be used in conjunction with a client created custom.js to override the Autocomplete feature in SharePoint: 1. Create feature files that will inject content into the master page "AdditionalPageHead" section. 2. Create a new feature folder under SharePoint. Add the Feature.xml and CustomSchema.xml files like below: TEMPLATE\FEATURES\DelegateControl\feature.xml Feature.xml =================== <?xml version="1.0" encoding="utf-8"?> <Feature Id="<GUID>" Title = "AUTOCOMPLETE Disable" Description = "AUTOCOMPLETE Disable" Creator = "creatorName" Version = "1.0.0.0" DefaultResourceFile=" " Hidden ="TRUE" Scope="WebApplication" xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests> <ElementManifest Location="CustomSchema.xml" /> </ElementManifests> </Feature> CustomSchema.xml ===================== <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Control Id="AdditionalPageHead" Sequence="80" ControlSrc="~/_controltemplates/custom/custom.ascx"> </Control> </Elements> 2. Create a custom.ascx file and place it in the TEMPLATE\CONTROLTEMPLATES\custom\ directory of the 12 hive Custom.ascx ==================== <%@ Control Language="C#" %> <script type="text/javascript" src="/_layouts/Custom/Custom.js" defer="true"></script> 3. Create your custom.js and place it in the Layouts/Custom/ directory of the 12 hive Custom.js ==================== if (document.getElementsByTagName) { var forms = document.getElementsByTagName("form"); for (var i=0; i<forms.length; i++) { forms[i].autocomplete = "off"; } } More InformationFeature Element (Feature) http://msdn.microsoft.com/en-us/library/ms436075.aspx (http://msdn.microsoft.com/en-us/library/ms436075.aspx) DISCLAIMERMICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
|
|
Back to the top
