Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ea968972
Kaydet (Commit)
ea968972
authored
Tem 18, 2012
tarafından
Fridrich Štrba
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
First step to proper handling of character encodings in windows ldap backend
Change-Id: Id28174af5c28346fc363e3f62a8004ce0cf98c6a
üst
b7911551
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
24 deletions
+22
-24
ldapaccess.cxx
extensions/source/config/ldap/ldapaccess.cxx
+12
-12
ldapaccess.hxx
extensions/source/config/ldap/ldapaccess.hxx
+7
-7
ldapuserprofilebe.cxx
extensions/source/config/ldap/ldapuserprofilebe.cxx
+2
-4
ldapuserprofilebe.hxx
extensions/source/config/ldap/ldapuserprofilebe.hxx
+1
-1
No files found.
extensions/source/config/ldap/ldapaccess.cxx
Dosyayı görüntüle @
ea968972
...
...
@@ -138,8 +138,8 @@ void LdapConnection::connectSimple()
// Do the bind
LdapErrCode
retCode
=
ldap_simple_bind_s
(
mConnection
,
CONST_PCHAR_CAST
mLdapDefinition
.
mAnonUser
.
getStr
(),
CONST_PCHAR_CAST
mLdapDefinition
.
mAnonCredentials
.
getStr
())
;
CONST_PCHAR_CAST
rtl
::
OUStringToOString
(
mLdapDefinition
.
mAnonUser
,
RTL_TEXTENCODING_UTF8
)
.
getStr
(),
CONST_PCHAR_CAST
rtl
::
OUStringToOString
(
mLdapDefinition
.
mAnonCredentials
,
RTL_TEXTENCODING_UTF8
)
.
getStr
())
;
checkLdapReturnCode
(
"SimpleBind"
,
retCode
,
mConnection
)
;
}
...
...
@@ -158,14 +158,14 @@ void LdapConnection::initConnection()
if
(
mLdapDefinition
.
mPort
==
0
)
mLdapDefinition
.
mPort
=
LDAP_PORT
;
mConnection
=
ldap_init
(
CONST_PCHAR_CAST
mLdapDefinition
.
mServer
.
getStr
(),
mConnection
=
ldap_init
(
CONST_PCHAR_CAST
rtl
::
OUStringToOString
(
mLdapDefinition
.
mServer
,
RTL_TEXTENCODING_UTF8
)
.
getStr
(),
mLdapDefinition
.
mPort
)
;
if
(
mConnection
==
NULL
)
{
rtl
::
OUStringBuffer
message
;
message
.
appendAscii
(
"Cannot initialise connection to LDAP server "
)
;
message
.
append
Ascii
(
mLdapDefinition
.
mServer
.
getStr
()
)
;
message
.
append
(
mLdapDefinition
.
mServer
)
;
message
.
appendAscii
(
":"
)
;
message
.
append
(
mLdapDefinition
.
mPort
)
;
throw
ldap
::
LdapConnectionException
(
message
.
makeStringAndClear
(),
...
...
@@ -181,11 +181,11 @@ void LdapConnection::initConnection()
OSL_ASSERT
(
data
!=
0
);
if
(
!
isValid
())
{
connectSimple
();
}
rtl
::
O
String
aUserDn
=
findUserDn
(
rtl
::
OUStringToOString
(
aUser
,
RTL_TEXTENCODING_ASCII_US
)
);
rtl
::
O
UString
aUserDn
=
findUserDn
(
aUser
);
LdapMessageHolder
result
;
LdapErrCode
retCode
=
ldap_search_s
(
mConnection
,
CONST_PCHAR_CAST
aUserDn
.
getStr
(),
CONST_PCHAR_CAST
rtl
::
OUStringToOString
(
aUserDn
,
RTL_TEXTENCODING_UTF8
)
.
getStr
(),
LDAP_SCOPE_BASE
,
"(objectclass=*)"
,
0
,
...
...
@@ -209,7 +209,7 @@ void LdapConnection::initConnection()
}
}
//------------------------------------------------------------------------------
rtl
::
O
String
LdapConnection
::
findUserDn
(
const
rtl
::
O
String
&
aUser
)
rtl
::
O
UString
LdapConnection
::
findUserDn
(
const
rtl
::
OU
String
&
aUser
)
throw
(
lang
::
IllegalArgumentException
,
ldap
::
LdapConnectionException
,
ldap
::
LdapGenericException
)
{
...
...
@@ -225,7 +225,7 @@ void LdapConnection::initConnection()
rtl
::
OStringBuffer
filter
(
"(&(objectclass="
);
rtl
::
O
U
StringBuffer
filter
(
"(&(objectclass="
);
filter
.
append
(
mLdapDefinition
.
mUserObjectClass
).
append
(
")("
)
;
filter
.
append
(
mLdapDefinition
.
mUserUniqueAttr
).
append
(
"="
).
append
(
aUser
).
append
(
"))"
)
;
...
...
@@ -235,19 +235,19 @@ void LdapConnection::initConnection()
attributes
[
0
]
=
const_cast
<
sal_Char
*>
(
LDAP_NO_ATTRS
);
attributes
[
1
]
=
NULL
;
LdapErrCode
retCode
=
ldap_search_s
(
mConnection
,
CONST_PCHAR_CAST
mLdapDefinition
.
mBaseDN
.
getStr
(),
CONST_PCHAR_CAST
rtl
::
OUStringToOString
(
mLdapDefinition
.
mBaseDN
,
RTL_TEXTENCODING_UTF8
)
.
getStr
(),
LDAP_SCOPE_SUBTREE
,
CONST_PCHAR_CAST
filter
.
makeStringAndClear
(
).
getStr
(),
attributes
,
0
,
&
result
.
msg
)
;
CONST_PCHAR_CAST
rtl
::
OUStringToOString
(
filter
.
makeStringAndClear
(),
RTL_TEXTENCODING_UTF8
).
getStr
(),
attributes
,
0
,
&
result
.
msg
)
;
checkLdapReturnCode
(
"FindUserDn"
,
retCode
,
mConnection
)
;
rtl
::
OString
userDn
;
rtl
::
O
U
String
userDn
;
LDAPMessage
*
entry
=
ldap_first_entry
(
mConnection
,
result
.
msg
)
;
if
(
entry
!=
NULL
)
{
sal_Char
*
charsDn
=
ldap_get_dn
(
mConnection
,
entry
)
;
userDn
=
charsDn
;
userDn
=
rtl
::
OStringToOUString
(
charsDn
,
RTL_TEXTENCODING_UTF8
)
;
ldap_memfree
(
charsDn
)
;
}
else
...
...
extensions/source/config/ldap/ldapaccess.hxx
Dosyayı görüntüle @
ea968972
...
...
@@ -45,19 +45,19 @@ struct LdapUserProfile;
struct
LdapDefinition
{
/** LDAP server name */
rtl
::
OString
mServer
;
rtl
::
O
U
String
mServer
;
/** LDAP server port number */
sal_Int32
mPort
;
/** Repository base DN */
rtl
::
OString
mBaseDN
;
rtl
::
O
U
String
mBaseDN
;
/** DN to use for "anonymous" connection */
rtl
::
OString
mAnonUser
;
rtl
::
O
U
String
mAnonUser
;
/** Credentials to use for "anonymous" connection */
rtl
::
OString
mAnonCredentials
;
rtl
::
O
U
String
mAnonCredentials
;
/** User Entity Object Class */
rtl
::
OString
mUserObjectClass
;
rtl
::
O
U
String
mUserObjectClass
;
/** User Entity Unique Attribute */
rtl
::
OString
mUserUniqueAttr
;
rtl
::
O
U
String
mUserUniqueAttr
;
}
;
typedef
std
::
map
<
rtl
::
OUString
,
rtl
::
OUString
>
LdapData
;
// key/value pairs
...
...
@@ -94,7 +94,7 @@ public:
/** finds DN of user
@return DN of User
*/
rtl
::
O
String
findUserDn
(
const
rtl
::
O
String
&
aUser
)
rtl
::
O
UString
findUserDn
(
const
rtl
::
OU
String
&
aUser
)
throw
(
lang
::
IllegalArgumentException
,
ldap
::
LdapConnectionException
,
ldap
::
LdapGenericException
);
...
...
extensions/source/config/ldap/ldapuserprofilebe.cxx
Dosyayı görüntüle @
ea968972
...
...
@@ -171,11 +171,9 @@ bool LdapUserProfileBe::readLdapConfiguration(
bool
LdapUserProfileBe
::
getLdapStringParam
(
uno
::
Reference
<
container
::
XNameAccess
>&
xAccess
,
const
rtl
::
OUString
&
aLdapSetting
,
rtl
::
OString
&
aServerParameter
)
rtl
::
O
U
String
&
aServerParameter
)
{
rtl
::
OUString
sParam
;
xAccess
->
getByName
(
aLdapSetting
)
>>=
sParam
;
aServerParameter
=
rtl
::
OUStringToOString
(
sParam
,
RTL_TEXTENCODING_ASCII_US
);
xAccess
->
getByName
(
aLdapSetting
)
>>=
aServerParameter
;
return
!
aServerParameter
.
isEmpty
();
}
...
...
extensions/source/config/ldap/ldapuserprofilebe.hxx
Dosyayı görüntüle @
ea968972
...
...
@@ -151,7 +151,7 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
bool
getLdapStringParam
(
uno
::
Reference
<
container
::
XNameAccess
>&
xAccess
,
const
rtl
::
OUString
&
aLdapSetting
,
rtl
::
OString
&
aServerParameter
);
rtl
::
O
U
String
&
aServerParameter
);
LdapData
data_
;
}
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment