ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/IBServices.pas
(Generate patch)

Comparing ibx/trunk/runtime/IBServices.pas (file contents):
Revision 33 by tony, Sat Jul 18 12:30:52 2015 UTC vs.
Revision 39 by tony, Tue May 17 08:14:52 2016 UTC

# Line 42 | Line 42
42   unit IBServices;
43  
44   {$Mode Delphi}
45 + {$IF FPC_FULLVERSION >= 20700 }
46 + {$codepage UTF8}
47 + {$ENDIF}
48  
49   interface
50  
# Line 137 | Line 140 | type
140  
141    protected
142      procedure Loaded; override;
143 <    function Login: Boolean;
143 >    function Login(var aServerName: string): Boolean;
144      procedure CheckActive;
145      procedure CheckInactive;
146      procedure HandleException(Sender: TObject);
# Line 521 | Line 524 | procedure TIBCustomService.Attach;
524   var
525    SPB: String;
526    ConnectString: String;
527 +  aServerName: string;
528   begin
529    CheckInactive;
530    CheckServerName;
531  
532 <  if FLoginPrompt and not Login then
532 >  aServerName := FServerName;
533 >  if FLoginPrompt and not Login(aServerName) then
534      IBError(ibxeOperationCancelled, [nil]);
535  
536    { Generate a new SPB if necessary }
# Line 537 | Line 542 | begin
542      Move(SPB[1], FSPB[0], FSPBLength);
543    end;
544    case FProtocol of
545 <    TCP: ConnectString := FServerName + ':service_mgr'; {do not localize}
546 <    SPX: ConnectString := FServerName + '@service_mgr'; {do not localize}
547 <    NamedPipe: ConnectString := '\\' + FServerName + '\service_mgr'; {do not localize}
545 >    TCP: ConnectString := aServerName + ':service_mgr'; {do not localize}
546 >    SPX: ConnectString := aServerName + '@service_mgr'; {do not localize}
547 >    NamedPipe: ConnectString := '\\' + aServerName + '\service_mgr'; {do not localize}
548      Local: ConnectString := 'service_mgr'; {do not localize}
549    end;
550    if call(isc_service_attach(StatusVector, Length(ConnectString),
# Line 570 | Line 575 | begin
575    end;
576   end;
577  
578 < function TIBCustomService.Login: Boolean;
578 > function TIBCustomService.Login(var aServerName: string): Boolean;
579   var
580    IndexOfUser, IndexOfPassword: Integer;
581    Username, Password: String;
# Line 583 | Line 588 | begin
588        LoginParams.Assign(Params);
589        FOnLogin(Self, LoginParams);
590        Params.Assign (LoginParams);
591 +      aServerName := ServerName;
592      finally
593        LoginParams.Free;
594      end;
# Line 600 | Line 606 | begin
606        Password := Copy(Params[IndexOfPassword],
607                                           Pos('=', Params[IndexOfPassword]) + 1, {mbcs ok}
608                                           Length(Params[IndexOfPassword]));
609 <    result := IBGUIInterface.ServerLoginDialog(serverName, Username, Password);
609 >    result := IBGUIInterface.ServerLoginDialog(aServerName, Username, Password);
610      if result then
611      begin
612        IndexOfPassword := IndexOfSPBConst(SPBConstantNames[isc_spb_password]);
# Line 1522 | Line 1528 | begin
1528      if (Trim(FBackupFile[i]) = '') then continue;
1529      if (Pos('=', FBackupFile[i]) <> 0) then  {mbcs ok}
1530      begin
1531 <      ServiceStartAddParam(FBackupFile.Names[i], isc_spb_bkp_file);
1531 >      ServiceStartAddParam(AnsiUpperCase(FBackupFile.Names[i]), isc_spb_bkp_file);
1532        value := Copy(FBackupFile[i], Pos('=', FBackupFile[i]) + 1, Length(FBackupFile.Names[i])); {mbcs ok}
1533        param := StrToInt(value);
1534        ServiceStartAddParam(param, isc_spb_bkp_length);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines