Kaydet (Commit) ab9d657e authored tarafından Kurt Zenker's avatar Kurt Zenker

INTEGRATION: CWS dba22ui (1.24.32); FILE MERGED

2006/12/11 09:37:22 fs 1.24.32.2: acquire in dtor, to prevent reentrance
2006/12/04 11:19:13 fs 1.24.32.1: properly recognize invalid LDAP connections / #i71773# STR_COULD_NOT_CONNECT_LDAP
üst 96bbd4a4
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: MConnection.cxx,v $ * $RCSfile: MConnection.cxx,v $
* *
* $Revision: 1.24 $ * $Revision: 1.25 $
* *
* last change: $Author: ihi $ $Date: 2006-10-18 13:08:12 $ * last change: $Author: kz $ $Date: 2006-12-13 16:19:44 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
#include "diagnose_ex.h" #include "diagnose_ex.h"
#endif #endif
#include "resource/mozab_res.hrc"
#ifndef COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX #ifndef COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
#include <comphelper/officeresourcebundle.hxx> #include <comphelper/officeresourcebundle.hxx>
#endif #endif
...@@ -167,6 +169,7 @@ OConnection::OConnection(MozabDriver* _pDriver) ...@@ -167,6 +169,7 @@ OConnection::OConnection(MozabDriver* _pDriver)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
OConnection::~OConnection() OConnection::~OConnection()
{ {
acquire();
if(!isClosed()) if(!isClosed())
close(); close();
m_pDriver->release(); m_pDriver->release();
...@@ -206,8 +209,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV ...@@ -206,8 +209,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
else else
{ {
OSL_TRACE( "No subschema given!!!\n"); OSL_TRACE( "No subschema given!!!\n");
::dbtools::throwGenericSQLException( throwGenericSQLException( STR_URI_SYNTAX_ERROR );
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("No subschema provided")),NULL);
} }
} }
else else
...@@ -317,10 +319,8 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV ...@@ -317,10 +319,8 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
if ( m_sHostName.getLength() != 0 ) { if ( m_sHostName.getLength() != 0 ) {
m_sMozillaURI += m_sHostName; m_sMozillaURI += m_sHostName;
} }
else { else
::dbtools::throwGenericSQLException( throwGenericSQLException( STR_NO_HOSTNAME );
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("No HostName provided")),NULL);
}
if ( nPortNumber > 0 ) { if ( nPortNumber > 0 ) {
m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(":") ); m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(":") );
...@@ -331,10 +331,9 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV ...@@ -331,10 +331,9 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ); m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") );
m_sMozillaURI += sBaseDN; m_sMozillaURI += sBaseDN;
} }
else { else
::dbtools::throwGenericSQLException( throwGenericSQLException( STR_NO_BASEDN );
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("No BaseDN provided")),NULL);
}
// Addition of a fake query to enable the Mozilla LDAP directory to work correctly. // Addition of a fake query to enable the Mozilla LDAP directory to work correctly.
m_sMozillaURI += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?(or(DisplayName,=,DontDoThisAtHome)))")); m_sMozillaURI += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?(or(DisplayName,=,DontDoThisAtHome)))"));
...@@ -350,8 +349,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV ...@@ -350,8 +349,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
else else
{ {
OSL_TRACE("Invalid subschema given!!!\n"); OSL_TRACE("Invalid subschema given!!!\n");
::dbtools::throwGenericSQLException( throwGenericSQLException( STR_URI_SYNTAX_ERROR );
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid subschema provided")),NULL);
} }
OSL_TRACE("Moz URI = %s, %s\n", ((OUtoCStr(m_sMozillaURI)) ? (OUtoCStr(m_sMozillaURI)):("NULL")), usesFactory() ? "uses factory" : "no factory"); OSL_TRACE("Moz URI = %s, %s\n", ((OUtoCStr(m_sMozillaURI)) ? (OUtoCStr(m_sMozillaURI)):("NULL")), usesFactory() ? "uses factory" : "no factory");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment