summaryrefslogtreecommitdiff
path: root/src/user.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/user.cpp')
-rw-r--r--src/user.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/user.cpp b/src/user.cpp
index 3a21504..d98d0f3 100644
--- a/src/user.cpp
+++ b/src/user.cpp
@@ -64,10 +64,17 @@ void user::register_user( )
c.register_user.load( context( ) );
if( c.register_user.validate( ) ) {
cms.mail.subject = "Registration request";
- cms.mail.body = "Your registration code is: CODE";
+ cms.mail.body = "Your registration code is: CODE\n";
cms.mail.to = c.register_user.email.value( );
cms.mail.send( );
- response( ).set_redirect_header( cms.root( ) + "/confirm_register" );
+ if( cms.mail.hasError( ) ) {
+ c.register_user.email.valid( false );
+ c.register_user.email.error_message( "Can't send email to this address" );
+ booster::ptime::sleep( booster::ptime( 5, 0 ) );
+ std::cerr << "SEND MAIL ERROR: " << cms.mail.getLastError( ) << std::endl;
+ } else {
+ response( ).set_redirect_header( cms.root( ) + "/confirm_register" );
+ }
}
}