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:
parent
8154e21e58
commit
8559d199bd
29
src/zms.cpp
29
src/zms.cpp
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue