diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2015-04-29 18:58:07 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2015-04-29 18:58:07 +0200 |
commit | cb69299b9d59db0888e942025ae4915c6f32d066 (patch) | |
tree | fcb85301442a9eda1ed9d60a8ba52d8c60f11114 /src/user.cpp | |
parent | fa132310bf61c115907e5c237333207f308b1de4 (diff) | |
download | aCms-cb69299b9d59db0888e942025ae4915c6f32d066.tar.gz aCms-cb69299b9d59db0888e942025ae4915c6f32d066.tar.bz2 |
added libquickmail and email registration
Diffstat (limited to 'src/user.cpp')
-rw-r--r-- | src/user.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/user.cpp b/src/user.cpp index dddde30..3a21504 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -63,9 +63,14 @@ void user::register_user( ) if( request( ).request_method( ) == "POST" ) { 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.to = c.register_user.email.value( ); + cms.mail.send( ); response( ).set_redirect_header( cms.root( ) + "/confirm_register" ); } } + render( "register_user", c ); } @@ -202,6 +207,8 @@ register_user_form::register_user_form( apps::strusCms &cms ) password.error_message( "Your password is illegal" ); password2.message( "Your password (again)" ); password2.error_message( "Your password doesn't match" ); + email.message( "Email" ); + email.error_message( "Your email address is not valid" ); captcha.message( "Enter the correct captcha" ); captcha.error_message( "Captcha didn't match" ); submit.value( "Register user" ); @@ -209,12 +216,14 @@ register_user_form::register_user_form( apps::strusCms &cms ) add( username ); add( password ); add( password2 ); + add( email ); add( captcha ); add( submit ); username.non_empty( ); password.non_empty( ); password2.non_empty( ); + email.non_empty( ); captcha.non_empty( ); } @@ -243,6 +252,7 @@ bool register_user_form::validate( ) if( captcha.value( ).compare( cms.user.last_captcha ) != 0 ) { captcha.valid( false ); captcha.clear( ); + booster::ptime::sleep( booster::ptime( 5, 0 ) ); return false; } |