From 9f624560ffb625d7766480c4621169025df32c33 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 31 Jul 2015 15:30:32 +0200 Subject: checking password with cracklib now added printName (the visible name of the user in registration and login) --- src/cracklib.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/cracklib.cpp (limited to 'src/cracklib.cpp') diff --git a/src/cracklib.cpp b/src/cracklib.cpp new file mode 100644 index 0000000..022aff0 --- /dev/null +++ b/src/cracklib.cpp @@ -0,0 +1,22 @@ +#include "cracklib.hpp" + +#include + +#include "crack.h" + +PasswordCheck checkPassword( const std::string login, const std::string name, const std::string password ) +{ + PasswordCheck c; + const char *m; + + m = FascistCheckUser( password.c_str( ), NULL, login.c_str( ), name.c_str( ) ); + if( m == NULL ) { + c.ok = true; + c.msg = "Password ok"; + } else { + c.ok = false; + c.msg = std::string( m ); + } + + return c; +} -- cgit v1.2.3-54-g00ecf