1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_unotools.hxx"
30*cdf0e10cSrcweir #ifndef GCC
31*cdf0e10cSrcweir #endif
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
34*cdf0e10cSrcweir //	includes
35*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <unotools/securityoptions.hxx>
38*cdf0e10cSrcweir #include <unotools/configmgr.hxx>
39*cdf0e10cSrcweir #include <unotools/configitem.hxx>
40*cdf0e10cSrcweir #include <tools/debug.hxx>
41*cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
42*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
45*cdf0e10cSrcweir #include <tools/urlobj.hxx>
46*cdf0e10cSrcweir #include <tools/wldcrd.hxx>
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir #include <rtl/logfile.hxx>
51*cdf0e10cSrcweir #include "itemholder1.hxx"
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
54*cdf0e10cSrcweir //	namespaces
55*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir using namespace ::utl					;
58*cdf0e10cSrcweir using namespace ::rtl					;
59*cdf0e10cSrcweir using namespace ::osl					;
60*cdf0e10cSrcweir using namespace ::com::sun::star::uno	;
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
63*cdf0e10cSrcweir //	const
64*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir #define	ROOTNODE_SECURITY				OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Security/Scripting"))
67*cdf0e10cSrcweir #define	DEFAULT_SECUREURL				Sequence< OUString >()
68*cdf0e10cSrcweir #define	DEFAULT_SECLEVEL				3
69*cdf0e10cSrcweir #define DEFAULT_TRUSTEDAUTHORS			Sequence< SvtSecurityOptions::Certificate >()
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir // xmlsec05 depricated
72*cdf0e10cSrcweir #define	DEFAULT_STAROFFICEBASIC			eALWAYS_EXECUTE
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir #define	CSTR_SECUREURL					"SecureURL"
75*cdf0e10cSrcweir #define CSTR_DOCWARN_SAVEORSEND			"WarnSaveOrSendDoc"
76*cdf0e10cSrcweir #define CSTR_DOCWARN_SIGNING			"WarnSignDoc"
77*cdf0e10cSrcweir #define CSTR_DOCWARN_PRINT				"WarnPrintDoc"
78*cdf0e10cSrcweir #define CSTR_DOCWARN_CREATEPDF			"WarnCreatePDF"
79*cdf0e10cSrcweir #define CSTR_DOCWARN_REMOVEPERSONALINFO	"RemovePersonalInfoOnSaving"
80*cdf0e10cSrcweir #define CSTR_DOCWARN_RECOMMENDPASSWORD	"RecommendPasswordProtection"
81*cdf0e10cSrcweir #define CSTR_CTRLCLICK_HYPERLINK        "HyperlinksWithCtrlClick"
82*cdf0e10cSrcweir #define CSTR_MACRO_SECLEVEL				"MacroSecurityLevel"
83*cdf0e10cSrcweir #define CSTR_MACRO_TRUSTEDAUTHORS		"TrustedAuthors"
84*cdf0e10cSrcweir #define CSTR_MACRO_DISABLE				"DisableMacrosExecution"
85*cdf0e10cSrcweir #define CSTR_TRUSTEDAUTHOR_SUBJECTNAME	"SubjectName"
86*cdf0e10cSrcweir #define CSTR_TRUSTEDAUTHOR_SERIALNUMBER	"SerialNumber"
87*cdf0e10cSrcweir #define CSTR_TRUSTEDAUTHOR_RAWDATA		"RawData"
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir #define	PROPERTYNAME_SECUREURL					OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_SECUREURL						))
90*cdf0e10cSrcweir #define PROPERTYNAME_DOCWARN_SAVEORSEND			OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_DOCWARN_SAVEORSEND			))
91*cdf0e10cSrcweir #define PROPERTYNAME_DOCWARN_SIGNING			OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_DOCWARN_SIGNING				))
92*cdf0e10cSrcweir #define PROPERTYNAME_DOCWARN_PRINT				OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_DOCWARN_PRINT					))
93*cdf0e10cSrcweir #define PROPERTYNAME_DOCWARN_CREATEPDF			OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_DOCWARN_CREATEPDF				))
94*cdf0e10cSrcweir #define PROPERTYNAME_DOCWARN_REMOVEPERSONALINFO	OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_DOCWARN_REMOVEPERSONALINFO	))
95*cdf0e10cSrcweir #define PROPERTYNAME_DOCWARN_RECOMMENDPASSWORD  OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_DOCWARN_RECOMMENDPASSWORD     ))
96*cdf0e10cSrcweir #define PROPERTYNAME_CTRLCLICK_HYPERLINK        OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_CTRLCLICK_HYPERLINK           ))
97*cdf0e10cSrcweir #define PROPERTYNAME_MACRO_SECLEVEL				OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_MACRO_SECLEVEL				))
98*cdf0e10cSrcweir #define PROPERTYNAME_MACRO_TRUSTEDAUTHORS		OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_MACRO_TRUSTEDAUTHORS			))
99*cdf0e10cSrcweir #define PROPERTYNAME_MACRO_DISABLE				OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_MACRO_DISABLE					))
100*cdf0e10cSrcweir #define PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME	OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_TRUSTEDAUTHOR_SUBJECTNAME))
101*cdf0e10cSrcweir #define PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER	OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_TRUSTEDAUTHOR_SERIALNUMBER))
102*cdf0e10cSrcweir #define PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA		OUString(RTL_CONSTASCII_USTRINGPARAM(CSTR_TRUSTEDAUTHOR_RAWDATA))
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir // xmlsec05 depricated
105*cdf0e10cSrcweir #define	PROPERTYNAME_STAROFFICEBASIC	OUString(RTL_CONSTASCII_USTRINGPARAM("OfficeBasic"	))
106*cdf0e10cSrcweir #define PROPERTYNAME_EXECUTEPLUGINS     OUString(RTL_CONSTASCII_USTRINGPARAM("ExecutePlugins"  ))
107*cdf0e10cSrcweir #define PROPERTYNAME_WARNINGENABLED     OUString(RTL_CONSTASCII_USTRINGPARAM("Warning"  ))
108*cdf0e10cSrcweir #define PROPERTYNAME_CONFIRMATIONENABLED OUString(RTL_CONSTASCII_USTRINGPARAM("Confirmation"  ))
109*cdf0e10cSrcweir // xmlsec05 depricated
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir #define	PROPERTYHANDLE_SECUREURL					0
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir // xmlsec05 depricated
115*cdf0e10cSrcweir #define	PROPERTYHANDLE_STAROFFICEBASIC	1
116*cdf0e10cSrcweir #define PROPERTYHANDLE_EXECUTEPLUGINS   2
117*cdf0e10cSrcweir #define PROPERTYHANDLE_WARNINGENABLED   3
118*cdf0e10cSrcweir #define PROPERTYHANDLE_CONFIRMATIONENABLED 4
119*cdf0e10cSrcweir // xmlsec05 depricated
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir #define PROPERTYHANDLE_DOCWARN_SAVEORSEND			5
122*cdf0e10cSrcweir #define PROPERTYHANDLE_DOCWARN_SIGNING				6
123*cdf0e10cSrcweir #define PROPERTYHANDLE_DOCWARN_PRINT				7
124*cdf0e10cSrcweir #define PROPERTYHANDLE_DOCWARN_CREATEPDF			8
125*cdf0e10cSrcweir #define PROPERTYHANDLE_DOCWARN_REMOVEPERSONALINFO	9
126*cdf0e10cSrcweir #define PROPERTYHANDLE_DOCWARN_RECOMMENDPASSWORD    10
127*cdf0e10cSrcweir #define PROPERTYHANDLE_CTRLCLICK_HYPERLINK          11
128*cdf0e10cSrcweir #define PROPERTYHANDLE_MACRO_SECLEVEL               12
129*cdf0e10cSrcweir #define PROPERTYHANDLE_MACRO_TRUSTEDAUTHORS         13
130*cdf0e10cSrcweir #define PROPERTYHANDLE_MACRO_DISABLE                14
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir #define PROPERTYCOUNT                               15
133*cdf0e10cSrcweir #define PROPERTYHANDLE_INVALID						-1
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir #define CFG_READONLY_DEFAULT						sal_False
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
138*cdf0e10cSrcweir //	private declarations!
139*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir class SvtSecurityOptions_Impl : public ConfigItem
142*cdf0e10cSrcweir {
143*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
144*cdf0e10cSrcweir 	//	public methods
145*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 	public:
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
150*cdf0e10cSrcweir 		//	constructor / destructor
151*cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir 		 SvtSecurityOptions_Impl();
154*cdf0e10cSrcweir 		~SvtSecurityOptions_Impl();
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
157*cdf0e10cSrcweir 		//	overloaded methods of baseclass
158*cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir 		/*-****************************************************************************************************//**
161*cdf0e10cSrcweir 			@short		called for notify of configmanager
162*cdf0e10cSrcweir 			@descr		These method is called from the ConfigManager before application ends or from the
163*cdf0e10cSrcweir 			 			PropertyChangeListener if the sub tree broadcasts changes. You must update your
164*cdf0e10cSrcweir 						internal values.
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 			@seealso	baseclass ConfigItem
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 			@param		"seqPropertyNames" is the list of properties which should be updated.
169*cdf0e10cSrcweir 			@return		-
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir 			@onerror	-
172*cdf0e10cSrcweir 		*//*-*****************************************************************************************************/
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir     	virtual void Notify( const Sequence< OUString >& seqPropertyNames );
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir 		/*-****************************************************************************************************//**
177*cdf0e10cSrcweir 			@short		write changes to configuration
178*cdf0e10cSrcweir 			@descr		These method writes the changed values into the sub tree
179*cdf0e10cSrcweir 						and should always called in our destructor to guarantee consistency of config data.
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 			@seealso	baseclass ConfigItem
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir 			@param		-
184*cdf0e10cSrcweir 			@return		-
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir 			@onerror	-
187*cdf0e10cSrcweir 		*//*-*****************************************************************************************************/
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir     	virtual void Commit();
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
192*cdf0e10cSrcweir 		//	public interface
193*cdf0e10cSrcweir 		//---------------------------------------------------------------------------------------------------------
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir 		sal_Bool				IsReadOnly		( SvtSecurityOptions::EOption eOption					) const	;
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir 		Sequence< OUString >	GetSecureURLs	(														) const	;
198*cdf0e10cSrcweir 		void					SetSecureURLs	(	const	Sequence< OUString >&	seqURLList			)		;
199*cdf0e10cSrcweir 		sal_Bool				IsSecureURL		(	const	OUString&				sURL,
200*cdf0e10cSrcweir 													const	OUString&				sReferer			) const	;
201*cdf0e10cSrcweir 		inline sal_Int32		GetMacroSecurityLevel	(												) const	;
202*cdf0e10cSrcweir 		void					SetMacroSecurityLevel	( sal_Int32 _nLevel								)		;
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir 		inline sal_Bool			IsMacroDisabled			(												) const	;
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir 		Sequence< SvtSecurityOptions::Certificate >	GetTrustedAuthors		(																						) const	;
207*cdf0e10cSrcweir 		void										SetTrustedAuthors		( const Sequence< SvtSecurityOptions::Certificate >& rAuthors							)		;
208*cdf0e10cSrcweir 		sal_Bool									IsTrustedAuthorsEnabled	(																						)		;
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir 		sal_Bool				IsOptionSet		( SvtSecurityOptions::EOption eOption					) const	;
211*cdf0e10cSrcweir 		sal_Bool				SetOption		( SvtSecurityOptions::EOption eOption, sal_Bool bValue	)		;
212*cdf0e10cSrcweir 		sal_Bool				IsOptionEnabled	( SvtSecurityOptions::EOption eOption					) const	;
213*cdf0e10cSrcweir private:
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir 		/*-****************************************************************************************************//**
216*cdf0e10cSrcweir 			@short		return list of key names of ouer configuration management which represent our module tree
217*cdf0e10cSrcweir 			@descr		These methods return a static const list of key names. We need it to get needed values from our
218*cdf0e10cSrcweir 						configuration management.
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir 			@seealso	-
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir 			@param		-
223*cdf0e10cSrcweir 			@return		A list of needed configuration keys is returned.
224*cdf0e10cSrcweir 
225*cdf0e10cSrcweir 			@onerror	-
226*cdf0e10cSrcweir 		*//*-*****************************************************************************************************/
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir 		void					SetProperty( sal_Int32 nHandle, const Any& rValue, sal_Bool bReadOnly );
229*cdf0e10cSrcweir 		void					LoadAuthors( void );
230*cdf0e10cSrcweir 		static sal_Int32		GetHandle( const OUString& rPropertyName );
231*cdf0e10cSrcweir 		bool					GetOption( SvtSecurityOptions::EOption eOption, sal_Bool*& rpValue, sal_Bool*& rpRO );
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir 		static Sequence< OUString > GetPropertyNames();
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir         Sequence< OUString >					    m_seqSecureURLs;
236*cdf0e10cSrcweir 		sal_Bool									m_bSaveOrSend;
237*cdf0e10cSrcweir 		sal_Bool									m_bSigning;
238*cdf0e10cSrcweir 		sal_Bool									m_bPrint;
239*cdf0e10cSrcweir 		sal_Bool									m_bCreatePDF;
240*cdf0e10cSrcweir 		sal_Bool									m_bRemoveInfo;
241*cdf0e10cSrcweir         sal_Bool                                    m_bRecommendPwd;
242*cdf0e10cSrcweir         sal_Bool                                    m_bCtrlClickHyperlink;
243*cdf0e10cSrcweir 		sal_Int32									m_nSecLevel;
244*cdf0e10cSrcweir 		Sequence< SvtSecurityOptions::Certificate >	m_seqTrustedAuthors;
245*cdf0e10cSrcweir 		sal_Bool									m_bDisableMacros;
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir         sal_Bool                					m_bROSecureURLs;
248*cdf0e10cSrcweir 		sal_Bool									m_bROSaveOrSend;
249*cdf0e10cSrcweir 		sal_Bool									m_bROSigning;
250*cdf0e10cSrcweir 		sal_Bool									m_bROPrint;
251*cdf0e10cSrcweir 		sal_Bool									m_bROCreatePDF;
252*cdf0e10cSrcweir 		sal_Bool									m_bRORemoveInfo;
253*cdf0e10cSrcweir         sal_Bool                                    m_bRORecommendPwd;
254*cdf0e10cSrcweir         sal_Bool                                    m_bROCtrlClickHyperlink;
255*cdf0e10cSrcweir 		sal_Bool									m_bROSecLevel;
256*cdf0e10cSrcweir 		sal_Bool									m_bROTrustedAuthors;
257*cdf0e10cSrcweir 		sal_Bool									m_bRODisableMacros;
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir 		// xmlsec05 depricated
261*cdf0e10cSrcweir         EBasicSecurityMode      m_eBasicMode;
262*cdf0e10cSrcweir         sal_Bool                m_bExecutePlugins;
263*cdf0e10cSrcweir         sal_Bool                m_bWarning;
264*cdf0e10cSrcweir         sal_Bool                m_bConfirmation;
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir         sal_Bool                m_bROConfirmation;
267*cdf0e10cSrcweir         sal_Bool                m_bROWarning;
268*cdf0e10cSrcweir         sal_Bool                m_bROExecutePlugins;
269*cdf0e10cSrcweir         sal_Bool                m_bROBasicMode;
270*cdf0e10cSrcweir 		public:
271*cdf0e10cSrcweir         sal_Bool IsWarningEnabled() const;
272*cdf0e10cSrcweir         void SetWarningEnabled( sal_Bool bSet );
273*cdf0e10cSrcweir         sal_Bool IsConfirmationEnabled() const;
274*cdf0e10cSrcweir         void SetConfirmationEnabled( sal_Bool bSet );
275*cdf0e10cSrcweir         sal_Bool    IsExecutePlugins() const;
276*cdf0e10cSrcweir         void        SetExecutePlugins( sal_Bool bSet );
277*cdf0e10cSrcweir 		EBasicSecurityMode		GetBasicMode	(												) const	;
278*cdf0e10cSrcweir 		void					SetBasicMode	(			EBasicSecurityMode		eMode		)		;
279*cdf0e10cSrcweir };
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
282*cdf0e10cSrcweir //	definitions
283*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir //*****************************************************************************************************************
286*cdf0e10cSrcweir //	constructor
287*cdf0e10cSrcweir //*****************************************************************************************************************
288*cdf0e10cSrcweir SvtSecurityOptions_Impl::SvtSecurityOptions_Impl()
289*cdf0e10cSrcweir 	:ConfigItem				( ROOTNODE_SECURITY			)
290*cdf0e10cSrcweir 	,m_seqSecureURLs		( DEFAULT_SECUREURL			)
291*cdf0e10cSrcweir 	,m_bSaveOrSend			( sal_True					)
292*cdf0e10cSrcweir 	,m_bSigning				( sal_True					)
293*cdf0e10cSrcweir 	,m_bPrint				( sal_True					)
294*cdf0e10cSrcweir 	,m_bCreatePDF			( sal_True					)
295*cdf0e10cSrcweir 	,m_bRemoveInfo			( sal_True					)
296*cdf0e10cSrcweir 	,m_nSecLevel			( sal_True					)
297*cdf0e10cSrcweir 	,m_seqTrustedAuthors	( DEFAULT_TRUSTEDAUTHORS	)
298*cdf0e10cSrcweir 	,m_bDisableMacros		( sal_False					)
299*cdf0e10cSrcweir 	,m_bROSecureURLs		( CFG_READONLY_DEFAULT		)
300*cdf0e10cSrcweir 	,m_bROSaveOrSend		( CFG_READONLY_DEFAULT		)
301*cdf0e10cSrcweir 	,m_bROSigning			( CFG_READONLY_DEFAULT		)
302*cdf0e10cSrcweir 	,m_bROPrint				( CFG_READONLY_DEFAULT		)
303*cdf0e10cSrcweir 	,m_bROCreatePDF			( CFG_READONLY_DEFAULT		)
304*cdf0e10cSrcweir 	,m_bRORemoveInfo		( CFG_READONLY_DEFAULT		)
305*cdf0e10cSrcweir 	,m_bROSecLevel			( CFG_READONLY_DEFAULT		)
306*cdf0e10cSrcweir 	,m_bROTrustedAuthors	( CFG_READONLY_DEFAULT		)
307*cdf0e10cSrcweir 	,m_bRODisableMacros		( sal_True					) // currently is not intended to be changed
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir 	// xmlsec05 depricated
310*cdf0e10cSrcweir     ,   m_eBasicMode        ( DEFAULT_STAROFFICEBASIC )
311*cdf0e10cSrcweir     ,   m_bExecutePlugins   ( sal_True                )
312*cdf0e10cSrcweir     ,   m_bWarning          ( sal_True                )
313*cdf0e10cSrcweir     ,   m_bConfirmation     ( sal_True                )
314*cdf0e10cSrcweir     ,   m_bROConfirmation   ( CFG_READONLY_DEFAULT    )
315*cdf0e10cSrcweir     ,   m_bROWarning        ( CFG_READONLY_DEFAULT    )
316*cdf0e10cSrcweir     ,   m_bROExecutePlugins ( CFG_READONLY_DEFAULT    )
317*cdf0e10cSrcweir     ,   m_bROBasicMode      ( CFG_READONLY_DEFAULT    )
318*cdf0e10cSrcweir 	// xmlsec05 depricated
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir {
321*cdf0e10cSrcweir 	Sequence< OUString >	seqNames	= GetPropertyNames	(			);
322*cdf0e10cSrcweir 	Sequence< Any >			seqValues	= GetProperties		( seqNames	);
323*cdf0e10cSrcweir 	Sequence< sal_Bool >	seqRO		= GetReadOnlyStates	( seqNames	);
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir 	// Safe impossible cases.
326*cdf0e10cSrcweir 	// We need values from ALL configuration keys.
327*cdf0e10cSrcweir 	// Follow assignment use order of values in relation to our list of key names!
328*cdf0e10cSrcweir 	DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtSecurityOptions_Impl::SvtSecurityOptions_Impl()\nI miss some values of configuration keys!\n" );
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir 	// Copy values from list in right order to our internal member.
331*cdf0e10cSrcweir 	sal_Int32				nPropertyCount = seqValues.getLength();
332*cdf0e10cSrcweir 	for( sal_Int32 nProperty = 0 ; nProperty < nPropertyCount ; ++nProperty )
333*cdf0e10cSrcweir 		SetProperty( nProperty, seqValues[ nProperty ], seqRO[ nProperty ] );
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir 	LoadAuthors();
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir 	// Enable notification mechanism of our baseclass.
338*cdf0e10cSrcweir 	// We need it to get information about changes outside these class on our used configuration keys!*/
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir 	EnableNotification( seqNames );
341*cdf0e10cSrcweir }
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir //*****************************************************************************************************************
344*cdf0e10cSrcweir //	destructor
345*cdf0e10cSrcweir //*****************************************************************************************************************
346*cdf0e10cSrcweir SvtSecurityOptions_Impl::~SvtSecurityOptions_Impl()
347*cdf0e10cSrcweir {
348*cdf0e10cSrcweir 	if( IsModified() )
349*cdf0e10cSrcweir 		Commit();
350*cdf0e10cSrcweir }
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir void SvtSecurityOptions_Impl::SetProperty( sal_Int32 nProperty, const Any& rValue, sal_Bool bRO )
353*cdf0e10cSrcweir {
354*cdf0e10cSrcweir 	switch( nProperty )
355*cdf0e10cSrcweir 	{
356*cdf0e10cSrcweir 		case PROPERTYHANDLE_SECUREURL:
357*cdf0e10cSrcweir 		{
358*cdf0e10cSrcweir 			m_seqSecureURLs.realloc( 0 );
359*cdf0e10cSrcweir 			rValue >>= m_seqSecureURLs;
360*cdf0e10cSrcweir 			SvtPathOptions	aOpt;
361*cdf0e10cSrcweir         	sal_uInt32		nCount = m_seqSecureURLs.getLength();
362*cdf0e10cSrcweir         	for( sal_uInt32 nItem = 0 ; nItem < nCount ; ++nItem )
363*cdf0e10cSrcweir 				m_seqSecureURLs[ nItem ] = aOpt.SubstituteVariable( m_seqSecureURLs[ nItem ] );
364*cdf0e10cSrcweir 			m_bROSecureURLs = bRO;
365*cdf0e10cSrcweir 		}
366*cdf0e10cSrcweir 		break;
367*cdf0e10cSrcweir 
368*cdf0e10cSrcweir 		case PROPERTYHANDLE_DOCWARN_SAVEORSEND:
369*cdf0e10cSrcweir 		{
370*cdf0e10cSrcweir 			rValue >>= m_bSaveOrSend;
371*cdf0e10cSrcweir 			m_bROSaveOrSend = bRO;
372*cdf0e10cSrcweir 		}
373*cdf0e10cSrcweir 		break;
374*cdf0e10cSrcweir 
375*cdf0e10cSrcweir 		case PROPERTYHANDLE_DOCWARN_SIGNING:
376*cdf0e10cSrcweir 		{
377*cdf0e10cSrcweir 			rValue >>= m_bSigning;
378*cdf0e10cSrcweir 			m_bROSigning = bRO;
379*cdf0e10cSrcweir 		}
380*cdf0e10cSrcweir 		break;
381*cdf0e10cSrcweir 
382*cdf0e10cSrcweir 		case PROPERTYHANDLE_DOCWARN_PRINT:
383*cdf0e10cSrcweir 		{
384*cdf0e10cSrcweir 			rValue >>= m_bPrint;
385*cdf0e10cSrcweir 			m_bROPrint = bRO;
386*cdf0e10cSrcweir 		}
387*cdf0e10cSrcweir 		break;
388*cdf0e10cSrcweir 
389*cdf0e10cSrcweir 		case PROPERTYHANDLE_DOCWARN_CREATEPDF:
390*cdf0e10cSrcweir 		{
391*cdf0e10cSrcweir 			rValue >>= m_bCreatePDF;
392*cdf0e10cSrcweir 			m_bROCreatePDF = bRO;
393*cdf0e10cSrcweir 		}
394*cdf0e10cSrcweir 		break;
395*cdf0e10cSrcweir 
396*cdf0e10cSrcweir 		case PROPERTYHANDLE_DOCWARN_REMOVEPERSONALINFO:
397*cdf0e10cSrcweir 		{
398*cdf0e10cSrcweir 			rValue >>= m_bRemoveInfo;
399*cdf0e10cSrcweir 			m_bRORemoveInfo = bRO;
400*cdf0e10cSrcweir 		}
401*cdf0e10cSrcweir 		break;
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir         case PROPERTYHANDLE_DOCWARN_RECOMMENDPASSWORD:
404*cdf0e10cSrcweir         {
405*cdf0e10cSrcweir             rValue >>= m_bRecommendPwd;
406*cdf0e10cSrcweir             m_bRORecommendPwd = bRO;
407*cdf0e10cSrcweir         }
408*cdf0e10cSrcweir 		break;
409*cdf0e10cSrcweir 
410*cdf0e10cSrcweir         case PROPERTYHANDLE_CTRLCLICK_HYPERLINK:
411*cdf0e10cSrcweir         {
412*cdf0e10cSrcweir             rValue >>= m_bCtrlClickHyperlink;
413*cdf0e10cSrcweir             m_bROCtrlClickHyperlink = bRO;
414*cdf0e10cSrcweir         }
415*cdf0e10cSrcweir 		break;
416*cdf0e10cSrcweir 
417*cdf0e10cSrcweir 		case PROPERTYHANDLE_MACRO_SECLEVEL:
418*cdf0e10cSrcweir 		{
419*cdf0e10cSrcweir 			rValue >>= m_nSecLevel;
420*cdf0e10cSrcweir 			m_bROSecLevel = bRO;
421*cdf0e10cSrcweir 		}
422*cdf0e10cSrcweir 		break;
423*cdf0e10cSrcweir 
424*cdf0e10cSrcweir 		case PROPERTYHANDLE_MACRO_TRUSTEDAUTHORS:
425*cdf0e10cSrcweir         {
426*cdf0e10cSrcweir 			// don't care about value here...
427*cdf0e10cSrcweir             m_bROTrustedAuthors = bRO;
428*cdf0e10cSrcweir         }
429*cdf0e10cSrcweir 		break;
430*cdf0e10cSrcweir 
431*cdf0e10cSrcweir 		case PROPERTYHANDLE_MACRO_DISABLE:
432*cdf0e10cSrcweir 		{
433*cdf0e10cSrcweir 			rValue >>= m_bDisableMacros;
434*cdf0e10cSrcweir 			m_bRODisableMacros = bRO;
435*cdf0e10cSrcweir 		}
436*cdf0e10cSrcweir 		break;
437*cdf0e10cSrcweir 
438*cdf0e10cSrcweir 
439*cdf0e10cSrcweir 		// xmlsec05 depricated
440*cdf0e10cSrcweir         case PROPERTYHANDLE_STAROFFICEBASIC:
441*cdf0e10cSrcweir 		{
442*cdf0e10cSrcweir 			sal_Int32 nMode = 0;
443*cdf0e10cSrcweir 			rValue >>= nMode;
444*cdf0e10cSrcweir 			m_eBasicMode = (EBasicSecurityMode)nMode;
445*cdf0e10cSrcweir             m_bROBasicMode = bRO;
446*cdf0e10cSrcweir 		}
447*cdf0e10cSrcweir 		break;
448*cdf0e10cSrcweir         case PROPERTYHANDLE_EXECUTEPLUGINS:
449*cdf0e10cSrcweir 		{
450*cdf0e10cSrcweir 			rValue >>= m_bExecutePlugins;
451*cdf0e10cSrcweir 			m_bROExecutePlugins = bRO;
452*cdf0e10cSrcweir 		}
453*cdf0e10cSrcweir 		break;
454*cdf0e10cSrcweir         case PROPERTYHANDLE_WARNINGENABLED:
455*cdf0e10cSrcweir 		{
456*cdf0e10cSrcweir 			rValue >>= m_bWarning;
457*cdf0e10cSrcweir 			m_bROWarning = bRO;
458*cdf0e10cSrcweir 		}
459*cdf0e10cSrcweir 		break;
460*cdf0e10cSrcweir         case PROPERTYHANDLE_CONFIRMATIONENABLED:
461*cdf0e10cSrcweir 		{
462*cdf0e10cSrcweir 			rValue >>= m_bConfirmation;
463*cdf0e10cSrcweir 			m_bROConfirmation = bRO;
464*cdf0e10cSrcweir 		}
465*cdf0e10cSrcweir 		break;
466*cdf0e10cSrcweir 		// xmlsec05 depricated
467*cdf0e10cSrcweir 
468*cdf0e10cSrcweir 
469*cdf0e10cSrcweir 		#if OSL_DEBUG_LEVEL > 1
470*cdf0e10cSrcweir 		default:
471*cdf0e10cSrcweir 			DBG_ASSERT( false, "SvtSecurityOptions_Impl::SetProperty()\nUnkown property!\n" );
472*cdf0e10cSrcweir 		#endif
473*cdf0e10cSrcweir 	}
474*cdf0e10cSrcweir }
475*cdf0e10cSrcweir 
476*cdf0e10cSrcweir void SvtSecurityOptions_Impl::LoadAuthors( void )
477*cdf0e10cSrcweir {
478*cdf0e10cSrcweir 	m_seqTrustedAuthors.realloc( 0 );		// first clear
479*cdf0e10cSrcweir 	Sequence< OUString >	lAuthors = GetNodeNames( PROPERTYNAME_MACRO_TRUSTEDAUTHORS );
480*cdf0e10cSrcweir 	sal_Int32				c1 = lAuthors.getLength();
481*cdf0e10cSrcweir 	if( c1 )
482*cdf0e10cSrcweir 	{
483*cdf0e10cSrcweir 		sal_Int32				c2 = c1 * 3;				// 3 Properties inside Struct TrustedAuthor
484*cdf0e10cSrcweir 		Sequence< OUString >	lAllAuthors( c2 );
485*cdf0e10cSrcweir 
486*cdf0e10cSrcweir 		sal_Int32				i1;
487*cdf0e10cSrcweir 		sal_Int32				i2;
488*cdf0e10cSrcweir 		OUString				aSep( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
489*cdf0e10cSrcweir 		for( i1 = 0, i2 = 0 ; i1 < c1 ; ++i1 )
490*cdf0e10cSrcweir 		{
491*cdf0e10cSrcweir 			lAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + lAuthors[ i1 ] + aSep + PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME;
492*cdf0e10cSrcweir 			++i2;
493*cdf0e10cSrcweir 			lAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + lAuthors[ i1 ] + aSep + PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER;
494*cdf0e10cSrcweir 			++i2;
495*cdf0e10cSrcweir 			lAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + lAuthors[ i1 ] + aSep + PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA;
496*cdf0e10cSrcweir 			++i2;
497*cdf0e10cSrcweir 		}
498*cdf0e10cSrcweir 
499*cdf0e10cSrcweir 		Sequence< Any >			lValues = GetProperties( lAllAuthors );
500*cdf0e10cSrcweir 		if( lValues.getLength() == c2 )
501*cdf0e10cSrcweir 		{
502*cdf0e10cSrcweir 			m_seqTrustedAuthors.realloc( c1 );
503*cdf0e10cSrcweir 			SvtSecurityOptions::Certificate aCert( 3 );
504*cdf0e10cSrcweir 			for( i1 = 0, i2 = 0 ; i1 < c1 ; ++i1 )
505*cdf0e10cSrcweir 			{
506*cdf0e10cSrcweir 				lValues[ i2 ] >>= aCert[ 0 ];
507*cdf0e10cSrcweir 				++i2;
508*cdf0e10cSrcweir 				lValues[ i2 ] >>= aCert[ 1 ];
509*cdf0e10cSrcweir 				++i2;
510*cdf0e10cSrcweir 				lValues[ i2 ] >>= aCert[ 2 ];
511*cdf0e10cSrcweir 				++i2;
512*cdf0e10cSrcweir 				m_seqTrustedAuthors[ i1 ] = aCert;
513*cdf0e10cSrcweir 			}
514*cdf0e10cSrcweir 		}
515*cdf0e10cSrcweir 	}
516*cdf0e10cSrcweir }
517*cdf0e10cSrcweir 
518*cdf0e10cSrcweir sal_Int32 SvtSecurityOptions_Impl::GetHandle( const OUString& rName )
519*cdf0e10cSrcweir {
520*cdf0e10cSrcweir 	sal_Int32	nHandle;
521*cdf0e10cSrcweir 
522*cdf0e10cSrcweir 	if( rName.compareToAscii( CSTR_SECUREURL ) == 0 )
523*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_SECUREURL;
524*cdf0e10cSrcweir 	else if( rName.compareToAscii( CSTR_DOCWARN_SAVEORSEND ) == 0 )
525*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_DOCWARN_SAVEORSEND;
526*cdf0e10cSrcweir 	else if( rName.compareToAscii( CSTR_DOCWARN_SIGNING ) == 0 )
527*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_DOCWARN_SIGNING;
528*cdf0e10cSrcweir 	else if( rName.compareToAscii( CSTR_DOCWARN_PRINT ) == 0 )
529*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_DOCWARN_PRINT;
530*cdf0e10cSrcweir 	else if( rName.compareToAscii( CSTR_DOCWARN_CREATEPDF ) == 0 )
531*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_DOCWARN_CREATEPDF;
532*cdf0e10cSrcweir 	else if( rName.compareToAscii( CSTR_DOCWARN_REMOVEPERSONALINFO ) == 0 )
533*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_DOCWARN_REMOVEPERSONALINFO;
534*cdf0e10cSrcweir     else if( rName.compareToAscii( CSTR_DOCWARN_RECOMMENDPASSWORD ) == 0 )
535*cdf0e10cSrcweir         nHandle = PROPERTYHANDLE_DOCWARN_RECOMMENDPASSWORD;
536*cdf0e10cSrcweir     else if( rName.compareToAscii( CSTR_CTRLCLICK_HYPERLINK ) == 0 )
537*cdf0e10cSrcweir         nHandle = PROPERTYHANDLE_CTRLCLICK_HYPERLINK;
538*cdf0e10cSrcweir 	else if( rName.compareToAscii( CSTR_MACRO_SECLEVEL ) == 0 )
539*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_MACRO_SECLEVEL;
540*cdf0e10cSrcweir 	else if( rName.compareToAscii( CSTR_MACRO_TRUSTEDAUTHORS ) == 0 )
541*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_MACRO_TRUSTEDAUTHORS;
542*cdf0e10cSrcweir 	else if( rName.compareToAscii( CSTR_MACRO_DISABLE ) == 0 )
543*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_MACRO_DISABLE;
544*cdf0e10cSrcweir 
545*cdf0e10cSrcweir 	// xmlsec05 depricated
546*cdf0e10cSrcweir 	else if( rName == PROPERTYNAME_STAROFFICEBASIC )
547*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_STAROFFICEBASIC;
548*cdf0e10cSrcweir 	else if( rName == PROPERTYNAME_EXECUTEPLUGINS )
549*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_EXECUTEPLUGINS;
550*cdf0e10cSrcweir 	else if( rName == PROPERTYNAME_WARNINGENABLED )
551*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_WARNINGENABLED;
552*cdf0e10cSrcweir 	else if( rName == PROPERTYNAME_CONFIRMATIONENABLED )
553*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_CONFIRMATIONENABLED;
554*cdf0e10cSrcweir 	// xmlsec05 depricated
555*cdf0e10cSrcweir 
556*cdf0e10cSrcweir 	else
557*cdf0e10cSrcweir 		nHandle = PROPERTYHANDLE_INVALID;
558*cdf0e10cSrcweir 
559*cdf0e10cSrcweir 	return nHandle;
560*cdf0e10cSrcweir }
561*cdf0e10cSrcweir 
562*cdf0e10cSrcweir bool SvtSecurityOptions_Impl::GetOption( SvtSecurityOptions::EOption eOption, sal_Bool*& rpValue, sal_Bool*& rpRO )
563*cdf0e10cSrcweir {
564*cdf0e10cSrcweir 	switch( eOption )
565*cdf0e10cSrcweir 	{
566*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_SAVEORSEND:
567*cdf0e10cSrcweir 			rpValue = &m_bSaveOrSend;
568*cdf0e10cSrcweir 			rpRO = &m_bROSaveOrSend;
569*cdf0e10cSrcweir 			break;
570*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_SIGNING:
571*cdf0e10cSrcweir 			rpValue = &m_bSigning;
572*cdf0e10cSrcweir 			rpRO = &m_bROSigning;
573*cdf0e10cSrcweir 			break;
574*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_PRINT:
575*cdf0e10cSrcweir 			rpValue = &m_bPrint;
576*cdf0e10cSrcweir 			rpRO = &m_bROPrint;
577*cdf0e10cSrcweir 			break;
578*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_CREATEPDF:
579*cdf0e10cSrcweir 			rpValue = &m_bCreatePDF;
580*cdf0e10cSrcweir 			rpRO = &m_bROCreatePDF;
581*cdf0e10cSrcweir 			break;
582*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO:
583*cdf0e10cSrcweir 			rpValue = &m_bRemoveInfo;
584*cdf0e10cSrcweir 			rpRO = &m_bRORemoveInfo;
585*cdf0e10cSrcweir 			break;
586*cdf0e10cSrcweir         case SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD:
587*cdf0e10cSrcweir             rpValue = &m_bRecommendPwd;
588*cdf0e10cSrcweir             rpRO = &m_bRORecommendPwd;
589*cdf0e10cSrcweir             break;
590*cdf0e10cSrcweir         case SvtSecurityOptions::E_CTRLCLICK_HYPERLINK:
591*cdf0e10cSrcweir             rpValue = &m_bCtrlClickHyperlink;
592*cdf0e10cSrcweir             rpRO = &m_bROCtrlClickHyperlink;
593*cdf0e10cSrcweir             break;
594*cdf0e10cSrcweir 		default:
595*cdf0e10cSrcweir 			rpValue = NULL;
596*cdf0e10cSrcweir 			rpRO = NULL;
597*cdf0e10cSrcweir 			break;
598*cdf0e10cSrcweir 	}
599*cdf0e10cSrcweir 
600*cdf0e10cSrcweir 	return rpValue != NULL;
601*cdf0e10cSrcweir }
602*cdf0e10cSrcweir 
603*cdf0e10cSrcweir void SvtSecurityOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
604*cdf0e10cSrcweir {
605*cdf0e10cSrcweir 	// Use given list of updated properties to get his values from configuration directly!
606*cdf0e10cSrcweir 	Sequence< Any >			seqValues = GetProperties( seqPropertyNames );
607*cdf0e10cSrcweir     Sequence< sal_Bool >	seqRO = GetReadOnlyStates( seqPropertyNames );
608*cdf0e10cSrcweir 	// Safe impossible cases.
609*cdf0e10cSrcweir 	// We need values from ALL notified configuration keys.
610*cdf0e10cSrcweir 	DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtSecurityOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
611*cdf0e10cSrcweir 	// Step over list of property names and get right value from coreesponding value list to set it on internal members!
612*cdf0e10cSrcweir 	sal_Int32				nCount = seqPropertyNames.getLength();
613*cdf0e10cSrcweir 	for( sal_Int32 nProperty = 0 ; nProperty < nCount ; ++nProperty )
614*cdf0e10cSrcweir 		SetProperty( GetHandle( seqPropertyNames[ nProperty ] ), seqValues[ nProperty ], seqRO[ nProperty ] );
615*cdf0e10cSrcweir 
616*cdf0e10cSrcweir 	// read set of trusted authors separately
617*cdf0e10cSrcweir 	LoadAuthors();
618*cdf0e10cSrcweir }
619*cdf0e10cSrcweir 
620*cdf0e10cSrcweir void SvtSecurityOptions_Impl::Commit()
621*cdf0e10cSrcweir {
622*cdf0e10cSrcweir 	// Get names of supported properties, create a list for values and copy current values to it.
623*cdf0e10cSrcweir     Sequence< OUString >    lOrgNames = GetPropertyNames();
624*cdf0e10cSrcweir     sal_Int32               nOrgCount = lOrgNames.getLength();
625*cdf0e10cSrcweir 
626*cdf0e10cSrcweir     Sequence< OUString >    lNames(nOrgCount);
627*cdf0e10cSrcweir     Sequence< Any >         lValues(nOrgCount);
628*cdf0e10cSrcweir     sal_Int32               nRealCount = 0;
629*cdf0e10cSrcweir 	bool					bDone;
630*cdf0e10cSrcweir 
631*cdf0e10cSrcweir 	ClearNodeSet( PROPERTYNAME_MACRO_TRUSTEDAUTHORS );
632*cdf0e10cSrcweir 
633*cdf0e10cSrcweir     for( sal_Int32 nProperty = 0 ; nProperty < nOrgCount ; ++nProperty )
634*cdf0e10cSrcweir 	{
635*cdf0e10cSrcweir         switch( nProperty )
636*cdf0e10cSrcweir         {
637*cdf0e10cSrcweir             case PROPERTYHANDLE_SECUREURL:
638*cdf0e10cSrcweir 			{
639*cdf0e10cSrcweir 				bDone = !m_bROSecureURLs;
640*cdf0e10cSrcweir 				if( bDone )
641*cdf0e10cSrcweir 				{
642*cdf0e10cSrcweir 					Sequence< OUString >	lURLs( m_seqSecureURLs );
643*cdf0e10cSrcweir 					SvtPathOptions			aOpt;
644*cdf0e10cSrcweir 					sal_Int32				nURLsCnt = lURLs.getLength();
645*cdf0e10cSrcweir 					for( sal_Int32 nItem = 0 ; nItem < nURLsCnt ; ++nItem )
646*cdf0e10cSrcweir 						lURLs[ nItem ] = aOpt.UseVariable( lURLs[ nItem ] );
647*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= lURLs;
648*cdf0e10cSrcweir 				}
649*cdf0e10cSrcweir 			}
650*cdf0e10cSrcweir 			break;
651*cdf0e10cSrcweir 
652*cdf0e10cSrcweir 			case PROPERTYHANDLE_DOCWARN_SAVEORSEND:
653*cdf0e10cSrcweir 			{
654*cdf0e10cSrcweir 				bDone = !m_bROSaveOrSend;
655*cdf0e10cSrcweir 				if( bDone )
656*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_bSaveOrSend;
657*cdf0e10cSrcweir 			}
658*cdf0e10cSrcweir 			break;
659*cdf0e10cSrcweir 
660*cdf0e10cSrcweir 			case PROPERTYHANDLE_DOCWARN_SIGNING:
661*cdf0e10cSrcweir 			{
662*cdf0e10cSrcweir 				bDone = !m_bROSigning;
663*cdf0e10cSrcweir 				if( bDone )
664*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_bSigning;
665*cdf0e10cSrcweir 			}
666*cdf0e10cSrcweir 			break;
667*cdf0e10cSrcweir 
668*cdf0e10cSrcweir 			case PROPERTYHANDLE_DOCWARN_PRINT:
669*cdf0e10cSrcweir 			{
670*cdf0e10cSrcweir 				bDone = !m_bROPrint;
671*cdf0e10cSrcweir 				if( bDone )
672*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_bPrint;
673*cdf0e10cSrcweir 			}
674*cdf0e10cSrcweir 			break;
675*cdf0e10cSrcweir 
676*cdf0e10cSrcweir 			case PROPERTYHANDLE_DOCWARN_CREATEPDF:
677*cdf0e10cSrcweir 			{
678*cdf0e10cSrcweir 				bDone = !m_bROCreatePDF;
679*cdf0e10cSrcweir 				if( bDone )
680*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_bCreatePDF;
681*cdf0e10cSrcweir 			}
682*cdf0e10cSrcweir 			break;
683*cdf0e10cSrcweir 
684*cdf0e10cSrcweir 			case PROPERTYHANDLE_DOCWARN_REMOVEPERSONALINFO:
685*cdf0e10cSrcweir 			{
686*cdf0e10cSrcweir 				bDone = !m_bRORemoveInfo;
687*cdf0e10cSrcweir 				if( bDone )
688*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_bRemoveInfo;
689*cdf0e10cSrcweir 			}
690*cdf0e10cSrcweir 			break;
691*cdf0e10cSrcweir 
692*cdf0e10cSrcweir             case PROPERTYHANDLE_DOCWARN_RECOMMENDPASSWORD:
693*cdf0e10cSrcweir             {
694*cdf0e10cSrcweir                 bDone = !m_bRORecommendPwd;
695*cdf0e10cSrcweir                 if( bDone )
696*cdf0e10cSrcweir                     lValues[ nRealCount ] <<= m_bRecommendPwd;
697*cdf0e10cSrcweir             }
698*cdf0e10cSrcweir             break;
699*cdf0e10cSrcweir 
700*cdf0e10cSrcweir             case PROPERTYHANDLE_CTRLCLICK_HYPERLINK:
701*cdf0e10cSrcweir             {
702*cdf0e10cSrcweir                 bDone = !m_bROCtrlClickHyperlink;
703*cdf0e10cSrcweir                 if( bDone )
704*cdf0e10cSrcweir                     lValues[ nRealCount ] <<= m_bCtrlClickHyperlink;
705*cdf0e10cSrcweir             }
706*cdf0e10cSrcweir             break;
707*cdf0e10cSrcweir 
708*cdf0e10cSrcweir             case PROPERTYHANDLE_MACRO_SECLEVEL:
709*cdf0e10cSrcweir 			{
710*cdf0e10cSrcweir 				bDone = !m_bROSecLevel;
711*cdf0e10cSrcweir 				if( bDone )
712*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_nSecLevel;
713*cdf0e10cSrcweir 			}
714*cdf0e10cSrcweir 			break;
715*cdf0e10cSrcweir 
716*cdf0e10cSrcweir             case PROPERTYHANDLE_MACRO_TRUSTEDAUTHORS:
717*cdf0e10cSrcweir 			{
718*cdf0e10cSrcweir 				bDone = !m_bROTrustedAuthors;
719*cdf0e10cSrcweir 				if( bDone )
720*cdf0e10cSrcweir 				{
721*cdf0e10cSrcweir 					sal_Int32	nCnt = m_seqTrustedAuthors.getLength();
722*cdf0e10cSrcweir 					if( nCnt )
723*cdf0e10cSrcweir 					{
724*cdf0e10cSrcweir 						String	s;
725*cdf0e10cSrcweir 						s.AppendAscii( CSTR_MACRO_TRUSTEDAUTHORS );
726*cdf0e10cSrcweir 						s.AppendAscii( "/a" );
727*cdf0e10cSrcweir 
728*cdf0e10cSrcweir 						Sequence< Sequence< com::sun::star::beans::PropertyValue > > lPropertyValuesSeq( nCnt );
729*cdf0e10cSrcweir 						for( sal_Int32 i = 0 ; i < nCnt ; ++i )
730*cdf0e10cSrcweir 						{
731*cdf0e10cSrcweir 							String	aPrefix( s );
732*cdf0e10cSrcweir 							aPrefix += String::CreateFromInt32( i );
733*cdf0e10cSrcweir 							aPrefix.AppendAscii( "/" );
734*cdf0e10cSrcweir 							Sequence< com::sun::star::beans::PropertyValue >	lPropertyValues( 3 );
735*cdf0e10cSrcweir 							lPropertyValues[ 0 ].Name = aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME;
736*cdf0e10cSrcweir 							lPropertyValues[ 0 ].Value <<= m_seqTrustedAuthors[ i ][0];
737*cdf0e10cSrcweir 							lPropertyValues[ 1 ].Name = aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER;
738*cdf0e10cSrcweir 							lPropertyValues[ 1 ].Value <<= m_seqTrustedAuthors[ i ][1];
739*cdf0e10cSrcweir 							lPropertyValues[ 2 ].Name = aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA;
740*cdf0e10cSrcweir 							lPropertyValues[ 2 ].Value <<= m_seqTrustedAuthors[ i ][2];
741*cdf0e10cSrcweir 
742*cdf0e10cSrcweir 
743*cdf0e10cSrcweir 							SetSetProperties( PROPERTYNAME_MACRO_TRUSTEDAUTHORS, lPropertyValues );
744*cdf0e10cSrcweir 						}
745*cdf0e10cSrcweir 
746*cdf0e10cSrcweir 						bDone = false;		// because we save in loop above!
747*cdf0e10cSrcweir 					}
748*cdf0e10cSrcweir 					else
749*cdf0e10cSrcweir 						bDone = false;
750*cdf0e10cSrcweir 				}
751*cdf0e10cSrcweir 			}
752*cdf0e10cSrcweir 			break;
753*cdf0e10cSrcweir 
754*cdf0e10cSrcweir             case PROPERTYHANDLE_MACRO_DISABLE:
755*cdf0e10cSrcweir 			{
756*cdf0e10cSrcweir 				bDone = !m_bRODisableMacros;
757*cdf0e10cSrcweir 				if( bDone )
758*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= (sal_Bool)m_bDisableMacros;
759*cdf0e10cSrcweir 			}
760*cdf0e10cSrcweir 			break;
761*cdf0e10cSrcweir 
762*cdf0e10cSrcweir 
763*cdf0e10cSrcweir 			// xmlsec05 depricated
764*cdf0e10cSrcweir             case PROPERTYHANDLE_STAROFFICEBASIC:
765*cdf0e10cSrcweir 			{
766*cdf0e10cSrcweir 				bDone = !m_bROBasicMode;
767*cdf0e10cSrcweir 				if( bDone )
768*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= (sal_Int32)m_eBasicMode;
769*cdf0e10cSrcweir 			}
770*cdf0e10cSrcweir 			break;
771*cdf0e10cSrcweir             case PROPERTYHANDLE_EXECUTEPLUGINS:
772*cdf0e10cSrcweir 			{
773*cdf0e10cSrcweir 				bDone = !m_bROExecutePlugins;
774*cdf0e10cSrcweir 				if( bDone )
775*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_bExecutePlugins;
776*cdf0e10cSrcweir 			}
777*cdf0e10cSrcweir 			break;
778*cdf0e10cSrcweir             case PROPERTYHANDLE_WARNINGENABLED:
779*cdf0e10cSrcweir 			{
780*cdf0e10cSrcweir 				bDone = !m_bROWarning;
781*cdf0e10cSrcweir 				if( bDone )
782*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_bWarning;
783*cdf0e10cSrcweir 			}
784*cdf0e10cSrcweir 			break;
785*cdf0e10cSrcweir             case PROPERTYHANDLE_CONFIRMATIONENABLED:
786*cdf0e10cSrcweir 			{
787*cdf0e10cSrcweir 				bDone = !m_bROConfirmation;
788*cdf0e10cSrcweir 				if( bDone )
789*cdf0e10cSrcweir 					lValues[ nRealCount ] <<= m_bConfirmation;
790*cdf0e10cSrcweir 			}
791*cdf0e10cSrcweir 			break;
792*cdf0e10cSrcweir 			// xmlsec05 depricated
793*cdf0e10cSrcweir 
794*cdf0e10cSrcweir 
795*cdf0e10cSrcweir 			default:
796*cdf0e10cSrcweir 				bDone = false;
797*cdf0e10cSrcweir 		}
798*cdf0e10cSrcweir 
799*cdf0e10cSrcweir 		if( bDone )
800*cdf0e10cSrcweir 		{
801*cdf0e10cSrcweir 			lNames[ nRealCount ] = lOrgNames[ nProperty ];
802*cdf0e10cSrcweir 			++nRealCount;
803*cdf0e10cSrcweir 		}
804*cdf0e10cSrcweir 	}
805*cdf0e10cSrcweir 	// Set properties in configuration.
806*cdf0e10cSrcweir     lNames.realloc(nRealCount);
807*cdf0e10cSrcweir     lValues.realloc(nRealCount);
808*cdf0e10cSrcweir     PutProperties( lNames, lValues );
809*cdf0e10cSrcweir }
810*cdf0e10cSrcweir 
811*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::IsReadOnly( SvtSecurityOptions::EOption eOption ) const
812*cdf0e10cSrcweir {
813*cdf0e10cSrcweir     sal_Bool	bReadonly;
814*cdf0e10cSrcweir     switch(eOption)
815*cdf0e10cSrcweir     {
816*cdf0e10cSrcweir         case SvtSecurityOptions::E_SECUREURLS :
817*cdf0e10cSrcweir             bReadonly = m_bROSecureURLs;
818*cdf0e10cSrcweir             break;
819*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_SAVEORSEND:
820*cdf0e10cSrcweir 			bReadonly = m_bROSaveOrSend;
821*cdf0e10cSrcweir 			break;
822*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_SIGNING:
823*cdf0e10cSrcweir 			bReadonly = m_bROSigning;
824*cdf0e10cSrcweir 			break;
825*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_PRINT:
826*cdf0e10cSrcweir 			bReadonly = m_bROPrint;
827*cdf0e10cSrcweir 			break;
828*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_CREATEPDF:
829*cdf0e10cSrcweir 			bReadonly = m_bROCreatePDF;
830*cdf0e10cSrcweir 			break;
831*cdf0e10cSrcweir 		case SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO:
832*cdf0e10cSrcweir 			bReadonly = m_bRORemoveInfo;
833*cdf0e10cSrcweir 			break;
834*cdf0e10cSrcweir         case SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD:
835*cdf0e10cSrcweir             bReadonly = m_bRORecommendPwd;
836*cdf0e10cSrcweir             break;
837*cdf0e10cSrcweir 		case SvtSecurityOptions::E_MACRO_SECLEVEL:
838*cdf0e10cSrcweir 			bReadonly = m_bROSecLevel;
839*cdf0e10cSrcweir 			break;
840*cdf0e10cSrcweir 		case SvtSecurityOptions::E_MACRO_TRUSTEDAUTHORS:
841*cdf0e10cSrcweir 			bReadonly = m_bROTrustedAuthors;
842*cdf0e10cSrcweir 			break;
843*cdf0e10cSrcweir 		case SvtSecurityOptions::E_MACRO_DISABLE:
844*cdf0e10cSrcweir 			bReadonly = m_bRODisableMacros;
845*cdf0e10cSrcweir 			break;
846*cdf0e10cSrcweir         case SvtSecurityOptions::E_CTRLCLICK_HYPERLINK:
847*cdf0e10cSrcweir             bReadonly = m_bROCtrlClickHyperlink;
848*cdf0e10cSrcweir             break;
849*cdf0e10cSrcweir 
850*cdf0e10cSrcweir 
851*cdf0e10cSrcweir 		// xmlsec05 depricated
852*cdf0e10cSrcweir 		case SvtSecurityOptions::E_BASICMODE:
853*cdf0e10cSrcweir 			bReadonly = m_bROBasicMode;
854*cdf0e10cSrcweir 			break;
855*cdf0e10cSrcweir 		case SvtSecurityOptions::E_EXECUTEPLUGINS:
856*cdf0e10cSrcweir 			bReadonly = m_bROExecutePlugins;
857*cdf0e10cSrcweir 			break;
858*cdf0e10cSrcweir 		case SvtSecurityOptions::E_WARNING:
859*cdf0e10cSrcweir 			bReadonly = m_bROWarning;
860*cdf0e10cSrcweir 			break;
861*cdf0e10cSrcweir 		case SvtSecurityOptions::E_CONFIRMATION:
862*cdf0e10cSrcweir 			bReadonly = m_bROConfirmation;
863*cdf0e10cSrcweir 			break;
864*cdf0e10cSrcweir 		// xmlsec05 depricated
865*cdf0e10cSrcweir 
866*cdf0e10cSrcweir 
867*cdf0e10cSrcweir 		default:
868*cdf0e10cSrcweir 			bReadonly = sal_True;
869*cdf0e10cSrcweir     }
870*cdf0e10cSrcweir 
871*cdf0e10cSrcweir     return bReadonly;
872*cdf0e10cSrcweir }
873*cdf0e10cSrcweir 
874*cdf0e10cSrcweir Sequence< OUString > SvtSecurityOptions_Impl::GetSecureURLs() const
875*cdf0e10cSrcweir {
876*cdf0e10cSrcweir 	return m_seqSecureURLs;
877*cdf0e10cSrcweir }
878*cdf0e10cSrcweir 
879*cdf0e10cSrcweir void SvtSecurityOptions_Impl::SetSecureURLs( const Sequence< OUString >& seqURLList )
880*cdf0e10cSrcweir {
881*cdf0e10cSrcweir     DBG_ASSERT(!m_bROSecureURLs, "SvtSecurityOptions_Impl::SetSecureURLs()\nYou tried to write on a readonly value!\n");
882*cdf0e10cSrcweir     if (!m_bROSecureURLs && m_seqSecureURLs!=seqURLList)
883*cdf0e10cSrcweir     {
884*cdf0e10cSrcweir         m_seqSecureURLs = seqURLList;
885*cdf0e10cSrcweir         SetModified();
886*cdf0e10cSrcweir     }
887*cdf0e10cSrcweir }
888*cdf0e10cSrcweir 
889*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::IsSecureURL(	const	OUString&	sURL	,
890*cdf0e10cSrcweir 												const	OUString&	sReferer) const
891*cdf0e10cSrcweir {
892*cdf0e10cSrcweir 	sal_Bool bState = sal_False;
893*cdf0e10cSrcweir 
894*cdf0e10cSrcweir     // Check for uncritical protocols first
895*cdf0e10cSrcweir     // All protocols different from "macro..." and "slot..." are secure per definition and must not be checked.
896*cdf0e10cSrcweir     // "macro://#..." means AppBasic macros that are considered safe
897*cdf0e10cSrcweir     INetURLObject   aURL        ( sURL );
898*cdf0e10cSrcweir     INetProtocol    aProtocol   = aURL.GetProtocol();
899*cdf0e10cSrcweir 
900*cdf0e10cSrcweir     // All other URLs must checked in combination with referer and internal information about security
901*cdf0e10cSrcweir     if ( (aProtocol != INET_PROT_MACRO && aProtocol !=  INET_PROT_SLOT) ||
902*cdf0e10cSrcweir          aURL.GetMainURL( INetURLObject::NO_DECODE ).matchIgnoreAsciiCaseAsciiL( "macro:///", 9 ) == 0)
903*cdf0e10cSrcweir     {
904*cdf0e10cSrcweir         // security check only for "macro" ( without app basic ) or "slot" protocols
905*cdf0e10cSrcweir         bState = sal_True;
906*cdf0e10cSrcweir     }
907*cdf0e10cSrcweir     else
908*cdf0e10cSrcweir 	{
909*cdf0e10cSrcweir         //  check list of allowed URL patterns
910*cdf0e10cSrcweir         // Trusted referer given?
911*cdf0e10cSrcweir         // NO  => bState will be false per default
912*cdf0e10cSrcweir         // YES => search for it in our internal url list
913*cdf0e10cSrcweir         if( sReferer.getLength() > 0 )
914*cdf0e10cSrcweir         {
915*cdf0e10cSrcweir             // Search in internal list
916*cdf0e10cSrcweir             ::rtl::OUString sRef = sReferer.toAsciiLowerCase();
917*cdf0e10cSrcweir             sal_uInt32 nCount = m_seqSecureURLs.getLength();
918*cdf0e10cSrcweir             for( sal_uInt32 nItem=0; nItem<nCount; ++nItem )
919*cdf0e10cSrcweir             {
920*cdf0e10cSrcweir                 OUString sCheckURL = m_seqSecureURLs[nItem].toAsciiLowerCase();
921*cdf0e10cSrcweir                 sCheckURL += OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
922*cdf0e10cSrcweir                 if( WildCard( sCheckURL ).Matches( sRef ) == sal_True )
923*cdf0e10cSrcweir                 {
924*cdf0e10cSrcweir                     bState = sal_True;
925*cdf0e10cSrcweir                     break;
926*cdf0e10cSrcweir                 }
927*cdf0e10cSrcweir             }
928*cdf0e10cSrcweir 
929*cdf0e10cSrcweir             if ( !bState )
930*cdf0e10cSrcweir                 bState = sRef.compareToAscii("private:user") == COMPARE_EQUAL;
931*cdf0e10cSrcweir         }
932*cdf0e10cSrcweir 	}
933*cdf0e10cSrcweir 
934*cdf0e10cSrcweir 	// Return result of operation.
935*cdf0e10cSrcweir 	return bState;
936*cdf0e10cSrcweir }
937*cdf0e10cSrcweir 
938*cdf0e10cSrcweir inline sal_Int32 SvtSecurityOptions_Impl::GetMacroSecurityLevel() const
939*cdf0e10cSrcweir {
940*cdf0e10cSrcweir 	return m_nSecLevel;
941*cdf0e10cSrcweir }
942*cdf0e10cSrcweir 
943*cdf0e10cSrcweir inline sal_Bool SvtSecurityOptions_Impl::IsMacroDisabled() const
944*cdf0e10cSrcweir {
945*cdf0e10cSrcweir 	return m_bDisableMacros;
946*cdf0e10cSrcweir }
947*cdf0e10cSrcweir 
948*cdf0e10cSrcweir void SvtSecurityOptions_Impl::SetMacroSecurityLevel( sal_Int32 _nLevel )
949*cdf0e10cSrcweir {
950*cdf0e10cSrcweir 	if( !m_bROSecLevel )
951*cdf0e10cSrcweir 	{
952*cdf0e10cSrcweir 		if( _nLevel > 3 || _nLevel < 0 )
953*cdf0e10cSrcweir 			_nLevel = 3;
954*cdf0e10cSrcweir 
955*cdf0e10cSrcweir 		if( m_nSecLevel != _nLevel )
956*cdf0e10cSrcweir 		{
957*cdf0e10cSrcweir 			m_nSecLevel = _nLevel;
958*cdf0e10cSrcweir 			SetModified();
959*cdf0e10cSrcweir 		}
960*cdf0e10cSrcweir 	}
961*cdf0e10cSrcweir }
962*cdf0e10cSrcweir 
963*cdf0e10cSrcweir Sequence< SvtSecurityOptions::Certificate > SvtSecurityOptions_Impl::GetTrustedAuthors() const
964*cdf0e10cSrcweir {
965*cdf0e10cSrcweir 	return m_seqTrustedAuthors;
966*cdf0e10cSrcweir }
967*cdf0e10cSrcweir 
968*cdf0e10cSrcweir void SvtSecurityOptions_Impl::SetTrustedAuthors( const Sequence< SvtSecurityOptions::Certificate >& rAuthors )
969*cdf0e10cSrcweir {
970*cdf0e10cSrcweir     DBG_ASSERT(!m_bROTrustedAuthors, "SvtSecurityOptions_Impl::SetTrustedAuthors()\nYou tried to write on a readonly value!\n");
971*cdf0e10cSrcweir 	if( !m_bROTrustedAuthors && rAuthors != m_seqTrustedAuthors )
972*cdf0e10cSrcweir 	{
973*cdf0e10cSrcweir 		m_seqTrustedAuthors = rAuthors;
974*cdf0e10cSrcweir 		SetModified();
975*cdf0e10cSrcweir 	}
976*cdf0e10cSrcweir }
977*cdf0e10cSrcweir 
978*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::IsTrustedAuthorsEnabled()
979*cdf0e10cSrcweir {
980*cdf0e10cSrcweir 	return m_bROTrustedAuthors;
981*cdf0e10cSrcweir }
982*cdf0e10cSrcweir 
983*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::IsOptionSet( SvtSecurityOptions::EOption eOption ) const
984*cdf0e10cSrcweir {
985*cdf0e10cSrcweir 	sal_Bool*	pValue;
986*cdf0e10cSrcweir 	sal_Bool*	pRO;
987*cdf0e10cSrcweir 	sal_Bool	bRet = sal_False;
988*cdf0e10cSrcweir 
989*cdf0e10cSrcweir 	if( ( const_cast< SvtSecurityOptions_Impl* >( this ) )->GetOption( eOption, pValue, pRO ) )
990*cdf0e10cSrcweir 		bRet = *pValue;
991*cdf0e10cSrcweir 
992*cdf0e10cSrcweir 	return bRet;
993*cdf0e10cSrcweir }
994*cdf0e10cSrcweir 
995*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::SetOption( SvtSecurityOptions::EOption eOption, sal_Bool bValue )
996*cdf0e10cSrcweir {
997*cdf0e10cSrcweir 	sal_Bool*	pValue;
998*cdf0e10cSrcweir 	sal_Bool*	pRO;
999*cdf0e10cSrcweir 	sal_Bool	bRet = sal_False;
1000*cdf0e10cSrcweir 
1001*cdf0e10cSrcweir 	if( GetOption( eOption, pValue, pRO ) )
1002*cdf0e10cSrcweir 	{
1003*cdf0e10cSrcweir 		if( !*pRO )
1004*cdf0e10cSrcweir 		{
1005*cdf0e10cSrcweir 			bRet = sal_True;
1006*cdf0e10cSrcweir 			if( *pValue != bValue )
1007*cdf0e10cSrcweir 			{
1008*cdf0e10cSrcweir 				*pValue = bValue;
1009*cdf0e10cSrcweir 				SetModified();
1010*cdf0e10cSrcweir 			}
1011*cdf0e10cSrcweir 		}
1012*cdf0e10cSrcweir 	}
1013*cdf0e10cSrcweir 
1014*cdf0e10cSrcweir 	return bRet;
1015*cdf0e10cSrcweir }
1016*cdf0e10cSrcweir 
1017*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::IsOptionEnabled( SvtSecurityOptions::EOption eOption ) const
1018*cdf0e10cSrcweir {
1019*cdf0e10cSrcweir 	sal_Bool*	pValue;
1020*cdf0e10cSrcweir 	sal_Bool*	pRO;
1021*cdf0e10cSrcweir 	sal_Bool	bRet = sal_False;
1022*cdf0e10cSrcweir 
1023*cdf0e10cSrcweir 	if( ( const_cast< SvtSecurityOptions_Impl* >( this ) )->GetOption( eOption, pValue, pRO ) )
1024*cdf0e10cSrcweir 		bRet = !*pRO;
1025*cdf0e10cSrcweir 
1026*cdf0e10cSrcweir 	return bRet;
1027*cdf0e10cSrcweir }
1028*cdf0e10cSrcweir 
1029*cdf0e10cSrcweir Sequence< OUString > SvtSecurityOptions_Impl::GetPropertyNames()
1030*cdf0e10cSrcweir {
1031*cdf0e10cSrcweir 	// Build static list of configuration key names.
1032*cdf0e10cSrcweir 	static const OUString pProperties[] =
1033*cdf0e10cSrcweir 	{
1034*cdf0e10cSrcweir 		PROPERTYNAME_SECUREURL,
1035*cdf0e10cSrcweir 		PROPERTYNAME_STAROFFICEBASIC,
1036*cdf0e10cSrcweir 		PROPERTYNAME_EXECUTEPLUGINS,
1037*cdf0e10cSrcweir 		PROPERTYNAME_WARNINGENABLED,
1038*cdf0e10cSrcweir 		PROPERTYNAME_CONFIRMATIONENABLED,
1039*cdf0e10cSrcweir 		PROPERTYNAME_DOCWARN_SAVEORSEND,
1040*cdf0e10cSrcweir 		PROPERTYNAME_DOCWARN_SIGNING,
1041*cdf0e10cSrcweir 		PROPERTYNAME_DOCWARN_PRINT,
1042*cdf0e10cSrcweir 		PROPERTYNAME_DOCWARN_CREATEPDF,
1043*cdf0e10cSrcweir 		PROPERTYNAME_DOCWARN_REMOVEPERSONALINFO,
1044*cdf0e10cSrcweir         PROPERTYNAME_DOCWARN_RECOMMENDPASSWORD,
1045*cdf0e10cSrcweir         PROPERTYNAME_CTRLCLICK_HYPERLINK,
1046*cdf0e10cSrcweir 		PROPERTYNAME_MACRO_SECLEVEL,
1047*cdf0e10cSrcweir 		PROPERTYNAME_MACRO_TRUSTEDAUTHORS,
1048*cdf0e10cSrcweir 		PROPERTYNAME_MACRO_DISABLE
1049*cdf0e10cSrcweir 	};
1050*cdf0e10cSrcweir 	// Initialize return sequence with these list ...
1051*cdf0e10cSrcweir 	static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
1052*cdf0e10cSrcweir 	// ... and return it.
1053*cdf0e10cSrcweir 	return seqPropertyNames;
1054*cdf0e10cSrcweir }
1055*cdf0e10cSrcweir 
1056*cdf0e10cSrcweir //*****************************************************************************************************************
1057*cdf0e10cSrcweir //	initialize static member
1058*cdf0e10cSrcweir //	DON'T DO IT IN YOUR HEADER!
1059*cdf0e10cSrcweir //	see definition for further informations
1060*cdf0e10cSrcweir //*****************************************************************************************************************
1061*cdf0e10cSrcweir SvtSecurityOptions_Impl*	SvtSecurityOptions::m_pDataContainer	= NULL	;
1062*cdf0e10cSrcweir sal_Int32					SvtSecurityOptions::m_nRefCount			= 0		;
1063*cdf0e10cSrcweir 
1064*cdf0e10cSrcweir SvtSecurityOptions::SvtSecurityOptions()
1065*cdf0e10cSrcweir {
1066*cdf0e10cSrcweir     // Global access, must be guarded (multithreading!).
1067*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1068*cdf0e10cSrcweir 	// Increase ouer refcount ...
1069*cdf0e10cSrcweir 	++m_nRefCount;
1070*cdf0e10cSrcweir 	// ... and initialize ouer data container only if it not already exist!
1071*cdf0e10cSrcweir     if( m_pDataContainer == NULL )
1072*cdf0e10cSrcweir 	{
1073*cdf0e10cSrcweir         RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? ) ::SvtSecurityOptions_Impl::ctor()");
1074*cdf0e10cSrcweir         m_pDataContainer = new SvtSecurityOptions_Impl;
1075*cdf0e10cSrcweir 
1076*cdf0e10cSrcweir         ItemHolder1::holdConfigItem(E_SECURITYOPTIONS);
1077*cdf0e10cSrcweir 	}
1078*cdf0e10cSrcweir }
1079*cdf0e10cSrcweir 
1080*cdf0e10cSrcweir SvtSecurityOptions::~SvtSecurityOptions()
1081*cdf0e10cSrcweir {
1082*cdf0e10cSrcweir     // Global access, must be guarded (multithreading!)
1083*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1084*cdf0e10cSrcweir 	// Decrease ouer refcount.
1085*cdf0e10cSrcweir 	--m_nRefCount;
1086*cdf0e10cSrcweir 	// If last instance was deleted ...
1087*cdf0e10cSrcweir 	// we must destroy ouer static data container!
1088*cdf0e10cSrcweir     if( m_nRefCount <= 0 )
1089*cdf0e10cSrcweir 	{
1090*cdf0e10cSrcweir 		delete m_pDataContainer;
1091*cdf0e10cSrcweir 		m_pDataContainer = NULL;
1092*cdf0e10cSrcweir 	}
1093*cdf0e10cSrcweir }
1094*cdf0e10cSrcweir 
1095*cdf0e10cSrcweir sal_Bool SvtSecurityOptions::IsReadOnly( EOption eOption ) const
1096*cdf0e10cSrcweir {
1097*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1098*cdf0e10cSrcweir     return m_pDataContainer->IsReadOnly(eOption);
1099*cdf0e10cSrcweir }
1100*cdf0e10cSrcweir 
1101*cdf0e10cSrcweir Sequence< OUString > SvtSecurityOptions::GetSecureURLs() const
1102*cdf0e10cSrcweir {
1103*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1104*cdf0e10cSrcweir 	return m_pDataContainer->GetSecureURLs();
1105*cdf0e10cSrcweir }
1106*cdf0e10cSrcweir 
1107*cdf0e10cSrcweir void SvtSecurityOptions::SetSecureURLs( const Sequence< OUString >& seqURLList )
1108*cdf0e10cSrcweir {
1109*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1110*cdf0e10cSrcweir 	m_pDataContainer->SetSecureURLs( seqURLList );
1111*cdf0e10cSrcweir }
1112*cdf0e10cSrcweir 
1113*cdf0e10cSrcweir sal_Bool SvtSecurityOptions::IsSecureURL(	const	OUString&	sURL		,
1114*cdf0e10cSrcweir 											const	OUString&	sReferer	) const
1115*cdf0e10cSrcweir {
1116*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1117*cdf0e10cSrcweir 	return m_pDataContainer->IsSecureURL( sURL, sReferer );
1118*cdf0e10cSrcweir }
1119*cdf0e10cSrcweir 
1120*cdf0e10cSrcweir sal_Int32 SvtSecurityOptions::GetMacroSecurityLevel() const
1121*cdf0e10cSrcweir {
1122*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1123*cdf0e10cSrcweir 	return m_pDataContainer->GetMacroSecurityLevel();
1124*cdf0e10cSrcweir }
1125*cdf0e10cSrcweir 
1126*cdf0e10cSrcweir void SvtSecurityOptions::SetMacroSecurityLevel( sal_Int32 _nLevel )
1127*cdf0e10cSrcweir {
1128*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1129*cdf0e10cSrcweir 	m_pDataContainer->SetMacroSecurityLevel( _nLevel );
1130*cdf0e10cSrcweir }
1131*cdf0e10cSrcweir 
1132*cdf0e10cSrcweir sal_Bool SvtSecurityOptions::IsMacroDisabled() const
1133*cdf0e10cSrcweir {
1134*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1135*cdf0e10cSrcweir 	return m_pDataContainer->IsMacroDisabled();
1136*cdf0e10cSrcweir }
1137*cdf0e10cSrcweir 
1138*cdf0e10cSrcweir Sequence< SvtSecurityOptions::Certificate > SvtSecurityOptions::GetTrustedAuthors() const
1139*cdf0e10cSrcweir {
1140*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1141*cdf0e10cSrcweir 	return m_pDataContainer->GetTrustedAuthors();
1142*cdf0e10cSrcweir }
1143*cdf0e10cSrcweir 
1144*cdf0e10cSrcweir void SvtSecurityOptions::SetTrustedAuthors( const Sequence< Certificate >& rAuthors	)
1145*cdf0e10cSrcweir {
1146*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1147*cdf0e10cSrcweir 	m_pDataContainer->SetTrustedAuthors( rAuthors );
1148*cdf0e10cSrcweir }
1149*cdf0e10cSrcweir 
1150*cdf0e10cSrcweir sal_Bool SvtSecurityOptions::IsTrustedAuthorsEnabled()
1151*cdf0e10cSrcweir {
1152*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1153*cdf0e10cSrcweir 	return m_pDataContainer->IsTrustedAuthorsEnabled();
1154*cdf0e10cSrcweir }
1155*cdf0e10cSrcweir 
1156*cdf0e10cSrcweir bool SvtSecurityOptions::IsOptionSet( EOption eOption ) const
1157*cdf0e10cSrcweir {
1158*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1159*cdf0e10cSrcweir 	return m_pDataContainer->IsOptionSet( eOption );
1160*cdf0e10cSrcweir }
1161*cdf0e10cSrcweir 
1162*cdf0e10cSrcweir bool SvtSecurityOptions::SetOption( EOption eOption, bool bValue )
1163*cdf0e10cSrcweir {
1164*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1165*cdf0e10cSrcweir 	return m_pDataContainer->SetOption( eOption, bValue );
1166*cdf0e10cSrcweir }
1167*cdf0e10cSrcweir 
1168*cdf0e10cSrcweir bool SvtSecurityOptions::IsOptionEnabled( EOption eOption ) const
1169*cdf0e10cSrcweir {
1170*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1171*cdf0e10cSrcweir 	return m_pDataContainer->IsOptionEnabled( eOption );
1172*cdf0e10cSrcweir }
1173*cdf0e10cSrcweir 
1174*cdf0e10cSrcweir Mutex& SvtSecurityOptions::GetInitMutex()
1175*cdf0e10cSrcweir {
1176*cdf0e10cSrcweir 	// Initialize static mutex only for one time!
1177*cdf0e10cSrcweir     static Mutex* pMutex = NULL;
1178*cdf0e10cSrcweir 	// If these method first called (Mutex not already exist!) ...
1179*cdf0e10cSrcweir     if( pMutex == NULL )
1180*cdf0e10cSrcweir     {
1181*cdf0e10cSrcweir 		// ... we must create a new one. Protect follow code with the global mutex -
1182*cdf0e10cSrcweir 		// It must be - we create a static variable!
1183*cdf0e10cSrcweir         MutexGuard aGuard( Mutex::getGlobalMutex() );
1184*cdf0e10cSrcweir 		// We must check our pointer again - because it can be that another instance of ouer class will be faster then these!
1185*cdf0e10cSrcweir         if( pMutex == NULL )
1186*cdf0e10cSrcweir         {
1187*cdf0e10cSrcweir 			// Create the new mutex and set it for return on static variable.
1188*cdf0e10cSrcweir             static Mutex aMutex;
1189*cdf0e10cSrcweir             pMutex = &aMutex;
1190*cdf0e10cSrcweir         }
1191*cdf0e10cSrcweir     }
1192*cdf0e10cSrcweir 	// Return new created or already existing mutex object.
1193*cdf0e10cSrcweir     return *pMutex;
1194*cdf0e10cSrcweir }
1195*cdf0e10cSrcweir 
1196*cdf0e10cSrcweir 
1197*cdf0e10cSrcweir 
1198*cdf0e10cSrcweir 
1199*cdf0e10cSrcweir // xmlsec05 depricated
1200*cdf0e10cSrcweir 
1201*cdf0e10cSrcweir EBasicSecurityMode SvtSecurityOptions_Impl::GetBasicMode() const
1202*cdf0e10cSrcweir {
1203*cdf0e10cSrcweir 	return m_eBasicMode;
1204*cdf0e10cSrcweir }
1205*cdf0e10cSrcweir 
1206*cdf0e10cSrcweir void SvtSecurityOptions_Impl::SetBasicMode( EBasicSecurityMode eMode )
1207*cdf0e10cSrcweir {
1208*cdf0e10cSrcweir     DBG_ASSERT(!m_bROBasicMode, "SvtSecurityOptions_Impl::SetBasicMode()\nYou tried to write on a readonly value!\n");
1209*cdf0e10cSrcweir     if (!m_bROBasicMode && m_eBasicMode!=eMode)
1210*cdf0e10cSrcweir     {
1211*cdf0e10cSrcweir         m_eBasicMode = eMode;
1212*cdf0e10cSrcweir         SetModified();
1213*cdf0e10cSrcweir     }
1214*cdf0e10cSrcweir }
1215*cdf0e10cSrcweir 
1216*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::IsExecutePlugins() const
1217*cdf0e10cSrcweir {
1218*cdf0e10cSrcweir     return m_bExecutePlugins;
1219*cdf0e10cSrcweir }
1220*cdf0e10cSrcweir 
1221*cdf0e10cSrcweir void SvtSecurityOptions_Impl::SetExecutePlugins( sal_Bool bSet )
1222*cdf0e10cSrcweir {
1223*cdf0e10cSrcweir     DBG_ASSERT(!m_bROExecutePlugins, "SvtSecurityOptions_Impl::SetExecutePlugins()\nYou tried to write on a readonly value!\n");
1224*cdf0e10cSrcweir     if (!m_bROExecutePlugins && m_bExecutePlugins!=bSet)
1225*cdf0e10cSrcweir     {
1226*cdf0e10cSrcweir         m_bExecutePlugins = bSet;
1227*cdf0e10cSrcweir         SetModified();
1228*cdf0e10cSrcweir     }
1229*cdf0e10cSrcweir }
1230*cdf0e10cSrcweir 
1231*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::IsWarningEnabled() const
1232*cdf0e10cSrcweir {
1233*cdf0e10cSrcweir     return m_bWarning;
1234*cdf0e10cSrcweir }
1235*cdf0e10cSrcweir 
1236*cdf0e10cSrcweir void SvtSecurityOptions_Impl::SetWarningEnabled( sal_Bool bSet )
1237*cdf0e10cSrcweir {
1238*cdf0e10cSrcweir     DBG_ASSERT(!m_bROWarning, "SvtSecurityOptions_Impl::SetWarningEnabled()\nYou tried to write on a readonly value!\n");
1239*cdf0e10cSrcweir     if (!m_bROWarning && m_bWarning!=bSet)
1240*cdf0e10cSrcweir     {
1241*cdf0e10cSrcweir         m_bWarning = bSet;
1242*cdf0e10cSrcweir         SetModified();
1243*cdf0e10cSrcweir     }
1244*cdf0e10cSrcweir }
1245*cdf0e10cSrcweir 
1246*cdf0e10cSrcweir sal_Bool SvtSecurityOptions_Impl::IsConfirmationEnabled() const
1247*cdf0e10cSrcweir {
1248*cdf0e10cSrcweir     return m_bConfirmation;
1249*cdf0e10cSrcweir }
1250*cdf0e10cSrcweir 
1251*cdf0e10cSrcweir void SvtSecurityOptions_Impl::SetConfirmationEnabled( sal_Bool bSet )
1252*cdf0e10cSrcweir {
1253*cdf0e10cSrcweir     DBG_ASSERT(!m_bROConfirmation, "SvtSecurityOptions_Impl::SetConfirmationEnabled()\nYou tried to write on a readonly value!\n");
1254*cdf0e10cSrcweir     if (!m_bROConfirmation && m_bConfirmation!=bSet)
1255*cdf0e10cSrcweir     {
1256*cdf0e10cSrcweir         m_bConfirmation = bSet;
1257*cdf0e10cSrcweir         SetModified();
1258*cdf0e10cSrcweir     }
1259*cdf0e10cSrcweir }
1260*cdf0e10cSrcweir 
1261*cdf0e10cSrcweir 
1262*cdf0e10cSrcweir sal_Bool SvtSecurityOptions::IsExecutePlugins() const
1263*cdf0e10cSrcweir {
1264*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1265*cdf0e10cSrcweir     return m_pDataContainer->IsExecutePlugins();
1266*cdf0e10cSrcweir }
1267*cdf0e10cSrcweir 
1268*cdf0e10cSrcweir void SvtSecurityOptions::SetExecutePlugins( sal_Bool bSet )
1269*cdf0e10cSrcweir {
1270*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1271*cdf0e10cSrcweir     m_pDataContainer->SetExecutePlugins( bSet );
1272*cdf0e10cSrcweir }
1273*cdf0e10cSrcweir 
1274*cdf0e10cSrcweir sal_Bool SvtSecurityOptions::IsWarningEnabled() const
1275*cdf0e10cSrcweir {
1276*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1277*cdf0e10cSrcweir     return m_pDataContainer->IsWarningEnabled();
1278*cdf0e10cSrcweir }
1279*cdf0e10cSrcweir 
1280*cdf0e10cSrcweir void SvtSecurityOptions::SetWarningEnabled( sal_Bool bSet )
1281*cdf0e10cSrcweir {
1282*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1283*cdf0e10cSrcweir     m_pDataContainer->SetWarningEnabled( bSet );
1284*cdf0e10cSrcweir }
1285*cdf0e10cSrcweir 
1286*cdf0e10cSrcweir sal_Bool SvtSecurityOptions::IsConfirmationEnabled() const
1287*cdf0e10cSrcweir {
1288*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1289*cdf0e10cSrcweir     return m_pDataContainer->IsConfirmationEnabled();
1290*cdf0e10cSrcweir }
1291*cdf0e10cSrcweir 
1292*cdf0e10cSrcweir void SvtSecurityOptions::SetConfirmationEnabled( sal_Bool bSet )
1293*cdf0e10cSrcweir {
1294*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1295*cdf0e10cSrcweir     m_pDataContainer->SetConfirmationEnabled( bSet );
1296*cdf0e10cSrcweir }
1297*cdf0e10cSrcweir 
1298*cdf0e10cSrcweir void SvtSecurityOptions::SetBasicMode( EBasicSecurityMode eMode )
1299*cdf0e10cSrcweir {
1300*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1301*cdf0e10cSrcweir 	m_pDataContainer->SetBasicMode( eMode );
1302*cdf0e10cSrcweir }
1303*cdf0e10cSrcweir 
1304*cdf0e10cSrcweir EBasicSecurityMode SvtSecurityOptions::GetBasicMode() const
1305*cdf0e10cSrcweir {
1306*cdf0e10cSrcweir     MutexGuard aGuard( GetInitMutex() );
1307*cdf0e10cSrcweir 	return m_pDataContainer->GetBasicMode();
1308*cdf0e10cSrcweir }
1309*cdf0e10cSrcweir 
1310