Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
2c015583
Commit
2c015583
authored
Sep 26, 2011
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed getuniboard.com access
parent
0482d9a6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
63 additions
and
352 deletions
+63
-352
UBThumbnailAdaptor.cpp
src/adaptors/UBThumbnailAdaptor.cpp
+4
-0
adaptors.pri
src/adaptors/adaptors.pri
+56
-57
UBAbstractPublisher.cpp
src/adaptors/publishing/UBAbstractPublisher.cpp
+0
-148
UBAbstractPublisher.h
src/adaptors/publishing/UBAbstractPublisher.h
+0
-51
UBDocumentPublisher.cpp
src/adaptors/publishing/UBDocumentPublisher.cpp
+2
-2
UBDocumentPublisher.h
src/adaptors/publishing/UBDocumentPublisher.h
+1
-2
UBSettings.cpp
src/core/UBSettings.cpp
+0
-24
UBSettings.h
src/core/UBSettings.h
+0
-15
UBWebController.cpp
src/web/UBWebController.cpp
+0
-48
UBWebController.h
src/web/UBWebController.h
+0
-5
No files found.
src/adaptors/UBThumbnailAdaptor.cpp
View file @
2c015583
...
...
@@ -101,7 +101,11 @@ QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy)
if
(
file
.
exists
())
{
QPixmap
pix
;
//Warning. Works only with modified Qt
#ifdef Q_WS_X11
pix
.
load
(
fileName
,
0
,
Qt
::
AutoColor
);
#else
pix
.
load
(
fileName
,
0
,
Qt
::
AutoColor
,
false
);
#endif
thumbnails
.
append
(
pix
);
}
else
{
moreToProcess
=
false
;
...
...
src/adaptors/adaptors.pri
View file @
2c015583
HEADERS += src/adaptors/UBExportAdaptor.h\
src/adaptors/UBExportPDF.h \
src/adaptors/UBExportFullPDF.h \
src/adaptors/UBExportDocument.h \
src/adaptors/UBSvgSubsetAdaptor.h \
src/adaptors/UBMetadataDcSubsetAdaptor.h \
src/adaptors/UBImportAdaptor.h \
src/adaptors/UBImportDocument.h \
src/adaptors/UBThumbnailAdaptor.h \
src/adaptors/UBImportPDF.h \
src/adaptors/UBImportImage.h \
src/adaptors/UBIniFileParser.h \
src/adaptors/UBExportWeb.h \
src/adaptors/UBWebPublisher.h \
src/adaptors/UBImportCFF.h \
src/adaptors/UBCFFSubsetAdaptor.h
HEADERS += src/adaptors/publishing/UBDocumentPublisher.h \
src/adaptors/publishing/UBAbstractPublisher.h \
src/adaptors/publishing/UBSvgSubsetRasterizer.h
HEADERS += src/adaptors/voting/UBAbstractVotingSystem.h
SOURCES += src/adaptors/UBExportAdaptor.cpp\
src/adaptors/UBExportPDF.cpp \
src/adaptors/UBExportFullPDF.cpp \
src/adaptors/UBExportDocument.cpp \
src/adaptors/UBSvgSubsetAdaptor.cpp \
src/adaptors/UBMetadataDcSubsetAdaptor.cpp \
src/adaptors/UBImportAdaptor.cpp \
src/adaptors/UBImportDocument.cpp \
src/adaptors/UBThumbnailAdaptor.cpp \
src/adaptors/UBImportPDF.cpp \
src/adaptors/UBImportImage.cpp \
src/adaptors/UBIniFileParser.cpp \
src/adaptors/UBExportWeb.cpp \
src/adaptors/UBWebPublisher.cpp \
src/adaptors/UBImportCFF.cpp \
src/adaptors/UBCFFSubsetAdaptor.cpp
SOURCES += src/adaptors/publishing/UBDocumentPublisher.cpp \
src/adaptors/publishing/UBAbstractPublisher.cpp \
src/adaptors/publishing/UBSvgSubsetRasterizer.cpp
SOURCES += src/adaptors/voting/UBAbstractVotingSystem.cpp
win32 {
SOURCES += src/adaptors/voting/UBReply2005VotingSystem.cpp \
src/adaptors/voting/UBReplyWRS970VotingSystem.cpp
HEADERS += src/adaptors/voting/UBReply2005VotingSystem.h \
src/adaptors/voting/UBReplyWRS970VotingSystem.h
}
HEADERS += src/adaptors/UBExportAdaptor.h\
src/adaptors/UBExportPDF.h \
src/adaptors/UBExportFullPDF.h \
src/adaptors/UBExportDocument.h \
src/adaptors/UBSvgSubsetAdaptor.h \
src/adaptors/UBMetadataDcSubsetAdaptor.h \
src/adaptors/UBImportAdaptor.h \
src/adaptors/UBImportDocument.h \
src/adaptors/UBThumbnailAdaptor.h \
src/adaptors/UBImportPDF.h \
src/adaptors/UBImportImage.h \
src/adaptors/UBIniFileParser.h \
src/adaptors/UBExportWeb.h \
src/adaptors/UBWebPublisher.h \
src/adaptors/UBImportCFF.h \
src/adaptors/UBCFFSubsetAdaptor.h
HEADERS += src/adaptors/publishing/UBDocumentPublisher.h \
src/adaptors/publishing/UBSvgSubsetRasterizer.h
HEADERS += src/adaptors/voting/UBAbstractVotingSystem.h
SOURCES += src/adaptors/UBExportAdaptor.cpp\
src/adaptors/UBExportPDF.cpp \
src/adaptors/UBExportFullPDF.cpp \
src/adaptors/UBExportDocument.cpp \
src/adaptors/UBSvgSubsetAdaptor.cpp \
src/adaptors/UBMetadataDcSubsetAdaptor.cpp \
src/adaptors/UBImportAdaptor.cpp \
src/adaptors/UBImportDocument.cpp \
src/adaptors/UBThumbnailAdaptor.cpp \
src/adaptors/UBImportPDF.cpp \
src/adaptors/UBImportImage.cpp \
src/adaptors/UBIniFileParser.cpp \
src/adaptors/UBExportWeb.cpp \
src/adaptors/UBWebPublisher.cpp \
src/adaptors/UBImportCFF.cpp \
src/adaptors/UBCFFSubsetAdaptor.cpp \
src/adaptors/publishing/UBDocumentPublisher.cpp
SOURCES += \
src/adaptors/publishing/UBSvgSubsetRasterizer.cpp
SOURCES += src/adaptors/voting/UBAbstractVotingSystem.cpp
win32 {
SOURCES += src/adaptors/voting/UBReply2005VotingSystem.cpp \
src/adaptors/voting/UBReplyWRS970VotingSystem.cpp
HEADERS += src/adaptors/voting/UBReply2005VotingSystem.h \
src/adaptors/voting/UBReplyWRS970VotingSystem.h
}
src/adaptors/publishing/UBAbstractPublisher.cpp
deleted
100644 → 0
View file @
0482d9a6
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "UBAbstractPublisher.h"
#include <QtXml>
#include <openssl/aes.h>
#include <openssl/evp.h>
#include "core/UBSettings.h"
#include "core/UBApplication.h"
#include "network/UBNetworkAccessManager.h"
#include "network/UBServerXMLHttpRequest.h"
#include "core/memcheck.h"
UBAbstractPublisher
::
UBAbstractPublisher
(
QObject
*
parent
)
:
QObject
(
parent
)
,
mTokenRequest
(
0
)
{
// NOOP
}
void
UBAbstractPublisher
::
authenticate
()
{
sendAuthenticationTokenRequest
();
}
void
UBAbstractPublisher
::
sendAuthenticationTokenRequest
()
{
QUrl
publishingEndpoint
=
QUrl
(
UBSettings
::
settings
()
->
publishingAuthenticationUrl
);
mTokenRequest
=
new
UBServerXMLHttpRequest
(
UBNetworkAccessManager
::
defaultAccessManager
());
mTokenRequest
->
setVerbose
(
true
);
UBApplication
::
showMessage
(
tr
(
"Contacting %1"
).
arg
(
UBSettings
::
settings
()
->
uniboardWebUrl
->
get
().
toString
()),
true
);
connect
(
mTokenRequest
,
SIGNAL
(
finished
(
bool
,
const
QByteArray
&
)),
this
,
SLOT
(
processAuthenticationTokenResponse
(
bool
,
const
QByteArray
&
)));
mTokenRequest
->
get
(
publishingEndpoint
);
}
void
UBAbstractPublisher
::
processAuthenticationTokenResponse
(
bool
success
,
const
QByteArray
&
payload
)
{
if
(
mTokenRequest
)
mTokenRequest
->
deleteLater
();
if
(
success
)
{
/*
<publishing-token>
...
<token>iFzZIXhPxHTLhJeHWFF9BDVblMDWU546rpzoEEfxMSLrftMq444w4BuoisnNtRAjm6ht3hKUIHmMKA3xGN2Hlaof8tbYNLHmzf2R1dO439vnXFiHMPLBi7nFpSEPtBNJ</token>
<uuid>26fea4c0-1319-012d-d0fc-001f5b3d920c</uuid>
...
</publishing-token>
*/
QDomDocument
doc
(
"publishing-token"
);
doc
.
setContent
(
payload
,
false
);
QDomElement
root
=
doc
.
documentElement
();
const
QString
token
=
root
.
firstChildElement
(
"token"
).
text
();
const
QString
uuid
=
root
.
firstChildElement
(
"uuid"
).
text
();
if
(
token
.
length
()
>
0
&&
uuid
.
length
()
>
0
)
{
const
QByteArray
encrypted
=
encrypt
(
token
);
QString
encryptedBase64
=
QString
::
fromAscii
(
encrypted
.
toBase64
());
UBApplication
::
showMessage
(
tr
(
"Found %1"
).
arg
(
UBSettings
::
settings
()
->
uniboardWebUrl
->
get
().
toString
()),
false
);
emit
authenticated
(
QUuid
(
uuid
),
encryptedBase64
);
}
else
{
qWarning
()
<<
"Authentication failed"
<<
QString
::
fromUtf8
(
payload
);
emit
authenticationFailure
();
UBApplication
::
showMessage
(
tr
(
"Cannot Authenticate with %1"
).
arg
(
UBSettings
::
settings
()
->
uniboardWebUrl
->
get
().
toString
()));
}
}
else
{
qWarning
()
<<
"Authentication failed"
<<
QString
::
fromUtf8
(
payload
);
emit
authenticationFailure
();
UBApplication
::
showMessage
(
tr
(
"Cannot Authenticate with %1"
).
arg
(
UBSettings
::
settings
()
->
uniboardWebUrl
->
get
().
toString
()));
}
}
QByteArray
UBAbstractPublisher
::
encrypt
(
const
QString
&
clear
)
{
static
const
char
*
key
=
"9ecHaspud9uD9ste5erAchehefrup3ec"
;
EVP_CIPHER_CTX
aesEncryptContext
;
EVP_CIPHER_CTX_init
(
&
aesEncryptContext
);
EVP_EncryptInit_ex
(
&
aesEncryptContext
,
EVP_aes_256_ecb
(),
NULL
,
(
const
unsigned
char
*
)
key
,
NULL
);
QByteArray
clearData
=
clear
.
toUtf8
();
int
cipheredLength
=
clearData
.
length
()
+
AES_BLOCK_SIZE
;
int
paddingLength
=
0
;
unsigned
char
*
cipherText
=
(
unsigned
char
*
)
malloc
(
cipheredLength
);
if
(
!
EVP_EncryptInit_ex
(
&
aesEncryptContext
,
NULL
,
NULL
,
NULL
,
NULL
))
return
QByteArray
();
if
(
!
EVP_EncryptUpdate
(
&
aesEncryptContext
,
cipherText
,
&
cipheredLength
,
(
unsigned
char
*
)
clearData
.
data
(),
clearData
.
length
()))
return
QByteArray
();
/* update ciphertext with the final remaining bytes */
if
(
!
EVP_EncryptFinal_ex
(
&
aesEncryptContext
,
cipherText
+
cipheredLength
,
&
paddingLength
))
return
QByteArray
();
QByteArray
cipheredData
((
const
char
*
)
cipherText
,
cipheredLength
+
paddingLength
);
free
(
cipherText
);
EVP_CIPHER_CTX_cleanup
(
&
aesEncryptContext
);
return
cipheredData
;
}
src/adaptors/publishing/UBAbstractPublisher.h
deleted
100644 → 0
View file @
0482d9a6
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBABSTRACTPUBLISHER_H
#define UBABSTRACTPUBLISHER_H
#include <QtCore>
class
UBServerXMLHttpRequest
;
class
UBAbstractPublisher
:
public
QObject
{
Q_OBJECT
public
:
explicit
UBAbstractPublisher
(
QObject
*
parent
=
0
);
virtual
~
UBAbstractPublisher
(){}
void
authenticate
();
signals
:
void
authenticated
(
const
QUuid
&
,
const
QString
&
);
void
authenticationFailure
();
private
:
void
sendAuthenticationTokenRequest
();
QByteArray
encrypt
(
const
QString
&
token
);
UBServerXMLHttpRequest
*
mTokenRequest
;
private
slots
:
void
processAuthenticationTokenResponse
(
bool
,
const
QByteArray
&
);
};
#endif // UBABSTRACTPUBLISHER_H
src/adaptors/publishing/UBDocumentPublisher.cpp
View file @
2c015583
...
...
@@ -48,14 +48,14 @@
UBDocumentPublisher
::
UBDocumentPublisher
(
UBDocumentProxy
*
pDocument
,
QObject
*
parent
)
:
UBAbstractPublisher
(
parent
)
:
QObject
(
parent
)
,
mSourceDocument
(
pDocument
)
,
mPublishingDocument
(
0
)
,
mUsername
(
""
)
,
mPassword
(
""
)
,
bLoginCookieSet
(
false
)
{
init
();
//NOOP
}
...
...
src/adaptors/publishing/UBDocumentPublisher.h
View file @
2c015583
...
...
@@ -19,7 +19,6 @@
#include <QtNetwork>
#include "ui_webPublishing.h"
#include "UBAbstractPublisher.h"
#define DOCPUBLICATION_URL "http://planete.sankore.org/xwiki/bin/view/CreateResources/UniboardUpload?xpage=plain&outputSyntax=plain"
...
...
@@ -79,7 +78,7 @@ private:
};
class
UBDocumentPublisher
:
public
UBAbstractPublisher
class
UBDocumentPublisher
:
public
QObject
{
Q_OBJECT
;
...
...
src/core/UBSettings.cpp
View file @
2c015583
...
...
@@ -170,33 +170,10 @@ void UBSettings::ValidateKeyboardPaletteKeyBtnSize()
void
UBSettings
::
init
()
{
uniboardWebUrl
=
new
UBSetting
(
this
,
"App"
,
"UniboardWebAddress"
,
"http://web.getuniboard.com"
);
productWebUrl
=
new
UBSetting
(
this
,
"App"
,
"ProductWebAddress"
,
"http://www.sankore.org"
);
softwareUpdatesUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/software/installer/"
;
softwareLibrariesUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/software/library/"
;
softwareHomeUrl
=
productWebUrl
->
get
().
toString
();
softwarePurchaseUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/software/purchase/"
;
oEmbedJsLibraryUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/widgets/videopicker/scripts/jquery.oembed.js"
;
documentsPublishingUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/documents/publish"
;
capturesPublishingUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/captures/publish"
;
publishingAuthenticationUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/publish/token"
;
documentPlayerScriptUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/uniboard-player/scripts/ubplayer.js"
;
documentPlayerPageScriptUrl
=
uniboardWebUrl
->
get
().
toString
()
+
"/uniboard-player/scripts/ubplayer.page.js"
;
documentPlayerCssUrl
=
uniboardWebUrl
->
get
().
toString
()
+
QLatin1String
(
"/uniboard-player/stylesheets/viewer.css"
);
#ifdef Q_WS_MAC
appRssUrl
=
softwareUpdatesUrl
+
"appcast-mac.xml"
;
#elif defined(Q_WS_WIN)
appRssUrl
=
softwareUpdatesUrl
+
"appcast-win.xml"
;
#else
appRssUrl
=
""
;
// TODO Linux
#endif
appToolBarPositionedAtTop
=
new
UBSetting
(
this
,
"App"
,
"ToolBarPositionedAtTop"
,
true
);
appToolBarDisplayText
=
new
UBSetting
(
this
,
"App"
,
"ToolBarDisplayText"
,
true
);
appEnableAutomaticSoftwareUpdates
=
new
UBSetting
(
this
,
"App"
,
"EnableAutomaticSoftwareUpdates"
,
true
);
...
...
@@ -223,7 +200,6 @@ void UBSettings::init()
boardUseHighResTabletEvent
=
new
UBSetting
(
this
,
"Board"
,
"UseHighResTabletEvent"
,
true
);
// boardKeyboardPaletteAutoMinimize = new UBSetting(this, "Board", "KeyboardPaletteAutoMinimize", true);
boardKeyboardPaletteKeyBtnSize
=
new
UBSetting
(
this
,
"Board"
,
"KeyboardPaletteKeyBtnSize"
,
"16x16"
);
ValidateKeyboardPaletteKeyBtnSize
();
...
...
src/core/UBSettings.h
View file @
2c015583
...
...
@@ -192,21 +192,9 @@ class UBSettings : public QObject
static
QString
defaultDocumentGroupName
;
static
QString
documentTrashGroupName
;
UBSetting
*
uniboardWebUrl
;
UBSetting
*
productWebUrl
;
QString
softwareUpdatesUrl
;
QString
appRssUrl
;
QString
softwareLibrariesUrl
;
QString
softwareHomeUrl
;
QString
oEmbedJsLibraryUrl
;
QString
softwarePurchaseUrl
;
QString
documentsPublishingUrl
;
QString
capturesPublishingUrl
;
QString
publishingAuthenticationUrl
;
QString
documentPlayerScriptUrl
;
QString
documentPlayerPageScriptUrl
;
QString
documentPlayerCssUrl
;
UBSetting
*
appToolBarPositionedAtTop
;
UBSetting
*
appToolBarDisplayText
;
...
...
@@ -233,7 +221,6 @@ class UBSettings : public QObject
UBSetting
*
boardUseHighResTabletEvent
;
// UBSetting* boardKeyboardPaletteAutoMinimize;
UBSetting
*
boardKeyboardPaletteKeyBtnSize
;
UBColorListSetting
*
boardPenLightBackgroundColors
;
...
...
@@ -308,8 +295,6 @@ class UBSettings : public QObject
UBSetting
*
favoritesNativeToolUris
;
//UBSetting* shouldShowBundleMessage;
UBSetting
*
replyWWSerialPort
;
UBSetting
*
replyPlusConnectionURL
;
UBSetting
*
replyPlusAddressingMode
;
...
...
src/web/UBWebController.cpp
View file @
2c015583
...
...
@@ -602,54 +602,6 @@ void UBWebController::captureEduMedia()
}
}
void
UBWebController
::
getOEmbedProviderList
()
{
QUrl
url
(
UBSettings
::
settings
()
->
oEmbedJsLibraryUrl
);
mGetOEmbedProviderListRequest
=
new
UBServerXMLHttpRequest
(
UBNetworkAccessManager
::
defaultAccessManager
());
// destroyed in getOEmbedProviderListResponse
connect
(
mGetOEmbedProviderListRequest
,
SIGNAL
(
finished
(
bool
,
const
QByteArray
&
)),
this
,
SLOT
(
getOEmbedProviderListResponse
(
bool
,
const
QByteArray
&
)));
mGetOEmbedProviderListRequest
->
get
(
url
);
}
void
UBWebController
::
getOEmbedProviderListResponse
(
bool
success
,
const
QByteArray
&
payload
)
{
if
(
success
)
{
QString
js
(
payload
);
QStringList
lines
=
js
.
split
(
"
\n
"
);
foreach
(
QString
line
,
lines
)
{
if
(
line
.
contains
(
"new OEmbedProvider("
))
{
int
start
=
line
.
indexOf
(
"("
);
int
end
=
line
.
indexOf
(
")"
,
start
);
QString
provider
=
line
.
mid
(
start
,
end
-
start
);
provider
=
provider
.
replace
(
" "
,
""
);
provider
=
provider
.
replace
(
"
\"
"
,
""
);
QStringList
providerInfo
=
provider
.
split
(
","
);
if
(
providerInfo
.
length
()
>=
2
)
{
mOEmbedProviders
<<
providerInfo
.
at
(
1
);
}
}
}
qDebug
()
<<
"oEmbed provider list"
<<
mOEmbedProviders
;
}
mGetOEmbedProviderListRequest
->
deleteLater
();
}
bool
UBWebController
::
isOEmbedable
(
const
QUrl
&
pUrl
)
{
QString
urlAsString
=
pUrl
.
toString
();
...
...
src/web/UBWebController.h
View file @
2c015583
...
...
@@ -119,8 +119,6 @@ class UBWebController : public QObject
private
slots
:
void
getOEmbedProviderList
();
void
activePageChanged
();
void
trapFlash
();
...
...
@@ -128,9 +126,6 @@ class UBWebController : public QObject
void
showKeyboard
(
bool
checked
);
void
getOEmbedProviderListResponse
(
bool
success
,
const
QByteArray
&
payload
);
signals
:
/**
* This signal is emitted once the screenshot has been performed. This signal is also emitted when user
...
...
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