From d6e6f65a1cf8723a398689b549dd970121655053 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 19 Apr 2015 21:08:54 +0200 Subject: integrated libcaptcha and working on captcha in login form --- src/user.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/user.cpp') diff --git a/src/user.cpp b/src/user.cpp index 649c40e..8f18706 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -81,6 +81,12 @@ bool user::check_login( std::string user, std::string password ) return true; } +void user::ini( content::user &c ) +{ + master::ini( c ); + c.captcha = ">> CAPTCHA <<"; +} + } // namespace apps namespace content { @@ -93,14 +99,18 @@ login_form::login_form( apps::strusCms &cms ) username.error_message( "The login is illegal" ); password.message( "Your password" ); password.error_message( "Your password is illegal" ); + captcha.message( "Enter the correct captcha" ); + captcha.error_message( "Captcha didn't match" ); submit.value( "Log in" ); add( username ); add( password ); + add( captcha ); add( submit ); username.non_empty( ); password.non_empty( ); + captcha.non_empty( ); } bool login_form::validate( ) -- cgit v1.2.3-54-g00ecf