Skip to content

Commit 76d9344

Browse files
author
Koen Deforche
committed
merged authentication branch
1 parent 3afb493 commit 76d9344

File tree

362 files changed

+17963
-6426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+17963
-6426
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
*~
2+
.DS_Store
3+
*.db
24
build*/*
35
doc/reference
46
doc/examples
5-
CVS
6-
.DS_Store
77
examples/*/resources
8+
resources/tiny_mce
9+
test/interactive

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ SET(WTISAPI_SOVERSION 7)
2323
SET(WTDBO_SOVERSION 30)
2424
SET(WTDBOSQLITE3_SOVERSION 30)
2525
SET(WTDBOPOSTGRES_SOVERSION 30)
26+
SET(WTTEST_SOVERSION 1)
2627

2728
IF(NOT SHARED_LIBS)
2829
IF(WIN32)
@@ -86,6 +87,7 @@ ENDIF(GCC_COMPILER_VERSION MATCHES ".*4\\.4\\.4\\-14ubuntu5.*")
8687
OPTION(BUILD_EXAMPLES "Build examples" ON)
8788
OPTION(INSTALL_EXAMPLES "Install examples (binaries and source)" OFF)
8889
OPTION(INSTALL_RESOURCES "Install resources directory" ON)
90+
OPTION(ENABLE_SSL "Enable cryptography functions, using OpenSSL" ON)
8991
OPTION(ENABLE_GM "Enable GraphicsMagick, for supporting painting to raster images (PNG, GIF, ...) (WRasterImage)" ON)
9092
OPTION(ENABLE_HARU "Enable Haru Free PDF Library, which is used to provide support for painting to PDF (WPdfImage)" ON)
9193
OPTION(ENABLE_PANGO "Enable Pango Library, which is used for improved font support (WPdfImage and WRasterImage)" ON)
@@ -105,6 +107,9 @@ IF(NOT EXAMPLES_DESTINATION)
105107
ENDIF(NOT EXAMPLES_DESTINATION)
106108

107109
IF(WIN32)
110+
# required for all that uses boost.asio
111+
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
112+
108113
IF(SHARED_LIBS)
109114
# See http://svn.boost.org/trac/boost/ticket/3465
110115
SET(WT_NO_BOOST_INTRUSIVE true)
@@ -227,7 +232,7 @@ SET(SSL_PREFIX ${USERLIB_PREFIX} CACHE PATH
227232
SET(ZLIB_PREFIX ${USERLIB_PREFIX} CACHE PATH
228233
"Installation prefix of zlib library (overrides USERLIB_PREFIX)")
229234
SET(GM_PREFIX ${USERLIB_PREFIX} CACHE PATH
230-
"Installation prefix of GraphicsMgick library (overrides GM_PREFIX)")
235+
"Installation prefix of GraphicsMagick library (overrides USERLIB_PREFIX)")
231236

232237
OPTION(DEBUG "Support for debugging, must be enabled also in wt_config.xml" OFF)
233238
IF(CYGWIN)
@@ -336,6 +341,8 @@ ELSE(BOOST_WT_MT_FOUND)
336341
ADD_DEFINITIONS(-DBOOST_DISABLE_THREADS -DSQLITE_THREADSAFE=0)
337342
ENDIF(BOOST_WT_MT_FOUND)
338343

344+
345+
339346
FIND_PACKAGE(Doxygen)
340347

341348
# Boost is used nearly everywhere, so we can put these here
@@ -436,6 +443,11 @@ IF(ENABLE_HARU AND HARU_FOUND)
436443
SET(WT_HAS_WPDFIMAGE true)
437444
ENDIF(ENABLE_HARU AND HARU_FOUND)
438445

446+
IF(ENABLE_SSL AND SSL_FOUND)
447+
SET(HAVE_SSL ON)
448+
SET(WT_WITH_SSL true)
449+
ENDIF(ENABLE_SSL AND SSL_FOUND)
450+
439451
IF(ENABLE_GM AND GM_FOUND)
440452
SET(HAVE_GM ON)
441453
SET(WT_HAS_WRASTERIMAGE true)

Changelog

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,47 @@
1+
07-11-2011:
2+
* WException: new, public exception class (was previously an internal
3+
one)
4+
5+
* WIOService: new, public service class for async I/O, and its
6+
thread pool
7+
8+
* WStringStream: new, public fast stringstream implementation (was
9+
previously an internal class)
10+
11+
* Wt/Auth: new, authentication module
12+
13+
* Wt/Json: new, JSON library
14+
15+
* Wt/Mail: new, mail client
16+
17+
* Wt/Http/Client: new, http client (former Client renamed to WtClient)
18+
19+
* Wt/Test/WTestEnvironment: has moved to a "wttest" pseudo-connector
20+
library
21+
22+
* WFormWidget: added a valueText() that returns the textual
23+
representation of the current value
24+
25+
* WApplication: added deferRendering() and resumeRendering() API,
26+
useful for asynchronous client operations
27+
28+
* Wt::log(): global logging method, similar to but more useful
29+
than WApplication::log()
30+
31+
* WTemplate: added support for functions, and two standard functions
32+
id() and tr()
33+
34+
* WTemplate: implemented arguments parsing and use ("class")
35+
36+
* WebSession: added DoS meausures: ajax puzzle and plain session
37+
rate limitation
38+
139
19-10-2011:
240
* WAbstractItemView: reimplemented and simplified header item rendering
341

4-
* Wt.js: workaround browser bugs in scrollLeft reading in RTL mode, fixing WAbstractItemView column resizing in RTL layouts.
5-
42+
* Wt.js: workaround browser bugs in scrollLeft reading in RTL mode,
43+
fixing WAbstractItemView column resizing in RTL layouts.
44+
645
12-10-2011:
746
* WRectF: fix isEmpty() to be more restrictive: only a rect with
847
width = 0 and height = 0 is now empty

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ HIDE_UNDOC_CLASSES = YES
324324
# If set to NO (the default) these declarations will be included in the
325325
# documentation.
326326

327-
HIDE_FRIEND_COMPOUNDS = NO
327+
HIDE_FRIEND_COMPOUNDS = YES
328328

329329
# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
330330
# documentation blocks found inside the body of a function.

WConfig.h.in

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,13 @@
2929

3030
#cmakedefine WT_HAS_WRASTERIMAGE
3131
#cmakedefine WT_HAS_WPDFIMAGE
32+
#cmakedefine WT_WITH_SSL
3233

3334
#cmakedefine WT_NO_BOOST_INTRUSIVE
3435
#cmakedefine WT_NO_BOOST_RANDOM
3536
#cmakedefine WT_NO_STD_LOCALE
3637
#cmakedefine WT_NO_STD_WSTRING
37-
38-
#if ${WT_DEBUG_ENABLED}
39-
#ifndef WT_TARGET_JAVA
40-
#define WT_DEBUG(statement) do { if (Wt::WApplication::instance()->debug()) statement; } while(0)
41-
#else
42-
#define WT_DEBUG(statement)
43-
#endif
44-
#else
45-
#define WT_DEBUG(statement)
46-
#endif
38+
#cmakedefine WT_DEBUG_ENABLED
4739

4840
#endif
4941

examples/blog/BlogRSSFeed.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
#include "BlogRSSFeed.h"
1010

11-
#include "BlogSession.h"
11+
#include "model/BlogSession.h"
1212
#include "model/User.h"
1313
#include "model/Post.h"
1414
#include "model/Comment.h"
1515
#include "model/Tag.h"
16+
#include "model/Token.h"
1617

1718
namespace dbo = Wt::Dbo;
1819

examples/blog/BlogSession.C

Lines changed: 0 additions & 66 deletions
This file was deleted.

examples/blog/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ IF(ASCIIDOC_EXECUTABLE)
66
ENDIF(ASCIIDOC_EXECUTABLE)
77

88
WT_ADD_EXAMPLE(blog.wt
9+
model/BlogSession.C
10+
model/BlogUserDatabase.C
911
model/Post.C
1012
model/Comment.C
1113
model/User.C
12-
model/Tag.C
14+
model/Tag.C
15+
model/Token.C
1316
view/PostView.C
1417
view/CommentView.C
18+
view/BlogLoginWidget.C
1519
view/BlogView.C
1620
view/EditUsers.C
1721
asciidoc/asciidoc.C
18-
BlogSession.C
1922
BlogRSSFeed.C
2023
blog.C
2124
)

examples/blog/blog.C

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@
77
#include <Wt/WContainerWidget>
88
#include <Wt/WServer>
99

10+
#include "model/BlogSession.h"
11+
#include "model/Token.h"
12+
#include "model/User.h"
1013
#include "view/BlogView.h"
1114
#include "BlogRSSFeed.h"
1215

1316
using namespace Wt;
1417

18+
//static const char *FeedUrl = "/Test/blog/feed/";
19+
//static const char *BlogUrl = "/Test/blog";
20+
1521
static const char *FeedUrl = "/blog/feed/";
1622
static const char *BlogUrl = "/blog";
1723

@@ -43,7 +49,9 @@ int main(int argc, char **argv)
4349
"", "It's just an example.");
4450

4551
server.addResource(&rssFeed, FeedUrl);
46-
server.addEntryPoint(Application, createApplication, BlogUrl);
52+
server.addEntryPoint(Application, createApplication, BlogUrl);
53+
54+
BlogSession::initAuth();
4755

4856
std::cerr << "\n\n -- Warning: Example is deployed at '"
4957
<< BlogUrl << "'\n\n";

examples/blog/blog.xml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
<?xml version="1.0" encoding="ISO-8859-1" ?>
22
<messages>
33
<message id="blog-login">
4+
${name} ${password} ${remember-me} ${login},
5+
</message>
6+
7+
<message id="blog-login-status">
48
<div class="login-box">
59
<div class="login-menu">
6-
${name} ${passwd} ${rememberMe} ${login-button} ${login-link} ${register-link}
10+
${login} ${login-link} | ${register-link}
711
<a href="${feed-url}">
8-
<img src="/css/rss.png" alt="Rss Feed"
9-
style="margin-left: 6px; vertical-align: top;"/>
12+
<img src="css/rss.png" alt="Rss Feed"
13+
style="margin-left: 6px; vertical-align: top;"/>
1014
</a>
1115
</div>
1216
<div class="user-menu">
13-
${archive-link}
17+
${archive-link} ${profile-link} ${author-panel-link} ${userlist-link}
1418
</div>
1519
</div>
1620
</message>
1721

18-
<message id="remember-me">Remember me</message>
19-
2022
<message id="edit-users-list">
2123
<h4>Registered users</h4>
2224
${user-list}
@@ -43,7 +45,7 @@
4345

4446
<message id="blog-mustlogin">
4547
<div class="profile-panel">
46-
<h4>You need to log to access this function</h4>
48+
<h4>You need to log in to access this function</h4>
4749
</div>
4850
</message>
4951

@@ -137,21 +139,6 @@
137139
</div>
138140
</message>
139141

140-
<message id="blog-logout">
141-
<div class="login-box">
142-
<div class="login-menu">
143-
<b>${user}</b> ${logout-link}
144-
<a href="${feed-url}">
145-
<img src="/css/rss.png" alt="Rss Feed"
146-
style="margin-left: 6px; vertical-align: top;"/>
147-
</a>
148-
</div>
149-
<div class="user-menu">
150-
${archive-link} ${profile-link} ${author-panel-link} ${userlist-link}
151-
</div>
152-
</div>
153-
</message>
154-
155142
<message id="blog-post">
156143
<h4>${title}</h4>
157144
<div id="${anchor}">

0 commit comments

Comments
 (0)