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
ee641112
Kaydet (Commit)
ee641112
authored
Ock 29, 2008
tarafından
Mikhail Voitenko
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
allow to do some special site-related settings in configuration
üst
c87fcd67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
26 deletions
+83
-26
Helper.java
swext/mediawiki/src/com/sun/star/wiki/Helper.java
+72
-16
WikiArticle.java
swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
+3
-4
WikiEditSettingDialog.java
...ediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java
+3
-3
WikiPropDialog.java
swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java
+5
-3
No files found.
swext/mediawiki/src/com/sun/star/wiki/Helper.java
Dosyayı görüntüle @
ee641112
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
*
*
* $RCSfile: Helper.java,v $
* $RCSfile: Helper.java,v $
*
*
* $Revision: 1.
7
$
* $Revision: 1.
8
$
*
*
* last change: $Author: mav $ $Date: 2008-01-2
8 13:47:59
$
* last change: $Author: mav $ $Date: 2008-01-2
9 11:01:28
$
*
*
* 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.
...
@@ -696,18 +696,9 @@ public class Helper
...
@@ -696,18 +696,9 @@ public class Helper
}
}
boolean
bNoUnknownCertNotification
=
false
;
boolean
bNoUnknownCertNotification
=
false
;
if
(
aHostConfig
.
getProtocol
().
getScheme
().
equals
(
"https"
)
&&
m_aAcceptedUnknownCerts
!=
null
)
if
(
aHostConfig
.
getProtocol
().
getScheme
().
equals
(
"https"
)
&&
AllowUnknownCert
(
xContext
,
aURI
.
toString
()
)
)
{
Boolean
bAccepted
=
(
Boolean
)
m_aAcceptedUnknownCerts
.
get
(
aHostConfig
.
getHost
()
);
bNoUnknownCertNotification
=
(
bAccepted
!=
null
&&
bAccepted
.
booleanValue
()
);
}
if
(
!
bNoUnknownCertNotification
)
{
Helper
.
GetHttpClient
().
executeMethod
(
aHostConfig
,
aMethod
);
}
else
{
{
// let unknown certificates be accepted
{
{
{
{
aHostConfig
.
setHost
(
aHostConfig
.
getHost
(),
(
aURI
.
getPort
()
<
0
?
443
:
aURI
.
getPort
()
),
Helper
.
GetOwnHttps
(
aURI
.
getPort
()
)
);
aHostConfig
.
setHost
(
aHostConfig
.
getHost
(),
(
aURI
.
getPort
()
<
0
?
443
:
aURI
.
getPort
()
),
Helper
.
GetOwnHttps
(
aURI
.
getPort
()
)
);
...
@@ -715,6 +706,10 @@ public class Helper
...
@@ -715,6 +706,10 @@ public class Helper
}
}
}
}
}
}
else
{
Helper
.
GetHttpClient
().
executeMethod
(
aHostConfig
,
aMethod
);
}
}
}
}
}
...
@@ -755,12 +750,12 @@ public class Helper
...
@@ -755,12 +750,12 @@ public class Helper
return
bResult
;
return
bResult
;
}
}
static
protected
HostConfiguration
Login
(
URI
aMainURL
,
String
sWikiUser
,
String
sWikiPass
,
String
sWikiDomain
,
XComponentContext
xContext
)
static
protected
HostConfiguration
Login
(
URI
aMainURL
,
String
sWikiUser
,
String
sWikiPass
,
XComponentContext
xContext
)
throws
com
.
sun
.
star
.
uno
.
Exception
,
java
.
io
.
IOException
,
WikiCancelException
throws
com
.
sun
.
star
.
uno
.
Exception
,
java
.
io
.
IOException
,
WikiCancelException
{
{
HostConfiguration
aHostConfig
=
null
;
HostConfiguration
aHostConfig
=
null
;
if
(
sWikiUser
!=
null
&&
sWikiUser
.
length
()
>
0
&&
sWikiPass
!=
null
&&
sWikiDomain
!=
null
&&
xContext
!=
null
)
if
(
sWikiUser
!=
null
&&
sWikiUser
.
length
()
>
0
&&
sWikiPass
!=
null
&&
xContext
!=
null
)
{
{
HostConfiguration
aNewHostConfig
=
new
HostConfiguration
();
HostConfiguration
aNewHostConfig
=
new
HostConfiguration
();
...
@@ -781,7 +776,11 @@ public class Helper
...
@@ -781,7 +776,11 @@ public class Helper
aPost
.
addParameter
(
"wpName"
,
sWikiUser
);
aPost
.
addParameter
(
"wpName"
,
sWikiUser
);
aPost
.
addParameter
(
"wpRemember"
,
"1"
);
aPost
.
addParameter
(
"wpRemember"
,
"1"
);
aPost
.
addParameter
(
"wpPassword"
,
sWikiPass
);
aPost
.
addParameter
(
"wpPassword"
,
sWikiPass
);
aPost
.
addParameter
(
"wpDomain"
,
sWikiDomain
);
String
[][]
pArgs
=
GetSpecialArgs
(
xContext
,
aMainURL
.
toString
()
);
if
(
pArgs
!=
null
)
for
(
int
nArgInd
=
0
;
nArgInd
<
pArgs
.
length
;
nArgInd
++
)
if
(
pArgs
[
nArgInd
].
length
==
2
&&
pArgs
[
nArgInd
][
0
]
!=
null
&&
pArgs
[
nArgInd
][
1
]
!=
null
)
aPost
.
addParameter
(
pArgs
[
nArgInd
][
0
],
pArgs
[
nArgInd
][
1
]
);
ExecuteMethod
(
aPost
,
aNewHostConfig
,
aPostURI
,
xContext
,
false
);
ExecuteMethod
(
aPost
,
aNewHostConfig
,
aPostURI
,
xContext
,
false
);
...
@@ -971,5 +970,62 @@ public class Helper
...
@@ -971,5 +970,62 @@ public class Helper
return
bResult
;
return
bResult
;
}
}
private
static
boolean
AllowUnknownCert
(
XComponentContext
xContext
,
String
aURL
)
{
try
{
XNameAccess
xNameAccess
=
GetConfigNameAccess
(
xContext
,
"org.openoffice.Office.Custom.WikiExtension/SpecialData"
);
if
(
xNameAccess
.
hasByName
(
aURL
)
)
{
XNameAccess
xEntry
=
(
XNameAccess
)
UnoRuntime
.
queryInterface
(
XNameAccess
.
class
,
xNameAccess
.
getByName
(
aURL
)
);
if
(
xEntry
!=
null
&&
xEntry
.
hasByName
(
"AllowUnknownCertificate"
)
)
return
AnyConverter
.
toBoolean
(
xEntry
.
getByName
(
"AllowUnknownCertificate"
)
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
false
;
}
private
static
String
[][]
GetSpecialArgs
(
XComponentContext
xContext
,
String
aURL
)
{
try
{
XNameAccess
xNameAccess
=
GetConfigNameAccess
(
xContext
,
"org.openoffice.Office.Custom.WikiExtension/SpecialData"
);
if
(
xNameAccess
.
hasByName
(
aURL
)
)
{
XNameAccess
xEntry
=
(
XNameAccess
)
UnoRuntime
.
queryInterface
(
XNameAccess
.
class
,
xNameAccess
.
getByName
(
aURL
)
);
if
(
xEntry
!=
null
)
{
XNameAccess
xArgs
=
(
XNameAccess
)
UnoRuntime
.
queryInterface
(
XNameAccess
.
class
,
xEntry
.
getByName
(
"AdditionalLoginArguments"
)
);
if
(
xArgs
!=
null
)
{
String
[]
pNames
=
xArgs
.
getElementNames
();
if
(
pNames
!=
null
&&
pNames
.
length
>
0
)
{
String
[][]
pResult
=
new
String
[
pNames
.
length
][
2
];
for
(
int
nInd
=
0
;
nInd
<
pNames
.
length
;
nInd
++
)
{
pResult
[
nInd
][
0
]
=
pNames
[
nInd
];
pResult
[
nInd
][
1
]
=
AnyConverter
.
toString
(
xArgs
.
getByName
(
pNames
[
nInd
]
)
);
}
return
pResult
;
}
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
}
swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
Dosyayı görüntüle @
ee641112
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
*
*
* $RCSfile: WikiArticle.java,v $
* $RCSfile: WikiArticle.java,v $
*
*
* $Revision: 1.
2
$
* $Revision: 1.
3
$
*
*
* last change: $Author: mav $ $Date: 200
7-12-13 15:11:05
$
* last change: $Author: mav $ $Date: 200
8-01-29 11:01:28
$
*
*
* 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.
...
@@ -57,7 +57,6 @@ public class WikiArticle
...
@@ -57,7 +57,6 @@ public class WikiArticle
protected
String
m_sWikiUser
;
protected
String
m_sWikiUser
;
protected
String
m_sWikiPass
;
protected
String
m_sWikiPass
;
protected
String
m_sWikiDomain
=
"sun"
;
protected
String
m_sTitle
=
""
;
protected
String
m_sTitle
=
""
;
...
@@ -268,7 +267,7 @@ public class WikiArticle
...
@@ -268,7 +267,7 @@ public class WikiArticle
protected
boolean
Login
()
protected
boolean
Login
()
throws
com
.
sun
.
star
.
uno
.
Exception
,
java
.
io
.
IOException
,
WikiCancelException
throws
com
.
sun
.
star
.
uno
.
Exception
,
java
.
io
.
IOException
,
WikiCancelException
{
{
m_aHostConfig
=
Helper
.
Login
(
m_aMainURI
,
m_sWikiUser
,
m_sWikiPass
,
m_
sWikiDomain
,
m_
xContext
);
m_aHostConfig
=
Helper
.
Login
(
m_aMainURI
,
m_sWikiUser
,
m_sWikiPass
,
m_xContext
);
return
(
m_aHostConfig
!=
null
);
return
(
m_aHostConfig
!=
null
);
}
}
...
...
swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java
Dosyayı görüntüle @
ee641112
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
*
*
* $RCSfile: WikiEditSettingDialog.java,v $
* $RCSfile: WikiEditSettingDialog.java,v $
*
*
* $Revision: 1.
8
$
* $Revision: 1.
9
$
*
*
* last change: $Author: mav $ $Date: 2008-01-2
8 13:48:00
$
* last change: $Author: mav $ $Date: 2008-01-2
9 11:01:28
$
*
*
* 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.
...
@@ -196,7 +196,7 @@ public class WikiEditSettingDialog extends WikiDialog
...
@@ -196,7 +196,7 @@ public class WikiEditSettingDialog extends WikiDialog
else
else
{
{
if
(
(
sUserName
.
length
()
>
0
||
sPassword
.
length
()
>
0
)
if
(
(
sUserName
.
length
()
>
0
||
sPassword
.
length
()
>
0
)
&&
Helper
.
Login
(
new
URI
(
sMainURL
),
sUserName
,
sPassword
,
"sun"
,
m_xContext
)
==
null
)
&&
Helper
.
Login
(
new
URI
(
sMainURL
),
sUserName
,
sPassword
,
m_xContext
)
==
null
)
{
{
// a wrong login information is provided
// a wrong login information is provided
// show error
// show error
...
...
swext/mediawiki/src/com/sun/star/wiki/WikiPropDialog.java
Dosyayı görüntüle @
ee641112
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
*
*
* $RCSfile: WikiPropDialog.java,v $
* $RCSfile: WikiPropDialog.java,v $
*
*
* $Revision: 1.
7
$
* $Revision: 1.
8
$
*
*
* last change: $Author: mav $ $Date: 2008-01-2
8 13:48:00
$
* last change: $Author: mav $ $Date: 2008-01-2
9 11:01:28
$
*
*
* 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.
...
@@ -344,8 +344,10 @@ public class WikiPropDialog extends WikiDialog{
...
@@ -344,8 +344,10 @@ public class WikiPropDialog extends WikiDialog{
{
{
Helper
.
ShowError
(
m_xContext
,
Helper
.
ShowError
(
m_xContext
,
m_xDialog
,
m_xDialog
,
Helper
.
DLG_SENDTITLE
,
Helper
.
CANCELSENDING_ERROR
,
Helper
.
CANCELSENDING_ERROR
,
null
);
null
,
false
);
}
}
return
true
;
return
true
;
...
...
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