File tree Expand file tree Collapse file tree 1 file changed +36
-8
lines changed Expand file tree Collapse file tree 1 file changed +36
-8
lines changed Original file line number Diff line number Diff line change @@ -558,14 +558,42 @@ sub login {
558558 my $result ;
559559 logger($self -> {_debug }, " Entering Engine::login" ,1);
560560
561- my %mylogin =
562- (
563- " user" => {
564- " type" => " LoginRequest" ,
565- " username" => " $user " ,
566- " password" => " $password "
567- }
568- );
561+ my $domain ;
562+ my %mylogin ;
563+
564+ if (($domain ) = $user =~ / (\w +)@(\w +)/ ) {
565+ if (uc $2 eq " DOMAIN" ) {
566+ $domain = " DOMAIN" ;
567+ $user = $1 ;
568+ } elsif (uc $2 eq " SYSTEM" ) {
569+ $domain = " SYSTEM" ;
570+ $user = $1 ;
571+ } else {
572+ print " User can have only target - DOMAIN or SYSTEM" ;
573+ return 1;
574+ }
575+ %mylogin =
576+ (
577+ " user" => {
578+ " type" => " LoginRequest" ,
579+ " username" => " $user " ,
580+ " password" => " $password " ,
581+ " target" => $domain
582+ }
583+ );
584+ } else {
585+ # keep this for backward compability of dxtools.conf file
586+ # if sysadmin is defined there we need to be able to login
587+ %mylogin =
588+ (
589+ " user" => {
590+ " type" => " LoginRequest" ,
591+ " username" => " $user " ,
592+ " password" => " $password "
593+ }
594+ );
595+ }
596+
569597
570598 my $operation = " resources/json/delphix/login" ;
571599 my $json_data = encode_json($mylogin {' user' });
You can’t perform that action at this time.
0 commit comments