Wrapped user check in OPT_AUTH check.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1241 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2005-01-26 20:53:55 +00:00
parent 8154e21e58
commit 8559d199bd
1 changed files with 16 additions and 13 deletions

View File

@ -132,21 +132,24 @@ int main( int argc, const char *argv[] )
}
}
User *user = 0;
if ( *username && *password )
if ( (bool)config.Item( ZM_OPT_USE_AUTH ) )
{
user = zmLoadUser( username, password );
User *user = 0;
if ( *username && *password )
{
user = zmLoadUser( username, password );
}
else if ( *auth )
{
user = zmLoadAuthUser( auth );
}
if ( !user )
{
Error(( "Unable to authenticate user" ));
return( -1 );
}
ValidateAccess( user, id );
}
else if ( *auth )
{
user = zmLoadAuthUser( auth );
}
if ( !user )
{
Error(( "Unable to authenticate user" ));
return( -1 );
}
ValidateAccess( user, id );
setbuf( stdout, 0 );
if ( nph )