fix password and add debug

This commit is contained in:
Isaac Connor 2017-03-29 20:07:58 -04:00
parent fe223e3b29
commit 8b7acb68a3
1 changed files with 7 additions and 1 deletions

View File

@ -161,9 +161,11 @@ int main( int argc, const char *argv[] )
{
if ( !strcmp( name, "user" ) ) {
username = UriDecode( value );
Debug( 1, "Have %s for username", username.c_str() );
}
if ( !strcmp( name, "pass" ) ) {
password = UriDecode( password );
password = UriDecode( value );
Debug( 1, "Have %s for password", password.c_str() );
}
}
}
@ -183,12 +185,16 @@ int main( int argc, const char *argv[] )
{
if ( *auth ) {
user = zmLoadAuthUser( auth, config.auth_hash_ips );
} else {
Debug( 1, "Need both username and password" );
}
}
//else if ( strcmp( config.auth_relay, "plain" ) == 0 )
{
if ( username.length() && password.length() ) {
user = zmLoadUser( username.c_str(), password.c_str() );
} else {
Debug( 1, "Need both username and password" );
}
}
} // auth is none or something else